Eq. (12) (as proved, ): optimal weights of linear VICReg
ProvedSSLSpectralEmbedding.linear_vicreg_optimal_weightsLet be a relation matrix with Laplacian , let have invertible covariance , let , , and consider the linear VICReg model , , with , trained with the squared-variance VICReg loss with . Let
be positive semidefinite, with positive semidefinite square root . Then
minimises over all .
Formalization Note Eq. (12) takes the first columns of for . The proof in Appendix A.9 treats only , and the statement is restricted to that case. For the proof's claim that every choice of columns gives the same loss is unsupported. Positive semidefiniteness of is the implicit condition for to be real. The square root is any positive semidefinite with , which is unique.
import Mathlib import Definitions.Def_SSLSpectralEmbedding_Basic open Matrix
namespace SSLSpectralEmbedding
theorem linear_vicreg_optimal_weights {N D : ℕ} (α γ : ℝ) (hα : 0 < α) (hγ : 0 ≤ γ)
(G : Matrix (Fin N) (Fin N) ℝ) (hG : IsRelationMatrix G) (X : Matrix (Fin N) (Fin D) ℝ)
(hX : (cov X).det ≠ 0) (hB : (linB α γ G X).PosSemidef)
(R : Matrix (Fin D) (Fin D) ℝ) (hR : R.PosSemidef) (hRB : R * R = linB α γ G X) :
∀ W : Matrix (Fin D) (Fin D) ℝ,
vicLossSq α α γ G (X * ((cov X)⁻¹ * R)) ≤ vicLossSq α α γ G (X * W) := by sorry
end SSLSpectralEmbeddingRead-back
What the Lean code literally says, in plain math · claude-opus-5-5
Setting. Fix natural numbers (number of samples) and (input dimension, which is also the embedding dimension here), and real numbers with
Let be a relation matrix. This means is symmetric, for all , and for all . Let be a data matrix whose -th row is sample .
Definitions used.
- The degree matrix is , and the graph Laplacian is .
- The centring matrix is .
- For any , the covariance is
Here is interpreted as when , so is then the zero matrix.
- The matrix is
again with when .
Hypotheses.
- . When this holds automatically, since the empty determinant is . When and it fails, because .
- is positive semidefinite: it is symmetric and for all .
- is positive semidefinite and satisfies . That is, is a positive semidefinite square root of .
The loss. For , the squared-variance VICReg loss with both the variance and covariance weights equal to is
The first two terms together equal . The last sum runs over all ordered pairs , and its prefactor is when .
Conclusion. For every square matrix ,
In words, among linear embeddings with a weight matrix and no bias term, the weight attains the minimum of . The minimum is only claimed over this class of embeddings. The output dimension is fixed to equal .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.