LeanMachineLearning

Bandits.probReal_sumRewards_le_sumRewards_le๐Ÿ”—

Lemma

No docstring.

๐Ÿ”—theorem
Bandits.probReal_sumRewards_le_sumRewards_le.{u_1, u_2} {๐“ : Type u_1} {ฮฉ : Type u_2} [DecidableEq ๐“] {m๐“ : MeasurableSpace ๐“} {mฮฉ : MeasurableSpace ฮฉ} {P : MeasureTheory.Measure ฮฉ} [MeasureTheory.IsProbabilityMeasure P] {alg : Learning.Algorithm ๐“ โ„} {ฮฝ : ProbabilityTheory.Kernel ๐“ โ„} [ProbabilityTheory.IsMarkovKernel ฮฝ] {A : โ„• โ†’ ฮฉ โ†’ ๐“} {R : โ„• โ†’ ฮฉ โ†’ โ„} [Nonempty ๐“] [Fintype ๐“] [MeasurableSingletonClass ๐“] (h : Learning.IsAlgEnvSeq A R alg (Learning.stationaryEnv ฮฝ) P) (a : ๐“) (n mโ‚ mโ‚‚ : โ„•) : MeasureTheory.Measure.real P {ฯ‰ | Learning.pullCount A (bestArm ฮฝ) n ฯ‰ = mโ‚ โˆง Learning.pullCount A a n ฯ‰ = mโ‚‚ โˆง Learning.sumRewards A R (bestArm ฮฝ) n ฯ‰ โ‰ค Learning.sumRewards A R a n ฯ‰} โ‰ค MeasureTheory.Measure.real (streamMeasure ฮฝ) {ฯ‰ | โˆ‘ i โˆˆ Finset.range mโ‚, ฯ‰ i (bestArm ฮฝ) โ‰ค โˆ‘ i โˆˆ Finset.range mโ‚‚, ฯ‰ i a}
Bandits.probReal_sumRewards_le_sumRewards_le.{u_1, u_2} {๐“ : Type u_1} {ฮฉ : Type u_2} [DecidableEq ๐“] {m๐“ : MeasurableSpace ๐“} {mฮฉ : MeasurableSpace ฮฉ} {P : MeasureTheory.Measure ฮฉ} [MeasureTheory.IsProbabilityMeasure P] {alg : Learning.Algorithm ๐“ โ„} {ฮฝ : ProbabilityTheory.Kernel ๐“ โ„} [ProbabilityTheory.IsMarkovKernel ฮฝ] {A : โ„• โ†’ ฮฉ โ†’ ๐“} {R : โ„• โ†’ ฮฉ โ†’ โ„} [Nonempty ๐“] [Fintype ๐“] [MeasurableSingletonClass ๐“] (h : Learning.IsAlgEnvSeq A R alg (Learning.stationaryEnv ฮฝ) P) (a : ๐“) (n mโ‚ mโ‚‚ : โ„•) : MeasureTheory.Measure.real P {ฯ‰ | Learning.pullCount A (bestArm ฮฝ) n ฯ‰ = mโ‚ โˆง Learning.pullCount A a n ฯ‰ = mโ‚‚ โˆง Learning.sumRewards A R (bestArm ฮฝ) n ฯ‰ โ‰ค Learning.sumRewards A R a n ฯ‰} โ‰ค MeasureTheory.Measure.real (streamMeasure ฮฝ) {ฯ‰ | โˆ‘ i โˆˆ Finset.range mโ‚, ฯ‰ i (bestArm ฮฝ) โ‰ค โˆ‘ i โˆˆ Finset.range mโ‚‚, ฯ‰ i a}

Code

lemma probReal_sumRewards_le_sumRewards_le [Fintype ๐“] [MeasurableSingletonClass ๐“]
    (h : IsAlgEnvSeq A R alg (stationaryEnv ฮฝ) P)
    (a : ๐“) (n mโ‚ mโ‚‚ : โ„•) :
    P.real {ฯ‰ | pullCount A (bestArm ฮฝ) n ฯ‰ = mโ‚ โˆง pullCount A a n ฯ‰ = mโ‚‚ โˆง
        sumRewards A R (bestArm ฮฝ) n ฯ‰ โ‰ค sumRewards A R a n ฯ‰} โ‰ค
      (streamMeasure ฮฝ).real
        {ฯ‰ | โˆ‘ i โˆˆ range mโ‚, ฯ‰ i (bestArm ฮฝ) โ‰ค โˆ‘ i โˆˆ range mโ‚‚, ฯ‰ i a}
Proof
by
  have hA := h.measurable_action
  have hR := h.measurable_feedback
  refine le_trans (le_of_eq ?_)
    (ArrayModel.probReal_sumRewards_le_sumRewards_le (alg := alg) a n mโ‚ mโ‚‚)
  let s := {p : โ„• ร— โ„• ร— โ„ ร— โ„ | p.1 = mโ‚ โˆง p.2.1 = mโ‚‚ โˆง p.2.2.1 โ‰ค p.2.2.2}
  have hs : MeasurableSet s := by simp only [measurableSet_setOfPred, s]; fun_prop
  change P.real ((fun ฯ‰ โ†ฆ (pullCount A (bestArm ฮฝ) n ฯ‰,
      pullCount A a n ฯ‰, sumRewards A R (bestArm ฮฝ) n ฯ‰, sumRewards A R a n ฯ‰)) โปยน' s) =
    (ArrayModel.arrayMeasure ฮฝ).real
      ((fun ฯ‰ โ†ฆ (pullCount (ArrayModel.action alg) (bestArm ฮฝ) n ฯ‰,
        pullCount (ArrayModel.action alg) a n ฯ‰,
        sumRewards (ArrayModel.action alg) (ArrayModel.reward alg) (bestArm ฮฝ) n ฯ‰,
        sumRewards (ArrayModel.action alg) (ArrayModel.reward alg) a n ฯ‰)) โปยน' s)
  simp_rw [measureReal_def]
  congr 1
  rw [โ† Measure.map_apply ?_ hs, โ† Measure.map_apply (by fun_prop) hs]
  swap
  ยท refine Measurable.prod (by fun_prop) (Measurable.prod (by fun_prop) ?_)
    exact (measurable_sumRewards hA hR _ _).prod (measurable_sumRewards hA hR _ _)
  congr 1
  refine IdentDistrib.map_eq ?_
  have h_eq := h.law_pullCount_sumRewards_unique' (ArrayModel.isAlgEnvSeq_arrayMeasure alg ฮฝ)
    (n := n)
  exact h_eq.comp (u := fun p โ†ฆ ((p (bestArm ฮฝ)).1, (p a).1, (p (bestArm ฮฝ)).2, (p a).2))
    (by fun_prop)

Actions: Source ยท Open Issue

Meaning last changed in v4.34.0-rc2-14-gf86702d (2026-08-25), 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: 10 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.