# Wasserstein metric satisfies triangle inequality

This thread is meant to record a question that I feel interesting during my self-study. I'm very happy to receive your suggestion and comments.

Let $$X =Y=Z \subset \mathbb R^d$$, $$p \in [1, +\infty)$$, $$\mathcal P (X)$$ be the set of all Borel probability measures on $$X$$, and $$\mathcal P_p (X) := \left \{\mu \in \mathcal P(X) \,\middle\vert\, \int_X |x|^p \mathrm d \mu < +\infty \right \}.$$

We define the $$p$$-th Wasserstein metric $$W_p$$ by $$W_p (\mu, \nu) := \inf_{\gamma \in \Pi(\mu, \nu)} \left [ \int_{X \times Y} |x-y|^p \mathrm d \gamma (x, y) \right ]^{1/p} \quad \forall \mu, \nu \in \mathcal P_p (X).$$

Here $$\Pi(\mu, \nu)$$ is the set of all Borel probability measures on $$X\times Y$$ whose marginals are $$\mu, \nu$$ respectively.

Theorem: $$W_p$$ satisfies triangle inequality.

• I'm not the one who has downvoted, but I think that who did has a point. The question is not self-contained: though being clear to someone who already know the subject what $\Pi(\mu,\nu)$ stands for, I think that for all the others it would be worthwhile to define it directly in the question.
– Bob
Commented Jul 10, 2022 at 8:02
• @Bob thank you for your suggestion. I'm going to add related definitions. Commented Jul 10, 2022 at 8:09

Let $$\mu, \nu, \omega \in \mathcal P_p (X)$$. Let $$\pi_1 \in \Pi (\mu, \nu)$$ and $$\pi_2 \in \Pi (\mu, \nu)$$ be optimal, i.e., $$W^p_p (\mu, \nu) := \int_{X \times Y} |x-y|^p \mathrm d \pi_1 (x, y) \quad \text{and} \quad W^p_p (\nu, \omega) := \int_{Y \times Z} |y-z|^p \mathrm d \pi_2 (y, z).$$
Let $$P^{X \times Y}$$ and $$P^{Y \times Z}$$ be the projection maps from $$X \times Y \times Z$$ to $$X \times Y$$ and $$Y \times Z$$ respectively. Let $$\gamma \in \mathcal P(X \times Y \times Z)$$ such that $$P^{X \times Y}_\sharp \gamma = \pi_1$$ and $$P^{Y \times Z}_\sharp \gamma = \pi_2$$. Here $$P^{X \times Y}_\sharp \gamma$$ is the push-forward of $$\gamma$$ by $$P^{X \times Y}$$. Such $$\gamma$$ does exists by gluing lemma. Let $$\pi = P^{X \times Z}_\sharp \gamma$$. It's easy to prove that $$\pi \in \Pi(\mu, \omega)$$. Finally, \begin{align} W_p(\mu, \omega) &\le \left [ \int_{X \times Z} |x-z|^p \mathrm d \pi (x, z) \right ]^{1/p} \\ &= \left [ \int_{X \times Y \times Z} |(x-y) - (y-z)|^p \mathrm d \gamma(x,y,z) \right ]^{1/p} \\ &\le \left [ \int_{X \times Y} |x-y|^p \mathrm d \pi_1 (x, y) \right ]^{1/p} + \left [ \int_{Y \times Z} |y-z|^p \mathrm d \pi_2 (y, z) \right ]^{1/p} \\ &= W_p(\mu, \nu) + W_p(\nu, \omega). \end{align}