Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 7.1 — HMH_MHM​ is an (ϵ,δ)(\epsilon,\delta)(ϵ,δ)-approximator for M≥6ϵ−2ln⁡(2 rank(A)/δ)M \ge 6\epsilon^{-2}\ln(2\,\mathrm{rank}(A)/\delta)M≥6ϵ−2ln(2rank(A)/δ), 0<ϵ≤1/20<\epsilon\le 1/20<ϵ≤1/2

Proved
TraceEstimation.Hutchinson.hutchinson_estimator_approximator

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

p2o-batch-p200ap2o-gran-per-chapterp2o-plan-paperp2o-v1rademacherrandomized-numerical-linear-algebratrace-estimation

Let A∈Rn×nA \in \mathbb{R}^{n\times n}A∈Rn×n be symmetric positive semi-definite, let 0<ϵ≤1/20 < \epsilon \le 1/20<ϵ≤1/2 and 0<δ<10 < \delta < 10<δ<1, and let HM=1M∑i=1MziTAziH_M = \frac1M\sum_{i=1}^M z_i^TAz_iHM​=M1​∑i=1M​ziT​Azi​ be Hutchinson's trace estimator with M≥1M \ge 1M≥1 samples, the ziz_izi​ independent random vectors with independent Rademacher entries. If

M≥6ϵ−2ln⁡ ⁣(2 rank(A)δ),M \ge 6\epsilon^{-2}\ln\!\left(\frac{2\,\mathrm{rank}(A)}{\delta}\right),M≥6ϵ−2ln(δ2rank(A)​),

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

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

This is the first sample-complexity bound for Hutchinson's method, the most widely used randomized trace estimator. It exceeds the Gaussian estimator's bound by a ln⁡(rank(A))\ln(\mathrm{rank}(A))ln(rank(A)) factor, which the authors conjecture is not needed.

Formalization Note The paper prints the theorem with no range on ϵ\epsilonϵ. Its proof (p. 8:11) passes from Lemma 7.2 to the bound δ/rank(A)\delta/\mathrm{rank}(A)δ/rank(A) using M2(ϵ22−ϵ33)≥Mϵ26\frac{M}{2}(\frac{\epsilon^2}{2} - \frac{\epsilon^3}{3}) \ge \frac{M\epsilon^2}{6}2M​(2ϵ2​−3ϵ3​)≥6Mϵ2​, which requires ϵ≤1/2\epsilon \le 1/2ϵ≤1/2, and without a range the printed statement is false: for A=1n11TA = \frac1n\mathbf 1\mathbf 1^TA=n1​11T (rank 111, trace 111), n=104n = 10^4n=104, ϵ=10\epsilon = 10ϵ=10, δ=10−4\delta = 10^{-4}δ=10−4, the condition admits M=1M = 1M=1, while Pr⁡(H1>11)≈9⋅10−4>δ\Pr(H_1 > 11) \approx 9\cdot 10^{-4} > \deltaPr(H1​>11)≈9⋅10−4>δ. The theorem is therefore stated for 0<ϵ≤1/20 < \epsilon \le 1/20<ϵ≤1/2. rank(A)\mathrm{rank}(A)rank(A) is Matrix.rank. For A=0A = 0A=0, Lean's convention ln⁡0=0\ln 0 = 0ln0=0 makes the condition M≥0M \ge 0M≥0, in agreement with the paper's ln⁡0=−∞\ln 0 = -\inftyln0=−∞; the conclusion then holds because HM=trace(A)=0H_M = \mathrm{trace}(A) = 0HM​=trace(A)=0. The sample space is hutchinsonSampleMeasure n M and the approximator predicate is Definition 4.1.

Preamble
import Mathlib
import Definitions.Def_TraceEstimation_Hutchinson_hutchinsonEstimator
import Definitions.Def_TraceEstimation_Shared_IsApproximator
Formal statement
namespace TraceEstimation.Hutchinson

open MeasureTheory ProbabilityTheory Matrix

/-- Theorem 7.1 (Avron–Toledo, p. 8:10; proof p. 8:11), in the corrected form its proof
establishes. Let `A` be an `n × n` symmetric positive semi-definite matrix, `0 < ε ≤ 1/2`,
`0 < δ < 1`. For every natural `M ≥ 1` with `M ≥ 6 ε⁻² ln(2 rank(A)/δ)`, Hutchinson's
estimator `H_M` is an `(ε, δ)`-approximator of `trace(A)`.
The paper prints no range for `ε`; its proof (p. 8:11) needs `ε ≤ 1/2`, and without a range
the statement is false (`A = (1/n) 𝟙𝟙ᵀ`, `n = 10⁴`, `ε = 10`, `δ = 10⁻⁴` allows `M = 1`,
while `Pr(H_1 > 11) ≈ 9·10⁻⁴ > δ`).
For `A = 0` (rank `0`) Lean's `Real.log 0 = 0` makes the sample condition `M ≥ 0`, matching
the paper's `ln 0 = -∞`; the conclusion then holds because `H_M = trace(A) = 0`. -/
theorem hutchinson_estimator_approximator {n : ℕ} (A : Matrix (Fin n) (Fin n) ℝ)
    (hA : A.PosSemidef) (ε δ : ℝ) (hε : 0 < ε) (hε' : ε ≤ 1 / 2) (hδ : 0 < δ) (hδ' : δ < 1)
    (M : ℕ) (hM : 0 < M) (hMbound : 6 * ε⁻¹ ^ 2 * Real.log (2 * (A.rank : ℝ) / δ) ≤ (M : ℝ)) :
    Shared.IsApproximator (hutchinsonSampleMeasure n M) (hutchinsonEstimator A M) A ε δ := by sorry

end TraceEstimation.Hutchinson
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 7.1 (proof p. 8:11)
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