LeanMachineLearning

Bandits.ETC.expectation_pullCount_le🔗

Lemma

From the authors

Bound on the expectation of the number of pulls of each arm by the ETC algorithm.

Types
  • Ω : Type u_1mΩ : MeasurableSpace ΩA measurable space is a space equipped with a σ-algebra.
Given
  • K : NeZero K
  • m :
  • ν : ProbabilityTheory.Kernel (Fin K) 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.
  • 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.
  • O : → Ω → Unit
  • A : → Ω → Fin K
  • R : → Ω →
  • σ2 : NNReal
  • a : Fin K
  • n :
Assuming
Then
 (x : Ω), (fun ω => ↑(Learning.pullCount A a n ω)) xP↑m + (↑n - ↑K * ↑m) * Real.exp (-↑m * gap ν a ^ 2 / (4 * ↑σ2))
Code
lemma expectation_pullCount_le (h : IsAlgEnvSeq O A R (etcAlgorithm K m) (stationaryEnv ν) P)
    (hν : ∀ a, HasSubgaussianMGF (fun x ↦ x - (ν a)[id]) σ2 (ν a))
    (a : Fin K) (hm : m ≠ 0) {n : ℕ} (hn : K * m ≤ n) :
    P[fun ω ↦ (pullCount A a n ω : ℝ)]
      ≤ m + (n - K * m) * Real.exp (- (m : ℝ) * gap ν a ^ 2 / (4 * σ2))
Proof
by
  have hA := h.measurable_action
  have : (fun ω ↦ (pullCount A a n ω : ℝ))
      =ᵐ[P] fun ω ↦ m + (n - K * m) * {ω' | A (K * m) ω' = a}.indicator 1 ω := by
    filter_upwards [pullCount_of_ge h a hn] with ω h
    simp only [h, Set.indicator_apply, Set.mem_ofPred_eq, Pi.one_apply, mul_ite, mul_one, mul_zero,
      Nat.cast_add, Nat.cast_ite, CharP.cast_eq_zero, add_right_inj]
    norm_cast
  rw [integral_congr_ae this, integral_add (integrable_const _), integral_const_mul]
  swap
  · refine Integrable.const_mul ?_ _
    rw [integrable_indicator_iff]
    · exact integrableOn_const
    · exact (measurableSet_singleton _).preimage (by fun_prop)
  simp only [integral_const, probReal_univ, smul_eq_mul, one_mul, neg_mul, add_le_add_iff_left]
  gcongr
  · norm_cast
    simp
  rw [integral_indicator_one]
  · rw [← neg_mul]
    exact prob_arm_mul_eq_le h hν a hm
  · exact (measurableSet_singleton _).preimage (by fun_prop)

Meaning last changed in v4.34.0-rc2-90-gdde3322 (2026-09-16), the 9th 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: 22 project declarations, 131 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.