Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 5.3, proof — MGMMG_MMGM​ is χ2\chi^2χ2 with M rank(A)M\,\mathrm{rank}(A)Mrank(A) degrees of freedom

Proved
TraceEstimation.ProjectionRank.scaled_estimator_law

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

chi-squaredgaussianp2o-batch-p200ap2o-gran-per-chapterp2o-plan-paperp2o-v1projection-matrixtrace-estimation

Let A∈Rn×nA \in \mathbb{R}^{n\times n}A∈Rn×n be an orthogonal projection matrix, that is, AAA is symmetric and A2=AA^2 = AA2=A (equivalently, AAA is symmetric with all eigenvalues in {0,1}\{0,1\}{0,1}). Let M≥1M \ge 1M≥1 and let GMG_MGM​ be the Gaussian trace estimator of AAA with MMM samples. Then MGMM G_MMGM​ has the χ2\chi^2χ2 distribution with M rank(A)M\,\mathrm{rank}(A)Mrank(A) degrees of freedom: if g1,…,gM rank(A)g_1, \ldots, g_{M\,\mathrm{rank}(A)}g1​,…,gMrank(A)​ are independent standard normal random variables, then

M GM  =d  ∑l=1M rank(A)gl2.M\,G_M \;\overset{d}{=}\; \sum_{l=1}^{M\,\mathrm{rank}(A)} g_l^2 .MGM​=dl=1∑Mrank(A)​gl2​.

This identifies the exact law of the scaled estimator, reducing every probability bound about GMG_MGM​ for a projection to a tail bound for a χ2\chi^2χ2 variable.

Formalization Note No χ2\chi^2χ2 distribution is defined. The statement is an equality of pushforward measures (Measure.map): the law of ω↦M GM(ω)\omega \mapsto M\,G_M(\omega)ω↦MGM​(ω) under the product Gaussian measure of Definition 3.1 equals the law of g↦∑lgl2g \mapsto \sum_l g_l^2g↦∑l​gl2​ under the product of M rank(A)M\,\mathrm{rank}(A)Mrank(A) standard normals. Both maps are continuous, hence measurable, so neither side is the zero measure that Measure.map returns for non-measurable maps. "Projection matrix" is read as orthogonal projection (A.IsHermitian and A * A = A); an oblique idempotent also has eigenvalues 000 and 111, but the paper's diagonalization A=UTdiag(1,…,1,0,…,0)UA = U^T\mathrm{diag}(1,\ldots,1,0,\ldots,0)UA=UTdiag(1,…,1,0,…,0)U with UUU unitary requires symmetry.

Preamble
import Mathlib
import Definitions.Def_TraceEstimation_Shared_gaussianEstimator
Formal statement
namespace TraceEstimation.ProjectionRank

open MeasureTheory ProbabilityTheory Matrix

/-- Avron–Toledo, Lemma 5.3, proof (p. 8:9), first paragraph: for an orthogonal projection `A`
(symmetric, `A * A = A`) and `M ≥ 1` samples, `M · G_M` is `χ²` with `M · rank(A)` degrees of
freedom. Stated without a `χ²` definition: the law of `ω ↦ M · G_M(ω)` under the product
Gaussian measure equals the law of `g ↦ ∑_{l=1}^{M·rank(A)} g_l²` for i.i.d. standard normal
`g_1, …, g_{M·rank(A)}`. Both maps are continuous, hence measurable, so neither pushforward is
the junk zero measure. -/
theorem scaled_estimator_law {n : ℕ} (A : Matrix (Fin n) (Fin n) ℝ) (hA : A.IsHermitian)
    (hA2 : A * A = A) (M : ℕ) (hM : 0 < M) :
    (Shared.gaussianSampleMeasure n M).map (fun ω => (M : ℝ) * Shared.gaussianEstimator A M ω) =
      (Measure.pi fun _ : Fin (M * A.rank) => gaussianReal 0 1).map
        (fun g => ∑ l, g l ^ 2) := by sorry

end TraceEstimation.ProjectionRank
Source
Avron and Toledo, Randomized algorithms for estimating the trace of an implicit symmetric positive semi-definite matrix, J. ACM 58(2), Article 8 (2011), p. 8:9, proof of Lemma 5.3, first paragraph
Human review
  • Endorsed by Shuze Chen · Oct 1, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 1, 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