Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Corollary 3.4.1: the criteria are close under one-sided normalization

Proved
ContrastiveDuality.criteria_bounds_of_normalized

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

contrastive-learningfrobenius-normgram-matrixself-supervised-learninguniform-sphere

Let M,N≥1M,N\ge1M,N≥1 and K∈RM×N\mathcal K\in\mathbb{R}^{M\times N}K∈RM×N.

  1. If the embeddings are L2-normalized, ∥K⋅,i∥2=1\|\mathcal K_{\cdot,i}\|_2=1∥K⋅,i​∥2​=1 for every iii, then
Lnc−N+N2M≤Lc≤Lnc−N+N2.L_{nc}-N+\frac{N^2}{M}\le L_c\le L_{nc}-N+N^2.Lnc​−N+MN2​≤Lc​≤Lnc​−N+N2.
  1. If the dimensions are L2-normalized, ∥Kj,⋅∥2=1\|\mathcal K_{j,\cdot}\|_2=1∥Kj,⋅​∥2​=1 for every jjj, then
Lc−M+M2N≤Lnc≤Lc−M+M2.L_c-M+\frac{M^2}{N}\le L_{nc}\le L_c-M+M^2.Lc​−M+NM2​≤Lnc​≤Lc​−M+M2.

So, even when only one direction of the embedding matrix is normalized, the sample-contrastive and dimension-contrastive criteria cannot be arbitrarily far apart.

Formalization Note The batch size and embedding dimension are assumed positive, as in the paper's setting; all quantities are real numbers.

Preamble
import Mathlib
import Definitions.Def_ContrastiveDuality_Basic

open MeasureTheory ProbabilityTheory Matrix
Formal statement
namespace ContrastiveDuality

theorem criteria_bounds_of_normalized {M N : ℕ} (hM : 0 < M) (hN : 0 < N)
    (K : Matrix (Fin M) (Fin N) ℝ) :
    ((∀ i, colNorm K i = 1) →
      nonContrastiveCriterion K - N + (N : ℝ) ^ 2 / M ≤ contrastiveCriterion K ∧
        contrastiveCriterion K ≤ nonContrastiveCriterion K - N + (N : ℝ) ^ 2) ∧
    ((∀ j, rowNorm K j = 1) →
      contrastiveCriterion K - M + (M : ℝ) ^ 2 / N ≤ nonContrastiveCriterion K ∧
        nonContrastiveCriterion K ≤ contrastiveCriterion K - M + (M : ℝ) ^ 2) := by sorry

end ContrastiveDuality
Source
Garrido, Chen, Bardes, Najman and LeCun, On the duality between contrastive and non-contrastive self-supervised learning, arXiv:2206.02574v3 (ICLR 2023), Section 3, Corollary 3.4.1, eqs. (6)-(7), p. 5
Read-back

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

Let MMM and NNN be natural numbers with M>0M > 0M>0 and N>0N > 0N>0, and let K∈RM×NK \in \mathbb{R}^{M \times N}K∈RM×N be an arbitrary real matrix with MMM rows (indexed by j∈{1,…,M}j \in \{1,\dots,M\}j∈{1,…,M}) and NNN columns (indexed by i∈{1,…,N}i \in \{1,\dots,N\}i∈{1,…,N}). Write K⋅,iK_{\cdot,i}K⋅,i​ for the iii-th column and Kj,⋅K_{j,\cdot}Kj,⋅​ for the jjj-th row.

Definitions used. The column norm and row norm are the Euclidean norms

∥K⋅,i∥2=∑j=1MKj,i2,∥Kj,⋅∥2=∑i=1NKj,i2.\|K_{\cdot,i}\|_2 = \sqrt{\textstyle\sum_{j=1}^{M} K_{j,i}^2}, \qquad \|K_{j,\cdot}\|_2 = \sqrt{\textstyle\sum_{i=1}^{N} K_{j,i}^2}.∥K⋅,i​∥2​=∑j=1M​Kj,i2​​,∥Kj,⋅​∥2​=∑i=1N​Kj,i2​​.

