Lemma 7: singular value dynamics of the two-layer model
ProvedDimensionalCollapse.two_layer_singular_value_dynamicsLet follow the two-layer InfoNCE gradient flow at time (as in Lemma 3), and let () be singular value decompositions for near , with differentiable at . Write for the -th columns of and for the matrix of Lemma 1 at . Then for every
The overlaps are the entries of the alignment matrix ; when the sums collapse to one term, which gives Theorem 3.
Formalization Note The differentiable SVDs are hypotheses on a neighbourhood of , as in Lemma 4.
import Mathlib import Definitions.Def_DimensionalCollapse_Basic open Matrix Filter Topology
namespace DimensionalCollapse
theorem two_layer_singular_value_dynamics {N d : ℕ} (x x' : Fin N → Fin d → ℝ)
(W1 W2 U1 V1 U2 V2 : ℝ → Matrix (Fin d) (Fin d) ℝ) (sig1 sig2 : ℝ → Fin d → ℝ) (t : ℝ)
(hflow : IsTwoLayerFlowAt x x' W1 W2 t)
(hsvd1 : IsDiffSVDAt W1 U1 V1 sig1 t) (hsvd2 : IsDiffSVDAt W2 U2 V2 sig2 t) :
(∀ k, deriv (fun s => sig1 s k) t =
-∑ k', (∑ a, V2 t a k' * U1 t a k) * sig2 t k' *
(∑ a, ∑ b, U2 t a k' * Gmat x x' (W2 t * W1 t) a b * V1 t b k)) ∧
(∀ k, deriv (fun s => sig2 s k) t =
-∑ k', (∑ a, U1 t a k' * V2 t a k) * sig1 t k' *
(∑ a, ∑ b, U2 t a k * Gmat x x' (W2 t * W1 t) a b * V1 t b k')) := 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) and (dimension). There are two families of input vectors and , the two "branches" of pairs. There are six matrix-valued functions of a real time variable,
two vector-valued functions with components and , and a fixed time .
The loss. For embeddings and in , with , define
The "negatives" in are only the same-branch vectors with . Each enters only through the -th positive term.
The two-layer loss is
All partial derivatives below are defined as of the function along a coordinate direction. This construction would give at a point of non-differentiability. Here every , so is smooth everywhere.
The matrix . For , let and be the vectors of partial derivatives of with respect to the coordinates of and of . These are evaluated at and . Then
In the conclusion, denotes , and all of are evaluated at time .
Hypothesis 1 (gradient flow at the single instant ). For every entry :
- the map is differentiable at , with derivative evaluated at , , where is held fixed;
- likewise, has derivative at equal to at , where is held fixed.
Nothing is assumed about the flow at any other time.
Hypotheses 2 and 3 (differentiable SVDs). For each , the following holds for all in some neighbourhood of :
- and are orthogonal matrices;
- every ;
- .
In addition, every entry of and , and every component , is differentiable at . The hypotheses do not require the to be ordered or distinct. Any differentiable choice of such factors is allowed.
Conclusion. For every index :
Here and .
Edge cases.
- If , both conclusions are vacuous.
- If , the loss is identically and . The conclusion then says every has derivative at .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.