Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Section 5, Eq. (1) — moment generating function of Z=MGMZ = M G_MZ=MGM​

Proved
TraceEstimation.Gaussian.mgf_formula

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

gaussianmoment-generating-functionp2o-batch-p200ap2o-gran-per-chapterp2o-plan-paperp2o-v1trace-estimation

Let AAA be an n×nn \times nn×n real symmetric matrix with eigenvalues λ1,…,λn\lambda_1, \ldots, \lambda_nλ1​,…,λn​ (listed with multiplicity), let τ=trace(A)\tau = \mathrm{trace}(A)τ=trace(A), let M≥1M \ge 1M≥1, and let GMG_MGM​ be the Gaussian trace estimator with MMM samples. Put Z=MGMZ = M G_MZ=MGM​. For every real ttt with 2λit<12\lambda_i t < 12λi​t<1 for all iii, the moment generating function of ZZZ is

mZ(t)=E(exp⁡(tZ))=∏i=1n(1−2λit)−M/2=(1−2τt+h(t))−M/2,m_Z(t) = \mathrm{E}(\exp(tZ)) = \prod_{i=1}^{n}(1 - 2\lambda_i t)^{-M/2} = (1 - 2\tau t + h(t))^{-M/2},mZ​(t)=E(exp(tZ))=i=1∏n​(1−2λi​t)−M/2=(1−2τt+h(t))−M/2,

where h(t)=∑s=2n(−2)sts∑S⊆[n], ∣S∣=s∏i∈Sλih(t) = \sum_{s=2}^{n}(-2)^s t^s \sum_{S \subseteq [n],\,|S| = s} \prod_{i\in S} \lambda_ih(t)=∑s=2n​(−2)sts∑S⊆[n],∣S∣=s​∏i∈S​λi​.

This is the moment generating function on which the Chernoff argument for Theorem 5.2 rests.

Formalization Note The paper states the formula "as long as ∣λit∣≤12|\lambda_i t| \le \frac12∣λi​t∣≤21​ for all iii". At λit=12\lambda_i t = \frac12λi​t=21​ the base 1−2λit1 - 2\lambda_i t1−2λi​t is 000 and the expectation is infinite, while Lean's real power 0 ^ (-M/2) is 000; the statement therefore uses the open range 2λit<12\lambda_i t < 12λi​t<1, which is where the formula holds (it also covers negative ttt and negative eigenvalues). The moment generating function is Mathlib's mgf, and the eigenvalues are Matrix.IsHermitian.eigenvalues.

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

open MeasureTheory ProbabilityTheory Matrix

/-- Section 5, Eq. (1) (Avron–Toledo, pp. 8:7–8:8). Let `A` be symmetric with eigenvalues
`λ_1, …, λ_n` (with multiplicity) and `τ = trace(A)`. If `2 λ_i t < 1` for every `i`, the
moment generating function of `Z = M · G_M` at `t` is
`∏_i (1 - 2 λ_i t)^{-M/2} = (1 - 2 τ t + h(t))^{-M/2}`.
The page's range `|λ_i t| ≤ 1/2` includes `1 - 2 λ_i t = 0`, where the mgf is infinite; the
strict inequality is the range where the formula holds. -/
theorem mgf_formula {n : ℕ} (A : Matrix (Fin n) (Fin n) ℝ) (hA : A.IsHermitian)
    (M : ℕ) (hM : 0 < M) (t : ℝ) (ht : ∀ i, 2 * hA.eigenvalues i * t < 1) :
    mgf (fun ω => (M : ℝ) * Shared.gaussianEstimator A M ω) (Shared.gaussianSampleMeasure n M) t =
      ∏ i : Fin n, (1 - 2 * hA.eigenvalues i * t) ^ (-(M : ℝ) / 2) ∧
    mgf (fun ω => (M : ℝ) * Shared.gaussianEstimator A M ω) (Shared.gaussianSampleMeasure n M) t =
      (1 - 2 * A.trace * t + hPoly hA.eigenvalues t) ^ (-(M : ℝ) / 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), pp. 8:7-8:8, Section 5, Eq. (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