Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Corollary 2: cross-entropy lower bound with L2L_2L2​ penalty

Proved
SupConGeometry.ce_loss_l2_penalty

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 λ>0\lambda>0λ>0 and let rW=rW(ρ,λ)>0r_{\mathcal W}=r_{\mathcal W}(\rho,\lambda)>0rW​=rW​(ρ,λ)>0 be the unique solution in xxx of 2λx−ρ/(exp⁡(KρxK−1)+K−1)=02\lambda x-\rho/(\exp(\frac{K\rho x}{K-1})+K-1)=02λx−ρ/(exp(K−1Kρx​)+K−1)=0. Then

LCE(Z,W;Y)+λ∥W∥F2 ≥ log⁡(1+(K−1)exp⁡(−ρKK−1rW))+λKrW2,\mathcal L_{CE}(Z,W;Y)+\lambda\|W\|_F^2\ \ge\ \log\Big(1+(K-1)\exp\Big(-\rho\frac{K}{K-1}r_{\mathcal W}\Big)\Big)+\lambda K r_{\mathcal W}^2,LCE​(Z,W;Y)+λ∥W∥F2​ ≥ log(1+(K−1)exp(−ρK−1K​rW​))+λKrW2​,

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-wd) wy=rWρζyw_y=\frac{r_{\mathcal W}}{\rho}\zeta_ywy​=ρrW​​ζy​ for all yyy.

So weight decay removes the need for an explicit norm constraint on the classifier: at the optimum the weights form a regular simplex of radius rW(ρ,λ)r_{\mathcal W}(\rho,\lambda)rW​(ρ,λ).

Preamble
import Mathlib
import Definitions.Def_SupConGeometry_Basic

open Finset
Formal statement
namespace SupConGeometry

theorem ce_loss_l2_penalty {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) (lam : ℝ) (hlam : 0 < lam) :
    Real.log (1 + ((K : ℝ) - 1) *
          Real.exp (-(ρ * ((K : ℝ) / ((K : ℝ) - 1)) * ceL2Radius K ρ lam))) +
        lam * (K : ℝ) * ceL2Radius K ρ lam ^ 2 ≤ ceLoss Z W Y + lam * frobNorm W ^ 2 ∧
    (ceLoss Z W Y + lam * frobNorm W ^ 2 =
        Real.log (1 + ((K : ℝ) - 1) *
            Real.exp (-(ρ * ((K : ℝ) / ((K : ℝ) - 1)) * ceL2Radius K ρ lam))) +
          lam * (K : ℝ) * ceL2Radius K ρ lam ^ 2 ↔
      ∃ ζ : Fin K → Rep h, (∀ n, Z n = ζ (Y n)) ∧ IsSphereInscribedRegularSimplex ζ ρ ∧
        ∀ y, W y = (ceL2Radius K ρ lam / ρ) • ζ y) := by sorry

end SupConGeometry
Source
Graf, Hofer, Niethammer and Kwitt, Dissecting Supervised Contrastive Learning, ICML 2021, arXiv:2102.08817v4, Section 3.1, Corollary 2, p. 5; proof in Supplementary S2, p. 35; 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

Fix natural numbers N,K,hN, K, hN,K,h and work in Rh\mathbb{R}^hRh with the standard Euclidean inner product ⟨⋅,⋅⟩\langle\cdot,\cdot\rangle⟨⋅,⋅⟩ and norm ∥⋅∥\|\cdot\|∥⋅∥. The theorem assumes the following:

  • K≥2K \ge 2K≥2 and K≤h+1K \le h+1K≤h+1;
  • N>0N > 0N>0;
  • a real number ρ>0\rho > 0ρ>0;
  • points z1,…,zN∈Rhz_1,\dots,z_N \in \mathbb{R}^hz1​,…,zN​∈Rh (the configuration ZZZ) with ∥zn∥≤ρ\|z_n\| \le \rho∥zn​∥≤ρ for every nnn;
  • arbitrary vectors w1,…,wK∈Rhw_1,\dots,w_K \in \mathbb{R}^hw1​,…,wK​∈Rh (the rows of WWW), with no constraint;
  • a labelling y1,…,yN∈{1,…,K}y_1,\dots,y_N \in \{1,\dots,K\}y1​,…,yN​∈{1,…,K} that is balanced. For every class yyy, the count mY(y)=∣{n:yn=y}∣m_Y(y) = |\{n : y_n = y\}|mY​(y)=∣{n:yn​=y}∣ satisfies K⋅mY(y)=NK\cdot m_Y(y) = NK⋅mY​(y)=N. So KKK divides NNN and every class occurs exactly N/KN/KN/K times.
  • a real number λ>0\lambda > 0λ>0.

