Lemma 4.4: the same-class loss is controlled by the intraclass deviation
ProvedContrastiveUnsupervised.same_class_loss_le_deviationThere is an absolute constant such that for every latent class model ( a distribution on a countable set of classes, the class distributions), either loss (hinge or logistic), and every measurable bounded ,
Here with , and is the intraclass deviation.
Formalization Note The constant is universal, as in the paper's use of the lemma in Theorem 4.5.
import Mathlib import Definitions.Def_ContrastiveUnsupervised_Basic open MeasureTheory Filter Topology universe u v
namespace ContrastiveUnsupervised
theorem same_class_loss_le_deviation :
∃ c' : ℝ, 0 < c' ∧
∀ {X : Type u} [MeasurableSpace X] {C : Type v} [Countable C] {d : ℕ}
(D : C → Measure X) (ρ : C → ℝ), IsLatentClassModel D ρ →
∀ (hinge : Bool) (f : X → Rep d) (R : ℝ), IsBoundedRep f R →
unsupLossEq hinge D ρ f - 1 ≤ c' * intraclassDeviation D ρ f := by sorry
end ContrastiveUnsupervisedRead-back
What the Lean code literally says, in plain math · claude-opus-5-5
The statement asserts that there is a single real constant such that the inequality below holds in every setting of the following kind:
- is any type of data points with a -algebra.
- is any countable type of "latent classes".
- is any dimension, including .
- assigns a measure on to each class.
- is a real-valued function on the classes.
The constant is chosen once, before all of these, so it may not depend on , , , , , the loss choice, or .
Hypotheses. The pair is required to be a latent class model:
- every is a probability measure;
- for every ;
- is summable with sum exactly .
Then, for every Boolean switch selecting the loss (hinge or logistic), every map and every real , the statement assumes that is measurable and for all (Euclidean norm).
Some consequences of these hypotheses:
- must be nonempty, since an empty sum cannot equal .
- must be nonempty, since a probability measure on an empty space cannot exist.
- So the bound forces .
- itself does not appear in the conclusion; it only guarantees that is bounded.
The loss. With one negative sample, the scalar loss of a score is
Collision probability. Write .
Same-class unsupervised loss. The quantity on the left is
Here , and the single negative sample are all drawn independently from the same class distribution .
Intraclass deviation. The quantity on the right is
built from the following pieces:
- is the class mean.
- is the matrix with entries
that is, the covariance of under .
- is the spectral (operator) norm of a matrix acting on Euclidean .
Conventions. The definitions use these default values in degenerate cases:
- an expectation of a non-integrable function is taken to be ;
- a non-summable sum over is taken to be ;
- division by gives ;
- the square root of a negative number is .
Conclusion. Under all the hypotheses above,
Edge case . Here is identically , every score is , and for both losses. So the left side is and .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.