LeanMachineLearning

Bandits.hasLaw_rewardByCountUntil๐Ÿ”—

Lemma

From the authors

The law of rewardByCountUntil A R t under ๐”“ is โจ‚ (a, m), ฮฝ a, for all t.

Types
  • ๐“ : Type u_1m๐“ : MeasurableSpace ๐“A measurable space is a space equipped with a ฯƒ-algebra.DecidableEq ๐“MeasurableSingletonClass ๐“A typeclass mixin for MeasurableSpaces such that each singleton is measurable.Countable ๐“A type ฮฑ is countable if there exists an injective map ฮฑ โ†’ โ„•.
  • ฮฉ : Type u_2mฮฉ : MeasurableSpace ฮฉ
Given
  • O : โ„• โ†’ ฮฉ โ†’ Unit
  • A : โ„• โ†’ ฮฉ โ†’ ๐“
  • R : โ„• โ†’ ฮฉ โ†’ โ„
  • P : 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 PA measure ฮผ is called a probability measure if ฮผ univ = 1.
  • alg : Learning.Algorithm Unit ๐“ โ„A stochastic, sequential algorithm.
  • ฮฝ : 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.
  • t : โ„•
Then
ProbabilityTheory.HasLaw (Learning.rewardByCountUntil A R t) (MeasureTheory.Measure.infinitePi fun p => ฮฝ p.1)
  (P.prod (streamMeasure ฮฝ))
The predicate HasLaw X ฮผ P registers the fact that the random variable X has law ฮผ under the measure P, in other words that P.map X = ฮผ.
Code
lemma hasLaw_rewardByCountUntil (h : IsAlgEnvSeq O A R alg (stationaryEnv ฮฝ) P) (t : โ„•) :
    HasLaw (rewardByCountUntil A R t) (Measure.infinitePi fun p : ๐“ ร— โ„• โ†ฆ ฮฝ p.1) ๐”“
Proof
by
  induction t with
  | zero => exact hasLaw_rewardByCountUntil_zero P
  | succ t ih => exact (identDistrib_rewardByCountUntil_add_one h t).symm.hasLaw ih

Meaning last changed in v4.34.0-rc2-76-g565f652 (2026-09-10), 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: 11 project declarations, 61 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.