LeanMachineLearning

Bandits.ETC.expectation_pullCount_le๐Ÿ”—

Lemma

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

๐Ÿ”—theorem
Bandits.ETC.expectation_pullCount_le.{u_1} {K : โ„•} {hK : 0 < K} {m : โ„•} {ฮฝ : ProbabilityTheory.Kernel (Fin K) โ„} [ProbabilityTheory.IsMarkovKernel ฮฝ] {ฮฉ : Type u_1} {mฮฉ : MeasurableSpace ฮฉ} {P : MeasureTheory.Measure ฮฉ} [MeasureTheory.IsProbabilityMeasure P] {A : โ„• โ†’ ฮฉ โ†’ Fin K} {R : โ„• โ†’ ฮฉ โ†’ โ„} {ฯƒ2 : NNReal} [Nonempty (Fin K)] (h : Learning.IsAlgEnvSeq A R (etcAlgorithm hK m) (Learning.stationaryEnv ฮฝ) P) (hฮฝ : โˆ€ (a : Fin K), ProbabilityTheory.HasSubgaussianMGF (fun x => x - โˆซ (x : โ„), id x โˆ‚ฮฝ a) ฯƒ2 (ฮฝ a)) (a : Fin K) (hm : m โ‰  0) {n : โ„•} (hn : K * m โ‰ค n) : โˆซ (x : ฮฉ), (fun ฯ‰ => โ†‘(Learning.pullCount A a n ฯ‰)) x โˆ‚P โ‰ค โ†‘m + (โ†‘n - โ†‘K * โ†‘m) * Real.exp (-โ†‘m * gap ฮฝ a ^ 2 / (4 * โ†‘ฯƒ2))
Bandits.ETC.expectation_pullCount_le.{u_1} {K : โ„•} {hK : 0 < K} {m : โ„•} {ฮฝ : ProbabilityTheory.Kernel (Fin K) โ„} [ProbabilityTheory.IsMarkovKernel ฮฝ] {ฮฉ : Type u_1} {mฮฉ : MeasurableSpace ฮฉ} {P : MeasureTheory.Measure ฮฉ} [MeasureTheory.IsProbabilityMeasure P] {A : โ„• โ†’ ฮฉ โ†’ Fin K} {R : โ„• โ†’ ฮฉ โ†’ โ„} {ฯƒ2 : NNReal} [Nonempty (Fin K)] (h : Learning.IsAlgEnvSeq A R (etcAlgorithm hK m) (Learning.stationaryEnv ฮฝ) P) (hฮฝ : โˆ€ (a : Fin K), ProbabilityTheory.HasSubgaussianMGF (fun x => x - โˆซ (x : โ„), id x โˆ‚ฮฝ a) ฯƒ2 (ฮฝ a)) (a : Fin K) (hm : m โ‰  0) {n : โ„•} (hn : K * m โ‰ค n) : โˆซ (x : ฮฉ), (fun ฯ‰ => โ†‘(Learning.pullCount A a n ฯ‰)) x โˆ‚P โ‰ค โ†‘m + (โ†‘n - โ†‘K * โ†‘m) * Real.exp (-โ†‘m * gap ฮฝ a ^ 2 / (4 * โ†‘ฯƒ2))

Code

lemma expectation_pullCount_le [Nonempty (Fin K)]
    (h : IsAlgEnvSeq A R (etcAlgorithm hK 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 (fun _ โ†ฆ 1) ฯ‰ := by
    filter_upwards [pullCount_of_ge h a hm hn] with ฯ‰ h
    simp only [h, Set.indicator_apply, Set.mem_ofPred_eq, 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_const, smul_eq_mul, mul_one]
  ยท rw [โ† neg_mul]
    exact prob_arm_mul_eq_le h hฮฝ a hm
  ยท exact (measurableSet_singleton _).preimage (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: 18 project declarations, 138 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.