Skip to content
Is the Normal Distribution Curved?Chapter 5 The Wasserstein Distance

Chapter 5 The Wasserstein Distance

In this chapter we put a second geometry on the set of Gaussians: the Wasserstein distance, which measures how far apart two distributions are by the cost of transporting mass from one to the other. We mainly use measure-theoretic probability, the Gaussians of Chapter 1 (Definition 1.1), and the Riemannian metrics and distances of Chapter 2. The definition of the Wasserstein distance also appears in Why Pictures Emerge from Noise [KEI26b], but we restate what we need here. In this chapter we show the following.

  • •

    A formula for the Wasserstein distance between Gaussians in terms of their means and covariance matrices (Theorem 5.4).

  • •

    For d=1, the upper half-plane ℍ carries the Euclidean distance (Corollary 5.5).

  • •

    The displacement interpolation joining two Gaussians (Proposition 5.7).

  • •

    The Riemannian metric gW derived from the kinetic energy of Gaussians (Definition 5.11).

We do not treat the general theory of optimal transport. The existence of optimal couplings for general probability measures, the fact that 𝒲2 satisfies the axioms of a distance, the duality theorem and so on are not proved in this book. They can be found in Takatsu’s book [TAK26] (in Japanese), Villani’s book [VIL03] and Santambrogio’s book [SAN15].

History

The problem of minimising the cost of transporting mass goes back to Monge’s 1781 paper [MON81]. Kantorovich’s 1942 paper [KAN42] belongs to the same line. The formula for 𝒲2 between Gaussians (Theorem 5.4) was given independently in 1982 by Dowson and Landau [DL82] and by Olkin and Pukelsheim [OP82]. Givens and Shortt [GS84] also discussed it in 1984.

5.1 Couplings and the Wasserstein Distance

A probability measure on ℝd means a probability measure on the Borel σ-algebra.

Definition 5.1 (Coupling).

Let μ,ν be probability measures on ℝd. A probability measure π on ℝd×ℝd whose push-forwards to the first and second factors are μ and ν is called a coupling (joint law) of μ and ν. Equivalently, a pair (X,Y) of random variables on some probability space with X∼μ and Y∼ν is also called a coupling; then π=Law⁡(X,Y).

Couplings always exist. For example, the product measure μ⊗ν, that is, the pair of independent X∼μ and Y∼ν, is a coupling. In general there are many couplings, and each specifies how X and Y are tied together.

We write P2⁢(ℝd) for the set of probability measures μ on ℝd with ∫|x|2⁢𝑑μ⁢(x)<∞. For μ∈P2⁢(ℝd) the mean m=∫x⁢𝑑μ⁢(x) and the covariance matrix ∫(x−m)⁢(x−m)⊤⁢𝑑μ⁢(x) are finite. The Gaussian 𝒩⁢(m,Σ) belongs to P2⁢(ℝd), with mean m and covariance matrix Σ.

Definition 5.2 (Wasserstein distance).

For μ,ν∈P2⁢(ℝd) we put

𝒲2⁢(μ,ν)=inf{(𝔼⁢|X−Y|2)1/2:(X,Y)⁢ is a coupling of ⁢μ⁢ and ⁢ν}

and call it the Wasserstein distance.

Since 𝔼⁢|X−Y|2=∫|x−y|2⁢𝑑π⁢(x,y) depends only on π=Law⁡(X,Y), we may regard the infimum as taken over couplings π of μ and ν. For the product coupling, 𝔼⁢|X−Y|2≤2⁢𝔼⁢|X|2+2⁢𝔼⁢|Y|2<∞, so 𝒲2⁢(μ,ν) is finite. By definition, every coupling (X,Y) of μ and ν satisfies

𝒲2⁢(μ,ν)2≤𝔼⁢|X−Y|2. (5.1)

To compute 𝒲2, it suffices to prove the reverse inequality and find a coupling that attains the infimum. The next section carries this out for Gaussians.

Remark 5.3.

𝒲2 is a distance on P2⁢(ℝd) (not proved in this book). That is, 𝒲2⁢(μ,ν)=0 if and only if μ=ν, and symmetry and the triangle inequality hold. Symmetry follows immediately from the definition. See [VIL03] and [TAK26]. In this chapter we use this fact only in the remark after Proposition 5.7.

