LeanMachineLearning

Bandits.UCB.prob_ucbIndex_ge๐Ÿ”—

Lemma

No docstring.

๐Ÿ”—theorem
Bandits.UCB.prob_ucbIndex_ge.{u_1} {K : โ„•} {c : โ„} {ฮฝ : 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)] {alg : Learning.Algorithm (Fin K) โ„} (h : Learning.IsAlgEnvSeq A R alg (Learning.stationaryEnv ฮฝ) P) (hฮฝ : โˆ€ (a : Fin K), ProbabilityTheory.HasSubgaussianMGF (fun x => x - โˆซ (x : โ„), id x โˆ‚ฮฝ a) ฯƒ2 (ฮฝ a)) (hฯƒ2 : ฯƒ2 โ‰  0) (hc : 0 โ‰ค c) (a : Fin K) (n : โ„•) : P {h | 0 < Learning.pullCount A a n h โˆง โˆซ (x : โ„), id x โˆ‚ฮฝ a โ‰ค Learning.empMean A R a n h - ucbWidth A (c * โ†‘ฯƒ2) a n h} โ‰ค 1 / (โ†‘n + 1) ^ (c - 1)
Bandits.UCB.prob_ucbIndex_ge.{u_1} {K : โ„•} {c : โ„} {ฮฝ : 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)] {alg : Learning.Algorithm (Fin K) โ„} (h : Learning.IsAlgEnvSeq A R alg (Learning.stationaryEnv ฮฝ) P) (hฮฝ : โˆ€ (a : Fin K), ProbabilityTheory.HasSubgaussianMGF (fun x => x - โˆซ (x : โ„), id x โˆ‚ฮฝ a) ฯƒ2 (ฮฝ a)) (hฯƒ2 : ฯƒ2 โ‰  0) (hc : 0 โ‰ค c) (a : Fin K) (n : โ„•) : P {h | 0 < Learning.pullCount A a n h โˆง โˆซ (x : โ„), id x โˆ‚ฮฝ a โ‰ค Learning.empMean A R a n h - ucbWidth A (c * โ†‘ฯƒ2) a n h} โ‰ค 1 / (โ†‘n + 1) ^ (c - 1)

Code

lemma prob_ucbIndex_ge [Nonempty (Fin K)] {alg : Algorithm (Fin K) โ„}
    (h : IsAlgEnvSeq A R alg (stationaryEnv ฮฝ) P)
    (hฮฝ : โˆ€ a, HasSubgaussianMGF (fun x โ†ฆ x - (ฮฝ a)[id]) ฯƒ2 (ฮฝ a))
    (hฯƒ2 : ฯƒ2 โ‰  0) (hc : 0 โ‰ค c) (a : Fin K) (n : โ„•) :
    P {h | 0 < pullCount A a n h โˆง
      (ฮฝ a)[id] โ‰ค empMean A R a n h - ucbWidth A (c * ฯƒ2) a n h} โ‰ค 1 / (n + 1) ^ (c - 1)
Proof
by
  let s : Set (โ„• ร— โ„) := {(m, x) | 0 < m โˆง (ฮฝ a)[id] โ‰ค x / m - โˆš(2 * (c * ฯƒ2) * log (โ†‘n + 1) / m)}
  have hs : MeasurableSet s := by
    simp only [Nat.cast_nonneg, sqrt_div', id_eq, measurableSet_setOfPred, s]
    fun_prop
  classical
  calc P {h | 0 < pullCount A a n h โˆง (ฮฝ a)[id] โ‰ค empMean A R a n h - ucbWidth A (c * ฯƒ2) a n h}
  _ โ‰ค โˆ‘ k โˆˆ range (n + 1) with k โˆˆ Prod.fst '' s,
      (streamMeasure ฮฝ) {ฯ‰ | โˆ‘ i โˆˆ range k, ฯ‰ i a โˆˆ Prod.mk k โปยน' s} :=
    prob_pullCount_prod_sumRewards_mem_le h hs
  _ โ‰ค โˆ‘ k โˆˆ Icc 1 n,
      (streamMeasure ฮฝ) {ฯ‰ | โˆ‘ i โˆˆ range k, ฯ‰ i a โˆˆ Prod.mk k โปยน' s} := by
    refine Finset.sum_le_sum_of_subset_of_nonneg (fun m โ†ฆ ?_) fun _ _ _ โ†ฆ by positivity
    simp [s]
    grind
  _ = โˆ‘ k โˆˆ Icc 1 n,
      (streamMeasure ฮฝ)
        {ฯ‰ | (ฮฝ a)[id] โ‰ค (โˆ‘ i โˆˆ range k, ฯ‰ i a) / k - โˆš(2 * c * ฯƒ2 * log (โ†‘n + 1) / k)} := by
    refine Finset.sum_congr rfl fun k hk โ†ฆ ?_
    congr with ฯ‰
    have hk : 0 < k := by grind
    simp only [id_eq, Nat.cast_nonneg, sqrt_div', Set.preimage_ofPred_eq, hk, true_and,
      Set.mem_ofPred_eq, s]
    grind
  _ โ‰ค โˆ‘ k โˆˆ Icc 1 n, (1 : โ„โ‰ฅ0โˆž) / (n + 1) ^ c := by
    gcongr with k hk
    exact prob_avg_sub_sqrt_log_ge hฮฝ hฯƒ2 hc a n k (by grind)
  _ โ‰ค (n + 1) * (1 : โ„โ‰ฅ0โˆž) / (n + 1) ^ c := by
    simp only [one_div, sum_const, Nat.card_Icc, add_tsub_cancel_right, nsmul_eq_mul, mul_one]
    rw [div_eq_mul_inv ((n : โ„โ‰ฅ0โˆž) + 1)]
    gcongr
    exact le_self_add
  _ = 1 / (n + 1) ^ (c - 1) := by
    simp only [mul_one, one_div]
    rw [ENNReal.rpow_sub _ _ (by simp) (by finiteness), ENNReal.rpow_one, div_eq_mul_inv,
      ENNReal.div_eq_inv_mul, ENNReal.mul_inv (by simp) (by simp), inv_inv]

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, 116 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.