Theorem 6 (as proved): for similarities, , minimizers recover the latents up to permutation, sign flips, rescaling and a translation
ProvedContrastiveInverts.delta_contrastive_identifies_permutationLet be a convex body in , , with , and . Let , where is the metric and is a continuous bijection of with . This includes itself and its -th power. Let the marginal be uniform and (eq. 5). Let be differentiable and injective on with .
Let the model use the same metric up to a constant factor , so that and the objective is with similarity . Let be a class of encoders with measurable on , containing some with on . If is differentiable on and minimises this objective for over , then there are a permutation of , signs , a factor and a vector with
So is a composition of a permutation, sign flips, a rescaling and a translation.
Formalization Note The paper's conclusion omits the translation , and without it the statement is false. On with , the map sends onto and preserves every distance. It therefore has exactly the loss of the identity and is a minimiser, but . The proof establishes the statement with : Theorem 5 makes affine, and only its linear part is a scaled generalized permutation. The class of follows the main-text statement (an metric or a semi-metric of it in the sense of Lemma 1); the appendix restatement names the metric and its -th power, both of which are covered.
import Mathlib import Definitions.Def_ContrastiveInverts_Basic open MeasureTheory Filter Topology
namespace ContrastiveInverts
theorem delta_contrastive_identifies_permutation {N K : ℕ} (hNK : N ≤ K) (Z : Set (Vec N))
(hZ : IsConvexBody Z) (α : ℝ) (hα : 1 ≤ α) (hα2 : α ≠ 2)
(δ : Vec N → Vec N → ℝ) (hδ : ∃ j : ℝ → ℝ, IsReparam j ∧ ∀ a b, δ a b = j (lpDist α a b))
(s τ : ℝ) (hs : 0 < s) (hτ : 0 < τ)
(X : Set (Vec K)) (g : Vec N → Vec K) (hgX : ∀ z ∈ Z, g z ∈ X) (hg_inj : Set.InjOn g Z)
(hg_diff : DifferentiableOn ℝ g Z)
(F : Set (Vec K → Vec N))
(hF : ∀ f' ∈ F, (∀ x ∈ X, f' x ∈ Z) ∧ AEMeasurable (f' ∘ g) (volume.restrict Z))
(hflex : ∃ f₀ ∈ F, ∀ z ∈ Z, ∀ z' ∈ Z,
bodyModelCond τ (fun a b => s * δ a b) Z (f₀ ∘ g) z z' = expCond 1 δ Z z z')
(f : Vec K → Vec N) (hfF : f ∈ F) (hf_diff : DifferentiableOn ℝ f X)
(hmin : ∀ f' ∈ F,
deltaInfoNCELimit 1 δ τ (fun a b => s * δ a b) Z (f ∘ g) ≤
deltaInfoNCELimit 1 δ τ (fun a b => s * δ a b) Z (f' ∘ g)) :
∃ (σ : Equiv.Perm (Fin N)) (ε : Fin N → ℝ) (c : ℝ) (b : Vec N),
(∀ i, ε i = 1 ∨ ε i = -1) ∧ 0 < c ∧
∀ z ∈ Z, ∀ i, f (g z) i = c * ε i * z (σ i) + b i := by sorry
end ContrastiveInvertsRead-back
What the Lean code literally says, in plain math · claude-opus-5-5
Setting. Let be natural numbers. Write and for the Euclidean spaces, with coordinates of written for indices . Everything below is quantified over:
- The latent set. is a convex body: it is convex, compact, and has nonempty interior. When , is a single point and qualifies.
- The exponent. with and .
- The similarity function. such that there exists with
The requirements on are:
- maps bijectively onto ;
- is continuous on ;
- .
The values of on negative numbers play no role.
- Two scalars. and .
- The observation map. is an arbitrary set, and satisfies:
- for every ;
- is injective on ;
- is differentiable on , in the sense of differentiability within at each point of .
- The model class. is a set of maps . Every maps into , and is almost-everywhere measurable for Lebesgue measure restricted to .
- The candidate encoder. with , and differentiable on (within ).
Auxiliary objects. For , the following are used. All integrals are Bochner integrals, which by convention equal when the integrand is not integrable.
- The ground-truth conditional:
- The model conditional with similarity :
A division by yields .
- The uniform measure on : .
- The positive-pair law on : the product with density .
- For each , the InfoNCE-type objective:
- The limit objective: , with . If this limit does not exist, is an unspecified but fixed real number, not "" or "undefined".
Hypotheses.
- Realizability. There exists such that, with ,
This is an exact pointwise equality, not an almost-everywhere one. 2. Minimality. minimizes the limit objective over :
Conclusion. There exist:
- a permutation of the coordinate indices ;
- signs , each equal to or ;
- a real number ;
- a vector ;
such that for every and every index ,
In words, on the composite is a coordinate permutation with sign flips, one common positive scale , and a translation . Nothing is asserted about outside , or about outside . In the case the conclusion holds trivially.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.