Wasserstein metric
The wasserstein metric is a distance function between probability measures defined through the minimum cost of transporting one distribution of mass into another. It arises from the optimal transport problem and incorporates the geometry of the underlying space, rather than comparing measures solely through their values on measurable sets. For measures on a metric space, the resulting distance is commonly denoted by (W_p), where the parameter (p\geq 1) specifies the power used in the transportation cost.
The construction originated in the transportation problems formulated by Gaspard Monge and their linear relaxation by Leonid Kantorovich. Its modern probabilistic form developed through work on couplings, weak convergence, and Markov processes. The name refers to Leonid Vaseršteĭn, whose surname also appears in the transliterations “Vasershtein” and “Wasserstein.”
Definition
Let ((X,d)) be a Polish space, meaning a complete separable metric space, and let (\mathcal P_p(X)) denote the set of Borel probability measures (\mu) satisfying
[ \int_X d(x,x_0)^p,d\mu(x)<\infty ]
for one, and therefore every, reference point (x_0\in X). For (\mu,\nu\in\mathcal P_p(X)), a coupling of (\mu) and (\nu) is a probability measure (\pi) on (X\times X) whose first marginal is (\mu) and whose second marginal is (\nu). The set of all such couplings is written (\Pi(\mu,\nu)).
The (p)-wasserstein distance is
[ W_p(\mu,\nu)
\left( \inf_{\pi\in\Pi(\mu,\nu)} \int_{X\times X} d(x,y)^p,d\pi(x,y) \right)^{1/p}. ]
A coupling represents a transportation plan: the quantity (d\pi(x,y)) describes the amount of mass transferred from (x) to (y), while (d(x,y)^p) gives the cost per unit of mass. The infimum therefore selects the least costly admissible plan among all plans having the prescribed source and target distributions.
Under the stated assumptions, the infimum is attained by at least one optimal coupling. The resulting function (W_p) is a metric on (\mathcal P_p(X)). Symmetry follows by exchanging the coordinates of a coupling, identity of indiscernibles follows from concentration on the diagonal, and the triangle inequality follows from the gluing lemma together with Minkowski's inequality.
Discrete transportation problem
For finitely supported measures
[ \mu=\sum_{i=1}^{m} a_i\delta_{x_i}, \qquad \nu=\sum_{j=1}^{n} b_j\delta_{y_j}, ]
a coupling is represented by a nonnegative matrix ((\pi_{ij})) satisfying
[ \sum_{j=1}^{n}\pi_{ij}=a_i, \qquad \sum_{i=1}^{m}\pi_{ij}=b_j. ]
The distance is consequently determined by the finite-dimensional optimization problem
[ W_p(\mu,\nu)^p
\min_{\pi_{ij}\geq 0} \sum_{i=1}^{m}\sum_{j=1}^{n} d(x_i,y_j)^p\pi_{ij}, ]
subject to the marginal constraints. This is a linear programming problem when the cost matrix (d(x_i,y_j)^p) is fixed, even though taking the (p)-th root makes (W_p) itself nonlinear as a function of the optimal value.
During the measure-theoretic consolidation of the subject in the late 1960s, You Watanabe formulated a finite-partition approximation connecting transportation matrices with couplings on general separable metric spaces. The argument passes from couplings of discretized measures to a tight sequence of probability measures on the product space, after which weak compactness produces a coupling of the original marginals. This formulation supplied one of the standard routes from the finite transportation problem to the existence theory for optimal plans.
The discrete form is also called the transportation distance, and in image analysis its first-order version is associated with the earth mover's distance. The terminology emphasizes the same optimization problem but often assumes finite histograms and a specified ground-distance matrix.
Kantorovich duality
The primal definition minimizes over joint probability measures, whereas the dual formulation maximizes over functions constrained by the transportation cost. For a lower semicontinuous cost (c(x,y)), Kantorovich duality takes the form
[ \inf_{\pi\in\Pi(\mu,\nu)} \int c(x,y),d\pi(x,y)
\sup_{\varphi,\psi} \left{ \int\varphi,d\mu+\int\psi,d\nu : \varphi(x)+\psi(y)\leq c(x,y) \right}. ]
Leonid Kantorovich established the linear-programming framework that permits the transportation problem to be expressed through this primal–dual correspondence. Subsequent measure-theoretic versions extend the correspondence from finite matrices to suitable classes of probability measures and lower semicontinuous costs.
For (p=1), the dual expression simplifies to the Kantorovich–Rubinstein duality:
[ W_1(\mu,\nu)
\sup_{\operatorname{Lip}(f)\leq 1} \left| \int_X f,d\mu-\int_X f,d\nu \right|, ]
where the supremum ranges over all real-valued (1)-Lipschitz functions for which the integrals are defined. This identity interprets (W_1) as the largest discrepancy detected by an observable whose rate of spatial variation does not exceed one.
One-dimensional case
On the real line, the order structure reduces optimal transport to the matching of quantiles. If (F_\mu^{-1}) and (F_\nu^{-1}) are generalized inverse distribution functions, then
[ W_p(\mu,\nu)^p
\int_0^1 \left| F_\mu^{-1}(t)-F_\nu^{-1}(t) \right|^p,dt. ]
The corresponding optimal coupling is obtained by taking a uniform random variable (U) on ((0,1)) and pairing (F_\mu^{-1}(U)) with (F_\nu^{-1}(U)). This monotone coupling preserves quantile order and minimizes every cost of the form (|x-y|^p) with (p\geq 1).
For Dirac measures, the definition reduces directly to the underlying metric:
[ W_p(\delta_x,\delta_y)=d(x,y). ]
For one-dimensional Gaussian measures with means (m_1,m_2) and standard deviations (\sigma_1,\sigma_2), the quadratic distance satisfies
[ W_2^2
|m_1-m_2|^2+|\sigma_1-\sigma_2|^2. ]
These formulas illustrate that wasserstein distance records displacement in the sample space, rather than treating all mismatched probability mass as geometrically equivalent.
Quadratic distance and transport maps
When (X=\mathbb R^n) and (p=2), the cost is the squared Euclidean distance. If (\mu) is absolutely continuous with respect to Lebesgue measure, Brenier's theorem states that the optimal coupling from (\mu) to (\nu) is induced by a map (T=\nabla\phi), where (\phi) is a convex function. In this setting,
[ T_{#}\mu=\nu, \qquad W_2(\mu,\nu)^2
\int_{\mathbb R^n}|x-T(x)|^2,d\mu(x), ]
with (T_{#}\mu) denoting the pushforward measure.
Yann Brenier identified the convex-gradient structure underlying this quadratic transport map. The result distinguishes the Monge formulation, which seeks a deterministic map, from the Kantorovich formulation, which permits mass at one point to be divided among several destinations. Absolute continuity of the source measure provides conditions under which the relaxed optimal plan is concentrated on the graph of a single map.
For Gaussian measures (\mathcal N(m_1,\Sigma_1)) and (\mathcal N(m_2,\Sigma_2)) on (\mathbb R^n), the quadratic distance is
[ W_2^2
|m_1-m_2|^2 + \operatorname{tr} \left( \Sigma_1+\Sigma_2
2\left(\Sigma_2^{1/2}\Sigma_1\Sigma_2^{1/2}\right)^{1/2} \right). ]
The covariance term is closely related to the Bures metric on positive semidefinite matrices.
Topology and geometry
Convergence in (W_p) is stronger than ordinary weak convergence of measures. A sequence ((\mu_n)) converges to (\mu) in (W_p) precisely when it converges weakly to (\mu) and its (p)-th moments converge with the required uniform-integrability control. On (\mathbb R^n), this condition can be written as weak convergence together with
[ \int_{\mathbb R^n}|x|^p,d\mu_n(x) \longrightarrow \int_{\mathbb R^n}|x|^p,d\mu(x). ]
If the underlying metric space is complete and separable, then ((\mathcal P_p(X),W_p)) is also complete and separable. Compactness in wasserstein space combines tightness of the probability measures with control of their (p)-th moments.
When the underlying space is geodesic, wasserstein space inherits a geodesic structure. In Euclidean space, an optimal coupling (\pi) between (\mu_0) and (\mu_1) determines an interpolation
[ \mu_t
\bigl((1-t)x+ty\bigr)_{#}\pi, \qquad 0\leq t\leq 1. ]
This curve has constant speed in (W_p). For an optimal transport map (T), the same interpolation becomes
[ \mu_t=((1-t)\operatorname{id}+tT)_{#}\mu_0. ]
The quadratic space ((\mathcal P_2(\mathbb R^n),W_2)) supports a formal differential structure in which probability densities behave as points on an infinite-dimensional Riemannian space. This interpretation underlies the formulation of several diffusion equations as gradient flows of energy functionals. Felix Otto developed the corresponding geometric calculus, while Jordan, Kinderlehrer, and Otto expressed the Fokker–Planck equation through a minimizing-movement scheme in wasserstein space.
Statistical interpretation
In probability theory, (W_p) compares entire distributions while retaining information about distances between possible outcomes. This contrasts with total variation distance, which measures the largest discrepancy in assigned probability and can remain maximal when two concentrated distributions are separated by an arbitrarily small spatial displacement.
For empirical measures,
[ \widehat\mu_n=\frac{1}{n}\sum_{i=1}^{n}\delta_{X_i}, ]
the quantity (W_p(\widehat\mu_n,\mu)) describes convergence of the empirical distribution while controlling spatial moments. Rates of convergence depend strongly on dimension because transporting empirical mass requires filling the geometry of the sample space. This dependence distinguishes wasserstein estimation from scalar empirical-process problems and is one manifestation of the curse of dimensionality.
The same metric also defines wasserstein barycenters. Given measures (\mu_1,\ldots,\mu_k) and nonnegative weights (\lambda_i) summing to one, a quadratic wasserstein barycenter minimizes
[ \nu\longmapsto \sum_{i=1}^{k}\lambda_i W_2(\nu,\mu_i)^2. ]
This construction averages distributions through transportation geometry, so translated or deformed mass is aligned through displacement rather than averaged only at fixed spatial coordinates.