Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

BanditAlgorithm.bernoulli_chernoff_tail_bound

Proved

by Shuze Chen · Jul 26, 2026 · Mathlib 0df444a (Lean v4.33.1)

chernoffconcentrationprobability

(Chernoff's bound, L&S Lemma 10.3) Let X1,…,XnX_1, \dots, X_nX1​,…,Xn​ (n≥1n \ge 1n≥1) be independent random variables, Bernoulli distributed with mean μ∈[0,1]\mu \in [0,1]μ∈[0,1] (law equality map(Xi)P=μδ1+(1−μ)δ0\mathrm{map}(X_i)P = \mu\delta_1 + (1-\mu)\delta_0map(Xi​)P=μδ1​+(1−μ)δ0​), and let μ^=1n∑tXt\hat\mu = \frac{1}{n}\sum_t X_tμ^​=n1​∑t​Xt​. Then for ε∈[0,1−μ]\varepsilon \in [0, 1-\mu]ε∈[0,1−μ],

P(μ^≥μ+ε)≤exp⁡(−n d(μ+ε,μ))(Eq. 10.1),\mathbb{P}(\hat\mu \ge \mu + \varepsilon) \le \exp\big(-n\, d(\mu+\varepsilon, \mu)\big) \quad\text{(Eq. 10.1)},P(μ^​≥μ+ε)≤exp(−nd(μ+ε,μ))(Eq. 10.1),

and for ε∈[0,μ]\varepsilon \in [0, \mu]ε∈[0,μ],

P(μ^≤μ−ε)≤exp⁡(−n d(μ−ε,μ))(Eq. 10.2).\mathbb{P}(\hat\mu \le \mu - \varepsilon) \le \exp\big(-n\, d(\mu-\varepsilon, \mu)\big) \quad\text{(Eq. 10.2)}.P(μ^​≤μ−ε)≤exp(−nd(μ−ε,μ))(Eq. 10.2).
  • Both ε\varepsilonε-ranges are the book's closed intervals, and both conclusions are stated as one conjunction.
  • At μ∈{0,1}\mu \in \{0,1\}μ∈{0,1} the junk-valued exponent makes the bound weaker than the book's exp⁡(−∞)=0\exp(-\infty) = 0exp(−∞)=0 but still true.
Preamble
import Definitions.Def_bernoulliRelativeEntropy


open MeasureTheory ProbabilityTheory Real
Formal statement
theorem BanditAlgorithm.bernoulli_chernoff_tail_bound
    {Ω : Type} {mΩ : MeasurableSpace Ω} {P : Measure Ω} [IsProbabilityMeasure P]
    {n : ℕ} (hn : 0 < n) {X : Fin n → Ω → ℝ} {μ : ℝ}
    (hμ : μ ∈ Set.Icc (0 : ℝ) 1) (h_meas : ∀ i, Measurable (X i))
    (h_indep : iIndepFun X P)
    (h_law : ∀ i, Measure.map (X i) P =
      ENNReal.ofReal μ • Measure.dirac (1 : ℝ) +
        ENNReal.ofReal (1 - μ) • Measure.dirac (0 : ℝ)) :
    (∀ ε ∈ Set.Icc (0 : ℝ) (1 - μ),
      P.real {ω | μ + ε ≤ (∑ t, X t ω) / n} ≤
        exp (-(n * bernoulliRelativeEntropy (μ + ε) μ))) ∧
    (∀ ε ∈ Set.Icc (0 : ℝ) μ,
      P.real {ω | (∑ t, X t ω) / n ≤ μ - ε} ≤
        exp (-(n * bernoulliRelativeEntropy (μ - ε) μ))) := by
  sorry
Source
L&S Lemma 10.3, p.135 (with Corollary 10.4, p.136)

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