Bandits.ArrayModel.indepFun_snd_apply_truncRow
From the authors
The reward Ο.2 m a is independent of truncRow a m, which reads only other coordinates.
-
π : Type u_1mπ : MeasurableSpace πA measurable space is a space equipped with a Ο-algebra.DecidableEq π -
π‘ : Type u_2mπ‘ : MeasurableSpace π‘
-
Ξ½ : 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. -
a : π -
m : β
ProbabilityTheory.IndepFun (fun Ο => Ο.2 m a) (truncRow a m) (arrayMeasure Ξ½)Two functions are independent if the two measurable space structures they generate are independent.MeasurableSpace : Type u_6 β Type u_6A measurable space is a space equipped with a Ο-algebra.
DecidableEq : Sort u β Sort (max 1 u)Propositional equality is `Decidable` for all elements of a type. In other words, an instance of `DecidableEq Ξ±` is a means of deciding the proposition `a = b` is for all `a b : Ξ±`.
ProbabilityTheory.IsMarkovKernel : {Ξ± : Type u_1} β
{Ξ² : Type u_2} β {mΞ± : MeasurableSpace Ξ±} β {mΞ² : MeasurableSpace Ξ²} β ProbabilityTheory.Kernel Ξ± Ξ² β PropA kernel is a Markov kernel if every measure in its image is a probability measure.
ProbabilityTheory.Kernel : (Ξ± : Type u_1) β (Ξ² : Type u_2) β [MeasurableSpace Ξ±] β [MeasurableSpace Ξ²] β Type (max u_1 u_2)A kernel from a measurable space `Ξ±` to another measurable space `Ξ²` is a measurable function `ΞΊ : Ξ± β Measure Ξ²`. The measurable space structure on `MeasureTheory.Measure Ξ²` is given by `MeasureTheory.Measure.instMeasurableSpace`. A map `ΞΊ : Ξ± β MeasureTheory.Measure Ξ²` is measurable iff `β s : Set Ξ², MeasurableSet s β Measurable (fun a β¦ ΞΊ a s)`.
Nat : TypeThe natural numbers, starting at zero. This type is special-cased by both the kernel and the compiler, and overridden with an efficient implementation. Both use a fast arbitrary-precision arithmetic library (usually [GMP](https://gmplib.org/)); at runtime, `Nat` values that are sufficiently small are unboxed.
ProbabilityTheory.IndepFun : {Ξ© : Type u_1} β
{Ξ² : Type u_6} β
{Ξ³ : Type u_7} β
{_mΞ© : MeasurableSpace Ξ©} β
[MeasurableSpace Ξ²] β
[MeasurableSpace Ξ³] β
(Ξ© β Ξ²) β (Ξ© β Ξ³) β autoParam (MeasureTheory.Measure Ξ©) ProbabilityTheory.IndepFun._auto_1 β PropTwo functions are independent if the two measurable space structures they generate are independent. For a function `f` with codomain having measurable space structure `m`, the generated measurable space structure is `MeasurableSpace.comap f m`. We use the notation `f βα΅’[ΞΌ] g` for `IndepFun f g ΞΌ` (scoped in `ProbabilityTheory`).
Bandits.ArrayModel.truncRow : {π : Type u_1} β
{π‘ : Type u_2} β [DecidableEq π] β π β β β Bandits.ArrayModel.probSpace π π‘ β Bandits.ArrayModel.probSpace π π‘Modification of `Ο` in which the rewards of action `a` are read only up to index `m - 1`: in row `a` of the reward array, the entry at index `i` is kept if `i < m` and replaced by the entry at index `m + 1 + i` otherwise. The result does not depend on the coordinate `(m, a)` of the array.Go to its page
Bandits.ArrayModel.arrayMeasure : {π : Type u_1} β
{π‘ : Type u_2} β
{mπ : MeasurableSpace π} β
{mπ‘ : MeasurableSpace π‘} β ProbabilityTheory.Kernel π π‘ β MeasureTheory.Measure (Bandits.ArrayModel.probSpace π π‘)Probability measure for the array model of stochastic bandits.Go to its page
Code
lemma indepFun_snd_apply_truncRow (Ξ½ : Kernel π π‘) [IsMarkovKernel Ξ½] (a : π) (m : β) :
(fun Ο β¦ Ο.2 m a) βα΅’[arrayMeasure Ξ½] (truncRow a m)Proof
by
let T : (β β π β π‘) β (β β π β π‘) :=
fun Ο k b β¦ if b = a then Ο (if k < m then k else m + 1 + k) b else Ο k b
have hT : Measurable[β¨ p β {p : β Γ π | p β (m, a)},
MeasurableSpace.comap (fun Ο : β β π β π‘ β¦ Ο p.1 p.2) inferInstance] T := by
rw [measurable_iff_comap_le, MeasurableSpace.comap_pi]
refine iSup_le fun k β¦ ?_
rw [MeasurableSpace.comap_pi]
refine iSup_le fun b β¦ ?_
by_cases hb : b = a
Β· simp only [T, hb, βreduceIte]
refine le_iSupβ_of_le (if k < m then k else m + 1 + k, a) ?_ (le_of_eq rfl)
simp only [Set.mem_ofPred_eq, ne_eq, Prod.mk.injEq, and_true]
split_ifs <;> omega
Β· simp only [T, hb, βreduceIte]
exact le_iSupβ_of_le (k, b) (by simp [hb]) (le_of_eq rfl)
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 (ΞΌ := Measure.infinitePi fun _ β¦ volume) (by fun_prop) hTmMeaning last changed in v4.35.0-rc2-1-g61e506b (2026-09-22), the 3th 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: 4 project declarations, 38 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.