Theorem 4.1 (corrected constant): excess contrastive loss
ProvedSpectralContrastive.excess_contrastive_lossThere is a universal constant with the following property. Consider the finite data model, a hypothesis class of maps with for all and , where . Let be a minimizer of the population loss over all functions (Assumption 3.7). Let and . Draw a dataset i.i.d. from . Then, with probability at least , every minimizer of the empirical loss over satisfies
with and .
Formalization Note The paper prints . That is false: in Lemma D.3 (p. 38) the map is applied to with , so its Lipschitz constant is , not , and the corrected proof gives . For , a single point per natural datum and all functions bounded by , an empirical minimizer may take the value on unsampled points, and its excess loss grows like , which exceeds the printed bound for every constant once and are large. The constants and are written with one universal constant . The paper's is read as for odd , matching the disjoint pairs of the subsampling in Definition D.3. The conditions and are the domains of and in a nontrivial probability statement.
import Mathlib import Definitions.Def_SpectralContrastive_Basic open Matrix
namespace SpectralContrastive
theorem excess_contrastive_loss :
∃ C : ℝ, ∀ (Xbar X : Type) [Fintype Xbar] [Fintype X] [DecidableEq X] (k n : ℕ)
(P : Xbar → ℝ) (A : Xbar → X → ℝ), IsAugModel P A → 2 ≤ n →
∀ (F : Set (X → Fin k → ℝ)) (κ : ℝ), 0 < κ → (∀ f ∈ F, ∀ x i, |f x i| ≤ κ) →
∀ fstar ∈ F, (∀ f' : X → Fin k → ℝ, scLoss P A fstar ≤ scLoss P A f') →
∀ δ : ℝ, 0 < δ → δ < 1 →
1 - δ ≤ datasetProb P (fun d : Fin n → Xbar =>
∀ fhat ∈ F, (∀ f ∈ F, empLoss A d fhat ≤ empLoss A d f) →
scLoss P A fhat ≤ scLoss P A fstar +
C * (k ^ 2 * κ ^ 3 + k * κ) * rademacher F (n / 2) +
C * (k * κ ^ 2 + k ^ 2 * κ ^ 4) * (Real.sqrt (Real.log (2 / δ) / n) + δ)) := by sorry
end SpectralContrastiveRead-back
What the Lean code literally says, in plain math · claude-opus-5-5
There is a single real constant , fixed before any of the data below is chosen and not required to be positive, such that the following holds for every choice of the data.
Setting.
-
("natural data") and ("augmented data") are arbitrary finite types, with equality on decidable.
-
and are natural numbers with . The case is allowed.
-
and , written , form an augmentation model. This means:
- for all , and ;
- for all , and for every (including with );
- every has some with and .
These conditions force both and to be nonempty.
Function class.
- is any set of functions . Write for the -th coordinate and .
- is a real number with for every , every and every .
Population loss. For any , the population spectral contrastive loss is
- is an element of satisfying for every function . This is a global minimizer over all functions, not merely over .
- is a real number with .
Empirical loss. A dataset is a tuple . Its empirical loss of is
Rademacher complexity. Let , computed by natural-number division, so . Define
- The inner supremum is over pairs .
- When there are no such pairs, and the supremum is taken to be by convention.
Conclusion. Let be the event, on a dataset , that every minimizing over satisfies
where is the natural logarithm. The theorem asserts
That is, the probability of under i.i.d. draws from is at least .
Edge cases.
- If, for a given , no element of attains the minimum of over , the event holds vacuously for that .
- The last error term contains an additive alongside the square-root term.
- When , every loss is and both correction terms vanish.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.