Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 8: necessary and sufficient condition for a representation to solve a task linearly

Proved
SSLSpectralEmbedding.linear_probe_minimum_loss

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

graph-laplacianmatrix-analysisself-supervised-learningspectral-embeddingvicreg

Let Y∈RN×CY\in\mathbb{R}^{N\times C}Y∈RN×C be a task and Z∈RN×KZ\in\mathbb{R}^{N\times K}Z∈RN×K a representation, and let U^z\widehat U_zUz​ be the left singular vectors of ZZZ with nonzero singular values, i.e. an orthonormal basis U^z∈RN×r\widehat U_z\in\mathbb{R}^{N\times r}Uz​∈RN×r of the column space of ZZZ. With L(W)=12∥Y−ZW∥F2\mathcal L(W)=\frac12\|Y-ZW\|_F^2L(W)=21​∥Y−ZW∥F2​, the minimum is attained and

min⁡W∈RK×CL(W)=12∥Y∥F2−12∥U^z⊤UyΣy∥F2,\min_{W\in\mathbb{R}^{K\times C}}\mathcal L(W)=\frac12\|Y\|_F^2-\frac12\|\widehat U_z^\top U_y\Sigma_y\|_F^2,W∈RK×Cmin​L(W)=21​∥Y∥F2​−21​∥Uz⊤​Uy​Σy​∥F2​,

where Y=UyΣyVy⊤Y=U_y\Sigma_yV_y^\topY=Uy​Σy​Vy⊤​. This minimum is 000 if and only if the columns of U^z\widehat U_zUz​ span the columns of U^y\widehat U_yUy​, the left singular vectors of YYY with nonzero singular values.

Formalization Note U^z\widehat U_zUz​ is taken to be any matrix with orthonormal columns and the same column space as ZZZ. The right-hand side does not depend on the choice. Because UyΣy=YVyU_y\Sigma_y=YV_yUy​Σy​=YVy​ with VyV_yVy​ orthogonal, ∥U^z⊤UyΣy∥F=∥U^z⊤Y∥F\|\widehat U_z^\top U_y\Sigma_y\|_F=\|\widehat U_z^\top Y\|_F∥Uz⊤​Uy​Σy​∥F​=∥Uz⊤​Y∥F​, and the latter is used. The span of U^y\widehat U_yUy​ is the column space of YYY, so the span condition is stated as inclusion of column spaces.

Preamble
import Mathlib
import Definitions.Def_SSLSpectralEmbedding_Basic

open Matrix
Formal statement
namespace SSLSpectralEmbedding

theorem linear_probe_minimum_loss {N K C r : ℕ} (Y : Matrix (Fin N) (Fin C) ℝ)
    (Z : Matrix (Fin N) (Fin K) ℝ) (U : Matrix (Fin N) (Fin r) ℝ) (hU : Uᵀ * U = 1)
    (hUZ : LinearMap.range (Matrix.toLin' U) = LinearMap.range (Matrix.toLin' Z)) :
    IsLeast (Set.range fun W : Matrix (Fin K) (Fin C) ℝ => lsLoss Y Z W)
      ((1 / 2) * frobSq Y - (1 / 2) * frobSq (Uᵀ * Y)) ∧
    ((1 / 2) * frobSq Y - (1 / 2) * frobSq (Uᵀ * Y) = 0 ↔
      LinearMap.range (Matrix.toLin' Y) ≤ LinearMap.range (Matrix.toLin' U)) := by sorry

end SSLSpectralEmbedding
Source
Balestriero and LeCun, Contrastive and Non-Contrastive Self-Supervised Learning Recover Global and Local Spectral Embedding Methods, arXiv:2205.11508v3 (NeurIPS 2022), Section 6.2, Theorem 8, eq. (22), p. 16; proof in Appendix A.2-A.4, p. 24
Read-back

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

Let N,K,C,rN, K, C, rN,K,C,r be natural numbers, any of which may be 000. The theorem takes three real matrices:

  • a target matrix Y∈RN×CY \in \mathbb{R}^{N \times C}Y∈RN×C;
  • an embedding matrix Z∈RN×KZ \in \mathbb{R}^{N \times K}Z∈RN×K, whose iii-th row is the embedding of sample iii;
  • a matrix U∈RN×rU \in \mathbb{R}^{N \times r}U∈RN×r.

For a real matrix AAA, write ∥A∥F2=∑i,jAij2\|A\|_F^2 = \sum_{i,j} A_{ij}^2∥A∥F2​=∑i,j​Aij2​ for the squared Frobenius norm. For W∈RK×CW \in \mathbb{R}^{K \times C}W∈RK×C, the linear-probe loss is

L(W)  =  12 ∥Y−ZW∥F2.\mathcal{L}(W) \;=\; \tfrac12\,\|Y - ZW\|_F^2 .L(W)=21​∥Y−ZW∥F2​.

For a matrix AAA with NNN rows, col⁡(A)⊆RN\operatorname{col}(A) \subseteq \mathbb{R}^Ncol(A)⊆RN denotes its column space, i.e. the image of x↦Axx \mapsto Axx↦Ax.

Hypotheses. There are exactly two:

  1. U⊤U=IrU^\top U = I_rU⊤U=Ir​. The rrr columns of UUU are orthonormal in RN\mathbb{R}^NRN, which forces r≤Nr \le Nr≤N.
  2. col⁡(U)=col⁡(Z)\operatorname{col}(U) = \operatorname{col}(Z)col(U)=col(Z) as subspaces of RN\mathbb{R}^NRN.

No relation between rrr and KKK is assumed, and no rank or non-degeneracy condition is placed on ZZZ or YYY. The hypotheses can always be satisfied: take the columns of UUU to be an orthonormal basis of col⁡(Z)\operatorname{col}(Z)col(Z). In particular, if ZZZ has no columns (K=0K = 0K=0) or is zero, then col⁡(Z)={0}\operatorname{col}(Z) = \{0\}col(Z)={0} and necessarily r=0r = 0r=0.

Conclusion. The conclusion is the conjunction of two statements about the number

m  =  12 ∥Y∥F2  −  12 ∥U⊤Y∥F2,m \;=\; \tfrac12\,\|Y\|_F^2 \;-\; \tfrac12\,\|U^\top Y\|_F^2 ,m=21​∥Y∥F2​−21​∥U⊤Y∥F2​,

where U⊤Y∈Rr×CU^\top Y \in \mathbb{R}^{r \times C}U⊤Y∈Rr×C.

  • (a) mmm is the least element of the set {L(W):W∈RK×C}\{\mathcal{L}(W) : W \in \mathbb{R}^{K \times C}\}{L(W):W∈RK×C}. This means two things:
    • some WWW attains L(W)=m\mathcal{L}(W) = mL(W)=m;
    • m≤L(W)m \le \mathcal{L}(W)m≤L(W) for every W∈RK×CW \in \mathbb{R}^{K \times C}W∈RK×C.
  • (b) The following equivalence holds:
m=0  ⟺  col⁡(Y)⊆col⁡(U).m = 0 \iff \operatorname{col}(Y) \subseteq \operatorname{col}(U).m=0⟺col(Y)⊆col(U).

Edge cases. In the degenerate cases N=0N = 0N=0 or C=0C = 0C=0, all the matrices involved are empty, so every norm is 000. Then m=0m = 0m=0, the loss is identically 000, and both sides of (b) hold trivially. When r=0r = 0r=0, U⊤YU^\top YU⊤Y is empty, so m=12∥Y∥F2m = \tfrac12\|Y\|_F^2m=21​∥Y∥F2​.

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

    Confirmed by the moderator at approval.

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