|
| 1 | +/- |
| 2 | +Copyright (c) 2026 Rémy Degenne. All rights reserved. |
| 3 | +Released under Apache 2.0 license as described in the file LICENSE. |
| 4 | +Authors: Rémy Degenne |
| 5 | +-/ |
| 6 | +module |
| 7 | + |
| 8 | +public import LeanMachineLearning.SequentialLearning.IonescuTulceaSpace |
| 9 | +public import RandomDo.ForMathlib.MeasureTheory.MeasurableSpace.Constructions |
| 10 | +public import RandomDo.ForMathlib.Probability.Kernel.Composition.MeasureComp |
| 11 | + |
| 12 | +/-! |
| 13 | +# The history of the interaction, one round later |
| 14 | +
|
| 15 | +## Main results |
| 16 | +
|
| 17 | +* `IT.hist_succ_eq_snoc`: the history before time `n + 1` is the history before time `n`, followed |
| 18 | + by the round at time `n`. |
| 19 | +* `IT.map_hist_succ`: under `trajMeasure alg env`, the law of a function of the history before |
| 20 | + time `n + 1` is the law of the history before time `n`, bound to one round drawn from the step |
| 21 | + kernel. |
| 22 | +-/ |
| 23 | + |
| 24 | +@[expose] public section |
| 25 | + |
| 26 | +open MeasureTheory ProbabilityTheory |
| 27 | + |
| 28 | +namespace Learning.IT |
| 29 | + |
| 30 | +variable {𝓞 𝓐 𝓨 : Type*} {m𝓞 : MeasurableSpace 𝓞} {m𝓐 : MeasurableSpace 𝓐} |
| 31 | + {m𝓨 : MeasurableSpace 𝓨} |
| 32 | + |
| 33 | +lemma hist_succ_eq_snoc (n : ℕ) : |
| 34 | + hist (𝓞 := 𝓞) (𝓐 := 𝓐) (𝓨 := 𝓨) (n + 1) = fun ω ↦ Fin.snoc (hist n ω) (step n ω) := by |
| 35 | + funext ω i |
| 36 | + refine Fin.lastCases ?_ (fun j ↦ ?_) i |
| 37 | + · simp [hist, step] |
| 38 | + · simp [hist] |
| 39 | + |
| 40 | +/-- The history before time `n + 1` is the history before time `n`, followed by one round drawn |
| 41 | +from the step kernel. -/ |
| 42 | +lemma map_hist_succ {γ : Type*} [MeasurableSpace γ] (alg : Algorithm 𝓞 𝓐 𝓨) |
| 43 | + (env : Environment 𝓞 𝓐 𝓨) (n : ℕ) {F : Hist 𝓞 𝓐 𝓨 (n + 1) → γ} (hF : Measurable F) : |
| 44 | + (trajMeasure alg env).map (F ∘ hist (n + 1)) |
| 45 | + = ((trajMeasure alg env).map (hist n)).bind |
| 46 | + fun h ↦ (stepKernel alg env n h).map fun x ↦ F (Fin.snoc h x) := by |
| 47 | + have hsnoc : Measurable fun p : Hist 𝓞 𝓐 𝓨 n × Round 𝓞 𝓐 𝓨 ↦ F (Fin.snoc p.1 p.2) := |
| 48 | + hF.comp (measurable_fst.finSnoc measurable_snd) |
| 49 | + have e : F ∘ hist (n + 1) |
| 50 | + = (fun p ↦ F (Fin.snoc p.1 p.2)) ∘ (fun ω ↦ (hist n ω, step n ω)) := by |
| 51 | + rw [hist_succ_eq_snoc] |
| 52 | + rfl |
| 53 | + rw [e, ← Measure.map_map hsnoc (by fun_prop), (hasCondDistrib_step alg env n).map_eq, |
| 54 | + Measure.map_compProd_eq_bind _ _ hsnoc] |
| 55 | + |
| 56 | +end Learning.IT |
0 commit comments