LeanMachineLearning

Bandits.identDistrib_rewardByCountUntil_add_oneπŸ”—

Lemma

From the authors

The law of rewardByCountUntil A R t under 𝔓 does not depend on 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.IdentDistrib (Learning.rewardByCountUntil A R (t + 1)) (Learning.rewardByCountUntil A R t)
  (P.prod (streamMeasure Ξ½)) (P.prod (streamMeasure Ξ½))
Two functions defined on two (possibly different) measure spaces are identically distributed if their image measures coincide.
Code
lemma identDistrib_rewardByCountUntil_add_one (h : IsAlgEnvSeq O A R alg (stationaryEnv Ξ½) P)
    (t : β„•) :
    IdentDistrib (rewardByCountUntil A R (t + 1)) (rewardByCountUntil A R t) 𝔓 𝔓
Proof
by
  have hA := h.measurable_action
  have hR := h.measurable_feedback
  -- condition on the value of `(A t, pullCount A (A t) t)`
  refine identDistrib_of_forall_identDistrib_cond
    (g := fun Ο‰ : Ξ© Γ— (β„• β†’ 𝓐 β†’ ℝ) ↦ (A t Ο‰.1, pullCount A (A t Ο‰.1) t Ο‰.1))
    (((hA t).comp measurable_fst).prodMk
      ((measurable_uncurry_pullCount_comp hA (hA t) measurable_const).comp measurable_fst))
    (measurable_rewardByCountUntil hA hR _) (measurable_rewardByCountUntil hA hR _) fun p ↦ ?_
  have h_eq : (fun Ο‰ : Ξ© Γ— (β„• β†’ 𝓐 β†’ ℝ) ↦ (A t Ο‰.1, pullCount A (A t Ο‰.1) t Ο‰.1)) ⁻¹' {p}
      = {x | A t x = p.1 ∧ pullCount A p.1 t x = p.2} Γ—Λ’ Set.univ := by
    ext Ο‰
    simp only [Set.mem_preimage, Set.mem_singleton_iff, Prod.ext_iff, Set.mem_prod,
      Set.mem_ofPred_eq, Set.mem_univ, and_true]
    constructor
    · rintro ⟨h1, h2⟩
      exact ⟨h1, by rw [← h1]; exact h2⟩
    · rintro ⟨h1, h2⟩
      exact ⟨h1, by rw [h1]; exact h2⟩
  rw [h_eq, cond_prod_univ]
  exact identDistrib_rewardByCountUntil_add_one_cond h t p.1 p.2

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.