LeanMachineLearning

Bandits.prob_avg_add_sqrt_log_le๐Ÿ”—

Lemma

No docstring.

๐Ÿ”—theorem
Bandits.prob_avg_add_sqrt_log_le.{u_1} {๐“ : Type u_1} {m๐“ : MeasurableSpace ๐“} {ฮฝ : ProbabilityTheory.Kernel ๐“ โ„} [ProbabilityTheory.IsMarkovKernel ฮฝ] {ฯƒ2 : NNReal} {c : โ„} (hฮฝ : โˆ€ (a : ๐“), ProbabilityTheory.HasSubgaussianMGF (fun x => x - โˆซ (x : โ„), id x โˆ‚ฮฝ a) ฯƒ2 (ฮฝ a)) (hฯƒ2 : ฯƒ2 โ‰  0) (hc : 0 โ‰ค c) (a : ๐“) (n k : โ„•) (hk : k โ‰  0) : (streamMeasure ฮฝ) {ฯ‰ | (โˆ‘ m โˆˆ Finset.range k, ฯ‰ m a) / โ†‘k + โˆš(2 * c * โ†‘ฯƒ2 * Real.log (โ†‘n + 1) / โ†‘k) โ‰ค โˆซ (x : โ„), id x โˆ‚ฮฝ a} โ‰ค 1 / (โ†‘n + 1) ^ c
Bandits.prob_avg_add_sqrt_log_le.{u_1} {๐“ : Type u_1} {m๐“ : MeasurableSpace ๐“} {ฮฝ : ProbabilityTheory.Kernel ๐“ โ„} [ProbabilityTheory.IsMarkovKernel ฮฝ] {ฯƒ2 : NNReal} {c : โ„} (hฮฝ : โˆ€ (a : ๐“), ProbabilityTheory.HasSubgaussianMGF (fun x => x - โˆซ (x : โ„), id x โˆ‚ฮฝ a) ฯƒ2 (ฮฝ a)) (hฯƒ2 : ฯƒ2 โ‰  0) (hc : 0 โ‰ค c) (a : ๐“) (n k : โ„•) (hk : k โ‰  0) : (streamMeasure ฮฝ) {ฯ‰ | (โˆ‘ m โˆˆ Finset.range k, ฯ‰ m a) / โ†‘k + โˆš(2 * c * โ†‘ฯƒ2 * Real.log (โ†‘n + 1) / โ†‘k) โ‰ค โˆซ (x : โ„), id x โˆ‚ฮฝ a} โ‰ค 1 / (โ†‘n + 1) ^ c

Code

lemma prob_avg_add_sqrt_log_le {ฯƒ2 : โ„โ‰ฅ0} {c : โ„}
    (hฮฝ : โˆ€ a, HasSubgaussianMGF (fun x โ†ฆ x - (ฮฝ a)[id]) ฯƒ2 (ฮฝ a)) (hฯƒ2 : ฯƒ2 โ‰  0)
    (hc : 0 โ‰ค c) (a : ๐“) (n k : โ„•) (hk : k โ‰  0) :
    streamMeasure ฮฝ {ฯ‰ | (โˆ‘ m โˆˆ range k, ฯ‰ m a) / k + โˆš(2 * c * ฯƒ2 * log (n + 1) / k) โ‰ค (ฮฝ a)[id]} โ‰ค
      1 / (n + 1) ^ c
Proof
by
  have h_log_nonneg : 0 โ‰ค log (n + 1) := log_nonneg (by simp)
  calc
    streamMeasure ฮฝ {ฯ‰ | (โˆ‘ m โˆˆ range k, ฯ‰ m a) / k + โˆš(2 * c * ฯƒ2 * log (n + 1) / k) โ‰ค (ฮฝ a)[id]}
  _ = streamMeasure ฮฝ
      {ฯ‰ | (โˆ‘ s โˆˆ range k, (ฯ‰ s a - (ฮฝ a)[id])) / k โ‰ค - โˆš(2 * c * ฯƒ2 * log (n + 1) / k)} := by
    congr with ฯ‰
    field_simp
    rw [Finset.sum_sub_distrib]
    simp
    grind
  _ = streamMeasure ฮฝ
      {ฯ‰ | (โˆ‘ s โˆˆ range k, (ฯ‰ s a - (ฮฝ a)[id])) โ‰ค - โˆš(2 * c * k * ฯƒ2 * log (n + 1))} := by
    congr with ฯ‰
    field_simp
    congr! 2
    rw [sqrt_div (by positivity), โ† mul_div_assoc, mul_comm, mul_div_assoc, div_sqrt,
      mul_assoc (k : โ„), mul_assoc (k : โ„), mul_assoc (k : โ„),
      sqrt_mul (x := (k : โ„)) (by positivity), mul_comm]
  _ โ‰ค 1 / (n + 1) ^ c := prob_sum_le_sqrt_log hฮฝ hฯƒ2 hc a k hk

Actions: Source ยท Open Issue

Meaning last changed in v4.34.0-rc2-1-g439785b (2026-08-23), 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: 1 project declarations, 68 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.