Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Theorem 1 — weak compactness of the Wasserstein ball

Proved
WassersteinLinOpt.Ball.ball_isCompact

by mikedeng1 · Oct 2, 2026 · Mathlib 0df444a (Lean v4.33.1)

distributionally-robust-optimizationmeasure-theoryoptimal-transportwasserstein

Throughout, (X,d)(X,d)(X,d) is a proper metric space (every closed ball is compact; such a space is complete and separable, hence Polish) with its Borel σ\sigmaσ-algebra, and p≥1p \ge 1p≥1, r>0r > 0r>0 are real.

Theorem 1 (Weak Compactness of Wasserstein Ball). If ν∈P(X)\nu\in\mathcal P(X)ν∈P(X) has a finite ppp-th moment, then the Wasserstein ball

Br(ν)={μ∈P(X):Wp(μ,ν)≤r}\mathcal B_r(\nu)=\{\mu\in\mathcal P(X):W_p(\mu,\nu)\le r\}Br​(ν)={μ∈P(X):Wp​(μ,ν)≤r}

is compact in the weak topology of P(X)\mathcal P(X)P(X).

Compactness is what makes the existence results of Sections 4 and 5 possible.

Formalization Note. P(X)\mathcal P(X)P(X) is Mathlib's ProbabilityMeasure X with its topology of convergence against bounded continuous functions, i.e. the paper's weak convergence (Definition 2). The paper's weak compactness is sequential (Definition 3); since P(X)\mathcal P(X)P(X) is metrizable (p. 1120) the two notions agree, and the statement uses IsCompact.

Preamble
import Mathlib
import Definitions.Def_WassersteinLinOpt_Ball_wassersteinBall
import Definitions.Def_WassersteinLinOpt_Ball_HasFinitePthMoment

open MeasureTheory
open scoped ENNReal NNReal
Formal statement
namespace WassersteinLinOpt.Ball

/-- Theorem 1 (Weak Compactness of Wasserstein Ball), p. 1109. On a proper metric space, the
Wasserstein ball `𝓑_r(ν)` is compact in the weak topology of `𝒫(X)` whenever `ν` has a
finite `p`-th moment. -/
theorem ball_isCompact {X : Type*} [MetricSpace X] [ProperSpace X]
    [MeasurableSpace X] [BorelSpace X] (p r : ℝ) (hp : 1 ≤ p) (hr : 0 < r)
    (ν : ProbabilityMeasure X) (hν : HasFinitePthMoment p (ν : Measure X)) :
    IsCompact (wassersteinBall p r ν) := by sorry

end WassersteinLinOpt.Ball
Source
Yue, Kuhn & Wiesemann, On linear optimization over Wasserstein balls, Math. Program. 195 (2022) 1107–1122, https://doi.org/10.1007/s10107-021-01673-8, p. 1109, Theorem 1
Read-back

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

Setting. XXX is a proper metric space with metric ddd, equipped with its Borel σ-algebra. The remaining data and hypotheses are:

  • real numbers ppp and rrr with p≥1p \ge 1p≥1 and r>0r > 0r>0;
  • a probability measure ν\nuν on XXX with a finite ppp-th moment, meaning some x0x_0x0​ has ∫d(x,x0)p dν<∞\int d(x,x_0)^p\,d\nu < \infty∫d(x,x0​)pdν<∞.

The statement. The set

Br(ν)={μ a probability measure on X:Wp(μ,ν)≤r}\mathcal{B}_r(\nu) = \{\mu \text{ a probability measure on } X : W_p(\mu,\nu) \le r\}Br​(ν)={μ a probability measure on X:Wp​(μ,ν)≤r}

is a compact subset of the space of probability measures on XXX.

  • The space of probability measures carries Mathlib's standard topology. This is the topology of weak convergence: the coarsest topology making μ↦∫h dμ\mu \mapsto \int h\,d\muμ↦∫hdμ continuous for every bounded continuous function h:X→[0,∞)h : X \to [0,\infty)h:X→[0,∞).
  • Wp(μ,ν)W_p(\mu,\nu)Wp​(μ,ν) is the 1/p1/p1/p-th power of the infimum over couplings γ\gammaγ of (μ,ν)(\mu,\nu)(μ,ν) of ∫d(x1,x2)p dγ\int d(x_1,x_2)^p\,d\gamma∫d(x1​,x2​)pdγ, computed in [0,+∞][0,+\infty][0,+∞].

Degenerate cases. The hypotheses exclude p<1p < 1p<1 and r≤0r \le 0r≤0. The finite-moment hypothesis forces XXX to be non-empty. Compactness includes the case where the ball is empty, but that case does not arise, because Wp(ν,ν)W_p(\nu,\nu)Wp​(ν,ν) is never examined here and only the compactness claim is made.

Human review
  • Endorsed by Shuze Chen · Oct 21, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 21, 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 paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me