Gradient Flows

Eleven ideas from the theory of gradient flows, first in metric spaces and then in the Wasserstein space of probability measures, ending with the heat and Fokker–Planck equations as gradient flows of entropy. Run the schemes, drag the points, edit the histograms, draw a density, then check yourself with concept questions and practice problems.

Follows the chapter order of L. Ambrosio, N. Gigli and G. Savaré, Gradient Flows in Metric Spaces and in the Space of Probability Measures (Birkhäuser, Lectures in Mathematics ETH Zürich, 2005). Modules 1–4 follow Part I (Chapters 1–4) and modules 5–11 follow Part II (Chapters 5–11); the technical appendix (Chapter 12) is not covered. Chapter numbers refer to that book; the questions and examples here are written for this page.

InteractiveAmbrosio–Gigli–Savaré, Ch. 1: Curves and Gradients in Metric Spaces

Curves of maximal slope

In Rd a gradient flow is u′=−∇φ(u), an equation between vectors. A metric space has no vectors, but it still has speeds and slopes. The surprise is that one scalar inequality between speed, slope and energy already contains the whole equation.

The idea

Metric derivative. A curve u:(a,b)→S in a metric space (S,d) is absolutely continuous if d(u(s),u(t))≤∫stm(r)dr for some m∈L1(a,b) and all s<t. For such curves the limit
|u′|(t)=limh→0d(u(t+h),u(t))|h|
exists for almost every t, and it is the smallest admissible m. It is the speed of the curve; there is no velocity vector.
Local slope. For φ:S→(−∞,+∞] and v with φ(v)<∞,
|∂φ|(v)=lim supw→v(φ(v)−φ(w))+d(v,w).
It is the steepest rate of descent from v. For a C1 function on Rd it equals |∇φ(v)|, but it needs no differentiability.

In Rd, the chain rule and two elementary inequalities give, along any smooth curve,

−ddtφ(u)=−⟨∇φ(u),u′⟩≤|∇φ(u)||u′|≤12|u′|2+12|∇φ(u)|2.

Equality in Cauchy–Schwarz forces u′ to point along −∇φ; equality in Young's inequality forces |u′|=|∇φ|. Together: u′=−∇φ(u). So the gradient flow is exactly the curve that makes the energy fall as fast as this bound allows.

Curve of maximal slope. An absolutely continuous u along which φ∘u is nonincreasing and
φ(u(s))−φ(u(t)) ≥ 12∫st|u′|2(r)dr+12∫st|∂φ|2(u(r))dr(s≤t).
(Ch. 1 allows any upper gradient g in place of |∂φ|.)
Energy dissipation equality. If the slope is a strong upper gradient, meaning |φ(u(t))−φ(u(s))|≤∫st|∂φ|(u)|u′|dr along every absolutely continuous curve, then the inequality above is automatically an equality. For φ∈C1(Rd), curves of maximal slope are exactly the solutions of u′=−∇φ(u).

Below, the curve follows u′=αRθ(−∇φ(u)): the true gradient flow sped up by α and turned by an angle θ. Compare the energy it loses with the right-hand side.

Explore

Energy φ
the curve u on [0,T] true gradient flow · drag the start point
energy lost φ(u0)−φ(u(t)) 12∫0t|u′|2+12∫0t|∇φ(u)|2

Worked example

Take S=R and the nonsmooth energy φ(x)=|x|. Which curves starting at u0=1 are curves of maximal slope?

  1. Compute the local slope |∂φ|(x) at every x, including x=0.

    For x≠0, φ is differentiable with |φ′(x)|=1, so the slope is 1. At x=0: (φ(0)−φ(w))+=(−|w|)+=0 for every w, so |∂φ|(0)=0. The minimum has slope zero even though φ has a corner there.

  2. Check that u(t)=(1−t)+ satisfies the energy inequality on [0,t], first for t≤1 and then for t>1.

    For t≤1: energy lost =1−(1−t)=t; speed 1 and slope 1 give 12t+12t=t. Equality.

    For t>1: energy lost =1; the integrals are 12⋅1+12⋅1=1, because after time 1 both speed and slope are zero. Equality again.

  3. Try the curve that moves twice as fast, u(t)=(1−2t)+, on [0,12].

    Energy lost =1. Right side: 12∫01/24dr+12∫01/21dr=1+14=54>1. The inequality fails: going faster costs more in 12|u′|2 than it gains in energy.

  4. What about the curve that never moves, u≡1?

    Energy lost =0, but the slope term is 12∫0t1dr=t/2>0. It fails too. The slope term is what forces the curve to move; the speed term is what stops it moving too fast. Only (1−t)+ balances them, and it is exactly the solution of the differential inclusion u′∈−∂|u|.

Check your understanding

Give R2 the ℓ1 distance d(x,y)=|x1−y1|+|x2−y2|. What is the metric derivative of u(t)=(t,t)?

  1. 2That is the Euclidean speed. The metric derivative is computed with the distance you are given.
  2. 2
  3. 1Each coordinate moves at speed 1, and the ℓ1 distance adds the two.
d(u(t+h),u(t))=|h|+|h|=2|h|, so |u′|(t)=2. Speeds, and so curves of maximal slope, depend on the metric. In Part II the metric will be the Wasserstein distance, and changing the metric is exactly what turns one PDE into another.

In Rd, a curve satisfies φ(u(s))−φ(u(t))=∫st|u′||∇φ(u)|dr for all s≤t (speed times slope, instead of the two half-squares). Must it solve u′=−∇φ(u)?

  1. Yes, this is the energy identity.Try u′=−2∇φ(u): the energy falls at rate 2|∇φ|2=|u′||∇φ|.
  2. No. It forces u′ to point along −∇φ, but not the speed.
  3. No. It does not even fix the direction.Equality in Cauchy–Schwarz, −⟨∇φ,u′⟩=|∇φ||u′|, does force u′ to be a nonnegative multiple of −∇φ.
Any reparametrisation of a gradient-flow trajectory passes this test. Replacing |u′||∇φ| by 12|u′|2+12|∇φ|2 adds equality in Young's inequality, |u′|=|∇φ|, which fixes the speed. In the explorer, α≠1 with θ=0 is exactly this situation.

On R, let φ(x)=−|x|. What is |∂φ|(0)?

  1. 0, since 0 is a critical point.The slope measures descent. From 0 you can go down at rate 1 in either direction.
  2. 1
  3. Undefined, since φ is not differentiable at 0.The slope is a limsup of difference quotients and is defined at every point of the domain.
(φ(0)−φ(w))+/|w|=|w|/|w|=1. So the constant curve at 0 is not a curve of maximal slope (it loses no energy but pays 12∫1). Curves of maximal slope from 0 leave at speed 1, to the left or to the right: they exist, but they are not unique. Uniqueness needs convexity, which is the subject of Chapter 4.

Practice

The inequality implies the equationThe smooth case in Rd

Let φ∈C1(Rd) and let u be absolutely continuous on [0,T] with φ(u(0))−φ(u(T))≥12∫0T|u′|2+12∫0T|∇φ(u)|2. Show that u′=−∇φ(u) almost everywhere.

Hint

Write φ(u(0))−φ(u(T))=−∫0T⟨∇φ(u),u′⟩dt and compare integrands.

Solution

Pointwise, −⟨∇φ(u),u′⟩≤12|u′|2+12|∇φ(u)|2, with equality iff u′=−∇φ(u) (expand 12|u′+∇φ(u)|2≥0). Integrating, the hypothesis says the integral of the nonnegative function 12|u′+∇φ(u)|2 is ≤0. So it vanishes almost everywhere.

A space with no moving curvesThe snowflake metric

On R put d(x,y)=|x−y|1/2. Show that every absolutely continuous curve u:[a,b]→(R,d) is constant. What does that say about gradient flows in this space?

Hint

From |u(t)−u(s)|1/2≤∫stm, get |u(t)−u(s)|≤(∫stm)2, and sum over a fine partition.

Solution

Split [a,b] into intervals Ik. Then

|u(b)−u(a)|≤∑k(∫Ikm)2≤(maxk∫Ikm)∫abm,
and the maximum tends to 0 as the mesh shrinks, since m∈L1. So u(b)=u(a), and likewise on every subinterval. The only curves of maximal slope are constants, at points of zero slope. A metric theory of gradient flows needs a space with many rectifiable curves; the Wasserstein space will have plenty.

InteractiveAmbrosio–Gigli–Savaré, Ch. 2: Existence of Curves of Maximal Slope and their Variational Approximation

Minimizing movements

To build a gradient flow where there are no gradients, take small steps, each of which lowers the energy without moving too far. This is implicit Euler written as a minimization problem, and it makes sense in any metric space.

The idea

One step. For a step size τ>0 and a point u, minimize
Φ(τ,u;v)=φ(v)+d2(u,v)2τ.
A discrete solution starts at U0=u0 and picks Un among the minimizers of Φ(τ,Un−1;⋅). Interpolating piecewise constantly in time gives a curve U¯τ.
Minimizing movement. A curve u is a generalized minimizing movement if U¯τk(t)→u(t) for some sequence τk↓0 and every t. ("Generalized" because the minimizers, and the limits, need not be unique.)

