Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem B.3 (as proved): linear probe error in terms of λk+1\lambda_{k+1}λk+1​

Proved
SpectralContrastive.probe_error_eigen_bound

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

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

Consider the finite data model with N=∣X∣N=|\mathcal X|N=∣X∣, let 1≤k<N1\le k<N1≤k<N, and let λ1≤λ2≤⋯\lambda_1\le\lambda_2\le\cdotsλ1​≤λ2​≤⋯ be the eigenvalues of the normalized Laplacian of the augmentation graph. Assume λk+1>0\lambda_{k+1}>0λk+1​>0 and λk<1\lambda_k<1λk​<1. Let fpop∗:X→Rkf^*_{\mathrm{pop}}:\mathcal X\to\mathbb R^kfpop∗​:X→Rk minimize the population spectral contrastive loss L(f)\mathcal L(f)L(f) over all functions. Then for every labeling function y^:X→[r]\hat y:\mathcal X\to[r]y^​:X→[r] there is a linear head B∈Rk×rB\in\mathbb R^{k\times r}B∈Rk×r with ∥B∥F≤1/(1−λk)\|B\|_F\le1/(1-\lambda_k)∥B∥F​≤1/(1−λk​) such that

Exˉ∼P, x∼A(⋅∣xˉ)[∥y⃗(xˉ)−B⊤fpop∗(x)∥22]≤2ϕy^λk+1+4Δ(y,y^),\mathbb E_{\bar x\sim P,\,x\sim\mathcal A(\cdot\mid\bar x)}\big[\|\vec y(\bar x)-B^\top f^*_{\mathrm{pop}}(x)\|_2^2\big]\le\frac{2\phi^{\hat y}}{\lambda_{k+1}}+4\Delta(y,\hat y),Exˉ∼P,x∼A(⋅∣xˉ)​[∥y​(xˉ)−B⊤fpop∗​(x)∥22​]≤λk+1​2ϕy^​​+4Δ(y,y^​),

and every argmax prediction gfpop∗,Bg_{f^*_{\mathrm{pop}},B}gfpop∗​,B​ (any tie-breaking) satisfies

Pr⁡xˉ∼P, x∼A(⋅∣xˉ)(gfpop∗,B(x)≠y(xˉ))≤4ϕy^λk+1+8Δ(y,y^).\Pr_{\bar x\sim P,\,x\sim\mathcal A(\cdot\mid\bar x)}\big(g_{f^*_{\mathrm{pop}},B}(x)\ne y(\bar x)\big)\le\frac{4\phi^{\hat y}}{\lambda_{k+1}}+8\Delta(y,\hat y).xˉ∼P,x∼A(⋅∣xˉ)Pr​(gfpop∗​,B​(x)=y(xˉ))≤λk+1​4ϕy^​​+8Δ(y,y^​).

Formalization Note The paper prints the constants 111 and 222 in front of ϕy^/λk+1\phi^{\hat y}/\lambda_{k+1}ϕy^​/λk+1​. The proof establishes 222 and 444: summing eq. (26) over i∈[r]i\in[r]i∈[r] counts every edge (x,x′)(x,x')(x,x′) with y^(x)≠y^(x′)\hat y(x)\ne\hat y(x')y^​(x)=y^​(x′) twice, so eq. (27) holds with ϕy^/λk+1\phi^{\hat y}/\lambda_{k+1}ϕy^​/λk+1​ in place of ϕy^/(2λk+1)\phi^{\hat y}/(2\lambda_{k+1})ϕy^​/(2λk+1​). The statement here carries the proved constants. The hypotheses k<Nk<Nk<N and λk+1>0\lambda_{k+1}>0λk+1​>0 are those of Lemma B.6, which the proof uses. The hypothesis λk<1\lambda_k<1λk​<1 is the domain of the printed norm bound 1/(1−λk)1/(1-\lambda_k)1/(1−λk​). The head is the transpose of the paper's B∗∈Rr×kB^*\in\mathbb R^{r\times k}B∗∈Rr×k.

Preamble
import Mathlib
import Definitions.Def_SpectralContrastive_Basic

open Matrix
Formal statement
namespace SpectralContrastive

theorem probe_error_eigen_bound {Xbar X : Type*} [Fintype Xbar] [Fintype X] [DecidableEq X]
    {k r : ℕ} (P : Xbar → ℝ) (A : Xbar → X → ℝ) (hM : IsAugModel P A) (y : Xbar → Fin r)
    (hk : 1 ≤ k) (hkN : k + 1 ≤ Fintype.card X)
    (hl : 0 < lapEig (augWeight P A) (k + 1)) (hlk : lapEig (augWeight P A) k < 1)
    (f : X → Fin k → ℝ) (hf : ∀ f' : X → Fin k → ℝ, scLoss P A f ≤ scLoss P A f')
    (yhat : X → Fin r) :
    ∃ B : Matrix (Fin k) (Fin r) ℝ,
      frobNorm B ≤ 1 / (1 - lapEig (augWeight P A) k) ∧
      probeSqLoss P A y f B ≤
        2 * cutWeight (augWeight P A) yhat / lapEig (augWeight P A) (k + 1) +
          4 * labelDisagree P A y yhat ∧
      ∀ g : X → Fin r, IsProbePred f B g →
        labelDisagree P A y g ≤
          4 * cutWeight (augWeight P A) yhat / lapEig (augWeight P A) (k + 1) +
            8 * labelDisagree P A y yhat := 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.3, p. 27; proof in Appendix B.3, eqs. (25)-(28), pp. 31-32
Read-back

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