For a square matrix AAA, diag⁡(A)\operatorname{diag}(A)diag(A) denotes the matrix with the same diagonal entries as AAA and zeros elsewhere. The squared Frobenius norm of a matrix BBB is ∥B∥F2=∑a,bBa,b2\|B\|_F^2 = \sum_{a,b} B_{a,b}^2∥B∥F2​=∑a,b​Ba,b2​.

The contrastive criterion Lc(K)L_c(K)Lc​(K) uses the N×NN \times NN×N Gram matrix of the columns, K⊤KK^\top KK⊤K. It squares and sums its off-diagonal entries, which are the pairwise inner products of distinct columns:

Lc(K)=∥K⊤K−diag⁡(K⊤K)∥F2=∑i,i′=1i≠i′N⟨K⋅,i,K⋅,i′⟩2.L_c(K) = \big\|K^\top K - \operatorname{diag}(K^\top K)\big\|_F^2 = \sum_{\substack{i,i'=1\\ i\neq i'}}^{N} \langle K_{\cdot,i}, K_{\cdot,i'}\rangle^2 .Lc​(K)=​K⊤K−diag(K⊤K)​F2​=i,i′=1i=i′​∑N​⟨K⋅,i​,K⋅,i′​⟩2.

The non-contrastive criterion Lnc(K)L_{nc}(K)Lnc​(K) does the same for the M×MM \times MM×M Gram matrix of the rows, KK⊤KK^\topKK⊤:

Lnc(K)=∥KK⊤−diag⁡(KK⊤)∥F2=∑j,j′=1j≠j′M⟨Kj,⋅,Kj′,⋅⟩2.L_{nc}(K) = \big\|K K^\top - \operatorname{diag}(K K^\top)\big\|_F^2 = \sum_{\substack{j,j'=1\\ j\neq j'}}^{M} \langle K_{j,\cdot}, K_{j',\cdot}\rangle^2 .Lnc​(K)=​KK⊤−diag(KK⊤)​F2​=j,j′=1j=j′​∑M​⟨Kj,⋅​,Kj′,⋅​⟩2.

Assertion. For every such M,N,KM, N, KM,N,K, both of the following implications hold.

  1. Column normalisation. If every column of KKK has Euclidean norm exactly 111, i.e. ∥K⋅,i∥2=1\|K_{\cdot,i}\|_2 = 1∥K⋅,i​∥2​=1 for all i∈{1,…,N}i \in \{1,\dots,N\}i∈{1,…,N}, then
Lnc(K)−N+N2M  ≤  Lc(K)  ≤  Lnc(K)−N+N2.L_{nc}(K) - N + \frac{N^2}{M} \;\le\; L_c(K) \;\le\; L_{nc}(K) - N + N^2 .Lnc​(K)−N+MN2​≤Lc​(K)≤Lnc​(K)−N+N2.
  1. Row normalisation. If every row of KKK has Euclidean norm exactly 111, i.e. ∥Kj,⋅∥2=1\|K_{j,\cdot}\|_2 = 1∥Kj,⋅​∥2​=1 for all j∈{1,…,M}j \in \{1,\dots,M\}j∈{1,…,M}, then
Lc(K)−M+M2N  ≤  Lnc(K)  ≤  Lc(K)−M+M2.L_c(K) - M + \frac{M^2}{N} \;\le\; L_{nc}(K) \;\le\; L_c(K) - M + M^2 .Lc​(K)−M+NM2​≤Lnc​(K)≤Lc​(K)−M+M2.

Remarks on the statement.

  • All quantities are real numbers. NNN and MMM are treated as reals, and N2/MN^2/MN2/M and M2/NM^2/NM2/N are ordinary real divisions. Because M,N>0M, N > 0M,N>0, no division by zero occurs.
  • Both inequalities in each chain are non-strict (≤\le≤).
  • The two parts are independent implications joined by "and". Neither part requires the other's normalisation hypothesis.
  • Each hypothesis is satisfiable for every admissible M,NM, NM,N. For example, all columns equal to the first standard basis vector have unit norm. When M=NM = NM=N, the identity matrix satisfies both hypotheses.
  • The uniform sphere measure defined in the accompanying definitions file does not appear in this statement.
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