In Rd with smooth φ the minimizer satisfies Un−Un−1τ=−∇φ(Un): this is implicit Euler. For convex nonsmooth φ it reads Un−1−Unτ∈∂φ(Un). Comparing with v=Un−1 gives, for free, the discrete energy inequality

φ(Un)+d2(Un,Un−1)2τ≤φ(Un−1).

Existence (Ch. 2). If φ is lower semicontinuous, bounded below on bounded sets in a suitable sense, and its sublevels are (relatively) compact, then discrete solutions exist and generalized minimizing movements exist. If moreover the relaxed slope |∂−φ| (a lower semicontinuous relaxation of |∂φ|) is a strong upper gradient, every one of them is a curve of maximal slope for it and satisfies the energy dissipation equality (Theorem 2.3.3; Theorem 2.3.1 reaches the same conclusion, without the equality, from a weaker chain rule plus a continuity condition on φ).
The convex case. If φ is λ-convex along geodesics, the slope is lower semicontinuous and a strong upper gradient, so the theorem applies directly. Chapter 4 adds uniqueness and error bounds, under a slightly stronger convexity assumption (Module 4) that holds, for instance, in Hilbert spaces; for λ≥0, d(UN,u(Nτ))≤τ|∂φ|(u0)/2.
Explicit Euler is not an option. Un=Un−1−τ∇φ(Un−1) needs a vector to step along, and even in R it is unstable for stiff or nonsmooth φ. The explorer runs both.

Explore

Energy φ
minimizing movement explicit Euler · dashed: Φ(τ,U0;⋅) · drag u0
exact gradient flow Un explicit, against time t=nτ

Worked example

Run the minimizing-movement scheme for φ(x)=|x| on R from u0=1, and compare it with explicit Euler using the subgradient sign⁡(x).

  1. Solve one step: minimize |v|+(v−a)22τ for given a>0.

    The optimality condition is a−vτ∈∂|v|. If v>0 this says v=a−τ, which is consistent when a>τ. If v=0 it says a/τ∈[−1,1], i.e. a≤τ. So

    Un=max(Un−1−τ,0)(soft thresholding).
  2. Write out Un from u0=1 and compare it with the exact flow u(t)=(1−t)+ from the previous module.

    Un=(1−nτ)+=u(nτ). The scheme is exact at the grid times, and in particular it lands on the minimum and stays there.

  3. Now explicit Euler with τ=0.3: Un=Un−1−0.3sign⁡(Un−1). What happens?

    1, 0.7, 0.4, 0.1, −0.2, 0.1, −0.2,… It never settles: it oscillates around the minimum with amplitude of order τ, and φ(Un) goes up on every other step.

  4. Check the discrete energy inequality for the implicit step when a>τ.

    φ(Un)+|Un−a|22τ=(a−τ)+τ2=a−τ2≤a=φ(a). The energy drops by at least the "kinetic" term d2/2τ, which is the discrete version of 12∫|u′|2.

Check your understanding

For φ(x)=12x2 on R, what is one minimizing-movement step from x?

  1. x/(1+τ)
  2. x(1−τ)That is explicit Euler. Set the derivative of 12v2+(v−x)2/2τ to zero.
  3. xe−τThat is the exact flow after time τ, which the scheme only approximates.
v+(v−x)/τ=0 gives v=x/(1+τ). After n=t/τ steps, x(1+t/n)−n→xe−t. Note 1/(1+τ)∈(0,1) for every τ>0: the scheme never overshoots, unlike 1−τ, which overshoots for τ>1 and diverges for τ>2.

Why is the minimizing-movement scheme, and not explicit Euler, the right starting point in a metric space?

  1. It only uses φ and d; there is no vector −∇φ to step along.
  2. It is more accurate.Both are first-order methods. The point is that one of them can be written down at all.
  3. Its minimizer is always unique.Not for nonconvex φ: see the next question. That is why the theory speaks of generalized minimizing movements.
Φ(τ,u;v)=φ(v)+d2(u,v)/2τ is meaningful in any metric space. Its stability (the discrete energy inequality) also gives the compactness needed to pass to the limit, which is the content of Chapters 2 and 3.

Double well φ(x)=14(x2−1)2, start at u0=0 (a local maximum), step τ=2. What is U1?

  1. 0, since φ′(0)=0.Compare values: Φ(2,0;0)=14, while Φ(2,0;1/2)=116+18=316.
  2. Either 1/2 or −1/2: there are two minimizers and the scheme must choose.
  3. 1, the bottom of a well.At v=1, Φ=0+14=14, which is beaten by v=1/2.
The derivative of Φ is v(v2−1+1/τ). For τ<1 its only zero is v=0, and Φ is convex, so the scheme stays at 0 like the exact flow. For τ>1 the minimizers are ±1−1/τ. Try it in the explorer: drag u0 to 0 and move τ across 1.

Practice

A discrete Hölder estimateWhere compactness comes from

Let φ≥φmin and Un be a discrete solution. Show that ∑nd2(Un,Un−1)≤2τ(φ(u0)−φmin), and deduce d(Um,Un)≤2(φ(u0)−φmin)|m−n|τ.

Hint

Sum the discrete energy inequality (it telescopes), then use Cauchy–Schwarz on ∑k=n+1md(Uk,Uk−1).

Solution

Summing d2(Uk,Uk−1)/2τ≤φ(Uk−1)−φ(Uk) gives the first bound. Then

d(Um,Un)≤∑k=n+1md(Uk,Uk−1)≤m−n(∑kd2)1/2≤m−n2τ(φ(u0)−φmin).
Since |m−n|τ is the time elapsed, the discrete curves are uniformly 12-Hölder, which (with compact sublevels) gives a convergent subsequence by an Arzelà–Ascoli argument.

A concave energyWhen does a step exist?

Let φ(x)=−12x2 on R. For which τ does Φ(τ,a;⋅) have a minimizer? Compute Un and its limit as τ=t/n→0.

Solution

Φ=−12v2+(v−a)2/2τ has leading coefficient 12(1/τ−1). It is bounded below, with the unique minimizer v=a/(1−τ), exactly when τ<1; for τ≥1 it is unbounded below (or, at τ=1 with a≠0, linear). So Un=a(1−τ)−n→aet, the exact flow of u′=u. The restriction τ<1/(−λ) with λ=−1 is the one that appears for λ-convex energies in Chapter 4.

InteractiveAmbrosio–Gigli–Savaré, Ch. 3: Proofs of the Convergence Theorems

The Moreau–Yosida envelope

The value of one minimizing-movement step, seen as a function of the starting point, is a smoothed version of the energy. How it changes with τ is the key to the convergence proof: it turns the discrete energy inequality into a discrete energy identity.

The idea

Moreau–Yosida approximation.
φτ(u)=infv∈S(φ(v)+d2(u,v)2τ),
and Jτ[u] is the set of minimizers uτ. Taking v=u shows φτ≤φ; the penalty shrinks as τ grows, so τ↦φτ(u) is nonincreasing, and φτ(u)↑φ(u) as τ↓0 when φ is lower semicontinuous (under the standing compactness assumptions).

The picture: lower the downward parabola v↦c−d2(u,v)/2τ until it touches the graph of φ. The highest c that stays below φ is φτ(u), and the touching points are Jτ[u].

Derivative in τ. For almost every τ,
ddτφτ(u)=−d2(u,uτ)2τ2.
Slope estimate. For every uτ∈Jτ[u],
|∂φ|(uτ)≤d(u,uτ)τ.
In words: the endpoint of a step has slope at most the discrete speed of that step.

