Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Theorem 6.1 (corrected) — RMR_MRM​ is an (ϵ,δ)(\epsilon,\delta)(ϵ,δ)-approximator for M≥12ϵ−2n2rank−2(A)ln⁡(2/δ)κf2(A)M \ge \frac12\epsilon^{-2}n^2\mathrm{rank}^{-2}(A)\ln(2/\delta)\kappa_f^2(A)M≥21​ϵ−2n2rank−2(A)ln(2/δ)κf2​(A)

Proved
TraceEstimation.Rayleigh.rayleigh_estimator_approximator

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

hoeffding-inequalityp2o-batch-p200ap2o-gran-per-chapterp2o-plan-paperp2o-v1randomized-numerical-linear-algebratrace-estimation

Let A∈Rn×nA \in \mathbb{R}^{n\times n}A∈Rn×n be a nonzero symmetric positive semi-definite matrix, and let κf(A)\kappa_f(A)κf​(A) be the ratio between its largest and smallest nonzero eigenvalue. Let ϵ>0\epsilon > 0ϵ>0 and 0<δ<10 < \delta < 10<δ<1. Let RM=1M∑i=1MziTAziR_M = \frac1M\sum_{i=1}^M z_i^TAz_iRM​=M1​∑i=1M​ziT​Azi​ be a normalized Rayleigh-quotient trace estimator of AAA: z1,…,zMz_1, \ldots, z_Mz1​,…,zM​ are independent random vectors with ziTzi=nz_i^Tz_i = nziT​zi​=n and E(ziTAzi)=trace(A)\mathrm{E}(z_i^TAz_i) = \mathrm{trace}(A)E(ziT​Azi​)=trace(A). If

M  ≥  ln⁡(2/δ)⋅n2 κf2(A)2 rank2(A) ϵ2,M \;\ge\; \frac{\ln(2/\delta)\cdot n^2\,\kappa_f^2(A)}{2\,\mathrm{rank}^2(A)\,\epsilon^2},M≥2rank2(A)ϵ2ln(2/δ)⋅n2κf2​(A)​,

then RMR_MRM​ is an (ϵ,δ)(\epsilon,\delta)(ϵ,δ)-approximator of trace(A)\mathrm{trace}(A)trace(A), that is,

Pr⁡(∣RM−trace(A)∣≤ϵ trace(A))≥1−δ.\Pr\bigl(|R_M - \mathrm{trace}(A)| \le \epsilon\,\mathrm{trace}(A)\bigr) \ge 1-\delta .Pr(∣RM​−trace(A)∣≤ϵtrace(A))≥1−δ.

The bound holds for every estimator in the class at once — Hutchinson's, the unit vector estimator, and any other normalized one — and needs no assumption on the distribution of the ziz_izi​ beyond normalization and unbiasedness. Its price is the factor κf2(A)\kappa_f^2(A)κf2​(A), so it is informative for well-conditioned matrices.

Formalization Note The paper prints the threshold as M≥12ϵ−2n−2rank2(A)ln⁡(2/δ)κf2(A)M \ge \frac12\epsilon^{-2}n^{-2}\mathrm{rank}^2(A)\ln(2/\delta)\kappa_f^2(A)M≥21​ϵ−2n−2rank2(A)ln(2/δ)κf2​(A) (Theorem 6.1 and Table I); its proof on p. 8:10 ends with M≥ln⁡(2/δ) n2κf2(A)/(2 rank2(A)ϵ2)M \ge \ln(2/\delta)\,n^2\kappa_f^2(A)/(2\,\mathrm{rank}^2(A)\epsilon^2)M≥ln(2/δ)n2κf2​(A)/(2rank2(A)ϵ2), with the exponents of nnn and rank(A)\mathrm{rank}(A)rank(A) swapped. The printed version is false: for n=2n = 2n=2, A=e1e1TA = e_1e_1^TA=e1​e1T​, z=2 ekz = \sqrt2\,e_kz=2​ek​ with kkk uniform on {1,2}\{1,2\}{1,2}, and ϵ=δ=1/2\epsilon = \delta = 1/2ϵ=δ=1/2, it admits M=1M = 1M=1, while R1∈{0,2}R_1 \in \{0, 2\}R1​∈{0,2} is never within 1/21/21/2 of trace(A)=1\mathrm{trace}(A) = 1trace(A)=1. The statement here is the one the proof establishes. The probabilistic model is a general probability space (Ω,P)(\Omega,P)(Ω,P) with IsNormalizedRayleighSample P A z (measurable, mutually independent, ziTzi=nz_i^Tz_i = nziT​zi​=n almost surely, unbiased for this AAA); the hypotheses are satisfiable (Rademacher vectors, or n ek\sqrt n\,e_kn​ek​ with kkk uniform). The assumptions A≠0A \ne 0A=0 and M≥1M \ge 1M≥1 are implicit on the page (κf\kappa_fκf​ and 1/M1/M1/M must make sense).

Preamble
import Mathlib
import Definitions.Def_TraceEstimation_Shared_IsApproximator
import Definitions.Def_TraceEstimation_Rayleigh_kappaF
import Definitions.Def_TraceEstimation_Rayleigh_rayleighEstimator
Formal statement
namespace TraceEstimation.Rayleigh

open MeasureTheory ProbabilityTheory Matrix

/-- Avron–Toledo, **Theorem 6.1** (p. 8:10), in the form its proof establishes. Let `A ≠ 0` be a
symmetric positive semi-definite `n × n` matrix, `κ_f(A)` the ratio between its largest and
smallest nonzero eigenvalue, `0 < ε`, `0 < δ < 1`, and `R_M` a normalized Rayleigh-quotient trace
estimator of `A` with `M ≥ 1` samples (Definition 3.2). If
`M ≥ ln(2/δ) · n² κ_f²(A) / (2 rank²(A) ε²)`
(the last display of the proof, p. 8:10), then `R_M` is an `(ε, δ)`-approximator of `trace(A)`.

The paper prints the threshold as `½ ε⁻² n⁻² rank²(A) ln(2/δ) κ_f²(A)`, with the exponents of `n`
and `rank(A)` swapped relative to its proof; the printed version is false (`n = 2`,
`A = e₁e₁ᵀ`, `z = √2 e_k` with `k` uniform, `ε = δ = 1/2`, `M = 1`). -/
theorem rayleigh_estimator_approximator {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω)
    [IsProbabilityMeasure P] {n M : ℕ} (A : Matrix (Fin n) (Fin n) ℝ) (hA : A.PosSemidef)
    (hA0 : A ≠ 0) (hM : 0 < M) (z : Fin M → Ω → Fin n → ℝ)
    (hz : IsNormalizedRayleighSample P A z) (ε δ : ℝ) (hε : 0 < ε) (hδ : 0 < δ) (hδ1 : δ < 1)
    (hMbound : Real.log (2 / δ) * (n : ℝ) ^ 2 * kappaF hA.isHermitian ^ 2 /
        (2 * (A.rank : ℝ) ^ 2 * ε ^ 2) ≤ (M : ℝ)) :
    Shared.IsApproximator P (rayleighEstimator A z) A ε δ := by sorry

end TraceEstimation.Rayleigh
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:10, Theorem 6.1 (threshold as in the last display of its proof)
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 paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me