Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Corollary 1: cross-entropy lower bound with norm-bounded weights

Proved
SupConGeometry.ce_loss_norm_bounded_weights

by Xeroth · Nov 24, 2026 · Mathlib 0df444a (Lean v4.33.1)

cross-entropyneural-collapseregular-simplexrepresentation-geometrysupervised-contrastive-loss

Under the hypotheses of Theorem 1 (2≤K≤h+12\le K\le h+12≤K≤h+1, N≥1N\ge1N≥1, ρ>0\rho>0ρ>0, ∥zn∥≤ρ\|z_n\|\le\rho∥zn​∥≤ρ, balanced YYY), let r>0r>0r>0 and suppose ∥wy∥≤r\|w_y\|\le r∥wy​∥≤r for every yyy. Then

LCE(Z,W;Y) ≥ log⁡(1+(K−1)exp⁡(−KρrK−1)),\mathcal L_{CE}(Z,W;Y)\ \ge\ \log\Big(1+(K-1)\exp\Big(-\frac{K\rho r}{K-1}\Big)\Big),LCE​(Z,W;Y) ≥ log(1+(K−1)exp(−K−1Kρr​)),

with equality if and only if there are ζ1,…,ζK∈Rh\zeta_1,\dots,\zeta_K\in\mathbb R^hζ1​,…,ζK​∈Rh such that

  1. (C1) zn=ζynz_n=\zeta_{y_n}zn​=ζyn​​ for all nnn;
  2. (C2) {ζy}y\{\zeta_y\}_y{ζy​}y​ form a ρ\rhoρ-sphere-inscribed regular simplex;
  3. (C3-r) wy=rρζyw_y=\frac{r}{\rho}\zeta_ywy​=ρr​ζy​ for all yyy.

Formalization Note r>0r>0r>0 is implicit in the paper: its proof picks ρW=r>0\rho_W=r>0ρW​=r>0. For r=0r=0r=0 the equality claim fails, since W=0W=0W=0 attains the bound for every ZZZ.

Preamble
import Mathlib
import Definitions.Def_SupConGeometry_Basic

open Finset
Formal statement
namespace SupConGeometry

theorem ce_loss_norm_bounded_weights {N K h : ℕ} (hK : 2 ≤ K) (hKh : K ≤ h + 1) (hN : 0 < N)
    (ρ : ℝ) (hρ : 0 < ρ) (Z : Fin N → Rep h) (hZ : ∀ n, ‖Z n‖ ≤ ρ) (W : Fin K → Rep h)
    (Y : Fin N → Fin K) (hY : IsBalanced Y) (r : ℝ) (hr : 0 < r) (hW : ∀ y, ‖W y‖ ≤ r) :
    Real.log (1 + ((K : ℝ) - 1) * Real.exp (-((K : ℝ) * ρ * r / ((K : ℝ) - 1)))) ≤
      ceLoss Z W Y ∧
    (ceLoss Z W Y =
        Real.log (1 + ((K : ℝ) - 1) * Real.exp (-((K : ℝ) * ρ * r / ((K : ℝ) - 1)))) ↔
      ∃ ζ : Fin K → Rep h, (∀ n, Z n = ζ (Y n)) ∧ IsSphereInscribedRegularSimplex ζ ρ ∧
        ∀ y, W y = (r / ρ) • ζ y) := by sorry

end SupConGeometry
Source
Graf, Hofer, Niethammer and Kwitt, Dissecting Supervised Contrastive Learning, ICML 2021, arXiv:2102.08817v4, Section 3.1, Corollary 1, p. 4; proof in Supplementary S2, p. 34; standing assumption K ≤ h+1 of Supplementary S2, p. 28
Read-back

What the Lean code literally says, in plain math · claude-opus-5-5

Setting. Fix natural numbers N,K,hN, K, hN,K,h with

K≥2,K≤h+1,N>0.K \ge 2, \qquad K \le h + 1, \qquad N > 0 .K≥2,K≤h+1,N>0.

