Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

BanditAlgorithm.subgaussian_sample_mean_confidence_bound

Proved

by Shuze Chen · Jul 17, 2026 · Mathlib c5ea003 (Lean v4.30.0)

banditsconcentrationconfidenceprobability

(Confidence form — L&S Eqs. (5.6)-(5.7)) Under the same hypotheses, let δ∈(0,1)\delta \in (0,1)δ∈(0,1). With probability at least 1−δ1-\delta1−δ,

μ<μ^+2σ2log⁡(1/δ)n,\mu < \hat\mu + \sqrt{\frac{2\sigma^2\log(1/\delta)}{n}},μ<μ^​+n2σ2log(1/δ)​​,

stated as

P(μ^+2σ2log⁡(1/δ)n≤μ)≤δ.\mathbb{P}\left(\hat\mu + \sqrt{\frac{2\sigma^2\log(1/\delta)}{n}} \le \mu\right) \le \delta.P(μ^​+n2σ2log(1/δ)​​≤μ)≤δ.

This is the exact deviation bound the UCB index of Chapter 7 is built from.

Preamble
import Mathlib.Probability.Moments.SubGaussian


open MeasureTheory ProbabilityTheory Real NNReal
Formal statement
theorem BanditAlgorithm.subgaussian_sample_mean_confidence_bound
    {Ω : Type} {mΩ : MeasurableSpace Ω} {P : Measure Ω} [IsProbabilityMeasure P]
    {n : ℕ} (hn : 0 < n) {X : Fin n → Ω → ℝ} {m : ℝ} {σ : ℝ≥0} (hσ : 0 < σ)
    (h_indep : iIndepFun (fun i ω ↦ X i ω - m) P)
    (h_subG : ∀ i, HasSubgaussianMGF (fun ω ↦ X i ω - m) (σ ^ 2) P)
    {δ : ℝ} (hδ : δ ∈ Set.Ioo (0 : ℝ) 1) :
    P.real {ω | (∑ i, X i ω) / n + Real.sqrt (2 * (σ : ℝ) ^ 2 * log (1 / δ) / n) ≤ m} ≤ δ := by
  sorry
Source
L&S Eqs. (5.6)-(5.7), p.78
Read-back

What the Lean code literally says, in plain math · claude-fable-5

Setting. Identical to the tail-bound item: Ω an arbitrary type with a σ-algebra and a probability measure P; n a natural number with 0 < n; X a family of n real-valued functions on Ω; m an arbitrary real number; σ a nonnegative real with 0 < σ. The hypotheses are the same two:

  • the centered family ω ↦ Xᵢ(ω) − m (i = 0, …, n−1) is mutually independent under P;
  • each centered function ω ↦ Xᵢ(ω) − m has sub-Gaussian MGF with variance proxy σ² under P (for every real t, exp(t·(Xᵢ − m)) is integrable and E[exp(t·(Xᵢ − m))] ≤ exp(σ²·t²/2)).

Additionally, δ is a real number lying in the open interval (0, 1): 0 < δ and δ < 1, both strict.

Claim. Writing A(ω) = (∑ᵢ Xᵢ(ω))/n for the sample mean and w = √(2·σ²·log(1/δ)/n) for the confidence width, the theorem asserts the single inequality

P{ω : A(ω) + w ≤ m} ≤ δ.

In words: the probability of the event "the sample mean plus the width √(2σ²·log(1/δ)/n) is still at most m" is at most δ. This is a one-sided statement only (it says nothing about the event A(ω) − w ≥ m or about two-sided coverage).

Edge cases and conventions. Since 0 < δ < 1 strictly, 1/δ > 1 and log(1/δ) > 0, so the radicand is positive and the square root is genuine (no junk-value branch of √ is engaged). The event uses a non-strict ≤. As before, m is just a real parameter constrained only through the hypotheses, and no separate measurability of the Xᵢ is assumed.

Human review
  • Endorsed by Community (Bot) · Jul 17, 2026

  • Endorsed by Shuze Chen · Jul 17, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me