Theorem 3.3 (consequence, p. 4): for doubly normalized ,
ProvedContrastiveDuality.doubly_normalized_criteriaLet have all columns and all rows of unit Euclidean norm: for every and for every . Then
Since the two hypotheses force (see the note), the constant is always , so under double normalization the two criteria are equal.
Formalization Note is computed in the real numbers. The two hypotheses together give , so they can hold only when ; for example the identity matrix satisfies them.
import Mathlib import Definitions.Def_ContrastiveDuality_Basic open MeasureTheory ProbabilityTheory Matrix
namespace ContrastiveDuality
theorem doubly_normalized_criteria {M N : ℕ} (K : Matrix (Fin M) (Fin N) ℝ)
(hcol : ∀ i, colNorm K i = 1) (hrow : ∀ j, rowNorm K j = 1) :
nonContrastiveCriterion K = contrastiveCriterion K + (N : ℝ) - (M : ℝ) := by sorry
end ContrastiveDualityRead-back
What the Lean code literally says, in plain math · claude-opus-5-5
Let be natural numbers (either may be ), and let be an arbitrary real matrix with rows indexed by and columns by . The rows are read as embedding dimensions and the columns as the samples of a batch.
Norms. For each column , the column norm is
and for each row , the row norm is
Criteria. For a square matrix , denotes the matrix with the same diagonal entries as and zeros elsewhere. is the squared Frobenius norm. Two quantities are defined from these.
- The contrastive criterion is
the sum of squared off-diagonal entries of the Gram matrix of the columns.
- The non-contrastive criterion is
the sum of squared off-diagonal entries of the Gram matrix of the rows.
Statement. Assume both of the following:
- every column of has Euclidean norm exactly , i.e. for all ;
- every row of has Euclidean norm exactly , i.e. for all .
Under these assumptions the theorem asserts the identity of real numbers
Edge cases. The two hypotheses together are restrictive.
- Summing the squared column norms gives . Summing the squared row norms gives the same total equal to . So the hypotheses can only hold simultaneously when . For the statement is vacuous, and whenever it applies the asserted identity amounts to .
- If and , every column norm is , so hypothesis 1 fails. Symmetrically, with makes hypothesis 2 fail.
- When , both hypotheses hold vacuously, both criteria are , and the identity reads .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.