Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 5.1 — G1G_1G1​ is unbiased with variance 2∥A∥F22\|A\|_F^22∥A∥F2​

Proved
TraceEstimation.Gaussian.single_sample_mean_variance

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

gaussianp2o-batch-p200ap2o-gran-per-chapterp2o-plan-paperp2o-v1trace-estimationvariance

Let AAA be an n×nn \times nn×n real symmetric matrix and let z∈Rnz \in \mathbb{R}^nz∈Rn have independent standard normal entries. The single-sample Gaussian estimator G1=zTAzG_1 = z^T A zG1​=zTAz has a finite second moment, is an unbiased estimator of the trace, and its variance is twice the squared Frobenius norm of AAA:

E(G1)=trace(A),Var(G1)=2∥A∥F2=2∑i=1n∑j=1nAij2.\mathrm{E}(G_1) = \mathrm{trace}(A), \qquad \mathrm{Var}(G_1) = 2\|A\|_F^2 = 2\sum_{i=1}^n\sum_{j=1}^n A_{ij}^2 .E(G1​)=trace(A),Var(G1​)=2∥A∥F2​=2i=1∑n​j=1∑n​Aij2​.

The variance of one sample is the first quality measure the paper compares across estimators (Table I); for MMM samples it is divided by MMM.

Formalization Note G1G_1G1​ is the estimator of Definition 3.1 with M=1M = 1M=1 on its product Gaussian space. Square integrability is part of the conclusion, so the Bochner integral and Mathlib's variance (both of which return 000 on non-integrable input) carry their genuine values. The paper adds after the proof that "the lemma also applies when AAA is non-symmetric"; that remark is not part of the lemma and is false for the variance (for A=(0100)A = \begin{pmatrix}0&1\\0&0\end{pmatrix}A=(00​10​), Var(zTAz)=1≠2∥A∥F2\mathrm{Var}(z^TAz) = 1 \ne 2\|A\|_F^2Var(zTAz)=1=2∥A∥F2​), so the statement keeps the symmetry hypothesis.

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

open MeasureTheory ProbabilityTheory Matrix

/-- Lemma 5.1 (Avron–Toledo, p. 8:7). For a symmetric `A`, the single-sample Gaussian
estimator `G_1 = zᵀ A z` is square integrable and unbiased, `E(G_1) = trace(A)`, and has
variance `Var(G_1) = 2‖A‖_F² = 2 ∑_{i,j} A_{ij}²`. The paper's remark that the lemma "also
applies when A is non-symmetric" is not part of the lemma and is false for the variance. -/
theorem single_sample_mean_variance {n : ℕ} (A : Matrix (Fin n) (Fin n) ℝ)
    (hA : A.IsHermitian) :
    MemLp (Shared.gaussianEstimator A 1) 2 (Shared.gaussianSampleMeasure n 1) ∧
    ∫ ω, Shared.gaussianEstimator A 1 ω ∂(Shared.gaussianSampleMeasure n 1) = A.trace ∧
    variance (Shared.gaussianEstimator A 1) (Shared.gaussianSampleMeasure n 1) =
      2 * ∑ i : Fin n, ∑ j : Fin n, A i j ^ 2 := by sorry

end TraceEstimation.Gaussian
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:7, Lemma 5.1
Human review
  • Endorsed by Shuze Chen · Sep 27, 2026

    Confirmed by the moderator at approval.

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