LeanMachineLearning

Bandits.condDistrib_rewardByCount_stepsUntil๐Ÿ”—

Lemma

The conditional distribution of the reward received at the m-th pull of action a given the time at which number of pulls is m is the constant kernel with value ฮฝ a.

๐Ÿ”—theorem
Bandits.condDistrib_rewardByCount_stepsUntil.{u_1, u_2} {๐“ : Type u_1} {ฮฉ : Type u_2} {m๐“ : MeasurableSpace ๐“} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐“] {A : โ„• โ†’ ฮฉ โ†’ ๐“} {R : โ„• โ†’ ฮฉ โ†’ โ„} {P : MeasureTheory.Measure ฮฉ} [MeasureTheory.IsProbabilityMeasure P] {alg : Learning.Algorithm ๐“ โ„} {ฮฝ : ProbabilityTheory.Kernel ๐“ โ„} [ProbabilityTheory.IsMarkovKernel ฮฝ] [StandardBorelSpace ๐“] [Nonempty ๐“] [StandardBorelSpace ฮฉ] [Countable ๐“] (h : Learning.IsAlgEnvSeq A R alg (Learning.stationaryEnv ฮฝ) P) (a : ๐“) (m : โ„•) (hm : m โ‰  0) : โ‡‘๐“›[Learning.rewardByCount A R a m | fun ฯ‰ => Learning.stepsUntil A a m (Prod.fst ฯ‰); MeasureTheory.Measure.prod P (streamMeasure ฮฝ)] =แต[MeasureTheory.Measure.map (fun ฯ‰ => Learning.stepsUntil A a m (Prod.fst ฯ‰)) (MeasureTheory.Measure.prod P (streamMeasure ฮฝ))] โ‡‘(ProbabilityTheory.Kernel.const โ„•โˆž (ฮฝ a))
Bandits.condDistrib_rewardByCount_stepsUntil.{u_1, u_2} {๐“ : Type u_1} {ฮฉ : Type u_2} {m๐“ : MeasurableSpace ๐“} {mฮฉ : MeasurableSpace ฮฉ} [DecidableEq ๐“] {A : โ„• โ†’ ฮฉ โ†’ ๐“} {R : โ„• โ†’ ฮฉ โ†’ โ„} {P : MeasureTheory.Measure ฮฉ} [MeasureTheory.IsProbabilityMeasure P] {alg : Learning.Algorithm ๐“ โ„} {ฮฝ : ProbabilityTheory.Kernel ๐“ โ„} [ProbabilityTheory.IsMarkovKernel ฮฝ] [StandardBorelSpace ๐“] [Nonempty ๐“] [StandardBorelSpace ฮฉ] [Countable ๐“] (h : Learning.IsAlgEnvSeq A R alg (Learning.stationaryEnv ฮฝ) P) (a : ๐“) (m : โ„•) (hm : m โ‰  0) : โ‡‘๐“›[Learning.rewardByCount A R a m | fun ฯ‰ => Learning.stepsUntil A a m (Prod.fst ฯ‰); MeasureTheory.Measure.prod P (streamMeasure ฮฝ)] =แต[MeasureTheory.Measure.map (fun ฯ‰ => Learning.stepsUntil A a m (Prod.fst ฯ‰)) (MeasureTheory.Measure.prod P (streamMeasure ฮฝ))] โ‡‘(ProbabilityTheory.Kernel.const โ„•โˆž (ฮฝ a))

Code

lemma condDistrib_rewardByCount_stepsUntil [StandardBorelSpace ฮฉ] [Countable ๐“]
    (h : IsAlgEnvSeq A R alg (stationaryEnv ฮฝ) P) (a : ๐“) (m : โ„•) (hm : m โ‰  0) :
    condDistrib (rewardByCount A R a m) (fun ฯ‰ โ†ฆ stepsUntil A a m ฯ‰.1) ๐”“
      =แต[(๐”“).map (fun ฯ‰ โ†ฆ stepsUntil A a m ฯ‰.1)] Kernel.const _ (ฮฝ a)
Proof
by
  have hA := h.measurable_action
  have hR := h.measurable_feedback
  refine (condDistrib_ae_eq_cond (ฮผ := ๐”“)
    (X := fun ฯ‰ โ†ฆ stepsUntil A a m ฯ‰.1) (by fun_prop) (by fun_prop)).trans ?_
  rw [Filter.EventuallyEq, ae_iff_of_countable]
  intro n hn
  simp only [Kernel.const_apply]
  cases n with
  | top =>
    rw [Measure.map_congr (g := fun ฯ‰ โ†ฆ ฯ‰.2 m a)]
    swap
    ยท refine ae_cond_of_forall_mem ((measurableSet_singleton _).preimage (by fun_prop)) ?_
      simp only [Set.mem_preimage, Set.mem_singleton_iff]
      exact fun ฯ‰ โ†ฆ rewardByCount_of_stepsUntil_eq_top
    rw [cond_of_indepFun _ (by fun_prop) (by fun_prop) (measurableSet_singleton _)]
    ยท exact (hasLaw_Z a m).map_eq
    ยท rwa [Measure.map_apply (by fun_prop) (measurableSet_singleton _)] at hn
    ยท exact indepFun_prod (X := fun ฯ‰ : ฮฉ โ†ฆ stepsUntil A a m ฯ‰)
        (Y := fun ฯ‰ : โ„• โ†’ ๐“ โ†’ โ„ โ†ฆ ฯ‰ m a) (by fun_prop) (by fun_prop)
  | coe n =>
    rw [Measure.map_congr (g := fun ฯ‰ โ†ฆ R n ฯ‰.1)]
    swap
    ยท refine ae_cond_of_forall_mem ((measurableSet_singleton _).preimage (by fun_prop)) ?_
      simp only [Set.mem_preimage, Set.mem_singleton_iff]
      exact fun ฯ‰ โ†ฆ rewardByCount_of_stepsUntil_eq_coe
    refine reward_cond_stepsUntil h a m n hm ?_
    rwa [Measure.map_apply (by fun_prop) (measurableSet_singleton _)] at hn

Actions: Source ยท Open Issue

Meaning last changed in v4.34.0-rc2-1-g439785b (2026-08-23), the 4th 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: 11 project declarations, 109 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.