Theorem 3: converges to the cross-entropy between latent distributions on a convex body
ProvedContrastiveInverts.delta_infonce_limit_cross_entropyLet and be convex bodies in , , and . Let be a metric induced by a norm, or a semi-metric of such a metric. Let the marginal be uniform, , and the conditional be . Consider the model conditional
where , maps injectively into , the encoder maps into , and is measurable on . Then
with the volume of .
Formalization Note The model assumption of Appendix A.2.1, with a convex body, is included; it makes every expectation finite.
import Mathlib import Definitions.Def_ContrastiveInverts_Basic open MeasureTheory Filter Topology
namespace ContrastiveInverts
theorem delta_infonce_limit_cross_entropy {N K : ℕ} (hNK : N ≤ K) (Z Z' : Set (Vec N))
(hZ : IsConvexBody Z) (hZ' : IsConvexBody Z') (lam τ : ℝ) (hlam : 0 < lam) (hτ : 0 < τ)
(δ : Vec N → Vec N → ℝ) (hδ : IsNormSemimetric δ)
(X : Set (Vec K)) (g : Vec N → Vec K) (hgX : ∀ z ∈ Z, g z ∈ X) (hg_inj : Set.InjOn g Z)
(f : Vec K → Vec N) (hf : ∀ x ∈ X, f x ∈ Z')
(hmeas : AEMeasurable (f ∘ g) (volume.restrict Z)) :
Tendsto (fun M : ℕ => deltaInfoNCE lam δ τ δ Z (f ∘ g) M - Real.log M +
Real.log (bodyVolume Z)) atTop
(𝓝 (bodyCrossEntropy lam δ τ δ Z (f ∘ g))) := by sorry
end ContrastiveInvertsRead-back
What the Lean code literally says, in plain math · claude-opus-5-5
Setting and variables. Let be natural numbers with . Write and for Euclidean spaces with Lebesgue measure. The theorem assumes:
- are both convex bodies: each is convex, compact, and has nonempty interior. The degenerate case is not excluded; then is a single point and .
- are real numbers with and .
- is a norm-induced semimetric: there exist and such that
where:
- is a norm (not necessarily Euclidean). That is, , , and .
- maps bijectively onto , is continuous on , and satisfies . Its values on negative inputs are unconstrained.
- is a set, and maps into and is injective on . Nothing else is assumed about : no continuity or measurability, and no condition off .
- maps into . Nothing else is assumed about .
- The composite is almost-everywhere measurable with respect to Lebesgue measure restricted to .
No further hypotheses appear. In particular:
- , , injectivity, and enter only through these assumptions, not through the conclusion.
- A single function is used both for the ground-truth conditional and for the model similarity.
Ingredients (all built from , , , , ). Let be the Lebesgue volume of , taken as a real number. The uniform measure is times Lebesgue measure restricted to .
The ground-truth conditional density is
The positive-pair law is a measure on . It is obtained from by attaching the density .
For , the InfoNCE objective is
The negatives are independent and uniform on .
The model conditional is
Here is an integral against unnormalized Lebesgue measure on .
The expected cross-entropy is
Conventions affecting these quantities.
- All integrals are Bochner integrals. Any integrand that is not integrable is assigned the value .
- Division by yields .
- and for . In particular, the term uses .
Conclusion. As through the natural numbers, the real sequence
converges to :
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.