Proposition 6.2: blocks of similar points give a tighter surrogate
ProvedContrastiveUnsupervised.block_loss_sandwichLet be a countable set of latent classes with distribution , , let be the hinge or logistic loss, let , and let be measurable and bounded. With the block loss
where are i.i.d. from , are i.i.d. from , and ,
Here is the average binary supervised loss and uses one negative sample. Averaging over blocks gives a tighter surrogate than single pairs.
Formalization Note The block size and are implicit in the paper.
import Mathlib import Definitions.Def_ContrastiveUnsupervised_Basic open MeasureTheory Filter Topology universe u v
namespace ContrastiveUnsupervised
theorem block_loss_sandwich {X : Type*} [MeasurableSpace X] {C : Type*} [Countable C] {d : ℕ}
(D : C → Measure X) (ρ : C → ℝ) (hDρ : IsLatentClassModel D ρ) (hτ : collisionProb ρ < 1)
(hinge : Bool) (b : ℕ) (hb : 1 ≤ b) (f : X → Rep d) (R : ℝ) (hf : IsBoundedRep f R) :
avgSupLoss (stdLoss hinge) D ρ 1 f ≤
1 / (1 - collisionProb ρ) * (blockUnsupLoss hinge D ρ b f - collisionProb ρ) ∧
1 / (1 - collisionProb ρ) * (blockUnsupLoss hinge D ρ b f - collisionProb ρ) ≤
1 / (1 - collisionProb ρ) * (unsupLoss hinge D ρ 1 f - collisionProb ρ) := by sorry
end ContrastiveUnsupervisedRead-back
What the Lean code literally says, in plain math · claude-opus-5-5
Setting. The statement involves:
- a measurable space (the data space);
- a countable type (the latent classes);
- a dimension , with representations in carrying the Euclidean norm and inner product;
- a family of measures on ;
- a function ;
- a Boolean switch selecting the loss;
- a natural number ;
- a function ;
- a real number .
Hypotheses.
- Every is a probability measure, for all , and (so is a probability distribution on ).
- The collision probability satisfies . Equivalently, is not concentrated on a single class.
- .
- is measurable and for every . The number appears nowhere else, so this simply requires to be bounded and measurable.
The loss . It acts on a scalar (or on a family of scalars indexed by a single "other" index). If the switch is set to hinge, . Otherwise is the logistic loss .
Throughout, an integral of a non-integrable function is taken to be , and an infinite sum over classes that does not converge is taken to be .
Quantity 1: the average supervised loss on 2-way tasks. It is defined as
The sums run over ordered pairs of distinct classes. The supervised loss of a task is
Here:
- denotes the other element of ;
- is the uniform label weight ;
- the infimum is over all assignments of a vector to each class, i.e. over all linear classifiers.
Quantity 2: the block contrastive loss. It is defined as
The expectation is over independent samples and . The pair ranges over all of , including pairs with .
Quantity 3: the contrastive loss with one negative sample. It is defined as
The sampling is as follows:
- is drawn from the similar-pair distribution ;
- is drawn independently from .
Conclusion. The theorem asserts both inequalities
Since , the factor is positive. The second inequality is therefore equivalent to .
The statement holds for each fixed , for both choices of loss, and for every bounded measurable . No condition is placed on beyond boundedness and measurability.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.