5.2 The Distance Between Gaussians

Let μ,ν∈P2⁢(ℝd) have means m1,m2 and covariance matrices Σ1,Σ2. For a coupling (X,Y) of μ and ν, define the cross-covariance matrix

Cov⁡(X,Y)=𝔼⁢[(X−m1)⁢(Y−m2)⊤].

Split X−Y=(m1−m2)+((X−m1)−(Y−m2)). The second term has mean 0, so the cross term vanishes in expectation when we expand. Also 𝔼⁢|X−m1|2=tr⁡Σ1, 𝔼⁢|Y−m2|2=tr⁡Σ2 and 𝔼⁢[(X−m1)⋅(Y−m2)]=tr⁡Cov⁡(X,Y). Hence

𝔼⁢|X−Y|2=|m1−m2|2+tr⁡Σ1+tr⁡Σ2−2⁢tr⁡Cov⁡(X,Y). (5.2)

The means and covariance matrices are determined by μ,ν, so the choice of coupling affects only tr⁡Cov⁡(X,Y). Computing 𝒲2 thus becomes the problem of maximising tr⁡Cov⁡(X,Y).

From now on, for a positive definite symmetric matrix A we write A1/2 for its positive definite symmetric square root and A−1/2 for the inverse of that.

Theorem 5.4 (The Wasserstein distance between Gaussians).

Let m1,m2∈ℝd and Σ1,Σ2∈Symd+, and put

R=(Σ11/2⁢Σ2⁢Σ11/2)1/2,T=Σ1−1/2⁢R⁢Σ1−1/2. (5.3)

Then T is a positive definite symmetric matrix satisfying T⁢Σ1⁢T=Σ2.

  1. 1.

    Let μ,ν∈P2⁢(ℝd) have means m1,m2 and covariance matrices Σ1,Σ2. Every coupling (X,Y) of μ and ν satisfies

    𝔼⁢|X−Y|2≥|m1−m2|2+tr⁡Σ1+tr⁡Σ2−2⁢tr⁡R,

    with equality if and only if Cov⁡(X,Y)=Σ1⁢T.

  2. 2.

    Let X∼𝒩⁢(m1,Σ1) and put Y=m2+T⁢(X−m1). Then Y∼𝒩⁢(m2,Σ2), and the coupling (X,Y) attains equality in (1). Consequently

    𝒲2⁢(𝒩⁢(m1,Σ1),𝒩⁢(m2,Σ2))2 (5.4)
    =|m1−m2|2+trΣ1+trΣ2−2tr(Σ11/2Σ2Σ11/2)1/2,

    and the infimum in Definition 5.2 is attained by this coupling.

For d=1 and Σi=σi2 (σi>0) we have R=σ1⁢σ2 and T=σ2/σ1. The coupling of (2) stretches X about its mean by the factor σ2/σ1 and then translates it. By (1), an optimal coupling between Gaussians, that is, a coupling attaining equality in (1), has the uniquely determined cross-covariance matrix Σ1⁢T.

The following proof establishes the properties of T, part (2), and part (1) for d=1. The proof of (1) for d≥2 is given afterwards, marked with ★.

Proof.

First we prove the properties of T. Since R is positive definite and symmetric, so is T=Σ1−1/2⁢R⁢Σ1−1/2. Also T⁢Σ1⁢T=Σ1−1/2⁢R⁢Σ1−1/2⁢Σ1⁢Σ1−1/2⁢R⁢Σ1−1/2=Σ1−1/2⁢R2⁢Σ1−1/2=Σ2.

Next, assuming (1), we prove (2). Since Y is an affine transformation of the Gaussian X, it is Gaussian, with mean m2 and covariance matrix T⁢Σ1⁢T⊤=T⁢Σ1⁢T=Σ2. So (X,Y) is a coupling of 𝒩⁢(m1,Σ1) and 𝒩⁢(m2,Σ2). Since T is symmetric,

Cov⁡(X,Y)=𝔼⁢[(X−m1)⁢(X−m1)⊤]⁢T=Σ1⁢T,

