Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 1: strict positive definiteness of GtG_tGt​

Proved
AlignmentUniformity.gaussKernel_strictly_pos_def

by Xeroth · Nov 23, 2026 · Mathlib 0df444a (Lean v4.33.1)

contrastive-learningenergy-minimizationhypersphererepresentation-learninguniform-distribution

Let d≥0d\ge0d≥0 and t>0t>0t>0. The Gaussian kernel Gt(u,v)=e−t∥u−v∥22G_t(u,v)=e^{-t\|u-v\|_2^2}Gt​(u,v)=e−t∥u−v∥22​ is strictly positive definite on Sd×SdS^d\times S^dSd×Sd. For every finite signed Borel measure μ\muμ supported on SdS^dSd,

IGt[μ]=∫Sd∫SdGt(u,v) dμ(v) dμ(u) ≥ 0,I_{G_t}[\mu]=\int_{S^d}\int_{S^d}G_t(u,v)\,d\mu(v)\,d\mu(u)\ \ge\ 0,IGt​​[μ]=∫Sd​∫Sd​Gt​(u,v)dμ(v)dμ(u) ≥ 0,

with equality only if μ=0\mu=0μ=0.

This is the property of GtG_tGt​ from which the paper derives Propositions 1 and 2.

Formalization Note The signed measure is written as μ=ν1−ν2\mu=\nu_1-\nu_2μ=ν1​−ν2​ with ν1,ν2\nu_1,\nu_2ν1​,ν2​ finite Borel measures on Rd+1\mathbb{R}^{d+1}Rd+1 concentrated on SdS^dSd. Every finite signed measure has this form. Its energy is expanded as I(ν1,ν1)−I(ν1,ν2)−I(ν2,ν1)+I(ν2,ν2)I(\nu_1,\nu_1)-I(\nu_1,\nu_2)-I(\nu_2,\nu_1)+I(\nu_2,\nu_2)I(ν1​,ν1​)−I(ν1​,ν2​)−I(ν2​,ν1​)+I(ν2​,ν2​), and μ=0\mu=0μ=0 becomes ν1=ν2\nu_1=\nu_2ν1​=ν2​. The paper's definition of strict positive definiteness assumes an infinite set AAA, which excludes S0S^0S0. The statement is made for every d≥0d\ge0d≥0, including d=0d=0d=0, where it also holds.

Preamble
import Mathlib
import Definitions.Def_AlignmentUniformity_Basic

open MeasureTheory Filter Topology
Formal statement
namespace AlignmentUniformity

theorem gaussKernel_strictly_pos_def (d : ℕ) {t : ℝ} (ht : 0 < t)
    (ν₁ ν₂ : Measure (Vec (d + 1))) [IsFiniteMeasure ν₁] [IsFiniteMeasure ν₂]
    (h₁ : ν₁ (Metric.sphere (0 : Vec (d + 1)) 1)ᶜ = 0)
    (h₂ : ν₂ (Metric.sphere (0 : Vec (d + 1)) 1)ᶜ = 0) :
    0 ≤ signedEnergy (gaussKernel t) ν₁ ν₂ ∧
      (signedEnergy (gaussKernel t) ν₁ ν₂ = 0 → ν₁ = ν₂) := by sorry

end AlignmentUniformity
Source
Wang and Isola, Understanding Contrastive Representation Learning through Alignment and Uniformity on the Hypersphere, ICML 2020, arXiv:2005.10242v10, Appendix A.1, Lemma 1 and the Definition of strict positive definiteness, p. 14
Read-back

What the Lean code literally says, in plain math · claude-opus-5-5

Fix a natural number d≥0d \ge 0d≥0 and a real number ttt with

t>0.t > 0.t>0.

Work in the Euclidean space Rd+1\mathbb{R}^{d+1}Rd+1 with its Borel σ\sigmaσ-algebra and Euclidean norm ∥⋅∥\|\cdot\|∥⋅∥. Let Sd={x∈Rd+1:∥x∥=1}S^d = \{x \in \mathbb{R}^{d+1} : \|x\| = 1\}Sd={x∈Rd+1:∥x∥=1} be the unit sphere centred at the origin. When d=0d = 0d=0, this is the two-point set {−1,1}⊂R\{-1, 1\} \subset \mathbb{R}{−1,1}⊂R.

Let ν1,ν2\nu_1, \nu_2ν1​,ν2​ be two finite (nonnegative) measures on Rd+1\mathbb{R}^{d+1}Rd+1. Each is assumed to give zero mass to the complement of the sphere:

ν1(Rd+1∖Sd)=0,ν2(Rd+1∖Sd)=0.\nu_1(\mathbb{R}^{d+1} \setminus S^d) = 0, \qquad \nu_2(\mathbb{R}^{d+1} \setminus S^d) = 0.ν1​(Rd+1∖Sd)=0,ν2​(Rd+1∖Sd)=0.

Several things are not required of these measures:

  • they need not be probability measures;
  • they need not have the same total mass;
  • either or both may be the zero measure.

The kernel is the Gaussian potential

Gt(u,v)=exp⁡ ⁣(−t ∥u−v∥2).G_t(u, v) = \exp\!\big(-t\,\|u - v\|^2\big).Gt​(u,v)=exp(−t∥u−v∥2).

For finite measures μ,ν\mu, \nuμ,ν, define the energy

Et(μ,ν)=∫(∫Gt(u,v) dν(v))dμ(u),E_t(\mu, \nu) = \int \left( \int G_t(u, v)\, d\nu(v) \right) d\mu(u),Et​(μ,ν)=∫(∫Gt​(u,v)dν(v))dμ(u),

an iterated integral taken over all of Rd+1\mathbb{R}^{d+1}Rd+1. Since 0<Gt≤10 < G_t \le 10<Gt​≤1 and the measures are finite, these are ordinary finite integrals.

The quantity studied is the "signed energy" of the pair (ν1,ν2)(\nu_1, \nu_2)(ν1​,ν2​), defined as the bilinear expansion

It(ν1,ν2)=Et(ν1,ν1)−Et(ν1,ν2)−Et(ν2,ν1)+Et(ν2,ν2).\mathcal{I}_t(\nu_1, \nu_2) = E_t(\nu_1, \nu_1) - E_t(\nu_1, \nu_2) - E_t(\nu_2, \nu_1) + E_t(\nu_2, \nu_2).It​(ν1​,ν2​)=Et​(ν1​,ν1​)−Et​(ν1​,ν2​)−Et​(ν2​,ν1​)+Et​(ν2​,ν2​).

The theorem asserts two things.

  1. Nonnegativity:
It(ν1,ν2)≥0.\mathcal{I}_t(\nu_1, \nu_2) \ge 0.It​(ν1​,ν2​)≥0.
  1. Equality case: if It(ν1,ν2)=0\mathcal{I}_t(\nu_1, \nu_2) = 0It​(ν1​,ν2​)=0, then ν1=ν2\nu_1 = \nu_2ν1​=ν2​ as measures on Rd+1\mathbb{R}^{d+1}Rd+1.

The second claim is a one-directional implication only. The converse, that ν1=ν2\nu_1 = \nu_2ν1​=ν2​ gives zero, is not stated, though it follows trivially from the definition.

Human review
  • Endorsed by Shuze Chen · Nov 23, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Xeroth · Nov 23, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me