Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 1 — Sparsify(G,q)(G,q)(G,q) with q=9C2nlog⁡n/ε2q=9C^2n\log n/\varepsilon^2q=9C2nlogn/ε2 is a (1±ε)(1\pm\varepsilon)(1±ε) spectral sparsifier with probability ≥1/2\ge 1/2≥1/2

Proved
EffResSparsify.Sampling.theorem_1

by mikedeng1 · Oct 7, 2026 · Mathlib 0df444a (Lean v4.33.1)

effective-resistancelaplacianp2o-batch-pfp2bp2o-gran-per-chapterp2o-plan-paperp2o-v1randomized-algorithmsspectral-sparsification

There are an absolute constant C>0C>0C>0 and a threshold N0N_0N0​ such that the following holds for every n≥N0n\ge N_0n≥N0​. Let G=(V,E,w)G=(V,E,w)G=(V,E,w) be a connected weighted graph on nnn vertices with positive edge weights and Laplacian LLL, and let 1/n<ε≤11/\sqrt n<\varepsilon\le11/n​<ε≤1. Let

q=⌈9C2 nlog⁡nε2⌉q=\Big\lceil\frac{9C^2\,n\log n}{\varepsilon^2}\Big\rceilq=⌈ε29C2nlogn​⌉

and let H=Sparsify(G,q)H=\mathrm{Sparsify}(G,q)H=Sparsify(G,q), with Laplacian L~\tilde LL~: qqq edges are drawn independently with replacement, edge eee with probability pep_epe​ proportional to weRew_eR_ewe​Re​ (its weight times its effective resistance), and each draw of eee adds weight we/(qpe)w_e/(qp_e)we​/(qpe​) to eee in HHH. Then with probability at least 1/21/21/2,

∀x∈Rn:(1−ε) xTLx≤xTL~x≤(1+ε) xTLx.\forall x\in\mathbb R^n:\qquad(1-\varepsilon)\,x^{\mathsf T}Lx\le x^{\mathsf T}\tilde Lx\le(1+\varepsilon)\,x^{\mathsf T}Lx.∀x∈Rn:(1−ε)xTLx≤xTL~x≤(1+ε)xTLx.

This is the main theorem of the paper: every weighted graph has a spectral sparsifier with O(nlog⁡n/ε2)O(n\log n/\varepsilon^2)O(nlogn/ε2) edges, obtained by independent sampling according to effective resistances.

Formalization Note The paper's "CCC is the constant in Lemma 5" and "nnn sufficiently large" are quantified as ∃C>0, ∃N0, ∀n≥N0\exists C>0,\ \exists N_0,\ \forall n\ge N_0∃C>0, ∃N0​, ∀n≥N0​, before the graph, the edge type and ε\varepsilonε, so both are uniform over all graphs and all admissible ε\varepsilonε. The printed q=9C2nlog⁡n/ε2q=9C^2n\log n/\varepsilon^2q=9C2nlogn/ε2 is not an integer and is rounded up. log⁡\loglog is natural. Vertices are Fin n; the edge set is any finite type with an arbitrary orientation and no loops (parallel edges allowed). Probability is the finite sum over the ∣E∣q|E|^q∣E∣q outcomes of ∏ipsi\prod_i p_{s_i}∏i​psi​​ times the indicator of the event.

Preamble
import Mathlib
import Definitions.Def_EffResSparsify_Sampling_Defs
Formal statement
namespace EffResSparsify.Sampling

open Matrix

/-- Theorem 1, p. 2: there are an absolute constant `C > 0` and a threshold `N₀` such that for
every `n ≥ N₀`, every connected weighted graph `G` on `n` vertices and every
`1/√n < ε ≤ 1`, with `q = ⌈9 C² n log n / ε²⌉`, the graph `H = Sparsify(G, q)` satisfies
`(1 − ε) xᵀ L x ≤ xᵀ L̃ x ≤ (1 + ε) xᵀ L x` for all `x ∈ ℝⁿ` with probability at least `1/2`. -/
theorem theorem_1 :
    ∃ C : ℝ, 0 < C ∧ ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n →
      ∀ (E : Type) [Fintype E] [DecidableEq E] (G : WGraph (Fin n) E), G.IsConnected →
      ∀ ε : ℝ, 1 / Real.sqrt n < ε → ε ≤ 1 →
        (1 / 2 : ℝ) ≤ G.sparsifyProb ⌈9 * C ^ 2 * n * Real.log n / ε ^ 2⌉₊
          (fun s => ∀ x : Fin n → ℝ,
            (1 - ε) * (x ⬝ᵥ (G.laplacian *ᵥ x)) ≤
                x ⬝ᵥ (G.sparsifiedLaplacian ⌈9 * C ^ 2 * n * Real.log n / ε ^ 2⌉₊ s *ᵥ x) ∧
              x ⬝ᵥ (G.sparsifiedLaplacian ⌈9 * C ^ 2 * n * Real.log n / ε ^ 2⌉₊ s *ᵥ x) ≤
                (1 + ε) * (x ⬝ᵥ (G.laplacian *ᵥ x))) := by sorry

end EffResSparsify.Sampling
Source
Spielman, Srivastava, Graph Sparsification by Effective Resistances, arXiv:0803.0929v4, p. 2, Theorem 1 (proof pp. 8–9)
Human review
  • Endorsed by Shuze Chen · Oct 7, 2026

    Confirmed by the moderator at approval.

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