and equality holds in (1). Then tr⁡(Σ1⁢T)=tr⁡(Σ11/2⁢R⁢Σ1−1/2)=tr⁡R, so by (5.2), 𝔼⁢|X−Y|2 equals the right-hand side of (5.4). By (5.1), 𝒲22 is at most this value. On the other hand, by (1), 𝔼⁢|X−Y|2 is at least this value for every coupling, so 𝒲22 is at least this value too. Hence (5.4) holds and the infimum is attained by (X,Y).

Finally we prove (1) for d=1. Writing Σi=σi2, by (5.2) the inequality to be shown is equivalent to Cov⁡(X,Y)≤σ1⁢σ2. This is nothing but the Cauchy–Schwarz inequality

Cov⁡(X,Y) =𝔼⁢[(X−m1)⁢(Y−m2)]
≤(𝔼⁢(X−m1)2)1/2⁢(𝔼⁢(Y−m2)2)1/2=σ1⁢σ2.

The equality condition is Cov⁡(X,Y)=σ1⁢σ2=Σ1⁢T. Moreover, by the equality condition of the Cauchy–Schwarz inequality, this is equivalent to the existence of a constant c≥0 with Y−m2=c⁢(X−m1) a.s. Comparing the variances of both sides gives c=σ2/σ1. ∎

The last paragraph of this proof also shows that for d=1 the coupling attaining equality in (1) is itself unique: equality holds if and only if Y=m2+(σ2/σ1)⁢(X−m1) a.s.

⋆ Proof.

We prove (1) for d≥2. Put C=Cov⁡(X,Y). The covariance matrix of the ℝ2⁢d-valued random variable Z=(X,Y) is

B=(Σ1CC⊤Σ2).

For every a∈ℝ2⁢d, a⊤⁢B⁢a is the variance of a⋅Z, so B is positive semidefinite.

Step 1. Put K=Σ1−1/2⁢C⁢Σ2−1/2. We show that u⊤⁢K⁢w≤1 for all unit vectors u,w∈ℝd. With a=(Σ1−1/2⁢u,−Σ2−1/2⁢w) we have

0≤a⊤⁢B⁢a=|u|2+|w|2−2⁢u⊤⁢K⁢w=2−2⁢u⊤⁢K⁢w.

Step 2. We show tr⁡C≤tr⁡R. Put M=Σ21/2⁢Σ11/2; by the cyclicity of the trace, tr⁡C=tr⁡(Σ11/2⁢K⁢Σ21/2)=tr⁡(K⁢M). Let M=U⁢D⁢V⊤ be a singular value decomposition of M, where U,V are orthogonal matrices and D=diag⁢(ρ1,…,ρd), with ρi>0 since M is invertible. Write ui,vi for the ith columns of U,V; these are unit vectors. By Step 1,

tr⁡(K⁢M)=tr⁡(V⊤⁢K⁢U⁢D)=∑i=1dρi⁢vi⊤⁢K⁢ui≤∑i=1dρi.

On the other hand, M⊤⁢M=Σ11/2⁢Σ2⁢Σ11/2=V⁢D2⁢V⊤, so R=V⁢D⁢V⊤ and tr⁡R=∑iρi. Hence tr⁡C≤tr⁡R, and (5.2) gives the inequality of (1).

Step 3. We prove the equality condition. As seen in the proof of (2), tr⁡(Σ1⁢T)=tr⁡R, so equality holds if C=Σ1⁢T. Conversely, suppose equality holds. Since ρi>0, the inequality of Step 2 forces vi⊤⁢K⁢ui=1 for all i. Put K′=V⊤⁢K⁢U. For unit vectors u,w we have u⊤⁢K′⁢w=(V⁢u)⊤⁢K⁢(U⁢w), and V⁢u,U⁢w are also unit vectors, so u⊤⁢K′⁢w≤1 by Step 1. Moreover, all diagonal entries of K′ equal 1. The length of the ith column K′⁢ei of K′ is sup|u|=1u⊤⁢K′⁢ei≤1. The only vector of length at most 1 whose ith component is 1 is ei, so K′=I, that is, K=V⁢U⊤. Here M−1=V⁢D−1⁢U⊤ gives V⁢U⊤=(V⁢D⁢V⊤)⁢(V⁢D−1⁢U⊤)=R⁢M−1. Therefore

