Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Berry–Esseen theorem: ∣Fn(x)−Φ(x)∣≤3ρσ3n|F_n(x)-\Phi(x)| \le \dfrac{3\rho}{\sigma^3\sqrt n}∣Fn​(x)−Φ(x)∣≤σ3n​3ρ​

Open
BerryEsseenFeller.berry_esseen

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

berry-esseencentral-limit-theoremindependencemomentsnormal-distributionprobability

This is the Berry–Esseen theorem, the classical quantitative form of the central limit theorem, in the version with the explicit constant 333 proved in Feller's and Durrett's textbooks.

Let X1,X2,…X_1, X_2, \dotsX1​,X2​,… be independent and identically distributed real random variables on a probability space (Ω,F,P)(\Omega, \mathcal F, \mathbb P)(Ω,F,P) such that

EX1=0,EX12=σ2>0,ρ=E∣X1∣3<∞.\mathbb E X_1 = 0, \qquad \mathbb E X_1^2 = \sigma^2 > 0, \qquad \rho = \mathbb E|X_1|^3 < \infty .EX1​=0,EX12​=σ2>0,ρ=E∣X1​∣3<∞.

For n≥1n \ge 1n≥1 let FnF_nFn​ be the distribution function of the normalized sum,

Fn(x)=P ⁣(X1+⋯+Xnσn≤x),x∈R,F_n(x) = \mathbb P\!\left( \frac{X_1 + \cdots + X_n}{\sigma \sqrt n} \le x \right), \qquad x \in \mathbb R,Fn​(x)=P(σn​X1​+⋯+Xn​​≤x),x∈R,

and let Φ(x)=12π∫−∞xe−t2/2 dt\Phi(x) = \frac{1}{\sqrt{2\pi}} \int_{-\infty}^{x} e^{-t^2/2}\, dtΦ(x)=2π​1​∫−∞x​e−t2/2dt be the standard normal distribution function. Then for every n≥1n \ge 1n≥1 and every real xxx,

∣Fn(x)−Φ(x)∣≤3ρσ3n.\bigl| F_n(x) - \Phi(x) \bigr| \le \frac{3\rho}{\sigma^3 \sqrt n}.​Fn​(x)−Φ(x)​≤σ3n​3ρ​.

The central limit theorem only asserts that Fn(x)→Φ(x)F_n(x) \to \Phi(x)Fn​(x)→Φ(x). The Berry–Esseen theorem turns this into an explicit error bound of order n−1/2n^{-1/2}n−1/2 that is uniform in xxx and depends on the common distribution only through the ratio ρ/σ3\rho/\sigma^3ρ/σ3; the order n−1/2n^{-1/2}n−1/2 cannot be improved in general (for instance for symmetric ±1\pm 1±1 steps). It is the standard tool for quantifying normal approximations of sums of independent variables. Smaller admissible values of the absolute constant are known; the constant 333 is the one in the cited textbook statements.

Formalization Note The sequence is X : ℕ → Ω → ℝ indexed from 000, so XkX_kXk​ of the text is X (k - 1) and X1+⋯+XnX_1 + \cdots + X_nX1​+⋯+Xn​ is ∑ i ∈ Finset.range n, X i ω. The i.i.d. assumption is iIndepFun X P together with IdentDistrib (X i) (X 0) P P for every i, exactly as in Mathlib's central limit theorem ProbabilityTheory.tendstoInDistribution_inv_sqrt_mul_sum_sub. Finiteness of the third absolute moment is the hypothesis that ∣X1∣3|X_1|^3∣X1​∣3 is integrable; on a probability space this also makes X1X_1X1​ and X12X_1^2X12​ integrable, so the Bochner integrals in the hypotheses EX1=0\mathbb E X_1 = 0EX1​=0 and EX12=σ2\mathbb E X_1^2 = \sigma^2EX12​=σ2 are genuine expectations, and ρ\rhoρ is named by the hypothesis ∫∣X1∣3 dP=ρ\int |X_1|^3 \, d\mathbb P = \rho∫∣X1​∣3dP=ρ. Fn(x)F_n(x)Fn​(x) is ProbabilityTheory.cdf of the law P.map of the normalized sum, and Φ\PhiΦ is cdf (gaussianReal 0 1). The hypotheses σ>0\sigma > 0σ>0 and n≥1n \ge 1n≥1 are part of the source statement and are needed: for n=0n = 0n=0 Lean's convention a/0=0a / 0 = 0a/0=0 would make the right-hand side 000.

Preamble
import Mathlib

open MeasureTheory ProbabilityTheory
Formal statement
namespace BerryEsseenFeller

/-- **Berry–Esseen theorem** with Feller's constant `3` (Feller, Vol. II, Ch. XVI, §5, Theorem 1;
Durrett, *Probability: Theory and Examples*, 5th ed., Theorem 3.4.17).

`X 0, X 1, …` are i.i.d. real random variables (`iIndepFun` plus `IdentDistrib (X i) (X 0)`) with
`E X = 0`, `E X² = σ²`, `σ > 0`, and `E|X|³ = ρ < ∞`. For every `n ≥ 1` and every real `x`, the
distribution function of `(X 0 + ⋯ + X (n - 1)) / (σ √n)` (the `cdf` of its law `P.map _`) differs
from the standard normal distribution function `cdf (gaussianReal 0 1)` at `x` by at most
`3 ρ / (σ³ √n)`. -/
theorem berry_esseen {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} [IsProbabilityMeasure P]
    {X : ℕ → Ω → ℝ} (hindep : iIndepFun X P) (hident : ∀ i, IdentDistrib (X i) (X 0) P P)
    {σ ρ : ℝ} (hσ : 0 < σ) (h3 : Integrable (fun ω => |X 0 ω| ^ 3) P)
    (hmean : ∫ ω, X 0 ω ∂P = 0) (hvar : ∫ ω, X 0 ω ^ 2 ∂P = σ ^ 2)
    (hρ : ∫ ω, |X 0 ω| ^ 3 ∂P = ρ) (n : ℕ) (hn : 0 < n) (x : ℝ) :
    |cdf (P.map (fun ω => (∑ i ∈ Finset.range n, X i ω) / (σ * √(n : ℝ)))) x
        - cdf (gaussianReal 0 1) x| ≤ 3 * ρ / (σ ^ 3 * √(n : ℝ)) := by sorry

end BerryEsseenFeller
Source
W. Feller, An Introduction to Probability Theory and Its Applications, Vol. II, 2nd ed., Wiley (1971), Chapter XVI (Expansions related to the central limit theorem), Section 5 (Berry–Esseen theorems), Theorem 1: for i.i.d. X_k with E(X_k) = 0, E(X_k^2) = sigma^2 > 0, E(|X_k|^3) = rho < infinity and F_n the distribution of (X_1 + ... + X_n)/(sigma sqrt n), |F_n(x) - N(x)| <= 3 rho/(sigma^3 sqrt n) for all x and n. Also R. Durrett, Probability: Theory and Examples, 5th ed., Cambridge University Press (2019), Section 3.4.4 (Rates of convergence (Berry–Esseen)), Theorem 3.4.17 (Theorem 3.4.9 in the 4th ed.), same statement with constant 3. Original papers: A. C. Berry, The accuracy of the Gaussian approximation to the sum of independent variates, Trans. Amer. Math. Soc. 49 (1941), 122–136; C.-G. Esseen, On the Liapounoff limit of error in the theory of probability, Ark. Mat. Astr. Fys. 28A (1942), no. 9, 1–19.

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 paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me