Theorem 4: minimizers of the cross-entropy on a convex body are affine
ProvedContrastiveInverts.body_ce_minimizers_affineLet be a convex body in , , and . Let be a metric induced by a norm, or a semi-metric of such a metric. Let with uniform marginal on . Let the mixing function be differentiable and injective on with .
Let be a class of encoders with measurable on . Assume the class can match : some has for all , with as in eq. (7). If is differentiable on and minimises over , then is affine on : there is an affine map of with for all .
Formalization Note "Minimises the cross-entropy between and " is read as minimising the expected cross-entropy, the quantity that Theorem 3 relates to .
import Mathlib import Definitions.Def_ContrastiveInverts_Basic open MeasureTheory Filter Topology
namespace ContrastiveInverts
theorem body_ce_minimizers_affine {N K : ℕ} (hNK : N ≤ K) (Z : Set (Vec N))
(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)
(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 τ δ Z (f₀ ∘ g) z z' = expCond lam δ Z z z')
(f : Vec K → Vec N) (hfF : f ∈ F) (hf_diff : DifferentiableOn ℝ f X)
(hmin : ∀ f' ∈ F,
bodyCrossEntropy lam δ τ δ Z (f ∘ g) ≤ bodyCrossEntropy lam δ τ δ Z (f' ∘ g)) :
∃ A : Vec N →ᵃ[ℝ] Vec N, ∀ z ∈ Z, f (g z) = A z := by sorry
end ContrastiveInvertsRead-back
What the Lean code literally says, in plain math · claude-opus-5-5
Fix natural numbers . Write and for Euclidean spaces with their Lebesgue measure .
The data and hypotheses. The statement takes the following data, each subject to the stated hypotheses.
- Latent space. is a convex body: convex, compact, and with nonempty interior.
- When , is a single point, and qualifies.
- Parameters. Real numbers and .
- Dissimilarity. is a norm-induced semi-metric. That is, there exist and with
where:
- satisfies the norm axioms:
- ;
- ;
- .
- restricts to a bijection of onto itself, is continuous on , and has .
- need not be Euclidean.
- Generator. is an arbitrary set, with no hypotheses on it. The map :
- sends every point of into ;
- is injective on ;
- is differentiable on , in the sense of differentiability within at each point of .
- Model class. is a set of maps . Every :
- maps into ;
- has almost-everywhere measurable with respect to Lebesgue measure restricted to .
The densities and the cross-entropy. For and , define the ground-truth conditional
Define the model conditional
Here:
- Division by yields .
- A non-integrable integrand gives integral .
Define the expected cross-entropy
Here:
- and , as for the total real logarithm.
- Both integrals have the same "non-integrable gives " convention.
- The same appears in both and .
- uses the scale , while uses the temperature . No relation between and is assumed.
Remaining hypotheses.
- Realisability. There exists such that
- The map . satisfies:
- ;
- is differentiable on , within at each point of ;
- minimises the cross-entropy over :
Conclusion. There exists an affine map , i.e. with linear (not required to be invertible) and , such that
Nothing is asserted about outside .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.