Eqs. (4)–(5) (as corrected): InfoNCE embedding gradients and
ProvedDimensionalCollapse.infonce_gradients_and_G_eq_neg_WXFor embeddings (), the gradients of the InfoNCE loss are
Consequently, for every linear model and inputs , with ,
where
Combined with Lemma 1, the linear model evolves by , which is the equation that Theorem 1 studies.
Formalization Note The matrix is the one written at the start of the proof of Lemma 2 (Appendix B.2, p. 14). Eq. (6) on p. 4 prints a minus sign in front of the first sum; with that sign, is false (a numerical check with , gives an error of order ).
import Mathlib import Definitions.Def_DimensionalCollapse_Basic open Matrix Filter Topology
namespace DimensionalCollapse
theorem infonce_gradients_and_G_eq_neg_WX {N n d : ℕ} :
(∀ (z z' : Fin N → Fin d → ℝ) (i : Fin N),
gradZ z z' i = (∑ j ∈ Finset.univ.erase i, alpha z z' i j • (z j - z' i)) +
∑ j ∈ Finset.univ.erase i, alpha z z' j i • (z j - z i)) ∧
(∀ (z z' : Fin N → Fin d → ℝ) (i : Fin N),
gradZ' z z' i = ∑ j ∈ Finset.univ.erase i, alpha z z' i j • (z' i - z i)) ∧
(∀ (x x' : Fin N → Fin n → ℝ) (W : Matrix (Fin d) (Fin n) ℝ),
Gmat x x' W = -(W * Xmat x x' W)) := by sorry
end DimensionalCollapseRead-back
What the Lean code literally says, in plain math · claude-opus-5-5
Setting. Fix natural numbers (number of samples), (input dimension) and (embedding dimension). All three may be , and there are no other hypotheses. For a vector , write . Below, denotes the -th standard basis vector of .
Definitions used. For two families of embeddings and in , define the partition function
Define the loss
Define the weights
The vector is defined componentwise. Its -th entry is the derivative at of
The vector is defined the same way, perturbing instead. Each is a vector of ordinary one-variable derivatives, with the convention that a non-existent derivative is recorded as .
Note that appears in and also in every with , through the term .
For inputs and in and a matrix :
- Set and . Let , and be computed at these embeddings.
- Define the matrix
- Define the matrix
Assertion. The statement is the conjunction of three claims.
- For all families (not only those of the form ) and every index :
- For all and every :
- For all and all :
Edge cases.
- : there are no indices , so claims 1 and 2 hold vacuously. In claim 3, both and are empty sums, so both sides are the zero matrix.
- : every sum over is empty. Claims 1 and 2 then assert that both gradients are the zero vector.
- or : the vectors or matrices involved have no entries.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.