Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Eq. (2.3) — Cramér–Chernoff bound P(μi−μ^i,s>ε)≤e−sψ∗(ε)\mathbb P(\mu_i-\hat\mu_{i,s}>\varepsilon)\le e^{-s\psi^*(\varepsilon)}P(μi​−μ^​i,s​>ε)≤e−sψ∗(ε)

Proved
RegretBandits.Stochastic.cramer_chernoff

by mikedeng1 · Oct 5, 2026 · Mathlib 0df444a (Lean v4.33.1)

banditsconcentrationp2o-batch-pfp1bp2o-gran-per-chapterp2o-plan-bookp2o-v1

Consider a stochastic bandit whose reward distributions satisfy the moment condition (2.2) with a convex function ψ\psiψ, and let ψ∗(ε)=sup⁡λ∈R(λε−ψ(λ))\psi^*(\varepsilon)=\sup_{\lambda\in\mathbb R}(\lambda\varepsilon-\psi(\lambda))ψ∗(ε)=supλ∈R​(λε−ψ(λ)). Let μ^i,s\hat\mu_{i,s}μ^​i,s​ be the sample mean of the first s≥1s\ge1s≥1 rewards of arm iii. Then for every ε≥0\varepsilon\ge0ε≥0,

P(μi−μ^i,s>ε)≤e−s ψ∗(ε),\mathbb P\big(\mu_i-\hat\mu_{i,s}>\varepsilon\big)\le e^{-s\,\psi^*(\varepsilon)},P(μi​−μ^​i,s​>ε)≤e−sψ∗(ε),

with e−∞=0e^{-\infty}=0e−∞=0.

This concentration inequality is what makes μ^i,s+(ψ∗)−1(1sln⁡1δ)\hat\mu_{i,s}+(\psi^*)^{-1}(\frac1s\ln\frac1\delta)μ^​i,s​+(ψ∗)−1(s1​lnδ1​) an upper confidence bound on μi\mu_iμi​ at level 1−δ1-\delta1−δ; the UCB analysis applies it with a union bound over the number of pulls.

Formalization Note. Two conventions the book leaves implicit are stated. (i) ε≥0\varepsilon\ge0ε≥0: for ε<0\varepsilon<0ε<0 the printed inequality is false (with ψ(λ)=λ2/8\psi(\lambda)=\lambda^2/8ψ(λ)=λ2/8 it would bound a probability close to 111 by e−2sε2e^{-2s\varepsilon^2}e−2sε2). (ii) ψ(λ)≥ψ(0)\psi(\lambda)\ge\psi(0)ψ(λ)≥ψ(0) for λ≤0\lambda\le0λ≤0. Condition (2.2) constrains ψ\psiψ only on λ≥0\lambda\ge0λ≥0, while ψ∗\psi^*ψ∗ takes the supremum over all λ∈R\lambda\in\mathbb Rλ∈R. Without (ii), ψ(λ)=cλ+λ2/8\psi(\lambda)=c\lambda+\lambda^2/8ψ(λ)=cλ+λ2/8 with large c>0c>0c>0 satisfies (2.2) for [0,1][0,1][0,1] rewards and has ψ∗(ε)=2(ε−c)2\psi^*(\varepsilon)=2(\varepsilon-c)^2ψ∗(ε)=2(ε−c)2, which makes (2.3) false for small ε\varepsilonε. Every ψ\psiψ used in the book is even and satisfies (ii). Under (ii) the supremum may be taken over λ≥0\lambda\ge0λ≥0. ψ∗\psi^*ψ∗ is computed in the extended reals and the right side is the extended exponential.

Preamble
import Mathlib
import Definitions.Def_RegretBandits_Stochastic_model
Formal statement
namespace RegretBandits.Stochastic

open MeasureTheory

/-- Eq. (2.3) of Bubeck and Cesa-Bianchi (arXiv:1204.5721v2, p. 10): if the rewards satisfy
(2.2) with a convex `ψ` (which is not below `ψ 0` on `(-∞, 0]`), then for every arm `i`, every
number of pulls `s ≥ 1` and every `ε ≥ 0`,
`ℙ(μ_i - μ̂_{i,s} > ε) ≤ e^{-s ψ*(ε)}`, with `e^{-∞} = 0`. -/
theorem cramer_chernoff {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω)
    [IsProbabilityMeasure P] {K : ℕ} (X : Fin K → ℕ → Ω → ℝ) (μ : Fin K → ℝ)
    (hX : IsStochasticBandit P X μ) (ψ : ℝ → ℝ) (hψ : SatisfiesMomentCondition P ψ X μ)
    (hψneg : ∀ l : ℝ, l ≤ 0 → ψ 0 ≤ ψ l) (i : Fin K) (s : ℕ) (hs : 1 ≤ s) (ε : ℝ)
    (hε : 0 ≤ ε) :
    P {ω | ε < μ i - sampleMean X i s ω} ≤
      EReal.exp (-((s : ℝ) : EReal) * legendreFenchel ψ ε) := by sorry

end RegretBandits.Stochastic
Source
Bubeck, Cesa-Bianchi, Regret Analysis of Stochastic and Nonstochastic Multi-armed Bandit Problems, arXiv:1204.5721v2, p. 10, Eq. (2.3)
Human review
  • Endorsed by Shuze Chen · Oct 5, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 5, 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