Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 1 (proof of result 2, step 3): σd\sigma_dσd​ is the unique minimizer of eq. (13)

Proved
AlignmentUniformity.relaxed_uniform_unique_minimizer

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

contrastive-learningenergy-minimizationhypersphererepresentation-learninguniform-distribution

Let d≥0d\ge0d≥0 and τ>0\tau>0τ>0, and let Uμ(u)=∫Sdeu⊤v/τ dμ(v)U_\mu(u)=\int_{S^d}e^{u^\top v/\tau}\,d\mu(v)Uμ​(u)=∫Sd​eu⊤v/τdμ(v). Then σd\sigma_dσd​ is the unique minimizer of the relaxed problem (eq. 13):

∫Sdlog⁡Uσd dσd ≤ ∫Sdlog⁡Uμ dμfor every μ∈M(Sd),\int_{S^d}\log U_{\sigma_d}\,d\sigma_d\ \le\ \int_{S^d}\log U_\mu\,d\mu\qquad\text{for every }\mu\in\mathcal{M}(S^d),∫Sd​logUσd​​dσd​ ≤ ∫Sd​logUμ​dμfor every μ∈M(Sd),

with equality only if μ=σd\mu=\sigma_dμ=σd​.

For an encoder fff, the uniformity term of Theorem 1 equals this objective at the law of f(x)f(x)f(x), x∼pdatax\sim p_{\mathrm{data}}x∼pdata​. Result 2 of Theorem 1 follows.

Preamble
import Mathlib
import Definitions.Def_AlignmentUniformity_Basic

open MeasureTheory Filter Topology
Formal statement
namespace AlignmentUniformity

theorem relaxed_uniform_unique_minimizer (d : ℕ) {τ : ℝ} (hτ : 0 < τ) :
    ∀ μ : Measure (Vec (d + 1)), IsSphereProb μ →
      relaxedObjective τ (sphereUnif (d + 1)) ≤ relaxedObjective τ μ ∧
        (relaxedObjective τ μ = relaxedObjective τ (sphereUnif (d + 1)) →
          μ = sphereUnif (d + 1)) := 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.2, proof of Theorem 1, result 2, eq. (13) and step 3, eq. (16), pp. 21-23
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 τ>0\tau > 0τ>0. Work in the Euclidean space Rd+1\mathbb{R}^{d+1}Rd+1 with its standard inner product ⟨u,v⟩\langle u, v\rangle⟨u,v⟩ and Euclidean norm, and let Sd={x∈Rd+1:∥x∥=1}S^d = \{x \in \mathbb{R}^{d+1} : \|x\| = 1\}Sd={x∈Rd+1:∥x∥=1} be its unit sphere.

Admissible measures. A Borel measure μ\muμ on Rd+1\mathbb{R}^{d+1}Rd+1 counts as a probability measure on the sphere when both of the following hold:

  • μ(Rd+1)=1\mu(\mathbb{R}^{d+1}) = 1μ(Rd+1)=1;
  • μ(Rd+1∖Sd)=0\mu(\mathbb{R}^{d+1} \setminus S^d) = 0μ(Rd+1∖Sd)=0.

The uniform measure. σ\sigmaσ denotes the normalized surface measure on SdS^dSd, regarded as a Borel measure on Rd+1\mathbb{R}^{d+1}Rd+1. The surface measure is defined from Lebesgue measure by

A↦(d+1)⋅vol⁡{ rx:0<r<1, x∈A }(A⊆Sd).A \mapsto (d+1)\cdot \operatorname{vol}\{\, r x : 0 < r < 1,\ x \in A \,\} \qquad (A \subseteq S^d).A↦(d+1)⋅vol{rx:0<r<1, x∈A}(A⊆Sd).

σ\sigmaσ is this measure divided by its total mass and then pushed forward along the inclusion Sd↪Rd+1S^d \hookrightarrow \mathbb{R}^{d+1}Sd↪Rd+1.

In the degenerate case d=0d = 0d=0, the sphere S0S^0S0 is the two-point set {−1,1}⊂R\{-1, 1\} \subset \mathbb{R}{−1,1}⊂R, and σ\sigmaσ is the measure 12δ−1+12δ1\tfrac12\delta_{-1} + \tfrac12\delta_{1}21​δ−1​+21​δ1​.

The potential and the objective. For a measure μ\muμ and a point u∈Rd+1u \in \mathbb{R}^{d+1}u∈Rd+1, define the potential

Uμ(u)=∫Rd+1exp⁡ ⁣(⟨u,v⟩τ) dμ(v).U_\mu(u) = \int_{\mathbb{R}^{d+1}} \exp\!\Big(\frac{\langle u, v\rangle}{\tau}\Big)\, d\mu(v).Uμ​(u)=∫Rd+1​exp(τ⟨u,v⟩​)dμ(v).

The relaxed objective is

Jτ(μ)=∫Rd+1log⁡Uμ(u) dμ(u).J_\tau(\mu) = \int_{\mathbb{R}^{d+1}} \log U_\mu(u)\, d\mu(u).Jτ​(μ)=∫Rd+1​logUμ​(u)dμ(u).

These integrals follow total-function conventions:

  • Any integral whose integrand is not integrable is assigned the value 000.
  • log⁡0=0\log 0 = 0log0=0, and log⁡x=log⁡∣x∣\log x = \log|x|logx=log∣x∣ for x<0x < 0x<0.

The assertion. For every Borel measure μ\muμ on Rd+1\mathbb{R}^{d+1}Rd+1 that is a probability measure on SdS^dSd in the above sense, two things hold:

  1. The objective at σ\sigmaσ is at most the objective at μ\muμ:
Jτ(σ)≤Jτ(μ).J_\tau(\sigma) \le J_\tau(\mu).Jτ​(σ)≤Jτ​(μ).
  1. If the two values coincide, then μ\muμ equals σ\sigmaσ as a Borel measure on Rd+1\mathbb{R}^{d+1}Rd+1:
Jτ(μ)=Jτ(σ)  ⟹  μ=σ.J_\tau(\mu) = J_\tau(\sigma) \implies \mu = \sigma.Jτ​(μ)=Jτ​(σ)⟹μ=σ.

Thus σ\sigmaσ is asserted to be the unique minimizer of JτJ_\tauJτ​ among probability measures concentrated on SdS^dSd. This is claimed for every d≥0d \ge 0d≥0, including d=0d = 0d=0, and for every τ>0\tau > 0τ>0.

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