C=Σ11/2⁢K⁢Σ21/2=Σ11/2⁢R⁢Σ1−1/2⁢Σ2−1/2⁢Σ21/2=Σ11/2⁢R⁢Σ1−1/2=Σ1⁢T.

∎

For d=1, the geometry of the upper half-plane can be read off from Theorem 5.4 at once. We identify the point (m,σ) of ℍ={(m,σ):σ>0} with 𝒩⁢(m,σ2) (Definition 1.1).

Corollary 5.5 (The Wasserstein distance for d=1).

Let d=1. For (m1,σ1),(m2,σ2)∈ℍ,

𝒲2⁢(𝒩⁢(m1,σ12),𝒩⁢(m2,σ22))2=(m1−m2)2+(σ1−σ2)2. (5.5)

That is, the distance that 𝒲2 puts on ℍ is the Euclidean distance, with (m,σ) regarded as a point of the Euclidean plane. This distance equals the distance (Definition 2.3) of the Riemannian metric d⁢m2+d⁢σ2 on ℍ. The Gaussian curvature of this metric is 0. The space (ℍ,𝒲2) is not complete.

Proof.

Setting d=1 in (5.4) gives tr(σ1σ22σ1)1/2=σ1σ2, hence (5.5). Next we find the distance of the metric d⁢m2+d⁢σ2. The length (Definition 2.2) of a piecewise C1 curve c:[a,b]→ℍ satisfies ∫ab|c′⁢(t)|⁢𝑑t≥|c⁢(b)−c⁢(a)|. Since ℍ is convex, the segment joining two points lies in ℍ, and its length equals the Euclidean distance. Hence the distance is the Euclidean distance. Its Gaussian curvature is 0, by the formula of Definition 2.18 with E=G=1. Finally, the sequence (0,1/n) is a Cauchy sequence for the Euclidean distance. If it had a limit (m,σ) in ℍ, this would equal its limit (0,0) in the Euclidean plane, contradicting σ>0. ∎

This is the second half of the book’s headline claim. The same ℍ was, with the Fisher metric, a complete hyperbolic plane of curvature −12 (Theorem 3.12). The lack of completeness becomes clear when we look at where σ→0 leads.

Example 5.6 (Dirac measures).

Let a∈ℝd and let δa be the probability measure concentrated at a. Let μ∈P2⁢(ℝd) have mean m and covariance matrix Σ (Σ may be degenerate). If X∼δa, then X=a a.s., so the only couplings of δa and μ are of the form (a,Y) with Y∼μ. Hence

𝒲2⁢(δa,μ)2=𝔼⁢|Y−a|2=|m−a|2+tr⁡Σ.

In particular 𝒲2⁢(δa,δb)=|a−b|. For d=1 we get 𝒲2⁢(δa,𝒩⁢(m,σ2))=((m−a)2+σ2)1/2, which is the Euclidean distance between (m,σ) and the boundary point (a,0). Hence, if we identify (a,0) with δa, the correspondence of Corollary 5.5 extends to an isometry from the closed half-plane {σ≥0}. As σ→0, 𝒲2⁢(𝒩⁢(m,σ2),δm)=σ→0, so the Gaussians approach a Dirac measure at finite distance.

5.3 Displacement Interpolation

The optimal coupling of Theorem 5.4 gives a curve joining two Gaussians: move each point X in a straight line towards Y=m2+T⁢(X−m1).

Proposition 5.7 (Displacement interpolation).

Let m1,m2∈ℝd and Σ1,Σ2∈Symd+, and let T be the matrix of (5.3). Let μ0=𝒩⁢(m1,Σ1), μ1=𝒩⁢(m2,Σ2) and X∼μ0. For s∈[0,1] put

