LeanMachineLearning

Bandits.indepFun_snd_apply_prod_streamMeasure_update🔗

Lemma

From the authors

Under a product measure μ.prod (streamMeasure ν), the entry (m, a) of the reward array is independent of the pair formed by the first coordinate and the reward array in which the entry (m, a) is replaced by a constant x.

Types
  • 𝓐 : Type u_1m𝓐 : MeasurableSpace 𝓐A measurable space is a space equipped with a σ-algebra.DecidableEq 𝓐
  • 𝓡 : Type u_2m𝓡 : MeasurableSpace 𝓡
  • Ω : Type u_3mΩ : MeasurableSpace Ω
Given
  • μ : MeasureTheory.Measure ΩA measure is defined to be an outer measure that is countably additive on measurable sets, with the additional assumption that the outer measure is the canonical extension of the restricted measure.MeasureTheory.IsProbabilityMeasure μA measure μ is called a probability measure if μ univ = 1.
  • ν : ProbabilityTheory.Kernel 𝓐 𝓡A kernel from a measurable space α to another measurable space β is a measurable function κ : α → Measure β.ProbabilityTheory.IsMarkovKernel νA kernel is a Markov kernel if every measure in its image is a probability measure.
  • m :
  • a : 𝓐
  • x : 𝓡
Then
ProbabilityTheory.IndepFun (fun ω => ω.2 m a) (fun ω => (ω.1, fun i b => if i = mb = a then x else ω.2 i b))
  (μ.prod (streamMeasure ν))
Two functions are independent if the two measurable space structures they generate are independent.
Code
lemma indepFun_snd_apply_prod_streamMeasure_update [DecidableEq 𝓐] {Ω : Type*}
    {mΩ : MeasurableSpace Ω} (μ : Measure Ω) [IsProbabilityMeasure μ] (ν : Kernel 𝓐 𝓡)
    [IsMarkovKernel ν] (m : ℕ) (a : 𝓐) (x : 𝓡) :
    (fun ω : Ω × (ℕ → 𝓐 → 𝓡) ↦ ω.2 m a) ⟂ᵢ[μ.prod (streamMeasure ν)]
      (fun ω ↦ (ω.1, fun i b ↦ if i = m ∧ b = a then x else ω.2 i b))
Proof
by
  let T : (ℕ → 𝓐 → 𝓡) → (ℕ → 𝓐 → 𝓡) := fun z i b ↦ if i = m ∧ b = a then x else z i b
  have hT : Measurable[⨆ p ∈ {p : ℕ × 𝓐 | p ≠ (m, a)},
      MeasurableSpace.comap (fun z : ℕ → 𝓐 → 𝓡 ↦ z p.1 p.2) inferInstance] T := by
    rw [measurable_iff_comap_le, MeasurableSpace.comap_pi]
    refine iSup_le fun i ↦ ?_
    rw [MeasurableSpace.comap_pi]
    refine iSup_le fun b ↦ ?_
    by_cases hib : i = m ∧ b = a
    · obtain ⟨rfl, rfl⟩ := hib
      simp only [T, and_self, ↓reduceIte, MeasurableSpace.comap_const]
      exact bot_le
    · simp only [T, hib, ↓reduceIte]
      refine le_iSup₂_of_le (i, b) ?_ le_rfl
      simpa only [Set.mem_ofPred_eq, ne_eq, Prod.mk.injEq] using hib
  have hTm : Measurable T :=
    hT.mono (iSup₂_le fun p _ ↦ Measurable.comap_le (by fun_prop)) le_rfl
  have h := (iIndepFun_eval_streamMeasure ν).indepFun_of_measurable_iSup_comap
    (fun _ ↦ by fun_prop) (i := (m, a)) (by simp) hT
  exact h.snd_prod (μ := μ) (by fun_prop) hTm

Meaning last changed in v4.35.0-rc2-1-g61e506b (2026-09-22), the 2th recorded change.

Self-contained, with its dependencies inlined and proofs replaced by sorry: download the raw file · open it in the Lean web editor.

Dependency graph

Audit surface: 1 project declarations, 23 external constants

✓ Proved: no sorry anywhere in its closure

This is the tool's own reading of one build's recorded axioms, and it is not robust against an author who wants it to pass. Checking meant to be relied on should go through Comparator, which replays the proof through the kernel from an export against an explicit list of permitted axioms.