Lemma 3: outer lower bound on the supervised contrastive loss
ProvedSupConGeometry.supcon_outer_boundThroughout, with , the batch size is , , and every lies on the sphere (standing assumptions of Supplementary S1).
For every labelling and every on the sphere,
with equality if and only if
- (A1) there is with whenever (including ), and
- (A2) there is with whenever .
It combines Lemma 1 with Jensen's inequality for over all triples with , .
Formalization Note A term with is read as (Lean's makes its factor ). The paper leaves this expression undefined. It occurs only when , or for when uses a single label.
import Mathlib import Definitions.Def_SupConGeometry_Basic open Finset
namespace SupConGeometry
theorem supcon_outer_bound {N K h b : ℕ} (hKh : K ≤ h + 1) (hb : 3 ≤ b)
(ρ : ℝ) (hρ : 0 < ρ) (Z : Fin N → Rep h) (hZ : ∀ n, ‖Z n‖ = ρ) (Y : Fin N → Fin K) :
(∑ l ∈ Icc 2 b, (l : ℝ) * (batchCountTotal Y b l : ℝ) *
Real.log ((l : ℝ) - 1 + ((b : ℝ) - l) *
Real.exp ((1 / (batchCountTotal Y b l : ℝ)) *
∑ y, ∑ B ∈ batchesWithCount Y b y l, sAux Z Y B y))) ≤ scLoss Z Y b ∧
(scLoss Z Y b =
∑ l ∈ Icc 2 b, (l : ℝ) * (batchCountTotal Y b l : ℝ) *
Real.log ((l : ℝ) - 1 + ((b : ℝ) - l) *
Real.exp ((1 / (batchCountTotal Y b l : ℝ)) *
∑ y, ∑ B ∈ batchesWithCount Y b y l, sAux Z Y B y)) ↔
(∃ α : ℝ, ∀ n m : Fin N, Y n = Y m → inner ℝ (Z n) (Z m) = α) ∧
(∃ β : ℝ, ∀ n m : Fin N, Y n ≠ Y m → inner ℝ (Z n) (Z m) = β)) := by sorry
end SupConGeometryRead-back
What the Lean code literally says, in plain math · claude-opus-5-5
Setting. Fix natural numbers (number of points), (number of labels), (dimension) and (batch size), with
Fix a real number and points with Euclidean norm for every . Fix any labelling , written .
No further assumptions are made:
- the labels need not be balanced;
- not every label needs to occur;
- is allowed;
- may exceed .
If and , no labelling exists, so the statement is vacuous in that case.
Batches. A batch is a multiset of exactly indices from , with repetitions allowed. denotes the finite set of all such multisets; it is empty if . For a batch and a label :
- is the sub-multiset of entries with , kept with multiplicity.
- is the sub-multiset of entries with .
- denotes multiset cardinality.
- means with one copy of removed.
The supervised contrastive loss. It is
where all sums over a multiset count multiplicity and
The summand for is when . If is empty, .
Auxiliary quantities. For :
- .
- , summed over all labels.
- For a batch and label , , where
- if , and otherwise
For and , none of these denominators vanish. Define
When , the factor is interpreted as ; that term is then anyway because of the prefactor . The argument of the logarithm is always at least .
Claim. Under these hypotheses, both of the following hold:
-
Bound: .
-
Equality case: if and only if both:
- there is a real such that for all pairs with , including ;
- there is a real such that for all pairs with .
Edge cases of the equality condition.
- Because the same-label condition includes , whenever it forces . Together with , this means whenever . So the condition literally says that same-label points coincide and all differently-labelled pairs share one common inner product.
- The -condition is vacuous if at most one label occurs.
- Both conditions are vacuous if .
Unused hypotheses. The hypotheses and appear only as assumptions. No regular-simplex or balance condition appears anywhere in the statement.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.