Xs=(1−s)⁢X+s⁢(m2+T⁢(X−m1)),μs=Law⁡(Xs).
  1. 1.

    Put ms=(1−s)⁢m1+s⁢m2 and Ts=(1−s)⁢I+s⁢T. Then μs=𝒩⁢(ms,Ts⁢Σ1⁢Ts) and Ts⁢Σ1⁢Ts∈Symd+. For s=0,1, μs agrees with the μ0,μ1 above. Moreover 𝒲2⁢(μs,μt)≤(t−s)⁢𝒲2⁢(μ0,μ1) for 0≤s≤t≤1.

  2. 2.

    Let d=1 and Σi=σi2. Then μs=𝒩⁢(ms,σs2) with σs=(1−s)⁢σ1+s⁢σ2. Moreover 𝒲2⁢(μs,μt)=|t−s|⁢𝒲2⁢(μ0,μ1) for all s,t∈[0,1].

Proof.

We prove (1). We have Xs=(1−s)⁢(m1+(X−m1))+s⁢m2+s⁢T⁢(X−m1)=ms+Ts⁢(X−m1). As a convex combination of the positive definite symmetric matrices I and T, Ts is positive definite and symmetric. Hence Xs follows the Gaussian 𝒩⁢(ms,Ts⁢Σ1⁢Ts), and Ts⁢Σ1⁢Ts is positive definite. The endpoints agree because T0=I and Law⁡(m2+T⁢(X−m1))=μ1 by Theorem 5.4 (2). The pair (Xs,Xt) is a coupling of μs and μt, and with Y=m2+T⁢(X−m1) we have Xt−Xs=(t−s)⁢(Y−X). Since 𝔼⁢|Y−X|2=𝒲2⁢(μ0,μ1)2 by Theorem 5.4 (2), (5.1) gives

𝒲2⁢(μs,μt)2≤(t−s)2⁢𝔼⁢|Y−X|2=(t−s)2⁢𝒲2⁢(μ0,μ1)2.

We prove (2). Since T=σ2/σ1, we have Ts⁢σ1=(1−s)⁢σ1+s⁢σ2=σs and μs=𝒩⁢(ms,σs2). By Corollary 5.5,

𝒲2⁢(μs,μt)2 =(mt−ms)2+(σt−σs)2
=(t−s)2⁢((m2−m1)2+(σ2−σ1)2)=(t−s)2⁢𝒲2⁢(μ0,μ1)2.

∎

For d=1, the point (ms,σs) moves along a segment in ℍ at constant speed. This is a geodesic (Definition 2.14) of the metric d⁢m2+d⁢σ2, because the Christoffel symbols of this metric vanish, so the geodesic equations are m¨=σ¨=0.

Remark 5.8.

The inequality of (1) is an equality also for d≥2. Indeed, granting the triangle inequality (Remark 5.3, not proved in this book), we have

𝒲2⁢(μ0,μ1) ≤𝒲2⁢(μ0,μs)+𝒲2⁢(μs,μt)+𝒲2⁢(μt,μ1)
≤(s+(t−s)+(1−t))⁢𝒲2⁢(μ0,μ1),

so all the intermediate inequalities are equalities. Moreover, the curve s↦(ms,Ts⁢Σ1⁢Ts) is a geodesic of the Wasserstein metric gW of the next section (not proved in this book). See McCann [MCC97] and Takatsu [TAK11].

Figure 5.1 compares the displacement interpolation from 𝒩⁢(−2,0.25) to 𝒩⁢(2,1) with the mixture (1−s)⁢p0+s⁢p1 of the two densities. The mixture is also a curve joining μ0 and μ1, but it reassigns the heights of the peaks without moving any mass. At the values s=14,12,34 shown in the figure, the mixture has two peaks and so is not Gaussian. The displacement interpolation carries each point along a straight line and stays Gaussian throughout.

Figure 5.1: Top: densities of the displacement interpolation μs=𝒩⁢(ms,σs2), ms=−2+4⁢s, σs=0.5+0.5⁢s, from 𝒩⁢(−2,0.25) to 𝒩⁢(2,1). Bottom: the mixture (1−s)⁢p0+s⁢p1 of the two densities. Both panels show s=0,14,12,34,1, with s=0,1 drawn thick. The curves join points computed from closed-form expressions.

5.4 The Wasserstein Metric

By Corollary 5.5, 𝒲2 for d=1 is the distance of the Riemannian metric d⁢m2+d⁢σ2. For general d too, we would like a Riemannian metric on ℝd×Symd+ corresponding to 𝒲2. The clue is kinetic energy. Along a curve of Gaussians, we move the mass at each point by some velocity field, and take the kinetic energy of that field as the squared length of the tangent vector. First we translate the velocity Σ˙ of the covariance matrix into the linear part S of the velocity field.

