Lemma 3.1: row scaling and invertible right factors preserve the linear probe
ProvedSpectralContrastive.probe_invariant_rescalingLet be an embedding matrix whose rows are the representations, let with for all , and let be invertible. Put , with rows . Then for every linear classifier the classifier on makes the same predictions as on :
Consequently the linear probe errors agree: , where is the linear probe error with the rows of as embeddings.
This is why the spectral embedding only needs to be learned up to row scaling and a right invertible transformation.
Formalization Note "Same prediction" is stated as equality of the argmax sets, which covers every tie-breaking rule.
import Mathlib import Definitions.Def_SpectralContrastive_Basic open Matrix
namespace SpectralContrastive
theorem probe_invariant_rescaling {Xbar X : Type*} [Fintype Xbar] [Fintype X] [DecidableEq X]
{k r : ℕ} (P : Xbar → ℝ) (A : Xbar → X → ℝ) (y : Xbar → Fin r)
(F : Matrix X (Fin k) ℝ) (s : X → ℝ) (hs : ∀ x, 0 < s x)
(Q : Matrix (Fin k) (Fin k) ℝ) (hQ : IsUnit Q.det) :
(∀ (B : Matrix (Fin k) (Fin r) ℝ) (x : X) (i : Fin r),
(∀ j, vecMul ((diagonal s * F * Q) x) (Q⁻¹ * B) j ≤
vecMul ((diagonal s * F * Q) x) (Q⁻¹ * B) i) ↔
(∀ j, vecMul (F x) B j ≤ vecMul (F x) B i)) ∧
linearProbeError P A y (diagonal s * F * Q) = linearProbeError P A y F := by sorry
end SpectralContrastiveRead-back
What the Lean code literally says, in plain math · claude-opus-5-5
Let and be arbitrary finite types, with equality on decidable. Let be arbitrary; either may be . The theorem takes the following data:
- , an arbitrary real-valued function on .
- , written , an arbitrary real-valued function.
- , an arbitrary labelling.
- , an arbitrary real matrix whose row is viewed as the representation of .
- , required to satisfy for every .
- , required to have invertible in , i.e. . When this holds automatically, since the empty determinant is .
No other hypotheses are imposed. In particular:
- is not required to be nonnegative or to sum to .
- is not required to be nonnegative or to have rows summing to .
- Nothing is required to have positive mass on any element.
Write and , so that the row of at is
The matrix denotes the genuine inverse of . The theorem asserts the conjunction of two statements.
(1) Argmax invariance. For every matrix , every and every class index :
Here is the row vector obtained by multiplying the row vector by the matrix , and ranges over . In words: is a maximizing coordinate of exactly when it is a maximizing coordinate of . If there is no , and this part is vacuous.
(2) Equality of linear probe errors.
For a representation (a matrix in with rows ), the quantity is defined as follows.
Probe predictions. For a linear head , call a probe prediction if
That is, is some argmax, with ties allowed.
Votes. For and a class , define
Ensemble predictions. Call an ensemble prediction for if
Error of a head. The error of the head is the supremum, over all such pairs , of
Linear probe error. Finally,
Both the supremum and the infimum are taken in under the convention that the supremum or infimum of an empty or unbounded family is . The family of pairs is finite. It is empty in at least one case: when and is nonempty, no probe prediction exists, and the error of every head is then by this convention.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.