Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Section 3.3: the diversity condition with a fixed set of KKK classes needs K≥M+1K \ge M+1K≥M+1

Proved
LinearIdentifiability.diversity_requires_enough_classes

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

identifiabilitylinear-algebrarepresentation-learningsoftmax-models

Let M≥1M\ge1M≥1, let g:Y→RMg:Y\to\mathbb R^Mg:Y→RM, and let S⊆YS\subseteq YS⊆Y be a finite set of KKK classes. If there are MMM tuples (yA(i),yB(i))(y_A^{(i)},y_B^{(i)})(yA(i)​,yB(i)​) of elements of SSS such that the matrix LLL with columns g(yA(i))−g(yB(i))g(y_A^{(i)})-g(y_B^{(i)})g(yA(i)​)−g(yB(i)​) is invertible, then

K≥M+1.K\ge M+1.K≥M+1.

In supervised classification, where SSS is the fixed set of all KKK labels, the diversity condition can therefore only hold when there are more classes than embedding dimensions.

Formalization Note The paper phrases this as the number of classes needed to generate MMM difference vectors g(y(1))−g(y(j))g(y^{(1)})-g(y^{(j)})g(y(1))−g(y(j)); the statement allows arbitrary tuples in SSS, which includes that case. The hypothesis M≥1M\ge1M≥1 excludes the degenerate case M=0M=0M=0, S=∅S=\emptysetS=∅.

Preamble
import Mathlib
import Definitions.Def_LinearIdentifiability_Basic

open Matrix
Formal statement
namespace LinearIdentifiability

theorem diversity_requires_enough_classes {Y : Type*} {M : ℕ} (hM : 0 < M)
    (g : Y → Fin M → ℝ) (S : Finset Y) (a b : Fin M → Y)
    (ha : ∀ i, a i ∈ S) (hb : ∀ i, b i ∈ S) (hL : IsUnit (diffMatrix g a b).det) :
    M + 1 ≤ S.card := by sorry

end LinearIdentifiability
Source
Roeder, Metz and Kingma, On Linear Identifiability of Learned Representations, arXiv:2007.00810v3 (2020), Section 3.3, Discussion of Diversity Condition, p. 5
Read-back

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

Let YYY be an arbitrary type (a set of "targets" or class labels, with no structure assumed) and let MMM be a natural number with M>0M > 0M>0. The theorem takes the following data:

  • a function g:Y→RMg : Y \to \mathbb{R}^Mg:Y→RM, assigning to each y∈Yy \in Yy∈Y a real vector g(y)=(g(y)0,…,g(y)M−1)g(y) = (g(y)_0, \dots, g(y)_{M-1})g(y)=(g(y)0​,…,g(y)M−1​);
  • a finite subset S⊆YS \subseteq YS⊆Y;
  • two MMM-tuples of elements of YYY, a=(a0,…,aM−1)a = (a_0, \dots, a_{M-1})a=(a0​,…,aM−1​) and b=(b0,…,bM−1)b = (b_0, \dots, b_{M-1})b=(b0​,…,bM−1​), indexed by i∈{0,…,M−1}i \in \{0, \dots, M-1\}i∈{0,…,M−1}.

It assumes:

  1. every aia_iai​ belongs to SSS;
  2. every bib_ibi​ belongs to SSS;
  3. the M×MM \times MM×M real matrix LLL whose iii-th column is the difference vector g(ai)−g(bi)g(a_i) - g(b_i)g(ai​)−g(bi​) is invertible. Explicitly, its entries are
Lj,i=g(ai)j−g(bi)j,j,i∈{0,…,M−1},L_{j,i} = g(a_i)_j - g(b_i)_j, \qquad j, i \in \{0, \dots, M-1\},Lj,i​=g(ai​)j​−g(bi​)j​,j,i∈{0,…,M−1},

and the assumption is det⁡L≠0\det L \neq 0detL=0.

Under these hypotheses the theorem concludes that SSS has at least M+1M+1M+1 elements:

∣S∣≥M+1.|S| \ge M + 1.∣S∣≥M+1.

Several points about the scope of the statement:

  • What the tuples may contain. The tuples aaa and bbb are not required to be injective, and an aia_iai​ may coincide with some bjb_jbj​. If ai=bia_i = b_iai​=bi​ for some iii, the iii-th column of LLL is zero and det⁡L=0\det L = 0detL=0, so hypothesis 3 rules out that case.
  • What is not involved. No probability distribution, data distribution, representation fff, or model probability appears. The only objects are ggg, SSS, aaa and bbb, and the only link between SSS and ggg is that all ai,bia_i, b_iai​,bi​ lie in SSS.
  • The case M=0M = 0M=0. This case is excluded by the hypothesis M>0M > 0M>0. For M=0M = 0M=0, the empty 0×00 \times 00×0 matrix has determinant 111, so hypothesis 3 would hold trivially, while the conclusion ∣S∣≥1|S| \ge 1∣S∣≥1 could fail for S=∅S = \emptysetS=∅.
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