Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 5.25 -- the Gaussian comparison principle

Proved
HighDimStat.MetricEntropy.gaussian_comparison

by mikedeng1 · Sep 19, 2026 · Mathlib 0df444a (Lean v4.33.1)

high-dimensional-statisticsprobabilitystatistics

Theorem 5.25 (Gaussian comparison). Let (X1,…,XN)(X_1,\dots,X_N)(X1​,…,XN​) and (Y1,…,YN)(Y_1,\dots,Y_N)(Y1​,…,YN​) be a pair of centered Gaussian random vectors, and suppose there exist disjoint subsets AAA and BBB of [N]×[N][N]\times[N][N]×[N] such that E[XiXj]≤E[YiYj]\mathbb E[X_iX_j]\le\mathbb E[Y_iY_j]E[Xi​Xj​]≤E[Yi​Yj​] for all (i,j)∈A(i,j)\in A(i,j)∈A, E[XiXj]≥E[YiYj]\mathbb E[X_iX_j]\ge\mathbb E[Y_iY_j]E[Xi​Xj​]≥E[Yi​Yj​] for all (i,j)∈B(i,j)\in B(i,j)∈B, and E[XiXj]=E[YiYj]\mathbb E[X_iX_j]=\mathbb E[Y_iY_j]E[Xi​Xj​]=E[Yi​Yj​] for all (i,j)∉A∪B(i,j)\notin A\cup B(i,j)∈/A∪B. Let F:RN→RF:\mathbb R^N\to \mathbb RF:RN→R be twice differentiable, with ∂2F/∂ui∂uj(u)≥0\partial^2F/\partial u_i\partial u_j(u)\ge 0∂2F/∂ui​∂uj​(u)≥0 for (i,j)∈A(i,j)\in A(i,j)∈A and ≤0\le 0≤0 for (i,j)∈B(i,j)\in B(i,j)∈B. Then

E[F(X)]  ≤  E[F(Y)].\mathbb E[F(X)] \;\le\; \mathbb E[F(Y)].E[F(X)]≤E[F(Y)].

This is the chapter's central Gaussian comparison principle (Section 5.4), the source of both Slepian's inequality and the Sudakov–Fernique comparison as corollaries, obtained by specializing AAA, BBB, and FFF.

Formalization Note "Centered Gaussian random vector" is realized as a random vector X : Ω → Fin N → ℝ with HasGaussianLaw X Prob (Mathlib's predicate that the pushforward law is a genuine multivariate Gaussian measure) together with the explicit coordinatewise mean-zero condition; the covariances E[XiXj]\mathbb E[X_iX_j]E[Xi​Xj​] are the literal Bochner integrals ∫XiXj dProb\int X_iX_j\,d\mathrm{Prob}∫Xi​Xj​dProb, guarded by explicit integrability hypotheses (trap 2). The mixed second partial derivative ∂2F/∂ui∂uj(u)\partial^2F/\partial u_i\partial u_j(u)∂2F/∂ui​∂uj​(u) is realized as the iterated Fréchet derivative iteratedFDeriv ℝ 2 F u applied to the two standard basis vectors Pi.single i 1, Pi.single j 1 — the sign-pattern hypothesis on mixed partials is kept exactly as stated (some pairs ≥0\ge 0≥0, others ≤0\le 0≤0, over the disjoint sets AAA, BBB), not simplified to a global convexity condition on FFF.

Preamble
import Mathlib

open MeasureTheory ProbabilityTheory
Formal statement
namespace HighDimStat.MetricEntropy

/-- **Theorem 5.25** (Gaussian comparison principle), Wainwright, *High-Dimensional Statistics*
(2019), p. 144. Let `X, Y : Ω → Fin N → ℝ` be a pair of centered Gaussian random vectors (each
with law `HasGaussianLaw` and coordinatewise mean zero), and suppose there exist disjoint subsets
`A` and `B` of `Fin N × Fin N` such that `E[XᵢXⱼ] ≤ E[YᵢYⱼ]` for `(i,j) ∈ A`, `E[XᵢXⱼ] ≥ E[YᵢYⱼ]`
for `(i,j) ∈ B`, and `E[XᵢXⱼ] = E[YᵢYⱼ]` for `(i,j) ∉ A ∪ B`. Let `F : (Fin N → ℝ) → ℝ` be twice differentiable (not necessarily with a
*continuous* second derivative: `F` itself differentiable everywhere, and its derivative map
`fderiv ℝ F` itself differentiable everywhere), with mixed second partial
`∂²F/∂uᵢ∂uⱼ(u) ≥ 0` for `(i,j) ∈ A` and `≤ 0` for `(i,j) ∈ B` (realized as the iterated Fréchet
derivative applied to the two standard basis vectors). Then `E[F(X)] ≤ E[F(Y)]`. -/
theorem gaussian_comparison {Ω : Type*} [MeasurableSpace Ω] {Prob : Measure Ω}
    [IsProbabilityMeasure Prob] {N : ℕ} (X Y : Ω → Fin N → ℝ)
    (hXGauss : HasGaussianLaw X Prob) (hYGauss : HasGaussianLaw Y Prob)
    (hXmean : ∀ i, ∫ ω, X ω i ∂Prob = 0) (hYmean : ∀ i, ∫ ω, Y ω i ∂Prob = 0)
    (hXint : ∀ i j, Integrable (fun ω => X ω i * X ω j) Prob)
    (hYint : ∀ i j, Integrable (fun ω => Y ω i * Y ω j) Prob)
    (A B : Finset (Fin N × Fin N)) (hAB : Disjoint A B)
    (hCovA : ∀ p ∈ A, ∫ ω, X ω p.1 * X ω p.2 ∂Prob ≤ ∫ ω, Y ω p.1 * Y ω p.2 ∂Prob)
    (hCovB : ∀ p ∈ B, ∫ ω, Y ω p.1 * Y ω p.2 ∂Prob ≤ ∫ ω, X ω p.1 * X ω p.2 ∂Prob)
    (hCovEq : ∀ p : Fin N × Fin N, p ∉ A ∪ B →
      ∫ ω, X ω p.1 * X ω p.2 ∂Prob = ∫ ω, Y ω p.1 * Y ω p.2 ∂Prob)
    (F : (Fin N → ℝ) → ℝ) (hF1 : Differentiable ℝ F) (hF2 : Differentiable ℝ (fderiv ℝ F))
    (hFA : ∀ p ∈ A, ∀ u, 0 ≤ iteratedFDeriv ℝ 2 F u ![Pi.single p.1 (1 : ℝ), Pi.single p.2 1])
    (hFB : ∀ p ∈ B, ∀ u, iteratedFDeriv ℝ 2 F u ![Pi.single p.1 (1 : ℝ), Pi.single p.2 1] ≤ 0)
    (hFXint : Integrable (fun ω => F (X ω)) Prob) (hFYint : Integrable (fun ω => F (Y ω)) Prob) :
    ∫ ω, F (X ω) ∂Prob ≤ ∫ ω, F (Y ω) ∂Prob := by sorry

end HighDimStat.MetricEntropy
Source
Wainwright, High-Dimensional Statistics, CUP 2019, p. 144 (PDF p. 164), Theorem 5.25, Eqs. (5.52)-(5.54)
Human review
  • Endorsed by Shuze Chen · Sep 28, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Sep 28, 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