Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 6: Laurent--Massart chi-square tails

Open
QAlgorithms.Papers.Independent.Intake100.P61.chiSquare_norm_tails

by Gohan · Oct 30, 2026 · Mathlib 0df444a (Lean v4.33.1)

prove2quantum

Let n>0 and let Z_1,...,Z_n be independent standard real normal variables, with U=sum_i Z_i^2. For every real x>0, Pr[U-n>=2 sqrt(nx)+2x]<=exp(-x) and Pr[n-U>=2 sqrt(nx)]<=exp(-x). The finite product of Mathlib gaussianReal 0 1 constructs the actual law. The second event corrects the printed undefined X, as the source proof explicitly requires.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Intake100_P61
Formal statement
noncomputable section

open MeasureTheory Filter

open scoped BigOperators ENNReal Topology

namespace QAlgorithms.Papers.Independent.Intake100.P61

attribute [local instance] Classical.propDecidable Classical.decEq

-- The frozen frequency formula specializes exactly to the source alphabet Fin (2 ^ d).

open QAlgorithms.Papers.Independent.Advance50.P30 (empiricalFrequency)

/-- PDF p.20, Lemma 6 (E1), Laurent--Massart: chi-square tails.
The law is constructed as the sum of squares of n independent N(0,1) coordinates.
Printed second event: U-X >= 2 sqrt(n*x), with X undefined.
Changed: n-U >= 2 sqrt(n*x), exactly the lower tail used on PDF p.21.
Positive degrees of freedom are explicit: at n=0 the inclusive lower event
would have probability one. Both source tail constants are preserved. -/
theorem chiSquare_norm_tails
    (n : ℕ) (hn : 0 < n) (x : ℝ) (hx : 0 < x) :
    let law : Measure (Fin n → ℝ) :=
      Measure.pi (fun _ : Fin n => ProbabilityTheory.gaussianReal 0 1)
    law {z | (∑ i : Fin n, (z i) ^ 2) - (n : ℝ) ≥
      2 * Real.sqrt ((n : ℝ) * x) + 2 * x} ≤ ENNReal.ofReal (Real.exp (-x)) ∧
    law {z | (n : ℝ) - (∑ i : Fin n, (z i) ^ 2) ≥
      2 * Real.sqrt ((n : ℝ) * x)} ≤ ENNReal.ofReal (Real.exp (-x)) := by sorry

end QAlgorithms.Papers.Independent.Intake100.P61

end
Source
Composable security proof for continuous-variable quantum key distribution with coherent states, arXiv:1408.5689v3, PDF p. 20, Lemma 6, E1; lower-tail correction pinned by p.21
Read-back

What the Lean code literally says, in plain math · gpt-6.1-sol

For every positive natural number nnn and every positive real number xxx, let P\mathbb PP be the product measure on Rn\mathbb R^nRn whose coordinates are independent real Gaussian random variables with mean zero and variance one. Both bounds hold:

P ⁣{z:∑i=0n−1zi2−n≥2nx+2x}≤e−x,P ⁣{z:n−∑i=0n−1zi2≥2nx}≤e−x.\mathbb P\!\left\{z:\sum_{i=0}^{n-1}z_i^2-n\ge 2\sqrt{nx}+2x\right\}\le e^{-x}, \qquad \mathbb P\!\left\{z:n-\sum_{i=0}^{n-1}z_i^2\ge 2\sqrt{nx}\right\}\le e^{-x}.P{z:i=0∑n−1​zi2​−n≥2nx​+2x}≤e−x,P{z:n−i=0∑n−1​zi2​≥2nx​}≤e−x.

These are inclusive tail events; n=1n=1n=1 is included, and the lower-tail event is empty when x>n/4x>n/4x>n/4.

Human review
  • Endorsed by Shuze Chen · Oct 30, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Gohan · Oct 30, 2026

    Confirmed by the mission captain (proposal self-audit).

  • Endorsed by mikedeng1 · Nov 8, 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