Lemma 5.9 (The matrix equation S⁢Σ+Σ⁢S=Σ˙).

Diagonalise Σ∈Symd+ as Σ=Q⁢Λ⁢Q⊤ (Q orthogonal, Λ=diag⁢(λ1,…,λd)), and let Σ˙ be a d×d symmetric matrix. Then there is exactly one d×d matrix S satisfying

S⁢Σ+Σ⁢S=Σ˙. (5.6)

It is symmetric and is given by

S=Q⁢S~⁢Q⊤,S~i⁢j=(Q⊤⁢Σ˙⁢Q)i⁢jλi+λj.

Moreover tr⁡(S⁢Σ⁢S)=12⁢tr⁡(S⁢Σ˙).

Proof.

For a d×d matrix S put S~=Q⊤⁢S⁢Q and X~=Q⊤⁢Σ˙⁢Q. Multiplying (5.6) by Q⊤ on the left and by Q on the right gives S~⁢Λ+Λ⁢S~=X~, that is, (λi+λj)⁢S~i⁢j=X~i⁢j entrywise. Since λi+λj>0, the unique solution is S~i⁢j=X~i⁢j/(λi+λj). Since X~ is symmetric, so is S~, and hence so is S=Q⁢S~⁢Q⊤. Finally, tr⁡(S2⁢Σ)=tr⁡(S⁢Σ⁢S) by the cyclicity of the trace, so

tr⁡(S⁢Σ˙)=tr⁡(S2⁢Σ)+tr⁡(S⁢Σ⁢S)=2⁢tr⁡(S⁢Σ⁢S).

∎

S depends linearly on Σ˙. For d=1 and Σ=σ2 we have S=Σ˙/(2⁢Σ). In particular, when σ moves with velocity σ˙, we have Σ˙=2⁢σ⁢σ˙, so S=σ˙/σ.

Proposition 5.10 (Kinetic energy of Gaussians).

Let J⊆ℝ be an open interval and t↦(m⁢(t),Σ⁢(t)) a C1 curve from J to ℝd×Symd+. For each t, let S⁢(t) be the symmetric solution of Σ˙⁢(t)=S⁢(t)⁢Σ⁢(t)+Σ⁢(t)⁢S⁢(t) (Lemma 5.9). Let p⁢(t,x) be the density of 𝒩⁢(m⁢(t),Σ⁢(t)), and consider the velocity field on ℝd

v⁢(t,x)=m˙⁢(t)+S⁢(t)⁢(x−m⁢(t)).

Then the continuity equation

∂tp+div⁡(p⁢v)=0 (5.7)

holds for all t∈J and x∈ℝd. Moreover

𝔼X∼𝒩⁢(m,Σ)⁢|v⁢(t,X)|2=|m˙|2+tr⁡(S⁢Σ⁢S). (5.8)

The continuity equation is the conservation law that a density satisfies when mass flows along a velocity field v. Hence v gives one way of moving mass that realises the curve 𝒩⁢(m⁢(t),Σ⁢(t)).

Proof.

Fix a time t and omit the argument t. With y=x−m,

log⁡p=−d2⁢log⁡(2⁢π)−12⁢log⁢detΣ−12⁢y⊤⁢Σ−1⁢y.

Using dd⁢t⁢log⁢detΣ=tr⁡(Σ−1⁢Σ˙), dd⁢t⁢Σ−1=−Σ−1⁢Σ˙⁢Σ−1 and ∂ty=−m˙, we obtain

∂tlog⁡p=−12⁢tr⁡(Σ−1⁢Σ˙)+m˙⊤⁢Σ−1⁢y+12⁢y⊤⁢Σ−1⁢Σ˙⁢Σ−1⁢y.

On the other hand, ∇log⁡p=−Σ−1⁢y and div⁡v=tr⁡S, so

div⁡(p⁢v)p=div⁡v+v⋅∇log⁡p=tr⁡S−m˙⊤⁢Σ−1⁢y−y⊤⁢S⁢Σ−1⁢y.