Integrate the derivative from 0 to τ and use the slope estimate along the family ur∈Jr[u], 0<r≤τ (De Giorgi's variational interpolation). One step then satisfies

φ(u)−φ(uτ)=d2(u,uτ)2τ+∫0τd2(u,ur)2r2dr ≥ d2(u,uτ)2τ+12∫0τ|∂φ|2(ur)dr,

the discrete counterpart of the energy inequality of Module 1, with both the speed and the slope terms. Passing to the limit in it is the heart of Chapter 3.

Explore

Energy φ
φ φτ parabola touching at uτ · drag u
r↦φr(u) slope −d2(u,uτ)/2τ2 at r=τ

Worked example

Compute Jτ and φτ for φ(x)=|x| on R, and check the derivative formula and the slope estimate by hand.

  1. What is Jτ[x]? (You solved this in the previous module.)

    Soft thresholding: xτ=sign⁡(x)max(|x|−τ,0).

  2. Compute φτ(x).

    If |x|≤τ, xτ=0 and φτ(x)=x2/2τ. If |x|>τ, φτ(x)=(|x|−τ)+τ2/2τ=|x|−τ/2. This is the Huber function: a parabola near the corner, joined to two lines. It is C1 with φτ′(x)=(x−xτ)/τ.

  3. Check ddτφτ(x)=−|x−xτ|22τ2 in both regimes.

    For |x|>τ: ddτ(|x|−τ/2)=−12, and |x−xτ|=τ gives −τ2/2τ2=−12. For |x|<τ: ddτx2/2τ=−x2/2τ2, and |x−xτ|=|x|. Both match.

  4. Check the slope estimate |∂φ|(xτ)≤|x−xτ|/τ. When is it an equality?

    For |x|>τ: slope at xτ≠0 is 1, and |x−xτ|/τ=1. Equality. For |x|≤τ: xτ=0 has slope 0, while |x|/τ can be up to 1. Strict inequality (unless |x|=τ). The step ends at a point with less slope than its speed suggests; this slack is why Chapter 3 gets an inequality in general and needs extra structure for equality.

Check your understanding

Fix u. How does φτ(u) depend on τ?

  1. It is nonincreasing in τ, and tends to φ(u) as τ↓0 (for l.s.c. φ).
  2. It is nondecreasing in τ.Larger τ makes the penalty d2/2τ smaller for every v, so the infimum can only go down.
  3. It can go either way, depending on φ.The monotonicity holds for every φ: compare the two infima competitor by competitor.
For each fixed v, φ(v)+d2(u,v)/2τ decreases in τ; an infimum of decreasing functions decreases. The derivative formula says more: the rate is exactly d2(u,uτ)/2τ2, the squared discrete speed over 2.

A step from u with τ=0.1 lands at uτ with d(u,uτ)=0.3. What can you conclude in a general metric space?

  1. |∂φ|(uτ)≤3
  2. |∂φ|(u)≤3The estimate is at the endpoint uτ. At the start u the slope can be anything; for the jump function in the explorer it can even be 0 at both ends.
  3. |∂φ|(uτ)=3Equality holds for C1 energies in Rd, where (u−uτ)/τ=∇φ(uτ). In general only the inequality survives: see the worked example with |x|≤τ.
If w is near uτ, minimality gives φ(uτ)−φ(w)≤(d2(u,w)−d2(u,uτ))/2τ≤d(uτ,w)(d(u,w)+d(u,uτ))/2τ. Divide by d(uτ,w) and let w→uτ.

φ is the jump function: 0 for x≤0 and 1 for x>0. What is φτ(x) for x>0?

  1. min(1, x2/2τ)
  2. 1You can also jump to v=0, where φ=0, at cost x2/2τ.
  3. x2/2τFor large x it is cheaper to stay put and pay φ(x)=1.
The only competitors worth considering are v=x (value 1) and v=0 (value x2/2τ). The envelope is continuous even though φ is not; at x=2τ the minimizer jumps from 0 to x and Jτ[x] has two points. Lower semicontinuity of φ (φ(0)=0, not 1) is what makes v=0 a minimizer at all.

Practice

The envelope of a quadraticEverything explicit

For φ(x)=a2x2 on R with a>0, compute xτ and φτ. Verify the derivative formula.

Solution

av+(v−x)/τ=0 gives xτ=x/(1+aτ). Then

φτ(x)=a2x2(1+aτ)2+12τ(aτx1+aτ)2=a2x21+aτ.
So ddτφτ=−a2x22(1+aτ)2, and |x−xτ|22τ2=(aτx)22τ2(1+aτ)2 is the same. The envelope is again quadratic, with the smaller coefficient a/(1+aτ)<1/τ.

The discrete energy inequality with slopesDe Giorgi's interpolation

Assuming the derivative formula and φr(u)→φ(u) as r↓0, prove

φ(u)−φ(uτ)≥d2(u,uτ)2τ+12∫0τ|∂φ|2(ur)dr
for any choice ur∈Jr[u].

Hint

φτ(u)=φ(uτ)+d2(u,uτ)/2τ. Write φ(u)−φτ(u) as an integral in r.

Solution

φ(u)−φτ(u)=∫0τd2(u,ur)2r2dr by the derivative formula (r↦φr(u) is monotone and locally Lipschitz on (0,∞)). The slope estimate gives d2(u,ur)r2≥|∂φ|2(ur). Substitute φτ(u)=φ(uτ)+d2(u,uτ)/2τ and rearrange.

SimulationAmbrosio–Gigli–Savaré, Ch. 4: Uniqueness, Generation of Contraction Semigroups, Error Estimates

λ-convexity and contraction

Without convexity, gradient flows can split (Module 1, quiz 3). With λ-convexity they cannot: two flows drift apart at most like e−λt, so the flow is unique and stable, and the minimizing-movement scheme converges with an explicit rate.

The idea

λ-convexity. φ is λ-convex along a constant-speed geodesic γ from v0 to v1 if
φ(γt)≤(1−t)φ(v0)+tφ(v1)−λ2t(1−t)d2(v0,v1).
In Rd, for C2 functions this means ∇2φ≥λI. λ may be negative: 14(x2−1)2 is (−1)-convex.
Assumption of Ch. 4. Any two points are joined by some curve along which v↦Φ(τ,w;v) is (1/τ+λ)-convex, for every base point w and 0<τ<1/λ−. It holds for λ-convex φ on Hilbert spaces and on nonpositively curved spaces. In the Wasserstein space it holds along generalized geodesics (Module 9).
Evolution variational inequality (EVI). Under that assumption, with S complete and φ proper, lower semicontinuous and coercive (bounded below as in Ch. 2), for every u0 in the closure of the domain the scheme converges to a unique curve u, and u is characterised by
12ddtd2(u(t),v)+λ2d2(u(t),v)≤φ(v)−φ(u(t))for all v.
Contraction and error. Two solutions satisfy d(u(t),w(t))≤e−λtd(u0,w0). For λ≥0 and constant step τ, the discrete solution obeys d(UN,u(Nτ))≤τ|∂φ|(u0)/2, and d2≤τ(φ(u0)−infφ) if only φ(u0)<∞.

In Rd the EVI is the first-order form of λ-convexity, φ(v)≥φ(u)+⟨∇φ(u),v−u⟩+λ2|v−u|2, with −∇φ(u)=u′ substituted. Its advantage is that it involves only distances and energies, and it still makes sense when φ has corners.

Explore

Energy φ on ℝ²
flow from p flow from q · drag the start points, then run
d(u(t),w(t)) bound e−λtd(u0,w0)

Worked example

Prove the contraction estimate for a C2 function φ on Rd with ∇2φ≥λI, and show it cannot be improved.

  1. What inequality does ∇2φ≥λI give for ∇φ(x)−∇φ(y)?

    Integrate the Hessian along the segment: ∇φ(x)−∇φ(y)=∫01∇2φ(y+s(x−y))(x−y)ds, so

    ⟨∇φ(x)−∇φ(y),x−y⟩≥λ|x−y|2.

  2. Let u,w be two gradient flows. Differentiate 12|u−w|2.

    ddt12|u−w|2=⟨u′−w′,u−w⟩=−⟨∇φ(u)−∇φ(w),u−w⟩≤−λ|u−w|2.
  3. Conclude.

    With D=|u−w|2, D′≤−2λD, so (e2λtD)′≤0 and |u(t)−w(t)|≤e−λt|u0−w0|. For λ>0 the flows merge; for λ=0 they never separate; for λ<0 they may separate, but at a controlled rate, which is still enough for uniqueness.

  4. Show the bound is sharp.

    For φ(x)=λ2|x|2 the flow is u(t)=e−λtu0, so |u(t)−w(t)|=e−λt|u0−w0| exactly. In the explorer, the saddle with both points on a vertical line shows equality with λ=−1.

Check your understanding

What is the largest λ for which φ(x,y)=x2+y4 is λ-convex on R2?

  1. λ=2That is the x-direction. In the y-direction the second derivative 12y2 vanishes at y=0.
  2. λ=0
  3. None: φ is not convex.Both terms are convex functions, so φ is convex.
∇2φ=diag⁡(2,12y2), whose smallest eigenvalue has infimum 0. So flows contract (weakly) but nothing forces exponential convergence in y: indeed y′=−4y3 decays only like t−1/2.

φ is convex (λ=0) but has corners, like |x|+12y2. Two flows start at distance 1. After time 5 their distance is

  1. at most 1.
  2. exactly 1.Contraction is an upper bound. In the corner example, two points on the same side of the corner come together as they stick to it.
  3. possibly more than 1, because of the corners.The EVI needs no smoothness: convexity alone gives contraction. Try the corner in the explorer.
The EVI holds for every convex φ (for |x| the flow is soft thresholding, which is 1-Lipschitz), and EVI implies contraction. Corners can only make trajectories merge, never cross.

For the saddle 12(x2−y2) (λ=−1), what does the theory give?

  1. d(u(t),w(t))≤etd(u0,w0): flows separate at most exponentially, so they are still unique.
  2. Nothing: uniqueness needs λ≥0.Any real λ gives uniqueness. Non-uniqueness needs a failure of semiconvexity, like −|x| at the origin.
  3. The distance still decreases.Two points separated vertically move apart like et.
If u0=w0 the bound gives d(u(t),w(t))≤et⋅0=0. Semiconvexity, λ∈R, is all that uniqueness needs. Compare −|x|, whose slope jumps at the top and which is not λ-convex for any λ.

Practice

Exponential decay of the energyλ > 0 and the Łojasiewicz inequality

Let φ∈C1(Rd) be λ-convex with λ>0 and minimizer u¯. Show φ(u)−φ(u¯)≤|∇φ(u)|2/2λ, and deduce φ(u(t))−φ(u¯)≤e−2λt(φ(u0)−φ(u¯)).

Hint

Minimize the right side of φ(v)≥φ(u)+⟨∇φ(u),v−u⟩+λ2|v−u|2 over v.

Solution

The minimum over v of the right side is φ(u)−|∇φ(u)|2/2λ, and the left side is at least φ(u¯). Along the flow, ddt(φ(u)−φ(u¯))=−|∇φ(u)|2≤−2λ(φ(u)−φ(u¯)), and Gronwall finishes.

Step size and convexityWhen is one step convex?

For the double well φ(x)=14(x2−1)2, find the best λ, and the range of τ for which Φ(τ,a;⋅) is strictly convex for every a. Relate this to quiz 3 of Module 2.

Solution

φ″(x)=3x2−1≥−1, so λ=−1. Φ″=3v2−1+1/τ≥1/τ−1. For τ<1=1/(−λ) this is bounded below by a positive constant; at τ=1, Φ″=3v2 vanishes only at v=0, so Φ is still strictly convex; for τ>1, Φ″(0)<0. So the range is τ≤1, and for such τ every step has exactly one minimizer, so the scheme is well defined. At τ=2, outside this range, the step from 0 had two minimizers.

InteractiveAmbrosio–Gigli–Savaré, Ch. 5: Preliminary Results on Measure Theory

Push-forwards and narrow convergence

Part II moves from points to probability measures. Two tools carry most of the weight: pushing a measure forward through a map (how mass is moved), and narrow convergence (how measures are compared in the limit).

The idea

Push-forward. For a Borel map T:X→Y and μ∈P(X), T#μ(B)=μ(T−1(B)). Equivalently ∫fd(T#μ)=∫f∘Tdμ for bounded Borel f.
Change of variables. If μ=ρLd and T is injective and differentiable (approximate differentiability suffices, Ch. 5.5) with det∇T>0, then
T#μ=ρdet∇T∘T−1Ldon T(X).
In one dimension: T#μ has density ∑x:T(x)=yρ(x)/|T′(x)|, and a flat piece of T creates an atom.
Narrow convergence. μn→μ narrowly if ∫fdμn→∫fdμ for every bounded continuous f. Prokhorov: on a complete separable metric space, a family is relatively compact for narrow convergence iff it is tight: for each ε there is a compact K with μ(X∖K)<ε for all members.
Uniformly integrable moments. limR→∞supn∫|x|>R|x|pdμn=0. Narrow convergence plus this is exactly convergence in the Wasserstein distance Wp (Ch. 7). Without it, a vanishing amount of mass can run off far enough to keep the distance large.

Chapter 5 also covers disintegration (writing a plan on X×Y as a family of conditional measures γx) and when plans converging narrowly implies maps converging; those reappear in the next two modules.

Explore

Start from a map
source μ (along x) map T · drag the knots up and down
density of T#μ atoms (mass written above)

Worked example

Let μn=(1−1n)δ0+1nδxn on R with xn→∞. Decide when μn→δ0, and in what sense.

  1. Show μn→δ0 narrowly, whatever xn is.

    For bounded continuous f, ∫fdμn=(1−1n)f(0)+1nf(xn), and |f(xn)|/n≤‖f‖∞/n→0. So the integrals converge to f(0).

  2. Take xn=n. Compute ∫|x|dμn and ∫|x|2dμn.

    ∫|x|dμn=1 and ∫|x|2dμn=n, while δ0 has both equal to 0. The moments do not converge: the escaping mass 1/n carries a fixed amount of first moment to infinity, so the moments are not uniformly integrable.

  3. The only plan from μn to δ0 sends everything to 0. Compute W1(μn,δ0) and W2(μn,δ0) for xn=n.

    W1=1n⋅n=1 and W2=(1n⋅n2)1/2=n. Neither tends to 0, even though the narrow limit is δ0.

  4. For which powers xn=na does W2(μn,δ0)→0?

    W22=n2a−1→0 iff a<12. At a=12 it stays equal to 1: narrow convergence holds, W2 convergence fails, and the second moments are bounded but not uniformly integrable.

Check your understanding

Does δ1/n converge narrowly to δ0?

  1. Yes.
  2. No: δ1/n({0})=0 for every n, but δ0({0})=1.Narrow convergence asks about integrals of continuous functions, not about the mass of every set. Mass may pile up on the boundary of a set in the limit.
f(1/n)→f(0) for every continuous f. The general rule (Portmanteau): lim supμn(C)≤μ(C) for closed C and lim infμn(U)≥μ(U) for open U. Here {0} is closed and 0≤1.

μ is uniform on [−1,1] and T(x)=x2. What is the density of T#μ on (0,1]?

  1. 12y
  2. 14yEach y has two preimages, ±y, and both contribute.
  3. 1 (uniform)T compresses intervals near 0 (its derivative vanishes there), so mass piles up near y=0.
Each preimage contributes ρ(x)/|T′(x)|=12/(2y), and there are two. Check: ∫01dy2y=1. The "Fold" preset in the explorer shows the same sum over preimages.

Which sequence in P(R) has no narrowly convergent subsequence?

  1. δ(−1)nIt is tight (all mass in [−1,1]); the even and odd subsequences converge.
  2. 12δ0+12δn
  3. the Gaussians N(0,1/n)They converge to δ0.
Half the mass escapes to infinity, so the family is not tight. A narrow limit would have to give mass 12 to {0} and nothing elsewhere, which is not a probability measure. Prokhorov's theorem says tightness is exactly what is missing.

Practice

Affine images of GaussiansPush-forward in practice

Show that if μ=N(m,σ2) on R and T(x)=ax+b with a≠0, then T#μ=N(am+b,a2σ2).

Solution

By change of variables, T#μ has density ρ((y−b)/a)/|a|=12π|a|σexp(−(y−b−am)22a2σ2). Every pair of Gaussians on R is linked by such a map with a=σ1/σ0>0; in Module 7 you will see it is the optimal one.

Moments are lower semicontinuousTruncation

Show that if μn→μ narrowly, then ∫|x|2dμ≤lim infn∫|x|2dμn. Give an example with strict inequality.

Hint

min(|x|2,R) is bounded and continuous.

Solution

∫min(|x|2,R)dμ=limn∫min(|x|2,R)dμn≤lim infn∫|x|2dμn. Let R→∞ and use monotone convergence. The worked example with xn=n gives 0<1.

InteractiveAmbrosio–Gigli–Savaré, Ch. 6: The Optimal Transportation Problem

Optimal transport

Moving one distribution of mass onto another costs something; the cheapest way to do it is the optimal transport problem. Optimal plans are recognised by a simple local test: no small rearrangement of who goes where can save anything.

The idea

Monge and Kantorovich. Monge: minimize ∫c(x,T(x))dμ over maps with T#μ=ν. Such maps may not exist (μ=δ0, ν=12δ−1+12δ1). Kantorovich relaxes to plans:
min{∫cdγ: γ∈Γ(μ,ν)},Γ(μ,ν)={γ∈P(X×Y): π#1γ=μ, π#2γ=ν}.
A minimizer exists for lower semicontinuous costs bounded below: Γ(μ,ν) is narrowly compact.
Cyclical monotonicity. A set Γ⊂X×Y is c-cyclically monotone if for all (x1,y1),…,(xn,yn)∈Γ and permutations σ, ∑c(xi,yi)≤∑c(xi,yσ(i)).
Optimality (Ch. 6.1). For a continuous cost with finite optimal cost (and a mild integrability bound on c), a plan is optimal iff its support is c-cyclically monotone; equivalently, iff Kantorovich's dual problem has a matching pair of potentials.
Brenier (the case c=|x−y|2). If μ is absolutely continuous on Rd (and both measures have finite second moments), the optimal plan is unique and induced by a map T=∇ψ with ψ convex. Chapter 6 extends this to "regular" μ and to Hilbert spaces.

For quadratic cost, the two-point test reads ⟨x1−x2,y1−y2⟩≥0: the plan is monotone. For c=|x−y|, optimality forces the segments of a matching not to cross (except in degenerate collinear configurations). For quadratic cost they can cross, but the moving particles never collide.

Explore

sources xi targets yj pairs that a swap would improve · drag points; click a source, then a target, to re-pair
Cost
Matching shown

Worked example

Let μ be uniform on [0,1] and ν uniform on [1,2]. Two maps push μ to ν: the translation T(x)=x+1 and the flip S(x)=2−x. Which is optimal, for c=|x−y| and for c=|x−y|2?

  1. Compute both costs for c=|x−y|.

    Translation: ∫011dx=1. Flip: ∫01|2−2x|dx=1. Equal.

  2. Show that no plan does better than 1 for c=|x−y|.

    For any γ∈Γ(μ,ν), ∫|x−y|dγ≥∫(y−x)dγ=∫ydν−∫xdμ=32−12=1. So both maps are optimal: with linear cost the optimal plan need not be unique.

  3. Now c=|x−y|2. Compute both costs.

    Translation: 1. Flip: ∫01(2−2x)2dx=43. The translation is cheaper.

  4. Show the translation is the unique optimal plan for c=|x−y|2.

    By Jensen, ∫(y−x)2dγ≥(∫(y−x)dγ)2=1, with equality iff y−x is γ-a.e. constant, i.e. γ is concentrated on y=x+1. That plan is the translation. Strict convexity of the cost is what buys uniqueness, and the optimal map is monotone, as the two-point test predicts.

Check your understanding

μ and ν are each uniform on n points. Must an optimal Kantorovich plan split mass?

  1. No: some optimal plan is a permutation (a perfect matching).
  2. Yes, in general.The plans form a polytope of doubly stochastic matrices (divided by n); a linear cost attains its minimum at a vertex, and the vertices are permutations.
  3. Only for quadratic cost is there an optimal permutation.The vertex argument works for any cost.
That is the Birkhoff–von Neumann theorem. It is why the explorer only searches over the 5!=120 matchings. With unequal numbers of points or unequal weights, splitting can be forced (see practice problem 2).

For c=|x−y|2 on Rd, when is pairing x1→y1, x2→y2 no worse than swapping the targets?

  1. When ⟨x1−x2, y1−y2⟩≥0.
  2. When the segments [x1,y1] and [x2,y2] do not cross.Not crossing is what optimality forces for c=|x−y|. Press "Crossing example": for squared cost the crossing pairing is the optimal one.
  3. When |x1−x2|≤|y1−y2|.Expand both costs: the squared norms cancel and only inner products remain.
|x1−y1|2+|x2−y2|2−|x1−y2|2−|x2−y1|2=−2⟨x1−x2,y1−y2⟩. Monotonicity of the support is the discrete shadow of Brenier's theorem: the gradient of a convex function is a monotone map.

μ is uniform on the unit disc and ν uniform on the disc of radius 2, both centred at 0. Which map is optimal for c=|x−y|2?

  1. T(x)=2x
  2. T(x)=2Rx, R a rotation by 90∘It also pushes μ to ν, but it is not the gradient of a convex function. Its cost is ∫|2Rx−x|2dμ=5∫|x|2dμ, versus ∫|x|2dμ for 2x.
  3. There are many optimal maps.μ is absolutely continuous, so Brenier's theorem gives uniqueness.
2x=∇(|x|2) and |x|2 is convex, so by Brenier it is the optimal map. Its cost is ∫|x|2dμ=12.

Practice

Monotone means optimal on the lineThe two-point test in 1-D

On R with c=|x−y|2, show that a plan whose support satisfies the two-point test is monotone: if (x1,y1),(x2,y2) are in the support and x1<x2, then y1≤y2. Why does this single out one plan?

Solution

The test says (x1−x2)(y1−y2)≥0, so x1<x2 forces y1≤y2. A monotone plan sends the u-th quantile of μ to the u-th quantile of ν, for every u∈(0,1), which determines it: γ=(Fμ−1,Fν−1)#L1|(0,1). That is the formula behind the next module.

When mass must splitThree atoms to two

Let μ=13(δ0+δ1+δ2) and ν=12(δ1/2+δ3/2). Find the optimal plan for c=|x−y|2 and its cost.

Hint

By the previous problem the plan is monotone: fill the targets from left to right.

Solution

0→12 with mass 13; the atom at 1 splits, 16 to 12 and 16 to 32; 2→32 with mass 13. Every move has length 12, so the cost is 14 and W2(μ,ν)=12. No map can do this: T#μ for a map gives each target a multiple of 13.

Edit it yourselfAmbrosio–Gigli–Savaré, Ch. 7: The Wasserstein Distance and its Behaviour along Geodesics

The Wasserstein distance

The optimal cost turns the probability measures into a metric space, the space where Part II's gradient flows live. On the line everything is explicit: sort the mass, and compare quantiles.

The idea

Wasserstein distance. On Pp(X)={μ:∫|x|pdμ<∞},
Wp(μ,ν)=(minγ∈Γ(μ,ν)∫|x−y|pdγ)1/p.
It is a complete separable metric, and Wp(μn,μ)→0 iff μn→μ narrowly with uniformly integrable p-moments.
On the line. With F−1 the quantile function, the monotone plan is optimal (Module 6) and
Wpp(μ,ν)=∫01|Fμ−1(u)−Fν−1(u)|pdu,W1(μ,ν)=∫R|Fμ−Fν|dx.
Geodesics. If γ is optimal for W2(μ0,μ1), then μt=((1−t)π1+tπ2)#γ is a constant-speed geodesic: W2(μs,μt)=|t−s|W2(μ0,μ1). This is displacement interpolation: every bit of mass travels along a straight line. On the line, Fμt−1=(1−t)Fμ0−1+tFμ1−1.
Mixtures are not geodesics. The linear interpolation (1−t)μ0+tμ1 fades one measure out while the other fades in. W2((1−t)δ0+tδ1, δ0)=t, so this curve is not even Lipschitz in W2.
Curvature (Ch. 7.3). P2(X) is positively curved: along a geodesic, W22(μt,ν)≥(1−t)W22(μ0,ν)+tW22(μ1,ν)−t(1−t)W22(μ0,μ1). On R the quantile map is an isometry into L2(0,1), so P2(R) is flat and equality holds.

Explore

Edit
Interpolation
μ0 μ1 μt · click or drag on the bars to edit
Quantile functions F−1(u). W22 is the mean squared vertical gap, W1 the shaded area.

Worked example

Let μ0 be uniform on [0,1] and μ1 uniform on [2,4]. Compute W2(μ0,μ1), the geodesic midpoint, and compare with the mixture midpoint ν=12μ0+12μ1.

  1. Write down the quantile functions and W2(μ0,μ1).

    F0−1(u)=u, F1−1(u)=2+2u. So W22=∫01(2+u)2du=4+2+13=193, and W2≈2.517.

  2. Find the displacement midpoint μ1/2 and check W2(μ0,μ1/2)=12W2(μ0,μ1).

    F1/2−1=12u+12(2+2u)=1+32u: uniform on [1,2.5]. Then W22(μ0,μ1/2)=∫01(1+u2)2du=1912=14⋅193. The midpoint is a single interval of intermediate length, not two bumps.

  3. Find the quantile function of the mixture ν.

    ν has mass 12 spread on [0,1] and 12 on [2,4]. So Fν−1(u)=2u for u<12 and 4u for u>12.

  4. Is ν on a geodesic between μ0 and μ1?

    W22(μ0,ν)=∫01/2u2du+∫1/219u2du=124+6324=83, and W22(ν,μ1)=∫01/24du+∫1/21(2u−2)2du=2+16=136. Then W2(μ0,ν)+W2(ν,μ1)≈1.633+1.472=3.105>2.517. The triangle inequality is strict, so ν lies on no geodesic between them. Load the "Split" preset and compare the two modes.

Check your understanding

μ=12δ0+12δ2 and ν=δ1. What is W2(μ,ν)?

  1. 0, since they have the same mean.W2=0 only for equal measures. Matching the mean is not enough.
  2. 1
  3. 2There is only one plan, and every unit of mass moves distance 1.
The only plan to a Dirac sends everything to it: W22=12⋅1+12⋅1=1. In general W22(μ,δy)=∫|x−y|2dμ, which is the variance when y is the mean.

Along the mixture μt=(1−t)δ0+tδ1, what is W2(μ0,μt)?

  1. t
  2. tThat is W2 along the displacement geodesic δt, where all the mass moves a distance t. Here mass t moves distance 1.
  3. t2The squared cost is t⋅12=t, and W2 is its square root, not its square.
The cost is t⋅12, so W2=t. The average speed t/t blows up as t→0. In fact W2(μs,μt)=|t−s| for all s,t, so the metric derivative is infinite everywhere and the mixture has infinite W2-length on every time interval, while W1=t is perfectly linear. Linear in the "vertical" sense (mass) and linear in the "horizontal" sense (position) are different notions.

ν is μ translated by a vector h∈Rd. What is W2(μ,ν)?

  1. |h|, for every μ
  2. at most |h|, and smaller when μ is spread outSome other plan might move mass less far on average? Jensen says no: ∫|x−y|2dγ≥|∫(x−y)dγ|2=|h|2.
  3. it depends on the shape of μThe lower bound from the means is attained by the translation itself, whatever μ is.
The translation achieves |h|2 and Jensen shows nothing beats it. In general W22(μ,ν)≥|mμ−mν|2, with equality iff ν is a translate of μ.

Practice

Gaussians on the lineA closed form

Show W22(N(m0,σ02),N(m1,σ12))=(m0−m1)2+(σ0−σ1)2 on R, and describe the geodesic.

Solution

Quantiles are mi+σiz(u) with z=Φ−1, and ∫01zdu=0, ∫01z2du=1. So W22=∫((m0−m1)+(σ0−σ1)z)2du=(m0−m1)2+(σ0−σ1)2. The geodesic is N(mt,σt2) with mt and σt (the standard deviation, not the variance) affine in t.

W1 as an areaCDFs versus quantiles

Explain why ∫01|Fμ−1−Fν−1|du=∫R|Fμ−Fν|dx.

Solution

Both are the area of the region between the graphs of Fμ and Fν in the (x,u) plane: integrating horizontally slice by slice (fixed u) gives the left side, vertically (fixed x) the right side. The graph of F−1 is the graph of F reflected in the diagonal, with vertical jumps filled in. For p>1 there is no such formula in terms of F alone.

Animated lessonAmbrosio–Gigli–Savaré, Ch. 8: A.C. Curves in Pp(X) and the Continuity Equation

The continuity equation

A curve of probability measures moves because its mass moves, with some velocity field. Many velocity fields can produce the same curve; the cheapest one is a gradient, and its kinetic energy is the curve's speed in W2. That makes the Wasserstein space look like a Riemannian manifold.

The idea

Continuity equation. ∂tμt+∇⋅(vtμt)=0 in the sense of distributions:
ddt∫ϕdμt=∫⟨∇ϕ,vt⟩dμtfor all ϕ∈Cc∞(Rd).
If v is smooth, μt=(Xt)#μ0 where Xt is the flow of v: mass is carried along the trajectories.
Absolutely continuous curves (Ch. 8.3). A curve μt in Pp(Rd) is absolutely continuous iff it solves the continuity equation for some vt with ∫‖vt‖Lp(μt)dt<∞. Every such v satisfies ‖vt‖Lp(μt)≥|μ′|(t), and there is one with equality for a.e. t.
Tangent space (Ch. 8.4). For p=2, the optimal vt is the unique one in
Tanμ⁡P2={∇ϕ:ϕ∈Cc∞}―L2(μ).
Two fields give the same curve iff their difference w satisfies ∇⋅(wμ)=0; removing that part only lowers the kinetic energy.
Benamou–Brenier. W22(μ0,μ1)=min{∫01∫|vt|2dμtdt} over all solutions of the continuity equation joining μ0 to μ1. Minimizers move along geodesics with tangent velocity.

Watch

moved by v=a moved by v=a+cJ(x−mt) · rings: density level sets of μt
  1. A probability measure μ0: a Gaussian, drawn as a sample of particles with its density level sets.
  2. Move every particle with the constant field v=a, a gradient (of ⟨a,x⟩). The measure slides: μt=N(m0+ta,σ2I).
  3. Start again with v=a+cJ(x−mt), J the rotation by 90∘. Particles now swirl around the moving centre.
  4. Yet the rings match: the swirl is divergence-free against the radial density, ∇⋅(J(x−mt)ρt)=0. Same curve μt, two velocity fields.
  5. The kinetic energies differ: |a|2 versus |a|2+2c2σ2. The curve's speed is |μ′|=|a|, achieved by the gradient field, which is the tangent vector.

Worked example

On R, let μt=N(0,(1+t)2) for t∈[0,1]. Find a velocity field, check the continuity equation, and decide whether the curve is a geodesic.

  1. Write μt as a push-forward of μ0 and read off a velocity.

    Xt(x)=(1+t)x pushes N(0,1) to N(0,(1+t)2). A particle at y=Xt(x) moves with speed X˙t(x)=x=y/(1+t), so vt(y)=y/(1+t).

  2. Check the weak form of the continuity equation.

    With Z∼N(0,1), ddt∫ϕdμt=ddtEϕ((1+t)Z)=E[ϕ′((1+t)Z)Z]=∫ϕ′(y)y1+tdμt(y).

  3. Compute the kinetic energy ∫|vt|2dμt. Is vt tangent?

    ∫y2(1+t)2dμt=1. And vt=∂y(y2/2(1+t)) is a gradient, so it is the tangent field and |μ′|(t)=1.

  4. Compare the length of the curve with W2(μ0,μ1).

    Length =∫01|μ′|dt=1, and W2(N(0,1),N(0,4))=|1−2|=1 by the Gaussian formula of Module 7. Length equals distance, so the curve is a geodesic, and the Benamou–Brenier action ∫01∫|vt|2dμtdt=1=W22 is minimal.

Check your understanding

On R, suppose μt has a smooth positive density for every t. How many velocity fields in L2(μt) solve the continuity equation for this curve?

  1. Exactly one.
  2. Infinitely many, as with the swirl.In one dimension ∂x(wρ)=0 means wρ is constant, and integrability forces the constant to be 0.
  3. None, unless the curve is a geodesic.Every absolutely continuous curve has velocity fields; geodesics are the ones whose tangent field has constant norm and is "straight".
There is no room to swirl on the line. Indeed, vt(x)=−∂tFt(x)/ρt(x), where Ft is the CDF: the flux through x is the rate at which mass to the left of x decreases.

μt=δx(t) for a smooth path x(t) in Rd. What is |μ′|(t) in W2?

  1. |x′(t)|
  2. 0, because a Dirac mass has no density to move.W2(δx,δy)=|x−y|, so the curve moves exactly as fast as the point.
  3. It is undefined: there is no velocity field on the complement of the support.Only the values of vt on the support of μt matter, since ‖vt‖L2(μt) only sees them.
x↦δx is an isometric embedding of Rd into P2(Rd). Any field with vt(x(t))=x′(t) works, and ‖vt‖L2(μt)=|x′(t)|.

A curve on [0,1] solves the continuity equation with ∫|vt|2dμt=E for every t. What follows?

  1. W2(μ0,μ1)≤E
  2. W2(μ0,μ1)=EAdd a swirl: the kinetic energy goes up and the curve stays the same.
  3. W2(μ0,μ1)≥EThe kinetic energy bounds the speed from above, not below.
W2(μ0,μ1)≤∫01|μ′|dt≤∫01‖vt‖L2(μt)dt=E. Equality needs both a geodesic and tangent velocities, which is the Benamou–Brenier statement.

Practice

The swirl is invisibleA divergence-free perturbation

Let ρ(x)=g(|x−m|) be a radial density on R2 and w(x)=J(x−m). Show ∇⋅(wρ)=0, and compute ∫|w|2dμ for μ=N(m,σ2I2).

Solution

∇⋅(wρ)=ρ∇⋅w+⟨w,∇ρ⟩. The rotation field has zero divergence, and ∇ρ is parallel to x−m, which is perpendicular to J(x−m). So both terms vanish. Then ∫|J(x−m)|2dμ=∫|x−m|2dμ=2σ2, the value in the animation's stats.

The velocity on the lineFrom the CDF

On R, show that vt=−∂tFt/ρt solves the continuity equation for a smooth curve of positive densities ρt with CDFs Ft. Check it on the translation ρt(x)=ρ(x−t).

Solution

Integrate ∂tρt=−∂x(vtρt) from −∞ to x: ∂tFt(x)=−vt(x)ρt(x), assuming the flux vanishes at −∞. For the translation, Ft(x)=F(x−t), so ∂tFt=−ρ(x−t) and vt=1.

InteractiveAmbrosio–Gigli–Savaré, Ch. 9: Convex Functionals in Pp(X)

Displacement convexity

Chapter 4 needs λ-convexity along geodesics. In the Wasserstein space geodesics move mass rather than mixing it, and a functional can be convex along one kind of interpolation and not the other. Here you test both.

The idea

Geodesic convexity in P2. ϕ is λ-convex along geodesics if for every μ0,μ1 there is a geodesic μt with ϕ(μt)≤(1−t)ϕ(μ0)+tϕ(μ1)−λ2t(1−t)W22(μ0,μ1). McCann called this displacement convexity.

The model examples (Ch. 9.3), with μ=ρLd:

  • Potential energy V(μ)=∫Vdμ is λ-convex iff V is λ-convex. Along mixtures it is always affine.
  • Interaction energy W(μ)=12∬W(x−y)dμ(x)dμ(y) is convex if W is convex. With W(z)=|z|2 on R it is the variance, which is concave along mixtures.
  • Internal energy F(μ)=∫F(ρ)dx is convex if F(0)=0 and s↦sdF(s−d) is convex and nonincreasing on (0,∞) (McCann's condition). This covers the entropy F(s)=slog⁡s and sm/(m−1) for m≥1−1/d.
  • Relative entropy with respect to γ=e−VLd is λ-convex iff V is λ-convex (Ch. 9.4): the entropy of a log-concave reference measure.
Generalized geodesics (Ch. 9.2). Because P2(Rd) is positively curved for d≥2, 12W22(⋅,ν) is not 1-convex along geodesics, and the assumption of Chapter 4 fails for plain geodesics. The fix is to interpolate between μ0 and μ1 using optimal plans from a third measure (the base point of the step). All the functionals above are convex along these generalized geodesics too, so Chapter 4's theory applies.

Explore

Endpoints
Functional
displacement μt mixture (1−t)μ0+tμ1 endpoints, and V when used
along displacement along mixture · dashed: the chord

Worked example

Compute the entropy H(μ)=∫ρlog⁡ρdx along the W2 geodesic between two Gaussians on R, and decide how convex it is.

  1. Compute H(N(m,σ2)).

    log⁡ρ=−12log⁡(2πσ2)−(x−m)22σ2, and the second term averages to −12. So H=−12log⁡(2πeσ2)=−log⁡σ−12log⁡(2πe).

  2. Along the geodesic from N(m0,σ02) to N(m1,σ12), what is H(μt)?

    By Module 7 the geodesic is N(mt,σt2) with σt=(1−t)σ0+tσ1. So H(μt)=−log⁡σt+const.

  3. Is it convex in t? Is it λ-convex for some λ>0?

    d2dt2(−log⁡σt)=(σ1−σ0)2/σt2≥0, so it is convex. But if σ0=σ1 and m0≠m1 (a translation) it is constant along a geodesic of positive length, so no λ>0 works: the entropy is exactly 0-convex.

  4. Why is the entropy convex along every 1-D geodesic, Gaussian or not?

    With quantile Q, H(μ)=∫01log⁡ρ(Q(u))du=−∫01log⁡Q′(u)du (because ρ(Q)Q′=1). Along a geodesic Qt′=(1−t)Q0′+tQ1′ is affine in t for each u, and −log is convex. In the explorer, the entropy curve is convex for every preset.

Check your understanding

For which V is μ↦∫Vdμ convex along every W2 geodesic?

  1. Exactly the convex V.
  2. Every V, since μ↦∫Vdμ is linear.It is linear along mixtures. Along the geodesic δxt between two Dirac masses it equals V(xt), which is convex only if V is.
  3. Every V bounded below.Try the double well across the origin in the explorer.
If V is λ-convex, ∫Vdμt=∫V((1−t)x+ty)dγ inherits λ-convexity from V, with ∫|x−y|2dγ=W22. Conversely, test on Dirac masses.

Is the entropy ∫ρlog⁡ρ on Rd λ-convex along geodesics for some λ>0?

  1. No: it is constant along translations, which are geodesics.
  2. Yes, with λ=1.That is the entropy relative to the standard Gaussian, where the added potential ∫|x|2/2dμ supplies the 1-convexity.
  3. No, it is not even convex.It is convex (0-convex) by McCann's condition: sd⋅s−dlog⁡s−d=−dlog⁡s is convex and nonincreasing.
Translating μ by th is a geodesic of length |h| along which ∫ρlog⁡ρ does not change. So the heat flow (Module 11) contracts with λ=0, not exponentially.

Var⁡(μ)=12∬|x−y|2dμdμ. Between μ0=δ−1 and μ1=δ1, along which interpolation is it convex?

  1. Along the displacement interpolation only.
  2. Along both.Along the mixture (1−t)δ−1+tδ1 the variance is 4t(1−t).
  3. Along the mixture only.The displacement interpolation is δ2t−1, with variance 0 throughout: that is convex.
W(z)=|z|2 is convex, so the interaction energy is displacement convex. Along mixtures, Var=∫|x|2dμ−|∫xdμ|2 is affine minus convex: concave. The "Variance" option shows both.

Practice

Entropy relative to a GaussianWhere λ = 1 comes from

Let γ=N(0,Id). Show H(μ|γ)=∫ρlog⁡ρdx+∫12|x|2dμ+const, deduce that it is 1-convex along geodesics, and check the constant 1 is sharp using translations of γ.

Solution

log⁡(ρ/γ)=log⁡ρ+12|x|2+d2log⁡2π. The entropy is 0-convex and 12|x|2 is 1-convex, so the sum is 1-convex. Along μt=N(th,I), H(μt|γ)=12t2|h|2, whose second derivative is |h|2=W22(μ0,μ1): equality with λ=1.

The quadratic internal energyQuantiles again

On R, show μ↦∫ρ2dx is convex along geodesics.

Hint

∫ρ2dx=∫01ρ(Q(u))du. Express ρ(Q(u)) through Q′.

Solution

ρ(Q(u))=1/Q′(u), so ∫ρ2dx=∫01duQ′(u). Along a geodesic Qt′ is affine and positive, and s↦1/s is convex on (0,∞). This matches McCann's condition in d=1: sF(1/s)=1/s is convex and nonincreasing.

Draw it yourselfAmbrosio–Gigli–Savaré, Ch. 10: Metric Slope and Subdifferential Calculus in Pp(X)

The Wasserstein gradient

On P2 a gradient is a velocity field: the direction in which to move the mass to raise the functional fastest. For the entropy that field is ∇ρ/ρ, and its kinetic energy is the Fisher information. Draw a density and see its gradient.

The idea

Subdifferential (Ch. 10.1). ξ∈L2(μ;Rd) belongs to ∂ϕ(μ) if, with tμν the optimal map from μ to ν,
ϕ(ν)−ϕ(μ)≥∫⟨ξ, tμν−id⟩dμ+o(W2(μ,ν)).
For λ-convex ϕ the o(⋅) can be replaced by λ2W22(μ,ν).
Slope = minimal subgradient. For λ-convex ϕ, |∂ϕ|(μ)=min{‖ξ‖L2(μ):ξ∈∂ϕ(μ)}, and the minimizer ∂∘ϕ(μ) lies in the tangent space.

For smooth densities the recipe is: take the first variation δϕδρ (the L2 derivative), then its spatial gradient. Ch. 10.4 makes this rigorous for the model functionals:

  • potential energy ∫Vdμ:  ξ=∇V;
  • interaction energy 12∬W(x−y)dμdμ (W even):  ξ=(∇W)∗μ;
  • internal energy ∫F(ρ)dx:  ξ=∇LF(ρ)/ρ with LF(s)=sF′(s)−F(s), which is ∇F′(ρ) for smooth ρ. For the entropy, ξ=∇ρ/ρ=∇log⁡ρ.
Fisher information. |∂H|2(μ)=∫|∇ρ|2ρdx, finite only if ρ∈Wloc1,1 with ∇ρ/ρ∈L2(μ). For the relative entropy with respect to e−V, ξ=∇log⁡(ρeV), which vanishes exactly at ρ∝e−V.

The first-variation identity behind all of this: ddεϕ((id+εη)#μ)|ε=0=∫⟨ξ,η⟩dμ. The explorer measures the left side with η=−ξ.

Explore

Draw a density with your mouse or finger (it is smoothed and normalised). ρ steepest-descent velocity −ξ e−V, when used
Functional
Or start from

Worked example

On R, take the relative entropy ϕ(μ)=∫ρlog⁡ρdx+∫12x2dμ and μ=N(m,s2). Compute the Wasserstein gradient, the slope, and the steepest-descent motion.

  1. What is ξ for a general smooth positive ρ?

    The first variation is log⁡ρ+1+12x2, so ξ=ρ′/ρ+x.

  2. Evaluate it for ρ=N(m,s2).

    ρ′/ρ=−(x−m)/s2, so ξ(x)=(1−1s2)x+ms2: an affine field.

  3. Compute |∂ϕ|2(μ)=∫ξ2dμ.

    Write ξ=ax+b with a=1−1/s2, b=m/s2. Then ∫ξ2dμ=a2s2+(am+b)2, and am+b=m. So

    |∂ϕ|2(μ)=(s−1s)2+m2,
    which vanishes only for N(0,1), the reference measure.

  4. Move every particle with velocity −ξ. What happens to m and s?

    A particle at m+sz moves with velocity −a(m+sz)−b. Matching the parts with and without z: m′=−m and s′=−as=1s−s. So Gaussians stay Gaussian, m(t)=m0e−t and (s2)′=2−2s2, i.e. s(t)2=1+(s02−1)e−2t. This is the Ornstein–Uhlenbeck flow you will run in the next module.

Check your understanding

What is the Wasserstein gradient of the potential energy ∫Vdμ at μ?

  1. The vector field ∇V, viewed in L2(μ).
  2. The function V.V is the first variation (the L2 gradient). The Wasserstein gradient is a velocity, so it is ∇V.
  3. The measure ∇Vμ.That is the flux vμ in the continuity equation, not the velocity v.
Moving mass by id+εη changes ∫Vdμ by ε∫⟨∇V,η⟩dμ+o(ε). The slope is ‖∇V‖L2(μ), and the gradient flow is ∂tμ=∇⋅(μ∇V): every particle follows x′=−∇V(x) independently.

What is the slope of the entropy at μ= uniform on [0,1]?

  1. 0, because ρ′=0 inside the interval.The jumps at 0 and 1 matter: ρ∉Wloc1,1(R). The heat flow spreads them at infinite initial speed.
  2. +∞
  3. 1There is no finite subgradient: any finite ξ would make the entropy change at a finite rate under the heat flow, but it drops infinitely fast at first.
Finite Fisher information needs ρ∈Wloc1,1. The uniform measure has finite entropy (it is in the domain) but infinite slope; by the regularising effect of Chapter 4, the flow enters the set of finite slope immediately. Draw a box-shaped density in the explorer: smoothing keeps the number finite, but it is large.

For the relative entropy with respect to γ=e−VLd (a probability measure), when is the slope zero?

  1. Exactly when μ=γ.
  2. When μ is a Dirac mass at a minimum of V.A Dirac mass has infinite entropy; it is not in the domain.
  3. Never: the entropy always pushes mass outward.The potential pushes inward. They balance when ∇log⁡ρ=−∇V.
ξ=∇log⁡(ρ/e−V)=0 means ρ/e−V is constant on the (connected) support. Choose "Relative entropy" and the "N(0, 1)" preset in the explorer: the arrows vanish.

Practice

The gradient of an interaction energyA first-variation computation

Let W(μ)=12∬W(x−y)dμ(x)dμ(y) with W even and C1. Compute ddεW((id+εη)#μ) at ε=0 and identify ξ.

Solution

W((id+εη)#μ)=12∬W(x−y+ε(η(x)−η(y)))dμdμ. Differentiating gives 12∬⟨∇W(x−y),η(x)−η(y)⟩. Since ∇W is odd, the two halves are equal, giving ∫⟨(∇W∗μ)(x),η(x)⟩dμ(x). So ξ=∇W∗μ.

Fisher information of a GaussianAnd the entropy's decay rate

Compute ∫(ρ′)2/ρdx for ρ=N(m,s2) on R. Along the heat flow s2(t)=s02+2t, check that ddtH(μt)=−|∂H|2(μt).

Solution

ρ′/ρ=−(x−m)/s2, so ∫(ρ′/ρ)2ρdx=s2/s4=1/s2. With H=−12log⁡(2πes2), ddtH=−12⋅2s2=−1s2. The energy falls at the rate "slope squared", as for any gradient flow.

SimulationAmbrosio–Gigli–Savaré, Ch. 11: Gradient Flows and Curves of Maximal Slope in Pp(X)

Heat and Fokker–Planck by JKO

Everything comes together: the minimizing-movement scheme of Module 2, run in the Wasserstein space with the free energy of Modules 9 and 10, produces the heat equation and the Fokker–Planck equation. Here it runs on particles, one minimization per step.

The idea

Gradient flow in P2 (Ch. 11.1). An absolutely continuous curve μt whose tangent velocity satisfies vt=−∂∘ϕ(μt) (more generally −vt∈∂ϕ(μt)), together with ∂tμt+∇⋅(vtμt)=0. Under mild conditions this is the same as a curve of maximal slope for |∂ϕ| in (P2,W2).
The JKO scheme. The minimizing movement of Module 2 with d=W2:
μn∈argminμ⁡ ϕ(μ)+W22(μ,μn−1)2τ.
Named after Jordan, Kinderlehrer and Otto, who used it for the Fokker–Planck equation.
Existence and uniqueness (Ch. 11.2). If ϕ is proper, lower semicontinuous, bounded below on some W2-ball (coercivity) and λ-convex along generalized geodesics, then for every μ0 in the W2-closure of its domain the JKO scheme converges, the limit is the unique gradient flow, it is characterised by the EVI in W2, and W2(μt,νt)≤e−λtW2(μ0,ν0). The error estimates of Chapter 4 hold as stated there.

With the free energy ϕ(μ)=∫ρlog⁡ρdx+∫Vdμ, Module 10 gives v=−∇ρ/ρ−∇V, and the continuity equation becomes

∂tρ=Δρ+∇⋅(ρ∇V).

V=0 gives the heat equation (λ=0); V=12|x|2 gives the Ornstein–Uhlenbeck equation (λ=1), whose solutions converge exponentially to N(0,I). Other free energies give the porous medium equation and nonlocal aggregation equations (Ch. 11.2.1).

How the simulation works. On the line, a measure made of N equal particles x1<⋯<xN has W22 to another such measure equal to 1N∑|xi−yi|2 (sorted order is optimal). The entropy is approximated by spreading mass 1/(N−1) uniformly over each gap. Each JKO step is then a minimization in (x1,…,xN), strictly convex as long as 1/τ+V″>0, solved by Newton's method.

Explore

Potential V
Initial datum
μn (ticks: particles) exact solution, when known equilibrium e−V/Z
free energy ϕ(μn) variance of μn exact variance, when known

Worked example

Do one JKO step for the heat equation (ϕ=H, V=0) on R, starting from μ0=N(0,s02), assuming the minimizer is a centred Gaussian N(0,s2).

  1. Write the JKO functional as a function of s.

    W22=(s−s0)2 (Module 7) and H=−log⁡s+const (Module 9). So minimize −log⁡s+(s−s0)22τ.

  2. Solve for s1.

    The derivative is −1s+s−s0τ=0, i.e. s2−s0s−τ=0, so s1=12(s0+s02+4τ).

  3. Compare s12 with the exact heat flow, s2(τ)=s02+2τ.

    From s12=s0s1+τ and s1=s0+τ/s0+O(τ2): s12=s02+2τ+O(τ2). One step is first-order accurate. In fact s1−s0τ=1s1 is implicit Euler for s′=1/s, the exact ODE for the standard deviation.

  4. Why is assuming a Gaussian minimizer harmless here?

    The entropy is convex along generalized geodesics, so the JKO functional is strictly convex along them and any critical point is the global minimizer. The Gaussian candidate satisfies the optimality condition (t−id)/τ=∇ρ1/ρ1, where t(x)=(s0/s1)x is the optimal map back to μ0: it reads (s0/s1−1)/τ=−1/s12, which is the equation of step 2.

Check your understanding

Which functional has ∂tρ=Δρ+∇⋅(ρ∇V) as its W2 gradient flow?

  1. ∫ρlog⁡ρdx+∫Vρdx
  2. 12∫|∇ρ|2dx+∫VρdxThe Dirichlet energy gives the heat equation as its L2 gradient flow, not as a W2 one. In W2 it gives a fourth-order equation.
  3. ∫ρlog⁡ρdx−∫VρdxCheck the sign: the velocity is −∇V−∇log⁡ρ, so mass flows down V.
ξ=∇log⁡ρ+∇V, and ∂tρ=∇⋅(ρξ)=Δρ+∇⋅(ρ∇V). The same PDE is a gradient flow for different pairs (functional, metric); the Wasserstein choice is the one in which the free energy is convex and the flow contracts.

Two solutions of the heat equation on Rd. What does Chapter 11 give for W2(μt,νt)?

  1. W2(μt,νt)≤W2(μ0,ν0)
  2. W2(μt,νt)≤e−tW2(μ0,ν0)That needs λ=1, as for Ornstein–Uhlenbeck. Two heat flows from translated data stay translates of each other, at constant distance.
  3. It may grow, since diffusion spreads mass.The entropy is 0-convex, so the flow is 0-contracting.
λ=0 for the entropy (Module 9, quiz 2). With the potential 12|x|2 added, λ=1: in the explorer the mean and variance relax to those of N(0,1) like e−t and e−2t.

Can the heat flow start from δ0∈P2(R), where the entropy is +∞?

  1. Yes: δ0 lies in the W2-closure of the domain, and the flow is μt=N(0,2t).
  2. No: the first JKO step needs ϕ(μ0)<∞.The step itself is fine: the minimization over μ only needs ϕ(μ)<∞ for some competitor. Chapter 4's theory covers initial data in the closure of the domain.
  3. Yes, but it stays at δ0.The slope term in the energy inequality forces it to move, as in Module 1.
Gaussians N(0,ε) have finite entropy and converge to δ0 in W2. By contraction the flows from them converge, and the limit is the heat kernel N(0,2t), at distance W2(μt,δ0)=2t.

Practice

Exponential contraction for Ornstein–UhlenbeckChecking λ = 1 by hand

With m(t)=m0e−t and s(t)2=1+(s02−1)e−2t (Module 10), verify W2(μt,γ)≤e−tW2(μ0,γ) for γ=N(0,1).

Hint

W22(μt,γ)=m(t)2+(s(t)−1)2. Write s−1=(s2−1)/(s+1).

Solution

The mean term is m02e−2t. For the other, |s(t)−1|=|s02−1|e−2ts(t)+1, and we need this ≤e−t|s0−1|, i.e. s(t)+1≥(s0+1)e−t. Since s(t)2≥s02e−2t (expand) we have s(t)≥s0e−t, and 1≥e−t. Adding the two terms gives the claim.

The porous medium equationA different internal energy

Show that the W2 gradient flow of F(μ)=1m−1∫ρmdx (m>1) is ∂tρ=Δ(ρm).

Solution

The first variation is mm−1ρm−1, so ξ=∇(mm−1ρm−1)=mρm−2∇ρ. Then ∂tρ=∇⋅(ρξ)=∇⋅(mρm−1∇ρ)=Δ(ρm). McCann's condition m≥1−1/d makes F displacement convex, so Chapter 11's theory applies.