Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem B.2: generalized version of Theorem 3.8

Open
SpectralContrastive.probe_error_sparsest_bound

by Xeroth · Nov 23, 2026 · Mathlib 0df444a (Lean v4.33.1)

cheeger-inequalitycontrastive-learninglinear-probeself-supervised-learningspectral-graph-theory

There are universal constants ccc and KKK with the following property. Consider the finite data model and integers k≥1k\ge1k≥1 and k′≥max⁡(r,1)k'\ge\max(r,1)k′≥max(r,1) with k+1=(1+ζ)k′k+1=(1+\zeta)k'k+1=(1+ζ)k′ for some ζ∈(0,1)\zeta\in(0,1)ζ∈(0,1). Let fpop∗f^*_{\mathrm{pop}}fpop∗​ minimize L(f)\mathcal L(f)L(f) over all f:X→Rkf:\mathcal X\to\mathbb R^kf:X→Rk, let y^:X→[r]\hat y:\mathcal X\to[r]y^​:X→[r] be any labeling function, and assume ρk′>0\rho_{k'}>0ρk′​>0. Then there is a linear head B∈Rk×rB\in\mathbb R^{k\times r}B∈Rk×r with

Exˉ,x[∥y⃗(xˉ)−B⊤fpop∗(x)∥22]≤c((1+1/ζ)Klog⁡(k+1) ϕy^ρk′2+Δ(y,y^)).\mathbb E_{\bar x,x}\big[\|\vec y(\bar x)-B^\top f^*_{\mathrm{pop}}(x)\|_2^2\big]\le c\Big((1+1/\zeta)^K\log(k+1)\,\frac{\phi^{\hat y}}{\rho_{k'}^2}+\Delta(y,\hat y)\Big).Exˉ,x​[∥y​(xˉ)−B⊤fpop∗​(x)∥22​]≤c((1+1/ζ)Klog(k+1)ρk′2​ϕy^​​+Δ(y,y^​)).

Every argmax prediction of this head has error Pr⁡xˉ,x(gfpop∗,B(x)≠y(xˉ))\Pr_{\bar x,x}(g_{f^*_{\mathrm{pop}},B}(x)\ne y(\bar x))Prxˉ,x​(gfpop∗​,B​(x)=y(xˉ)) at most twice the same right-hand side. If moreover λk<1\lambda_k<1λk​<1, the head can be taken with ∥B∥F≤1/(1−λk)\|B\|_F\le1/(1-\lambda_k)∥B∥F​≤1/(1−λk​).

Formalization Note The paper's poly(1/ζ)\mathrm{poly}(1/\zeta)poly(1/ζ) is written (1+1/ζ)K(1+1/\zeta)^K(1+1/ζ)K with a universal KKK, and its universal constant ccc is quantified before all data. The hypothesis ρk′>0\rho_{k'}>0ρk′​>0 excludes the case where the right-hand side divides by zero. The norm clause is conditional on λk<1\lambda_k<1λk​<1, which is where 1/(1−λk)1/(1-\lambda_k)1/(1−λk​) is defined.

Preamble
import Mathlib
import Definitions.Def_SpectralContrastive_Basic

open Matrix
Formal statement
namespace SpectralContrastive

theorem probe_error_sparsest_bound :
    ∃ (c : ℝ) (K : ℕ), ∀ (Xbar X : Type) [Fintype Xbar] [Fintype X] [DecidableEq X]
      (r k k' : ℕ) (ζ : ℝ) (P : Xbar → ℝ) (A : Xbar → X → ℝ), IsAugModel P A →
      1 ≤ k → 1 ≤ k' → r ≤ k' → 0 < ζ → ζ < 1 → (k : ℝ) + 1 = (1 + ζ) * k' →
      ∀ (y : Xbar → Fin r) (yhat : X → Fin r) (f : X → Fin k → ℝ),
      (∀ f' : X → Fin k → ℝ, scLoss P A f ≤ scLoss P A f') →
      0 < sparsestPartition (augWeight P A) k' →
      ∃ B : Matrix (Fin k) (Fin r) ℝ,
        probeSqLoss P A y f B ≤
          c * ((1 + 1 / ζ) ^ K * Real.log (k + 1) * cutWeight (augWeight P A) yhat /
            sparsestPartition (augWeight P A) k' ^ 2 + labelDisagree P A y yhat) ∧
        (∀ g : X → Fin r, IsProbePred f B g →
          labelDisagree P A y g ≤
            2 * c * ((1 + 1 / ζ) ^ K * Real.log (k + 1) * cutWeight (augWeight P A) yhat /
              sparsestPartition (augWeight P A) k' ^ 2 + labelDisagree P A y yhat)) ∧
        (lapEig (augWeight P A) k < 1 → frobNorm B ≤ 1 / (1 - lapEig (augWeight P A) k)) := by sorry

end SpectralContrastive
Source
HaoChen, Wei, Gaidon and Ma, Provable Guarantees for Self-Supervised Deep Learning with Spectral Contrastive Loss, arXiv:2106.04156v7 (NeurIPS 2021), Appendix B.1, Theorem B.2, p. 26
Read-back

What the Lean code literally says, in plain math · claude-opus-5-5

Claim. There exist a real constant ccc and a natural number KKK, with no sign or size restriction on ccc, chosen once and before everything below, such that the following holds for every choice of data satisfying the hypotheses.

Data and hypotheses. Fix:

  • finite sets Xˉ\bar{\mathcal X}Xˉ (natural data) and X\mathcal XX (augmented data);
  • natural numbers r,k,k′r, k, k'r,k,k′ and a real number ζ\zetaζ;
  • functions P:Xˉ→RP : \bar{\mathcal X} \to \mathbb RP:Xˉ→R and A:Xˉ×X→R\mathcal A : \bar{\mathcal X} \times \mathcal X \to \mathbb RA:Xˉ×X→R, writing A(x∣xˉ)\mathcal A(x \mid \bar x)A(x∣xˉ).

Assume all of the following:

  1. (P,A)(P, \mathcal A)(P,A) is an augmentation model:

    • P(xˉ)≥0P(\bar x) \ge 0P(xˉ)≥0 for all xˉ\bar xxˉ, and ∑xˉP(xˉ)=1\sum_{\bar x} P(\bar x) = 1∑xˉ​P(xˉ)=1;
    • A(x∣xˉ)≥0\mathcal A(x\mid\bar x) \ge 0A(x∣xˉ)≥0 for all xˉ,x\bar x, xxˉ,x, and ∑xA(x∣xˉ)=1\sum_{x} \mathcal A(x\mid\bar x) = 1∑x​A(x∣xˉ)=1 for every xˉ\bar xxˉ;
    • every x∈Xx \in \mathcal Xx∈X has some xˉ\bar xxˉ with P(xˉ)>0P(\bar x) > 0P(xˉ)>0 and A(x∣xˉ)>0\mathcal A(x\mid\bar x) > 0A(x∣xˉ)>0.

    In particular, both Xˉ\bar{\mathcal X}Xˉ and X\mathcal XX are nonempty.

  2. Constraints on the integers and ζ\zetaζ: k≥1k \ge 1k≥1, k′≥1k' \ge 1k′≥1, r≤k′r \le k'r≤k′, 0<ζ<10 < \zeta < 10<ζ<1, and

k+1=(1+ζ) k′.k + 1 = (1+\zeta)\,k'.k+1=(1+ζ)k′.

Hence ζ=k+1k′−1\zeta = \tfrac{k+1}{k'} - 1ζ=k′k+1​−1 is determined by k,k′k, k'k,k′, and k′<k+1<2k′k' < k+1 < 2k'k′<k+1<2k′. This is impossible when k′=1k' = 1k′=1, so effectively k′≥2k' \ge 2k′≥2 and k′≤k≤2k′−2k' \le k \le 2k'-2k′≤k≤2k′−2.

  1. Labels and representation. Fix arbitrary maps:

    • a label map y:Xˉ→{1,…,r}y : \bar{\mathcal X} \to \{1,\dots,r\}y:Xˉ→{1,…,r};
    • an arbitrary labelling y^:X→{1,…,r}\hat y : \mathcal X \to \{1,\dots,r\}y^​:X→{1,…,r};
    • a representation f:X→Rkf : \mathcal X \to \mathbb R^kf:X→Rk.

    Since Xˉ≠∅\bar{\mathcal X} \neq \emptysetXˉ=∅, yyy can only exist if r≥1r \ge 1r≥1.

  2. fff is a global minimizer of the population spectral contrastive loss over all maps X→Rk\mathcal X \to \mathbb R^kX→Rk: L(f)≤L(f′)\mathcal L(f) \le \mathcal L(f')L(f)≤L(f′) for every f′f'f′, where

L(f)=−2∑xˉP(xˉ)∑x,x′A(x∣xˉ)A(x′∣xˉ) f(x)⊤f(x′)  +  ∑xˉ,xˉ′P(xˉ)P(xˉ′)∑x,x′A(x∣xˉ)A(x′∣xˉ′) (f(x)⊤f(x′))2.\mathcal L(f) = -2\sum_{\bar x} P(\bar x)\sum_{x,x'} \mathcal A(x\mid\bar x)\mathcal A(x'\mid\bar x)\, f(x)^\top f(x') \;+\; \sum_{\bar x,\bar x'} P(\bar x)P(\bar x')\sum_{x,x'} \mathcal A(x\mid\bar x)\mathcal A(x'\mid\bar x')\,\big(f(x)^\top f(x')\big)^2 .L(f)=−2xˉ∑​P(xˉ)x,x′∑​A(x∣xˉ)A(x′∣xˉ)f(x)⊤f(x′)+xˉ,xˉ′∑​P(xˉ)P(xˉ′)x,x′∑​A(x∣xˉ)A(x′∣xˉ′)(f(x)⊤f(x′))2.
  1. The sparsest k′k'k′-partition is positive: ρk′>0\rho_{k'} > 0ρk′​>0, defined as follows.
    • The augmentation graph on X\mathcal XX has weights
wxx′=∑xˉP(xˉ) A(x∣xˉ) A(x′∣xˉ),w_{xx'} = \sum_{\bar x} P(\bar x)\,\mathcal A(x\mid\bar x)\,\mathcal A(x'\mid\bar x),wxx′​=xˉ∑​P(xˉ)A(x∣xˉ)A(x′∣xˉ),

with degrees wx=∑x′wxx′w_x = \sum_{x'} w_{xx'}wx​=∑x′​wxx′​.

  • The conductance of S⊆XS \subseteq \mathcal XS⊆X is
ϕ(S)=∑x∈S∑x′∉Swxx′∑x∈Swx.\phi(S) = \frac{\sum_{x\in S}\sum_{x'\notin S} w_{xx'}}{\sum_{x\in S} w_x}.ϕ(S)=∑x∈S​wx​∑x∈S​∑x′∈/S​wxx′​​.
  • ρk′\rho_{k'}ρk′​ is the infimum, over all surjective labellings σ:X→{1,…,k′}\sigma : \mathcal X \to \{1,\dots,k'\}σ:X→{1,…,k′} (partitions of X\mathcal XX into k′k'k′ nonempty labelled blocks Sj=σ−1(j)S_j = \sigma^{-1}(j)Sj​=σ−1(j)), of max⁡jϕ(Sj)\max_j \phi(S_j)maxj​ϕ(Sj​).
  • If ∣X∣<k′|\mathcal X| < k'∣X∣<k′ there is no such σ\sigmaσ, and ρk′\rho_{k'}ρk′​ is defined to be 000. So this hypothesis in particular forces ∣X∣≥k′|\mathcal X| \ge k'∣X∣≥k′.

Conclusion. There exists a matrix B∈Rk×rB \in \mathbb R^{k\times r}B∈Rk×r satisfying three properties at once. Write

Φ  =  (1+1/ζ)K ln⁡(k+1)  ϕy^ρk′ 2  +  Δ(y,y^),\Phi \;=\; \frac{(1+1/\zeta)^K \,\ln(k+1)\; \phi^{\hat y}}{\rho_{k'}^{\,2}} \;+\; \Delta(y,\hat y),Φ=ρk′2​(1+1/ζ)Kln(k+1)ϕy^​​+Δ(y,y^​),

where:

  • ϕy^=∑x∑x′wxx′ 1[y^(x)≠y^(x′)]\phi^{\hat y} = \sum_{x}\sum_{x'} w_{xx'}\,\mathbf 1[\hat y(x)\neq\hat y(x')]ϕy^​=∑x​∑x′​wxx′​1[y^​(x)=y^​(x′)] is summed over ordered pairs, so each unordered pair is counted twice;
  • Δ(y,y^)=∑xˉP(xˉ)∑xA(x∣xˉ) 1[y^(x)≠y(xˉ)]\Delta(y,\hat y) = \sum_{\bar x}P(\bar x)\sum_x \mathcal A(x\mid\bar x)\,\mathbf 1[\hat y(x)\neq y(\bar x)]Δ(y,y^​)=∑xˉ​P(xˉ)∑x​A(x∣xˉ)1[y^​(x)=y(xˉ)];
  • ln⁡\lnln is the natural logarithm.

The three properties are:

  1. Squared-loss bound:
∑xˉP(xˉ)∑xA(x∣xˉ)∑c=1r(1[c=y(xˉ)]−(f(x)⊤B)c)2  ≤  c Φ.\sum_{\bar x} P(\bar x)\sum_x \mathcal A(x\mid\bar x)\sum_{c=1}^{r}\Big(\mathbf 1[c=y(\bar x)] - \big(f(x)^\top B\big)_c\Big)^2 \;\le\; c\,\Phi.xˉ∑​P(xˉ)x∑​A(x∣xˉ)c=1∑r​(1[c=y(xˉ)]−(f(x)⊤B)c​)2≤cΦ.
  1. Error bound for every argmax classifier. Let g:X→{1,…,r}g : \mathcal X \to \{1,\dots,r\}g:X→{1,…,r} be any map with (f(x)⊤B)i≤(f(x)⊤B)g(x)\big(f(x)^\top B\big)_i \le \big(f(x)^\top B\big)_{g(x)}(f(x)⊤B)i​≤(f(x)⊤B)g(x)​ for all xxx and iii, i.e. g(x)g(x)g(x) is an argmax index under any tie-breaking. Every such ggg satisfies
∑xˉP(xˉ)∑xA(x∣xˉ) 1[g(x)≠y(xˉ)]  ≤  2c Φ.\sum_{\bar x}P(\bar x)\sum_x \mathcal A(x\mid\bar x)\,\mathbf 1[g(x)\neq y(\bar x)] \;\le\; 2c\,\Phi.xˉ∑​P(xˉ)x∑​A(x∣xˉ)1[g(x)=y(xˉ)]≤2cΦ.

This concerns the error on augmented data. No statement is made about the ensembled prediction on natural data.

  1. Norm bound. Let λk\lambda_kλk​ be the kkk-th smallest of the real roots, with multiplicity, of the characteristic polynomial of the normalized Laplacian L=I−AˉL = I - \bar AL=I−Aˉ, where Aˉxx′=wxx′/wxwx′\bar A_{xx'} = w_{xx'}/\sqrt{w_x w_{x'}}Aˉxx′​=wxx′​/wx​wx′​​. If kkk exceeds the number of such roots, λk\lambda_kλk​ is defined to be 000. Then:
λk<1  ⟹  ∥B∥F=(∑i,jBij2)1/2≤11−λk.\lambda_k < 1 \;\Longrightarrow\; \|B\|_F = \Big(\sum_{i,j} B_{ij}^2\Big)^{1/2} \le \frac{1}{1-\lambda_k}.λk​<1⟹∥B∥F​=(i,j∑​Bij2​)1/2≤1−λk​1​.

If λk≥1\lambda_k \ge 1λk​≥1, nothing is asserted about ∥B∥F\|B\|_F∥B∥F​. In the junk case k>∣X∣k > |\mathcal X|k>∣X∣, the hypothesis λk<1\lambda_k < 1λk​<1 holds automatically, and the bound reads ∥B∥F≤1\|B\|_F \le 1∥B∥F​≤1.

Human review
  • Endorsed by Shuze Chen · Nov 23, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Xeroth · Nov 23, 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