Fix finite types Xˉ\bar{\mathcal X}Xˉ (natural data) and X\mathcal XX (augmented data), and natural numbers kkk (representation dimension) and rrr (number of classes). Let

  • P:Xˉ→RP : \bar{\mathcal X} \to \mathbb RP:Xˉ→R, and
  • A(x∣xˉ)\mathcal A(x \mid \bar x)A(x∣xˉ) a real number for each xˉ∈Xˉ\bar x \in \bar{\mathcal X}xˉ∈Xˉ and x∈Xx \in \mathcal Xx∈X.

Model hypothesis. These form a finite 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 Xˉ\bar{\mathcal X}Xˉ is nonempty. Let y:Xˉ→{1,…,r}y : \bar{\mathcal X} \to \{1,\dots,r\}y:Xˉ→{1,…,r} be an arbitrary labelling. Its existence forces r≥1r \ge 1r≥1.

The augmentation graph. Its weights are

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ˉ),

and the degrees are wx=∑x′wxx′w_x = \sum_{x'} w_{xx'}wx​=∑x′​wxx′​. The normalized adjacency matrix is Aˉxx′=wxx′/wxwx′\bar A_{xx'} = w_{xx'} / \sqrt{w_x w_{x'}}Aˉxx′​=wxx′​/wx​wx′​​, and the normalized Laplacian is L=I−AˉL = I - \bar AL=I−Aˉ, an ∣X∣×∣X∣|\mathcal X| \times |\mathcal X|∣X∣×∣X∣ real matrix.

λi\lambda_iλi​ denotes the iii-th entry (i=1,2,…i = 1, 2, \dotsi=1,2,…) of the list of real roots of the characteristic polynomial of LLL. These roots are counted with multiplicity and sorted in increasing order. λi\lambda_iλi​ is defined to be 000 if iii exceeds the number of real roots, and i=0i = 0i=0 is read as index 111.

Remaining hypotheses.

  • k≥1k \ge 1k≥1 and k+1≤∣X∣k + 1 \le |\mathcal X|k+1≤∣X∣.
  • λk+1>0\lambda_{k+1} > 0λk+1​>0 and λk<1\lambda_k < 1λk​<1.

The representation. f:X→Rkf : \mathcal X \to \mathbb R^kf:X→Rk is any map that globally minimizes the spectral contrastive loss over all maps f′:X→Rkf' : \mathcal X \to \mathbb R^kf′:X→Rk. That is, 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.

If no global minimizer exists, the statement is vacuous.

The comparison labelling. y^:X→{1,…,r}\hat y : \mathcal X \to \{1,\dots,r\}y^​:X→{1,…,r} is an arbitrary labelling of augmented data. Define:

  • the cut weight ϕy^=∑x,x′wxx′ 1[y^(x)≠y^(x′)]\phi^{\hat y} = \sum_{x, x'} w_{xx'}\,\mathbf 1[\hat y(x) \ne \hat y(x')]ϕy^​=∑x,x′​wxx′​1[y^​(x)=y^​(x′)], summed over ordered pairs;
  • for any h:X→{1,…,r}h : \mathcal X \to \{1,\dots,r\}h:X→{1,…,r}, the disagreement Δ(y,h)=∑xˉP(xˉ)∑xA(x∣xˉ) 1[h(x)≠y(xˉ)]\Delta(y, h) = \sum_{\bar x} P(\bar x) \sum_x \mathcal A(x\mid\bar x)\,\mathbf 1[h(x) \ne y(\bar x)]Δ(y,h)=∑xˉ​P(xˉ)∑x​A(x∣xˉ)1[h(x)=y(xˉ)].

Conclusion. There exists a real k×rk \times rk×r matrix BBB such that all three of the following hold.

  1. The Frobenius norm of BBB satisfies
∥B∥F=∑i,jBij2≤11−λk.\|B\|_F = \sqrt{\textstyle\sum_{i,j} B_{ij}^2} \le \frac{1}{1 - \lambda_k}.∥B∥F​=∑i,j​Bij2​​≤1−λk​1​.
  1. The squared loss of the linear head against one-hot labels satisfies
∑xˉP(xˉ)∑xA(x∣xˉ)∑c=1r(1[c=y(xˉ)]−(f(x)⊤B)c)2  ≤  2 ϕy^λk+1+4 Δ(y,y^).\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)] - (f(x)^\top B)_c\Big)^2 \;\le\; \frac{2\,\phi^{\hat y}}{\lambda_{k+1}} + 4\,\Delta(y,\hat y).xˉ∑​P(xˉ)x∑​A(x∣xˉ)c=1∑r​(1[c=y(xˉ)]−(f(x)⊤B)c​)2≤λk+1​2ϕy^​​+4Δ(y,y^​).
  1. Consider every g:X→{1,…,r}g : \mathcal X \to \{1,\dots,r\}g:X→{1,…,r} that is an argmax prediction of BBB on fff, meaning (f(x)⊤B)i≤(f(x)⊤B)g(x)(f(x)^\top B)_i \le (f(x)^\top B)_{g(x)}(f(x)⊤B)i​≤(f(x)⊤B)g(x)​ for all xxx and all iii, with ties broken in any way. Every such ggg satisfies
Δ(y,g)≤4 ϕy^λk+1+8 Δ(y,y^).\Delta(y, g) \le \frac{4\,\phi^{\hat y}}{\lambda_{k+1}} + 8\,\Delta(y,\hat y).Δ(y,g)≤λk+1​4ϕy^​​+8Δ(y,y^​).

The bounds concern the per-augmentation classifier ggg and the squared loss. No statement is made about the ensembled prediction on natural data or about the linear probe error.

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