Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 5.3, proof — Pr⁡(∣GM−rank(A)∣≥rank(A)ϵ)≤2exp⁡(−M rank(A)ϵ2/6)\Pr(|G_M-\mathrm{rank}(A)|\ge \mathrm{rank}(A)\epsilon)\le 2\exp(-M\,\mathrm{rank}(A)\epsilon^2/6)Pr(∣GM​−rank(A)∣≥rank(A)ϵ)≤2exp(−Mrank(A)ϵ2/6)

Proved
TraceEstimation.ProjectionRank.estimator_tail

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

concentration-inequalitygaussianp2o-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 (symmetric with A2=AA^2 = AA2=A) of rank r=rank(A)≥1r = \mathrm{rank}(A) \ge 1r=rank(A)≥1, let M≥1M \ge 1M≥1, let GMG_MGM​ be the Gaussian trace estimator of AAA with MMM samples, and let 0<ϵ≤120 < \epsilon \le \tfrac120<ϵ≤21​. Then

Pr⁡(∣GM−r∣≥rϵ)=Pr⁡(∣MGM−Mr∣≥Mrϵ)≤2exp⁡ ⁣(−Mrϵ26).\Pr\bigl(|G_M - r| \ge r\epsilon\bigr) = \Pr\bigl(|MG_M - Mr| \ge Mr\epsilon\bigr) \le 2\exp\!\left(-\frac{M r \epsilon^2}{6}\right).Pr(∣GM​−r∣≥rϵ)=Pr(∣MGM​−Mr∣≥Mrϵ)≤2exp(−6Mrϵ2​).

This is the χ2\chi^2χ2 tail bound transferred to the Gaussian estimator of a projection: the relative error of GMG_MGM​ as an estimate of rank(A)\mathrm{rank}(A)rank(A) is exponentially unlikely to exceed ϵ\epsilonϵ in the product MrMrMr.

Formalization Note The probabilities are Measure.real of events under the product Gaussian measure of Definition 3.1. The range 0<ϵ≤1/20 < \epsilon \le 1/20<ϵ≤1/2 is that of the χ2\chi^2χ2 tail bound the paper applies (see the milestone on that bound, where the page states no range and the bound fails for ϵ=1\epsilon = 1ϵ=1); the paper uses only ϵ=1/(2r)\epsilon = 1/(2r)ϵ=1/(2r). "Projection matrix" is read as orthogonal projection.

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), the display after "By applying this result to
`MG_M`": for an orthogonal projection `A` (symmetric, `A * A = A`) with `rank(A) ≥ 1`, `M ≥ 1`
and `0 < ε ≤ 1/2` (the range of the `χ²` tail bound it applies),
`Pr(|G_M - rank(A)| ≥ rank(A) ε) = Pr(|M G_M - M rank(A)| ≥ M rank(A) ε)
  ≤ 2 exp(-M rank(A) ε² / 6)`. -/
theorem estimator_tail {n : ℕ} (A : Matrix (Fin n) (Fin n) ℝ) (hA : A.IsHermitian)
    (hA2 : A * A = A) (hr : 0 < A.rank) (M : ℕ) (hM : 0 < M) (ε : ℝ) (hε : 0 < ε)
    (hε2 : ε ≤ 1 / 2) :
    (Shared.gaussianSampleMeasure n M).real
        {ω | (A.rank : ℝ) * ε ≤ |Shared.gaussianEstimator A M ω - A.rank|} =
      (Shared.gaussianSampleMeasure n M).real
        {ω | (M : ℝ) * A.rank * ε ≤ |(M : ℝ) * Shared.gaussianEstimator A M ω - (M : ℝ) * A.rank|} ∧
    (Shared.gaussianSampleMeasure n M).real
        {ω | (A.rank : ℝ) * ε ≤ |Shared.gaussianEstimator A M ω - A.rank|} ≤
      2 * Real.exp (-((M : ℝ) * A.rank * ε ^ 2 / 6)) := 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, display after "By applying this result to MG_M"
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