Now substitute Σ˙=S⁢Σ+Σ⁢S. Then tr⁡(Σ−1⁢Σ˙)=tr⁡(Σ−1⁢S⁢Σ)+tr⁡S=2⁢tr⁡S. Also Σ−1⁢Σ˙⁢Σ−1=Σ−1⁢S+S⁢Σ−1, and the scalar y⊤⁢Σ−1⁢S⁢y equals its transpose y⊤⁢S⁢Σ−1⁢y, so 12⁢y⊤⁢Σ−1⁢Σ˙⁢Σ−1⁢y=y⊤⁢S⁢Σ−1⁢y. Hence

∂tp+div⁡(p⁢v)p =(−tr⁡S+m˙⊤⁢Σ−1⁢y+y⊤⁢S⁢Σ−1⁢y)
+(tr⁡S−m˙⊤⁢Σ−1⁢y−y⊤⁢S⁢Σ−1⁢y)=0,

which is (5.7).

Next let X∼𝒩⁢(m,Σ) and put Y=X−m. Since 𝔼⁢Y=0 and 𝔼⁢[Y⁢Y⊤]=Σ,

𝔼⁢|m˙+S⁢Y|2 =|m˙|2+2⁢m˙⊤⁢S⁢𝔼⁢Y+𝔼⁢[Y⊤⁢S2⁢Y]
=|m˙|2+tr⁡(S2⁢Σ)=|m˙|2+tr⁡(S⁢Σ⁢S).

∎

The next metric takes the right-hand side of (5.8) as the squared length of the tangent vector (m˙,Σ˙). The set ℝd×Symd+ is an open subset of ℝd×Symd (Definition 1.1), and its tangent vectors at each point are (m˙,Σ˙)∈ℝd×Symd.

Definition 5.11 (Wasserstein metric).

For (m,Σ)∈ℝd×Symd+ and tangent vectors (m˙k,Σ˙k) (k=1,2), let Sk be the symmetric solution of Σ˙k=Sk⁢Σ+Σ⁢Sk (Lemma 5.9). We put

g(m,Σ)W⁢((m˙1,Σ˙1),(m˙2,Σ˙2))=m˙1⋅m˙2+tr⁡(S1⁢Σ⁢S2)

and call it the Wasserstein metric.

We check that this is a Riemannian metric (Definition 2.1). Since Sk depends linearly on Σ˙k, gW is bilinear. Since tr⁡(S1⁢Σ⁢S2)=tr⁡((S1⁢Σ⁢S2)⊤)=tr⁡(S2⁢Σ⁢S1), it is symmetric. We have tr⁡(S⁢Σ⁢S)=tr⁡((S⁢Σ1/2)⊤⁢(S⁢Σ1/2))≥0, with equality only when S=0, that is, Σ˙=0. Hence gW is positive definite. S is the image of Σ˙ under the inverse of the invertible linear map S↦S⁢Σ+Σ⁢S on Symd. The entries of this linear map are linear in the entries of Σ, and the entries of its inverse are ratios of minors. Hence the components of gW depend smoothly on Σ. Also, by the cyclicity of the trace and transposition, tr⁡(S1⁢S2⁢Σ)=tr⁡(S2⁢S1⁢Σ)=tr⁡(S1⁢Σ⁢S2), so

12⁢tr⁡(S1⁢Σ˙2)=12⁢(tr⁡(S1⁢S2⁢Σ)+tr⁡(S1⁢Σ⁢S2))=tr⁡(S1⁢Σ⁢S2).

In particular gW⁢((m˙,Σ˙),(m˙,Σ˙))=|m˙|2+tr⁡(S⁢Σ⁢S)=|m˙|2+12⁢tr⁡(S⁢Σ˙). By Proposition 5.10, this equals the kinetic energy 𝔼⁢|v|2 of the velocity field v. Note that what enters the Σ part of gW is S, not Σ˙ itself.

Example 5.12 (The Wasserstein metric for d=1).

Let d=1 and write gW in the coordinates (m,σ). Since Σ=σ2, the tangent vector corresponding to (m˙,σ˙) is (m˙,2⁢σ⁢σ˙), and S=σ˙/σ. Hence tr⁡(S⁢Σ⁢S)=(σ˙/σ)2⁢σ2=σ˙2, and

