Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma B.5 (as proved): lower bound for the cross-entropy loss and its equality case

Proved
NeuralCollapseUFM.ce_loss_lower_bound

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

cross-entropyneural-collapsesimplex-etfstrict-saddleunconstrained-feature-model

Let K≥2K\ge2K≥2, z∈RKz\in\mathbb{R}^Kz∈RK, k∈[K]k\in[K]k∈[K] and c1>0c_1>0c1​>0, and let c2=11+c1log⁡((1+c1)(K−1))+c11+c1log⁡1+c1c1c_2=\frac1{1+c_1}\log\big((1+c_1)(K-1)\big)+\frac{c_1}{1+c_1}\log\frac{1+c_1}{c_1}c2​=1+c1​1​log((1+c1​)(K−1))+1+c1​c1​​logc1​1+c1​​. Then

LCE(z,yk)≥11+c1 (∑i=1Kzi)−KzkK−1+c2,\mathcal L_{CE}(z,y_k)\ge\frac1{1+c_1}\,\frac{\big(\sum_{i=1}^Kz_i\big)-Kz_k}{K-1}+c_2,LCE​(z,yk​)≥1+c1​1​K−1(∑i=1K​zi​)−Kzk​​+c2​,

with equality if and only if zi=zjz_i=z_jzi​=zj​ for all i,j≠ki,j\ne ki,j=k and

c1=[(K−1)exp⁡((∑i=1Kzi)−KzkK−1)]−1.c_1=\Big[(K-1)\exp\Big(\frac{(\sum_{i=1}^Kz_i)-Kz_k}{K-1}\Big)\Big]^{-1}.c1​=[(K−1)exp(K−1(∑i=1K​zi​)−Kzk​​)]−1.

This is a lower bound for the cross-entropy that is linear in the logits; it drives the proof of Theorem 3.1.

Formalization Note The paper states that equality holds "when" these conditions hold. Its proof shows both directions, and Lemma B.4 uses the "only if" direction, so the equivalence is stated.

Preamble
import Mathlib
import Definitions.Def_NeuralCollapseUFM_Basic

open Matrix Filter Topology
Formal statement
namespace NeuralCollapseUFM

theorem ce_loss_lower_bound {K : ℕ} (hK : 2 ≤ K) (z : Fin K → ℝ) (k : Fin K) (c1 : ℝ)
    (hc1 : 0 < c1) :
    1 / (1 + c1) * ((∑ i, z i) - K * z k) / ((K : ℝ) - 1) + cTwo K c1 ≤ ceLoss z k ∧
    (ceLoss z k = 1 / (1 + c1) * ((∑ i, z i) - K * z k) / ((K : ℝ) - 1) + cTwo K c1 ↔
      (∀ i j, i ≠ k → j ≠ k → z i = z j) ∧
        c1 = (((K : ℝ) - 1) * Real.exp (((∑ i, z i) - K * z k) / ((K : ℝ) - 1)))⁻¹) := by sorry

end NeuralCollapseUFM
Source
Zhu, Ding, Zhou, Li, You, Sulam and Qu, A Geometric Analysis of Neural Collapse with Unconstrained Features, arXiv:2105.02375v1 (2021), Appendix B.2, Lemma B.5, eqs. (34)-(35), p. 36
Read-back

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

The statement concerns a natural number KKK with K≥2K \ge 2K≥2, an arbitrary real vector z=(z1,…,zK)∈RKz = (z_1, \dots, z_K) \in \mathbb{R}^Kz=(z1​,…,zK​)∈RK (the coordinates are indexed by the KKK classes), an arbitrary class index k∈{1,…,K}k \in \{1, \dots, K\}k∈{1,…,K}, and an arbitrary real number c1c_1c1​ with c1>0c_1 > 0c1​>0. Throughout, write

S=∑i=1Kzi.S = \sum_{i=1}^{K} z_i.S=i=1∑K​zi​.

The cross-entropy loss of zzz at label kkk is defined as

LCE(z,k)=−log⁡ ⁣(ezk∑i=1Kezi),\mathcal{L}_{\mathrm{CE}}(z, k) = -\log\!\left(\frac{e^{z_k}}{\sum_{i=1}^{K} e^{z_i}}\right),LCE​(z,k)=−log(∑i=1K​ezi​ezk​​),

which equals log⁡∑iezi−zk\log \sum_i e^{z_i} - z_klog∑i​ezi​−zk​. The denominator is a nonempty sum of positive terms, so no degenerate logarithm arises.

The constant c2c_2c2​ is defined as

c2(K,c1)=11+c1 log⁡((1+c1)(K−1))+c11+c1 log⁡ ⁣(1+c1c1).c_2(K, c_1) = \frac{1}{1+c_1}\,\log\big((1+c_1)(K-1)\big) + \frac{c_1}{1+c_1}\,\log\!\left(\frac{1+c_1}{c_1}\right).c2​(K,c1​)=1+c1​1​log((1+c1​)(K−1))+1+c1​c1​​log(c1​1+c1​​).

Under the hypotheses K≥2K \ge 2K≥2 and c1>0c_1 > 0c1​>0, both logarithm arguments are strictly positive.

The theorem asserts the conjunction of two claims.

  1. Lower bound. The following inequality holds:
11+c1⋅S−KzkK−1+c2(K,c1)  ≤  LCE(z,k).\frac{1}{1+c_1}\cdot\frac{S - K z_k}{K-1} + c_2(K, c_1) \;\le\; \mathcal{L}_{\mathrm{CE}}(z, k).1+c1​1​⋅K−1S−Kzk​​+c2​(K,c1​)≤LCE​(z,k).

Here S−Kzk=∑i≠k(zi−zk)S - K z_k = \sum_{i \ne k} (z_i - z_k)S−Kzk​=∑i=k​(zi​−zk​), and K−1≥1K - 1 \ge 1K−1≥1, so the division is genuine.

  1. Equality characterization. The inequality in (1) holds with equality if and only if both of the following are true:
    • all coordinates of zzz other than the kkk-th are equal, that is, zi=zjz_i = z_jzi​=zj​ for all i,ji, ji,j with i≠ki \ne ki=k and j≠kj \ne kj=k;
    • c1c_1c1​ equals the specific value
c1=1(K−1) exp⁡ ⁣(S−KzkK−1).c_1 = \frac{1}{(K-1)\,\exp\!\left(\dfrac{S - K z_k}{K-1}\right)}.c1​=(K−1)exp(K−1S−Kzk​​)1​.
 This value is always strictly positive and finite.

When K=2K = 2K=2, there is only one index i≠ki \ne ki=k, so the first equality condition holds automatically. In that case equality is characterized by the condition on c1c_1c1​ alone.

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