Together these force h≥1h \ge 1h≥1. Work in Rh\mathbb{R}^hRh with its standard Euclidean inner product ⟨⋅,⋅⟩\langle\cdot,\cdot\rangle⟨⋅,⋅⟩ and norm ∥⋅∥\|\cdot\|∥⋅∥. The remaining data are:

  • Radius. A real number ρ>0\rho > 0ρ>0.
  • Points. A family z1,…,zN∈Rhz_1, \dots, z_N \in \mathbb{R}^hz1​,…,zN​∈Rh with ∥zn∥≤ρ\|z_n\| \le \rho∥zn​∥≤ρ for every nnn. The points need not be distinct, and they may lie strictly inside the ball.
  • Weights. A family w1,…,wK∈Rhw_1, \dots, w_K \in \mathbb{R}^hw1​,…,wK​∈Rh of weight vectors, thought of as the rows of a K×hK \times hK×h matrix WWW.
  • Labels. A labelling y:{1,…,N}→{1,…,K}y : \{1,\dots,N\} \to \{1,\dots,K\}y:{1,…,N}→{1,…,K}, with yny_nyn​ the label of nnn.
  • Weight bound. A real number r>0r > 0r>0 such that each weight vector individually satisfies ∥wy∥≤r\|w_y\| \le r∥wy​∥≤r for every yyy. This is a bound on each row separately, not on the Frobenius norm of WWW.

Balanced labels. The labelling is assumed balanced, meaning that for every class y∈{1,…,K}y \in \{1,\dots,K\}y∈{1,…,K},

K⋅#{n:yn=y}=N.K \cdot \#\{n : y_n = y\} = N .K⋅#{n:yn​=y}=N.

So KKK divides NNN and every class contains exactly N/K≥1N/K \ge 1N/K≥1 points. In particular, every class is nonempty.

Cross-entropy loss. The loss is

LCE(Z,W;Y)  =  1N∑n=1N−log⁡ ⁣(exp⁡⟨zn,wyn⟩∑l=1Kexp⁡⟨zn,wl⟩).L_{\mathrm{CE}}(Z,W;Y) \;=\; \frac{1}{N}\sum_{n=1}^{N} -\log\!\left(\frac{\exp\langle z_n, w_{y_n}\rangle}{\sum_{l=1}^{K}\exp\langle z_n, w_l\rangle}\right).LCE​(Z,W;Y)=N1​n=1∑N​−log(∑l=1K​exp⟨zn​,wl​⟩exp⟨zn​,wyn​​⟩​).

Every denominator here is strictly positive and N>0N > 0N>0, so no junk values arise.

The constant. Set

c  =  log⁡ ⁣(1+(K−1)exp⁡ ⁣(−KρrK−1)),c \;=\; \log\!\left(1 + (K-1)\exp\!\left(-\frac{K\rho r}{K-1}\right)\right),c=log(1+(K−1)exp(−K−1Kρr​)),

which is well defined since K−1≥1K - 1 \ge 1K−1≥1.

Claim. The theorem asserts two things.

  1. Lower bound. c≤LCE(Z,W;Y)c \le L_{\mathrm{CE}}(Z,W;Y)c≤LCE​(Z,W;Y).
  2. Equality case. LCE(Z,W;Y)=cL_{\mathrm{CE}}(Z,W;Y) = cLCE​(Z,W;Y)=c holds if and only if there exist vectors ζ1,…,ζK∈Rh\zeta_1, \dots, \zeta_K \in \mathbb{R}^hζ1​,…,ζK​∈Rh satisfying all of the following:
    • (a) every point equals the vector of its class, zn=ζynz_n = \zeta_{y_n}zn​=ζyn​​ for all nnn;

    • (b) the ζy\zeta_yζy​ form a "sphere-inscribed regular simplex of radius ρ\rhoρ", meaning:

      • ∑y=1Kζy=0\sum_{y=1}^K \zeta_y = 0∑y=1K​ζy​=0;
      • ∥ζy∥=ρ\|\zeta_y\| = \rho∥ζy​∥=ρ for every yyy;
      • there is a single real number ddd with ⟨ζy,ζy′⟩=d\langle \zeta_y, \zeta_{y'}\rangle = d⟨ζy​,ζy′​⟩=d for all y<y′y < y'y<y′.

      The value of ddd is only asserted to exist; it is not specified in the statement.

    • (c) each weight vector is the corresponding ζy\zeta_yζy​ rescaled, wy=rρ ζyw_y = \frac{r}{\rho}\,\zeta_ywy​=ρr​ζy​ for every yyy.

      In particular, at equality every ∥wy∥=r\|w_y\| = r∥wy​∥=r and every ∥zn∥=ρ\|z_n\| = \rho∥zn​∥=ρ.

Human review
  • Endorsed by Shuze Chen · Nov 24, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Xeroth · Nov 24, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me