Proposition 3.1 (as proved): mean and variance of the dot product of uniform unit vectors
ProvedContrastiveDuality.sphere_inner_mean_varLet , and let be independent random vectors on a probability space, each uniformly distributed on the unit sphere . Then
Formalization Note Proposition 3.1 is printed as a claim about the embeddings to which SimCLR and DCL lead with infinitely many negative samples. Its proof cites Theorem 1 of Wang and Isola (2020) for the fact that these embeddings are uniformly distributed on the sphere, and then computes the two moments. The cited asymptotic optimisation result is not a precise statement about finite objects, so the statement formalised is what the proof establishes after that citation: the moments of the dot product of two independent uniform unit vectors. The case , which the proof's route through Lemma C.1 does not cover, also satisfies the conclusion and is included because the printed proposition has no restriction on .
import Mathlib import Definitions.Def_ContrastiveDuality_Basic open MeasureTheory ProbabilityTheory Matrix
namespace ContrastiveDuality
theorem sphere_inner_mean_var {M : ℕ} (hM : 1 ≤ M) {Ω : Type*} [MeasurableSpace Ω]
(P : Measure Ω) [IsProbabilityMeasure P] (X Y : Ω → EuclideanSpace ℝ (Fin M))
(hX : Measurable X) (hY : Measurable Y)
(hXlaw : P.map X = uniformSphere M) (hYlaw : P.map Y = uniformSphere M)
(hXY : IndepFun X Y P) :
∫ ω, inner ℝ (X ω) (Y ω) ∂P = 0 ∧
variance (fun ω => inner ℝ (X ω) (Y ω)) P = 1 / (M : ℝ) := by sorry
end ContrastiveDualityRead-back
What the Lean code literally says, in plain math · claude-opus-5-5
Let be a natural number with . Let be an arbitrary measurable space carrying a probability measure . Let
be two measurable maps into -dimensional Euclidean space, which carries its standard inner product .
The law . The theorem assumes that both and have law , meaning and . Here is a measure on , defined as follows.
- Let be the surface measure on the unit sphere that is induced from Lebesgue measure on . Concretely, a set receives times the Lebesgue volume of the cone .
- Regard as a measure on that is supported on .
- Set
with the extended-real conventions and .
When , is the rotation-invariant uniform probability measure on . If that total mass were or , the normalisation would not yield a probability measure, and the two law hypotheses could not hold.
In the case , the sphere is the two-point set .
Independence. The theorem also assumes that and are independent random variables under .
Conclusion. Under these hypotheses, the real random variable
satisfies both of the following:
Conventions behind the conclusion.
- The expectation is the Bochner integral, which by convention takes the value for a non-integrable function.
- The variance is the real number obtained from . By convention it takes the value if that extended-real quantity is .
- is computed as real division, and is assumed.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.