Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem EC.1 (Bernstein), p. ec5 — Pr((1/N)ΣXⁱ − E X¹ ≥ t) ≤ exp(−Nt²/(2σ² + 2tc/3))

Proved
DataDrivenNV.LRS.theoremEC1_bernstein

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

bernstein-inequalityconcentration-inequalityiidp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-v1

Bernstein's inequality. Let X1,…,XNX^1,\dots,X^NX1,…,XN (N≥1N\ge1N≥1) be i.i.d. real random variables with common law ν\nuν such that ∣X1∣≤c|X^1|\le c∣X1∣≤c and ∣X1−E[X1]∣≤c|X^1-\mathbb E[X^1]|\le c∣X1−E[X1]∣≤c almost surely, and Var⁡(X1)=σ2\operatorname{Var}(X^1)=\sigma^2Var(X1)=σ2. Then for every t>0t>0t>0,

Pr⁡(1N∑i=1NXi−E[X1]≥t)≤exp⁡(−Nt22σ2+2tc/3).\Pr\Big(\frac1N\sum_{i=1}^N X^i - \mathbb E[X^1] \ge t\Big) \le \exp\Big(\frac{-Nt^2}{2\sigma^2 + 2tc/3}\Big).Pr(N1​i=1∑N​Xi−E[X1]≥t)≤exp(2σ2+2tc/3−Nt2​).

In the paper this is applied to indicators Xi=1[Di≤q]X^i=\mathbf 1[D^i\le q]Xi=1[Di≤q] (with c=1c=1c=1 and σ2=F(q)(1−F(q))\sigma^2=F(q)(1-F(q))σ2=F(q)(1−F(q))) to bound how far the empirical cdf can overshoot the true cdf, which is the step (EC.2) of the proof of Proposition EC.1.

Formalization Note The i.i.d. sample is the coordinate process of the product measure ν⊗N\nu^{\otimes N}ν⊗N on RN\mathbb R^NRN. The paper prints only ∣X1∣≤c|X^1|\le c∣X1∣≤c; the centred bound ∣X1−EX1∣≤c|X^1-\mathbb E X^1|\le c∣X1−EX1∣≤c is added because this form of Bernstein's inequality is the standard one for centred bounded variables (with only ∣X1∣≤c|X^1|\le c∣X1∣≤c the centred variable can reach 2c2c2c). The printed form is false without it: for X1∈{−1,1}X^1\in\{-1,1\}X1∈{−1,1} with Pr⁡(X1=1)=0.01\Pr(X^1=1)=0.01Pr(X1=1)=0.01, c=1c=1c=1, t=0.2t=0.2t=0.2 and N=500N=500N=500, the exact binomial tail is about 1.2⋅10−381.2\cdot10^{-38}1.2⋅10−38 while the printed bound is about 1.4⋅10−411.4\cdot10^{-41}1.4⋅10−41. Both bounds hold for the indicators to which the paper applies the inequality, so every use in the paper is covered.

Preamble
import Mathlib
import Definitions.Def_DataDrivenNV_LRS_Setting

open MeasureTheory ProbabilityTheory
Formal statement
namespace DataDrivenNV.LRS

/-- Theorem EC.1 (Bernstein's inequality), p. ec5. Let `X¹, …, Xᴺ` be i.i.d. with law `ν`
(the coordinates of the product measure `ν^⊗N`), with `|X¹| ≤ c` and `|X¹ - E X¹| ≤ c` almost
surely and `Var(X¹) = σ²`. Then for every `t > 0`,
`Pr((1/N) Σᵢ Xⁱ - E X¹ ≥ t) ≤ exp(-N t² / (2σ² + 2tc/3))`.
The centred bound `hcent` is added to the printed hypothesis `|X¹| ≤ c`; it holds in every use
the paper makes of the inequality (indicators, `c = 1`). -/
theorem theoremEC1_bernstein (ν : Measure ℝ) [IsProbabilityMeasure ν] (N : ℕ) (hN : 1 ≤ N)
    (c σ : ℝ) (hc : ∀ᵐ x ∂ν, |x| ≤ c) (hcent : ∀ᵐ x ∂ν, |x - ∫ y, y ∂ν| ≤ c)
    (hvar : ∫ x, (x - ∫ y, y ∂ν) ^ 2 ∂ν = σ ^ 2) (t : ℝ) (ht : 0 < t) :
    (Measure.pi fun _ : Fin N => ν)
        {x : Fin N → ℝ | t ≤ (1 / (N : ℝ)) * ∑ i, x i - ∫ y, y ∂ν} ≤
      ENNReal.ofReal (Real.exp (-((N : ℝ) * t ^ 2) / (2 * σ ^ 2 + 2 * t * c / 3))) := by sorry

end DataDrivenNV.LRS
Source
Levi, Perakis & Uichanco, The Data-Driven Newsvendor Problem: New Bounds and Insights, authors' accepted manuscript (MIT DSpace), p. ec5, Theorem EC.1 (Bernstein 1927)
Human review
  • Endorsed by Shuze Chen · Oct 6, 2026

    Confirmed by the moderator at approval.

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