Corollary 5.1.1 (as proved): competitive bound via intraclass concentration
ProvedContrastiveUnsupervised.competitive_bound_subgaussianLet the setting of Theorem 4.5 hold with the hinge loss: a countable set of classes with , a pointwise separable class of measurable representations with , and an empirical minimizer on tuples. There are absolute constants and such that, for every and , with probability at least over the training set, the following holds for every such that , , is -sub-Gaussian in every direction for every class and :
Here is the margin of Lemma 5.1 for , , , and .
Formalization Note The paper prints . Combining Lemma 5.1 with Theorem 4.5, as the paper does, gives , and the printed value is false (REPORT.md gives a counterexample). The sub-Gaussian hypothesis on , which the printed corollary leaves implicit in " as defined in Lemma 5.1", is stated explicitly. The paper's is an absolute constant , and "with probability at least " means that the outer measure of the failure set is at most . The statement is restricted to because the proof (Mohri et al., Theorem 3.1, and Hoeffding) produces and . These are only for bounded away from ; for the two forms agree up to the constant. Pointwise separability of and measurability of each are standing conventions the paper does not state. The hypothesis is implicit in the paper's division by .
import Mathlib import Definitions.Def_ContrastiveUnsupervised_Basic open MeasureTheory Filter Topology universe u v
namespace ContrastiveUnsupervised
theorem competitive_bound_subgaussian :
∃ K c' : ℝ, 0 < c' ∧
∀ {X : Type u} [MeasurableSpace X] {C : Type v} [Countable C] {d : ℕ}
(D : C → Measure X) (ρ : C → ℝ), IsLatentClassModel D ρ → collisionProb ρ < 1 →
∀ (R : ℝ), 0 < R →
∀ (F : Set (X → Rep d)), (∀ f ∈ F, IsBoundedRep f R) → IsPointwiseSeparable F →
∀ (M : ℕ), 1 ≤ M →
∀ (fhat : (Fin M → X × X × (Fin 1 → X)) → X → Rep d),
(∀ S, fhat S ∈ F ∧ ∀ f ∈ F, empUnsupLoss true 1 (fhat S) S ≤ empUnsupLoss true 1 f S) →
∀ ε : ℝ, 0 < ε → ∀ δ : ℝ, 0 < δ → δ ≤ 1 / 2 →
sampleMeasure D ρ 1 M {S | ¬ ∀ f ∈ F, ∀ (σ Rf : ℝ), 0 ≤ σ → IsSubGaussianRep D f σ →
(∀ x, ‖f x‖ ≤ Rf) →
avgMeanSupLoss (stdLoss true) D ρ 1 (fhat S) ≤
subGaussianMargin Rf σ ε *
avgMeanSupLoss (marginHingeLoss (subGaussianMargin Rf σ ε)) D ρ 1 f +
c' * (collisionProb ρ / (1 - collisionProb ρ)) * intraclassDeviation D ρ f +
1 / (1 - collisionProb ρ) * genError K R 1 M (rademacherAvg F S) δ + ε} ≤
ENNReal.ofReal δ := by sorry
end ContrastiveUnsupervisedRead-back
What the Lean code literally says, in plain math · claude-opus-5-5
There exist real constants and , with and no sign condition on , such that the following holds. The constants are chosen once, before and independently of everything below: the spaces, the dimension, the distributions, the function class, the sample size, and .
Setting and hypotheses. Let the following be given.
- is a measurable space (the data space).
- is a countable set (the latent classes).
- , and representations take values in with the Euclidean norm and inner product. The case is allowed.
- is a family of probability measures on .
- satisfies for all and (as an unconditionally convergent sum). This forces , and hence .
- The collision probability satisfies .
- is a real number.
- is a set of functions , each of which is measurable and satisfies for all .
- is pointwise separable: there is a countable such that every is the pointwise limit of some sequence in .
- is an integer (the sample size).
- assigns to every sample a function with two properties:
- ;
- minimizes the empirical hinge contrastive loss over , that is, for all , where
- This must hold for every sample , with no measurability required of . Since , it forces .
- and .
Conclusion. Draw from , where
Each sample point is with and an independent .
Consider the set of samples for which there exist and reals and satisfying both of the following:
- for all ;
- is -sub-Gaussian in every direction for every class, meaning:
- for every and every unit vector , is -integrable for all real ;
- and for all real .
- This is vacuous when .
and yet the following inequality fails:
The theorem asserts that the outer measure of this set of samples is at most . No measurability of the set is asserted. Equivalently, the inequality holds simultaneously for all admissible triples , except on a set of outer probability at most .
Meaning of the symbols.
-
Class means. .
-
Margin. is defined by
-
The square root of a negative number is taken to be . For example, this happens when .
-
Since and , we always have .
-
depends on the bound chosen for , not on .
-
Mean-classifier supervised loss on 2-way tasks. For a loss on real numbers, define
- The sums run over ordered pairs of distinct classes. The denominator equals .
- For a task ,
where $c'$ denotes the other element of $T$.
-
uses the hinge loss .
-
uses the margin hinge loss .
-
Intraclass deviation.
-
is the covariance matrix of under .
-
is the spectral (operator) norm.
-
Rademacher average of on .
where .
- Generalization term. It uses the global bound , not , and the constant . A term, which equals here, has already been dropped from the display above.
Conventions and edge cases.
- Integrals of non-integrable functions are taken to be , and divergent infinite sums are taken to be .
- Suprema over sets that are unbounded above or empty are taken to be . Here is bounded by and nonempty.
- Since , we have .
- Because may be negative or zero, the generalization term may be nonpositive.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.