The cross-entropy loss is

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

The Frobenius norm is ∥W∥F=(∑y=1K∥wy∥2)1/2\|W\|_F = \big(\sum_{y=1}^K \|w_y\|^2\big)^{1/2}∥W∥F​=(∑y=1K​∥wy​∥2)1/2, so ∥W∥F2=∑y∥wy∥2\|W\|_F^2 = \sum_y \|w_y\|^2∥W∥F2​=∑y​∥wy​∥2.

The quantity r=rW(ρ,λ)r = r_W(\rho,\lambda)r=rW​(ρ,λ) is defined as the infimum of the real solution set

S={x∈R:2λx−ρexp⁡ ⁣(Kρx/(K−1))+K−1=0}.S = \Big\{x \in \mathbb{R} : 2\lambda x - \frac{\rho}{\exp\!\big(K\rho x/(K-1)\big) + K - 1} = 0\Big\}.S={x∈R:2λx−exp(Kρx/(K−1))+K−1ρ​=0}.

The theorem itself asserts nothing about SSS: not that it is nonempty, not that it is bounded below, and not that it has a unique element. If SSS were empty or unbounded below, the infimum would take the default value r=0r = 0r=0.

Write

f(r)=log⁡ ⁣(1+(K−1)exp⁡ ⁣(−ρ KK−1 r))+λKr2.f(r) = \log\!\Big(1 + (K-1)\exp\!\Big(-\rho\,\tfrac{K}{K-1}\,r\Big)\Big) + \lambda K r^2.f(r)=log(1+(K−1)exp(−ρK−1K​r))+λKr2.

The theorem asserts two things:

  1. Lower bound.
f(r)≤LCE(Z,W;Y)+λ∥W∥F2.f(r) \le L_{CE}(Z,W;Y) + \lambda\|W\|_F^2.f(r)≤LCE​(Z,W;Y)+λ∥W∥F2​.
  1. Equality characterisation. Equality LCE(Z,W;Y)+λ∥W∥F2=f(r)L_{CE}(Z,W;Y) + \lambda\|W\|_F^2 = f(r)LCE​(Z,W;Y)+λ∥W∥F2​=f(r) 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:
    • zn=ζynz_n = \zeta_{y_n}zn​=ζyn​​ for every nnn, so all points of a class coincide with that class's vertex;
    • ζ1,…,ζK\zeta_1,\dots,\zeta_Kζ1​,…,ζK​ form a "sphere-inscribed regular simplex of radius ρ\rhoρ". By definition this means:
      • ∑yζy=0\sum_{y}\zeta_y = 0∑y​ζy​=0;
      • ∥ζy∥=ρ\|\zeta_y\| = \rho∥ζy​∥=ρ for every yyy;
      • there is some real ddd, otherwise unspecified, with ⟨ζy,ζy′⟩=d\langle\zeta_y,\zeta_{y'}\rangle = d⟨ζy​,ζy′​⟩=d for all y<y′y < y'y<y′;
    • wy=rρ ζyw_y = \dfrac{r}{\rho}\,\zeta_ywy​=ρr​ζy​ for every class yyy.

The statement holds for all ZZZ satisfying the norm bound and for all WWW. The value of rrr enters only through the infimum defined above.

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