Bandits.ArrayModel.hasCondDistrib_reward_pullCount_action
The conditional distribution of the reward at time n + 1, given the action at time n + 1
and the number of times that action has been pulled before time n + 1, is equal to
the kernel ฮฝ.
Bandits.ArrayModel.hasCondDistrib_reward_pullCount_action.{u_1, u_2} {๐ : Type u_1} {R : Type u_2} {m๐ : MeasurableSpace ๐} {mR : MeasurableSpace R} [Nonempty ๐] [StandardBorelSpace ๐] [DecidableEq ๐] [Countable ๐] [StandardBorelSpace R] [Nonempty R] (alg : Learning.Algorithm ๐ R) (ฮฝ : ProbabilityTheory.Kernel ๐ R) [ProbabilityTheory.IsMarkovKernel ฮฝ] (n : โ) : ProbabilityTheory.HasCondDistrib (reward alg (n + 1)) (fun ฯ => (action alg (n + 1) ฯ, Learning.pullCount (action alg) (action alg (n + 1) ฯ) (n + 1) ฯ)) (ProbabilityTheory.Kernel.prodMkRight โ ฮฝ) (arrayMeasure ฮฝ)Bandits.ArrayModel.hasCondDistrib_reward_pullCount_action.{u_1, u_2} {๐ : Type u_1} {R : Type u_2} {m๐ : MeasurableSpace ๐} {mR : MeasurableSpace R} [Nonempty ๐] [StandardBorelSpace ๐] [DecidableEq ๐] [Countable ๐] [StandardBorelSpace R] [Nonempty R] (alg : Learning.Algorithm ๐ R) (ฮฝ : ProbabilityTheory.Kernel ๐ R) [ProbabilityTheory.IsMarkovKernel ฮฝ] (n : โ) : ProbabilityTheory.HasCondDistrib (reward alg (n + 1)) (fun ฯ => (action alg (n + 1) ฯ, Learning.pullCount (action alg) (action alg (n + 1) ฯ) (n + 1) ฯ)) (ProbabilityTheory.Kernel.prodMkRight โ ฮฝ) (arrayMeasure ฮฝ)
Code
lemma hasCondDistrib_reward_pullCount_action
(alg : Algorithm ๐ R) (ฮฝ : Kernel ๐ R) [IsMarkovKernel ฮฝ] (n : โ) :
HasCondDistrib (reward alg (n + 1))
(fun ฯ โฆ (action alg (n + 1) ฯ, pullCount (action alg) (action alg (n + 1) ฯ) (n + 1) ฯ))
(ฮฝ.prodMkRight _) (arrayMeasure ฮฝ)Proof
by
have h_meas : Measurable fun ฯ โฆ pullCount (action alg) (action alg (n + 1) ฯ) (n + 1) ฯ := by
change Measurable ((fun p : (probSpace ๐ R) ร ๐ โฆ pullCount (action alg) p.2 (n + 1) p.1) โ
(fun ฯ : probSpace ๐ R โฆ (ฯ, action alg (n + 1) ฯ)))
exact (measurable_uncurry_pullCount (by fun_prop) _).comp (by fun_prop)
refine hasCondDistrib_of_condDistrib_eq (by fun_prop) (by fun_prop) ?_
refine (condDistrib_ae_eq_cond
(Measurable.prodMk (by fun_prop) (by fun_prop)) (by fun_prop)).trans ?_
rw [Filter.EventuallyEq, ae_iff_of_countable]
intro โจa, mโฉ ham
simp only [Kernel.prodMkRight_apply]
calc
Measure.map (reward alg (n + 1))
(arrayMeasure ฮฝ)[|(fun ฯ โฆ (action alg (n + 1) ฯ,
pullCount (action alg) (action alg (n + 1) ฯ) (n + 1) ฯ)) โปยน' {(a, m)}]
_ = Measure.map (fun ฯ โฆ ฯ.2 m a)
(arrayMeasure ฮฝ)[|(fun ฯ โฆ (action alg (n + 1) ฯ,
pullCount (action alg) (action alg (n + 1) ฯ) (n + 1) ฯ)) โปยน' {(a, m)}] := by
rw [reward_eq]
refine Measure.map_congr
(ae_cond_of_forall_mem ((measurableSet_singleton _).preimage (by fun_prop)) (fun x hx โฆ ?_))
simp only [Set.mem_preimage, Set.mem_singleton_iff, Prod.mk.injEq] at hx
simp only [hx.1] at hx โข
simp [hx.2]
_ = Measure.map (fun ฯ โฆ ฯ.2 m a)
(arrayMeasure ฮฝ)[|({ฯ | action alg (n + 1) ฯ = a โง
pullCount (action alg) a (n + 1) ฯ = m}).indicator 1 โปยน' {1}] := by
congr with ฯ
simp only [Set.mem_preimage, Set.mem_singleton_iff, Prod.mk.injEq, Set.indicator_apply,
Set.mem_ofPred_eq, Pi.one_apply, ite_eq_left_iff, not_and, zero_ne_one, imp_false,
Classical.not_imp, Decidable.not_not, and_congr_right_iff]
intro ha
simp [ha]
_ = ฮฝ a := by
rw [cond_of_indepFun, map_snd_apply_arrayMeasure m a]
ยท exact (indepFun_snd_apply_pullCount_action alg ฮฝ a m n).symm
ยท refine Measurable.indicator (by fun_prop) ?_
exact MeasurableSet.inter ((measurableSet_singleton _).preimage (by fun_prop))
((measurableSet_singleton _).preimage (by fun_prop))
ยท fun_prop
ยท simp
ยท rw [Measure.map_apply (by fun_prop) (by simp)] at ham
convert ham
ext ฯ
simp only [Set.mem_preimage, Set.indicator_apply, Set.mem_ofPred_eq, Pi.one_apply,
Set.mem_singleton_iff, ite_eq_left_iff, not_and, zero_ne_one, imp_false, Classical.not_imp,
Decidable.not_not, Prod.mk.injEq, and_congr_right_iff]
intro ha
simp [ha]Actions: Source ยท Open Issue
Meaning last changed in v4.34.0-rc2-1-g439785b (2026-08-23), the 5th 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: 14 project declarations, 94 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.