Documentation

CslibFrontier.Foundations.BooleanAnalysis.CentralLimit

The central limit theorem on the cube #

For a uniformly random x : Fin n → Bool, read as signs xᵢ = signVal (x i), the normalized sum Zₙ = ∑ᵢ xᵢ / √n converges in distribution to a standard Gaussian Z. This is Mathlib's central limit theorem (ProbabilityTheory.tendstoInDistribution_inv_sqrt_mul_sum) for a sequence of independent uniform signs under Measure.infinitePi, carried to the cube by integral_pi_rademacher. It is stated here as convergence of expectations on the cube:

In particular E[|Zₙ|] → E[|Z|] = √(2 / π) (tendsto_expect_abs_inv_sqrt_mul_sum_signVal), the estimate (5.4) of O'Donnell, Section 5.2 behind I[Majₙ] ∼ √(2 / π) √n.

Main results #

Usage #

The statements match an expectation written exactly as 𝔼 x : Fin n → Bool, g ((√n)⁻¹ * ∑ i, signVal (x i)), with n cast to ℝ; for another finite index type, reindex to Fin n first, for example with Fintype.expect_comp_arrowCongr. The form for functions of at most linear growth admits unbounded h of either sign; the second moments it uses are expect_sq_inv_sqrt_card_mul_sum_signVal_le. The checked clients in CslibFrontierTests/BooleanAnalysisHammingBallWeight.lean apply it to z - |z|, which is unbounded below, and derive that E[|∑ᵢ xᵢ / √n|] is eventually below 1.

References #

The central limit theorem on the cube. For a bounded continuous g, the expectation of g (∑ᵢ xᵢ / √n) at a uniform x ∈ {-1, 1}ⁿ tends to E[g(Z)] for a standard Gaussian Z.

The central limit theorem on the cube, for events. For a measurable E whose frontier is null for the standard Gaussian, Pr_x[∑ᵢ xᵢ / √n ∈ E] tends to Pr[Z ∈ E].

theorem Cslib.BitString.tendsto_expect_inv_sqrt_mul_sum_signVal_of_sq_le {h : ℝ → ℝ} (hc : Continuous h) {a b : ℝ} (hab : ∀ (z : ℝ), h z ^ 2 ≤ a * z ^ 2 + b) :
Filter.Tendsto (fun (n : ℕ) => Finset.univ.expect fun (x : Fin n → Bool) => h ((√↑n)⁻¹ * ∑ i : Fin n, signVal (x i))) Filter.atTop (nhds (∫ (z : ℝ), h z ∂ProbabilityTheory.gaussianReal 0 1))

The central limit theorem on the cube, for functions of at most linear growth. For a continuous h with h(z)² ≤ a z² + b, the expectation of h (∑ᵢ xᵢ / √n) at a uniform x ∈ {-1, 1}ⁿ tends to E[h(Z)] for a standard Gaussian Z. The second moments are at most one, which makes h uniformly integrable.

The mean absolute value of the normalized sign sum tends to that of a standard Gaussian, E[|∑ᵢ xᵢ / √n|] → E[|Z|] = √(2 / π) O'Donnell, Section 5.2, equation (5.4).