Theorem 6.2.1 — Hanson-Wright inequality
ProvedHighDimProb.QuadraticForms.hanson_wrightThis is the Hanson-Wright inequality, the capstone result of Chapter 6 of Vershynin's High-Dimensional Probability: a concentration inequality for a quadratic form ("chaos") in independent sub-gaussian random variables, playing the role for chaoses that Bernstein's inequality (Chapter 2) plays for linear sums.
Let be a random vector with independent, mean zero, sub-gaussian coordinates, and let be the largest of their sub-gaussian (Orlicz ) norms. Let be an matrix — with no constraint on its diagonal. Then, for every ,
where is the Frobenius norm and the operator norm of , and is an absolute constant, not depending on , , , or .
The bound has the familiar two-regime shape of Bernstein's inequality: sub-gaussian (quadratic exponent) for small , and sub-exponential (linear exponent) for large , reflecting that a quadratic form in sub-gaussian variables behaves like a sub-exponential, not sub-gaussian, random variable. Unlike the Decoupling theorem's diagonal-free hypothesis, here is a general matrix: its diagonal contributes to (more precisely in general) and is handled by Bernstein's inequality directly in the proof, while the off-diagonal part is handled by decoupling; keeping general is what makes this the actual content of the chapter, rather than a restatement of Bernstein's inequality for the special case of diagonal .
Formalization Note is written directly as (⨆ i, HighDimProb.Concentration.subgaussianNorm P (X i), reusing this
series' published sub-gaussian norm), and is existentially quantified before ,
, , , and , so it cannot depend on any of them, matching the book's
"absolute constant". Each coordinate's sub-gaussianity is stated as membership in the
admissible set of the sub-gaussian norm's own definition (some finite with the
exponential moment integrable and at most ), the same idiom used for the
sub-exponential hypothesis in this series' Bernstein's inequality. The quadratic form
itself is required Integrable, so that is a
genuine expectation and not Mathlib's junk value for a non-integrable integrand — a
fact that in principle follows from sub-gaussianity of the but is not itself proved
by this draft (:= by sorry). and are this mission's own
frobeniusNorm and opNorm. No hypothesis is imposed on 's diagonal: the general
matrix case is the chapter's actual content, and restricting to diagonal-free would
collapse the statement to a restatement of Bernstein's inequality.
import Mathlib import Definitions.Def_HighDimProb_Concentration_SubgaussianNorm import Definitions.Def_HighDimProb_QuadraticForms_FrobeniusNorm import Definitions.Def_HighDimProb_QuadraticForms_OperatorNorm open MeasureTheory ProbabilityTheory
namespace HighDimProb.QuadraticForms
/-- **Theorem 6.2.1** (Hanson-Wright inequality), Vershynin, *High-Dimensional Probability*
(2018), p. 139.
Let `X = (X₁, …, Xₙ) ∈ ℝⁿ` be a random vector with independent, mean zero, sub-gaussian
coordinates. Let `A` be an `n × n` matrix. Then, for every `t ≥ 0`,
`P{|XᵀAX − E XᵀAX| ≥ t} ≤ 2 exp[−c min(t²/(K⁴‖A‖_F²), t/(K²‖A‖))]`,
where `K = maxᵢ ‖Xᵢ‖_{ψ₂}` and `c > 0` is an absolute constant (not depending on `n`, `X`, `A`,
or `t`). -/
theorem hanson_wright :
∃ c : ℝ, 0 < c ∧
∀ {n : ℕ} {Ω : Type} [MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P]
(X : Fin n → Ω → ℝ),
(∀ i, Measurable (X i)) →
iIndepFun X P →
(∀ i, Integrable (X i) P) →
(∀ i, ∫ ω, X i ω ∂P = 0) →
(∀ i, ∃ s > 0, Integrable (fun ω => Real.exp ((X i ω) ^ 2 / s ^ 2)) P ∧
∫ ω, Real.exp ((X i ω) ^ 2 / s ^ 2) ∂P ≤ 2) →
∀ (A : Matrix (Fin n) (Fin n) ℝ),
Integrable (fun ω => ∑ i, ∑ j, A i j * X i ω * X j ω) P →
∀ {t : ℝ}, 0 ≤ t →
P.real {ω | t ≤ |∑ i, ∑ j, A i j * X i ω * X j ω -
∫ ω, ∑ i, ∑ j, A i j * X i ω * X j ω ∂P|} ≤
2 * Real.exp (-(c * min
(t ^ 2 / ((⨆ i, HighDimProb.Concentration.subgaussianNorm P (X i)) ^ 4 *
frobeniusNorm A ^ 2))
(t / ((⨆ i, HighDimProb.Concentration.subgaussianNorm P (X i)) ^ 2 *
opNorm A)))) := by sorry
end HighDimProb.QuadraticForms
Read-back
What the Lean code literally says, in plain math · claude-opus-5
There exists a real number with such that the following holds for every natural number , every type equipped with a measurable-space structure, every measure on that is a probability measure, and every family of real-valued functions indexed by , provided all of the following hypotheses hold:
- each is measurable;
- the family is mutually independent under (independence of the whole family, not merely pairwise);
- each is integrable with respect to ;
- each has vanishing integral: ;
- each satisfies the following sub-gaussian-style condition: there exists such that is -integrable and . Note that the witness is existentially quantified per coordinate and is not the quantity appearing later in the conclusion;
then for every real matrix such that the quadratic form
is -integrable, and for every real with ,
where the probability on the left is the real-valued measure of that set, and where the three quantities , , are as follows.
denotes the supremum over of a quantity written subgaussianNorm P (X i) — a definition imported from this bundle rather than a Mathlib standard, so its precise content is not visible in this statement; the read-back can only record that it is some real-valued function of the measure and the coordinate function , and that is the indexed supremum of those values over in the index type. Likewise frobeniusNorm A and opNorm A are definitions imported from this bundle, written here as and ; nothing in this statement constrains what they compute, and no hypothesis asserts that either is nonzero, nor that is finite, positive, or attained.
Note the exact structure of the quantifiers: the constant is chosen once, outermost, before , , , , and , so it is uniform in all of them — this is the formal content of "absolute constant". The index type of the coordinates is (a finite type of cardinality ), and both sums in range over that full index type. The inequality in the conclusion is non-strict (), the event is defined by the non-strict inequality (so the boundary case is included in the event), and the hypothesis on is , admitting . The ambient type is quantified over Type (the lowest universe), not over an arbitrary universe. No hypothesis requires to be symmetric, to have zero diagonal, or to be nonzero; no hypothesis bounds ; no hypothesis asserts that or are integrable beyond the single integrability assumption on the full quadratic form .
In the degenerate cases the hypotheses permit, the statement reads as follows. When the index type is empty: the independence, measurability, centering and exponential-moment hypotheses are vacuously satisfied, is the unique matrix, is identically (an empty sum) and integrable, and is the supremum of the empty family, which in Lean's complete-lattice-style indexed supremum over is the default value rather than ; consequently both and are , and both arguments of the minimum are divisions by zero, which in Lean evaluate to ; the minimum is then , the right-hand side is , and the left-hand side is a probability, so the claim holds but carries no information. The same collapse to right-hand side occurs whenever or (for instance ) or whenever : each quotient becomes or by Lean's total division, so the bound degenerates to the trivial bound . When the event is all of and the left-hand side is , while the right-hand side is if the denominators are nonzero, so the claim again holds trivially. If is the supremum of an unbounded family of sub-gaussian norms, the indexed supremum over is not but the junk default , again collapsing the bound to — though for the family is finite and hence bounded, so this arises only through the case or through subgaussianNorm itself returning unexpected values. The hypothesis package is nonvacuous — the all-zero coordinate functions on any probability space satisfy every hypothesis, with — so the theorem is not vacuously true by unsatisfiable premises; but nothing in the statement forces to be an upper bound on the actual sub-gaussian behaviour of the , since subgaussianNorm is opaque here, and nothing links the existentially quantified witnesses in the fifth hypothesis to .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.