gW=d⁢m2+d⁢σ2

(Proposition 2.6). By Corollary 5.5, for d=1 the distance of gW equals 𝒲2. In the same coordinates, the Fisher metric was (d⁢m2+2⁢d⁢σ2)/σ2 (Proposition 3.10).

Remark 5.13 (Otto’s calculus).

The velocity field v is not the only one satisfying the continuity equation (5.7), since we may add to v any field w with div⁡(p⁢w)=0. Among all such fields, v has the smallest kinetic energy 𝔼⁢|v|2 (not proved in this book). This is the restriction to Gaussians of Otto’s calculus [OTT01], which regards all of P2⁢(ℝd) formally as a Riemannian manifold. Moreover, also for d≥2, the Riemannian distance of gW equals the square root of the right-hand side of (5.4) (not proved in this book). See Takatsu [TAK11]. For d=1 this follows at once from Example 5.12 and Corollary 5.5. Takatsu [TAK11, Proposition A] writes this metric in the form tr⁡(X⁢Σ⁢Y), where X,Y are not Σ˙ but correspond to the S of Lemma 5.9 for the two tangent vectors.

Remark 5.14 (Curvature for d≥2).

For d=1, gW is flat (Example 5.12). For d≥2 the situation is different: the sectional curvature of gW is nonnegative (not proved in this book). Sectional curvature generalises the two-dimensional Gaussian curvature of Chapter 2 to higher dimensions; this book does not define it. See Takatsu [TAK11, Theorem B]. The only case in which this book shows that Wasserstein geometry is flat is d=1.

Conclusion

The set of one-dimensional Gaussians 𝒩⁢(m,σ2) can be regarded as the upper half-plane ℍ with coordinates (m,σ). Measured with the Fisher metric, ℍ is a complete hyperbolic plane of curvature −1/2; measured with the Wasserstein distance, it is a flat (incomplete) half-plane. Chapter 3 proved the first half; this chapter has proved the second (Corollary 5.5). The two geometries differ at the boundary σ=0: Dirac measures are infinitely far away for the Fisher metric but at finite distance for 𝒲2 (Example 5.6). In Chapter 6 we compare the gradient flows of the same function F for the two metrics.

Problems

  1. 1.

    Let μ∈P2⁢(ℝd) and a∈ℝd, and for X∼μ put ν=Law⁡(X+a). Show that 𝒲2⁢(μ,ν)=|a|.

    Hint: Every coupling satisfies 𝔼⁢|X−Y|2≥|𝔼⁢X−𝔼⁢Y|2.

  2. 2.

    Let λ1,…,λd be the eigenvalues of Σ∈Symd+. Show that 𝒲2⁢(𝒩⁢(m,Σ),γ)2=|m|2+∑i(λi−1)2.

    Hint: With Σ1=Σ and Σ2=I in (5.4), R=Σ1/2.

  3. 3.

    Show that if Σ1,Σ2∈Symd+ satisfy Σ1⁢Σ2=Σ2⁢Σ1, then 𝒲2⁢(𝒩⁢(m1,Σ1),𝒩⁢(m2,Σ2))2=|m1−m2|2+∥Σ11/2−Σ21/2∥F2. Here ∥A∥F2=tr⁡(A⊤⁢A).

    Hint: Commuting symmetric matrices can be diagonalised by the same orthogonal matrix.

  4. 4.

    Let d=2, Σ=diag⁢(1,4) and Σ˙=(0110). Find the S of Lemma 5.9 and show that gW⁢((0,Σ˙),(0,Σ˙))=15. Check also that the squared length for the Fisher metric, 12⁢tr⁡(Σ−1⁢Σ˙⁢Σ−1⁢Σ˙), is 14.

    Hint: Q=I, and the off-diagonal entries of S are 1/(1+4).

  5. 5.

    Let d=1 and consider the Xs of Proposition 5.7. Show that dd⁢s⁢Xs=v⁢(s,Xs), where v is the velocity field of Proposition 5.10 for the curve s↦(ms,σs2) (extend the curve by the same formula to an open interval on which σs>0).

    Hint: Use Xs−ms=(σs/σ1)⁢(X−m1) and S=σ˙s/σs.