# The continuity equation and Benamour Brenier formula

## Introduction

The continuity equation is an important equation in many fields of science, for example, electromagnetism, computer vision, fluid dynamics etc. However, in the field of optimal transport, the formulation from fluid dynamics is of a large significance. This form helps to explain the dynamic formulation of special cases of Wasserstein metric via the continuity equation, and we will focus in this direction. Related to this is the Benamou-Brenier Formula, which implies a Riemannian structure on our space of measures. For more general information about the continuity equation, look at the article Continuity equation.

## Continuity equation in fluid dynamics

First, because of the intuition, we will introduce the definition of the continuity equation in fluid mechanics. The exposition in this section will follow the book by Chorin and Marsden[1].

Suppose that mass of our fluid is conserved, through time. Denote ${\displaystyle \rho (x,t)}$ as a density function, representing the mass-density of fluid, and ${\displaystyle v(x,t)}$ as a velocity of particle at position ${\displaystyle x}$, at time ${\displaystyle t}$. Then, for any subspace ${\displaystyle W}$ of ${\displaystyle \mathbb {R} ^{3}}$ we have:

${\displaystyle \partial _{t}[\int _{W}\rho (x,t)dV]=-\int _{\partial W}\rho v\cdot ndS.}$

In this section, we assume both density function and particle velocity are smooth enough. Hence, after differentiating under the integral and applying the Divergence Theorem, we get:

${\displaystyle \int _{W}\partial _{t}\rho (x,t)dV=-\int _{W}\nabla \cdot (\rho v)dV.}$

Finally, we conclude that:

${\displaystyle \int _{W}\partial _{t}\rho +\nabla \cdot (\rho v)dV=0,}$

which implies, since ${\displaystyle W}$ is arbitrary, that:

${\displaystyle \partial _{t}\rho +\nabla \cdot (\rho v)=0.}$

The last equation is the continuity equation in fluid dynamics, written in the differential form. We use the equation in this form in optimal transport.

An important perspective comes from viewing the fluid as an system of particles moving in space (Langrangian perspective), as opposed to some continuous density that varies at specific points (Eulerian perspective) due to internal currents. This alternate perspective can be formalized via an ordinary differential equation[2].

${\displaystyle {\begin{cases}\gamma '(t)=v(\gamma (t),t)&\\\gamma (0)=x&\end{cases}}}$

where ${\displaystyle v(x,t)}$ is some vector field varying with time, and ${\displaystyle \gamma (t)}$ is absolutely continuous. Since we are not assuming our curve is differentiable, we can instead consider the integral form of our ODE

${\displaystyle \gamma (t)=x+\int _{0}^{t}v_{s}(\gamma (s))\,ds}$

In both cases, ${\displaystyle x}$ represents the starting point of our curve, which indicates the path of a specific particle in our fluid. The important fact is that the continuity equation and our ODE system are equivalent in a weak sense when given the same ${\displaystyle v(x,t)}$. Intuitively, the continuity equation is stating the the change in density at a point is dictated by the flow of particles, ${\displaystyle \rho \cdot v(x,t)}$ into that point. From the Lagrangian point of view, this flow is the result of all the trajectories of particles that follow the current ${\displaystyle v(x,t)}$ into the desired point.

## Continuity equation in optimal transport

The previous discussion assumed that the density function was smooth, which is not true of the general measures we consider in optimal transport. Even when a measure ${\displaystyle \mu }$ is absolutely continuous with respect to Lebesgue measure, which we write with a mild abuse of notation as ${\displaystyle d\mu (x)=\mu (x)dx}$, ${\displaystyle \mu }$ does not have to be smooth. So, we need to state a proper weak formulation of the continuity equation. Smooth functions satisfy all the cases below.

Here, we will present definitions and reasoning from book by F.Santambrogio[3].

From this point, we are looking at the following equation:

${\displaystyle \partial _{t}\mu _{t}+\nabla \cdot (\mu _{t}v_{t})=0.}$

We will give two different notions of solutions to the continuity equation.

• Distributional solution. All the measures we are interested in satisfy ${\displaystyle \int _{0}^{1}||v_{t}||_{L^{1}(\mu _{t})}dt<\infty }$, and solve continuity equation in a distributional sense, namely
${\displaystyle \int _{0}^{T}\int _{\Omega }[\partial _{t}\phi +\nabla \phi \cdot v_{t}]d\mu _{t}dt=0,}$ for all bounded Lipschitz functions ${\displaystyle \phi \in C_{c}^{1}((0,T)\times {\overline {\Omega }})}$, where ${\displaystyle \Omega }$ is a bounded domain or the whole space ${\displaystyle \mathbb {R} ^{d}}$, and ${\displaystyle 0. We assume no-flux condition in this case, namely ${\displaystyle \mu _{t}v_{t}\cdot n=0}$ on the boundary ${\displaystyle \partial \Omega .}$ This notion of solution is called a distributional solution.

The main goal of the classical optimal transport theory is how to find the least expensive way to move one measure to the another one. For more information, look at Monge Problem.So, we have to impose initial and terminal conditions on measures, for example ${\displaystyle \mu _{0}=\mu }$, and ${\displaystyle \mu _{1}=\nu .}$ Then, our equation becomes ${\displaystyle \int _{0}^{T}\int _{\Omega }[\partial _{t}\phi +\nabla \phi \cdot v_{t}]d\mu _{t}dt=\int _{\Omega }\phi (T,x)d\nu (x)-\int _{\Omega }\phi (0,x)d\mu (x),}$ for all ${\displaystyle \phi \in C_{c}^{1}([0,T]\times {\overline {\Omega }}).}$

• Weak solution. Another way to interpret solutions to the continuity equation is to assume that function ${\displaystyle t\rightarrow \int _{\Omega }\psi d\mu _{t}}$ is absolutely continuous, and for a.e. ${\displaystyle t}$ it holds: ${\displaystyle \partial _{t}\int _{\Omega }\psi d\mu _{t}=\int _{\Omega }\nabla \psi \cdot v_{t}d\mu _{t},}$ for all test functions ${\displaystyle \psi \in C_{c}^{1}({\overline {\Omega }})}$ This kind of solution is called a weak solution.

Some connections between these two types of solutions are given in the following propositions.

Proposition 1., (p.124,[3]) Distributional and weak solutions are equivalent. Every weak solution is a distributional solution. On the other hand, every distributional solution admits a representative (a.e. equal), that is weakly continuous and a weak solution.
Proposition 2.,(p.124,[3]) Let ${\displaystyle \mu }$ be the Lipschitz function in ${\displaystyle (t,x)}$ and ${\displaystyle v}$ be the Lipschitz function in ${\displaystyle x.}$ Suppose that the continuity equation is satisfied in the weak sense. Then it is satisfied in a.e. sense.

The following theorem will provide us with existence and uniqueness of the continuity equation solution. For simplicity, we will assume that ${\displaystyle \Omega =\mathbb {R} ^{d}.}$

Theorem.[3] Let measurable function ${\displaystyle v:(0,T)\times \mathbb {R} ^{d}\rightarrow \mathbb {R} ^{d}}$ be a Lipschitz continuous in ${\displaystyle x}$, uniformly in ${\displaystyle t}$, and uniformly bounded. Suppose that flow ${\displaystyle X_{t}}$ of the classical ODE problem, with function ${\displaystyle v}$ exists. Then, for any probability measure ${\displaystyle \mu _{0}}$, push-forward measures ${\displaystyle \mu _{t}=X_{t}\#\mu _{0}}$ satisfy the continuity equation with the initial condition ${\displaystyle \mu _{0}}$. Moreover, for all measures ${\displaystyle \mu _{t}}$ absolutely continuous with respect to Lebesgue measure, the previous solution is the only solution the continuity equation admits.
Sketch of the Proof.

Proving existence, or checking that ${\displaystyle \mu _{t}}$ satisfies the continuity equation in a sense of the weak solution is straightforward, using change of variables in the integral. However, resolving the uniqueness of this solution when it is absolutely continuous with respect to Lebesgue measure requires narrowing a test function space, using distributional solution. Hence, we can control the flow ${\displaystyle X_{t}}$ in a better way, and using a linear transport equation solution, we can prove the uniqueness of solution of our continuity equation.

## Applications

The following theorem can be found at the book by L.Ambrosio, E.Brué, and D.Semola[2].

Theorem (Benamou-Brenier Formula).[2] Let ${\displaystyle \mu ,\nu \in {\mathcal {P}}_{2}(\mathbb {R} ^{d})}$. Then
${\displaystyle W_{2}^{2}(\mu ,\nu )=\min _{(\mu (t),\nu (t))}\{\int _{0}^{1}|v(\cdot ,t)|_{L^{2}(\mu (t))}^{2}dt\quad |\quad \partial _{t}\mu +\nabla \cdot (v\mu )=0,\quad \mu (0)=\mu ,\quad \mu (1)=\nu \}.}$

This formula is important for defining the Riemannian structure of our Wasserstein space. In particular, this is related to the fact that the distance minimizing curves on Riemannian manifolds are geodesics. The property at play here is the fact that geodesics minimize the action of the Riemannian metric. In other words, an optimal transport plan between measures ${\displaystyle \mu }$ and ${\displaystyle \nu }$ is actually related to a geodesic connecting these measures on a Riemannian manifold. The Benamou-Brenier Formula implies that the correct action on this space is ${\displaystyle \min _{(\mu (t),\nu (t))}\int _{0}^{1}|v(\cdot ,t)|_{L^{2}(\mu (t))}^{2}dt}$ where ${\displaystyle v(\cdot ,t)}$ gives the velocity of the curve ${\displaystyle \mu }$. This implies the correct Riemannian metric for our Wasserstein space. You can see more at Formal Riemannian Structure of the Wasserstein metric.

In addition, using the continuity equation we can describe geodesics in the Wasserstein space. For more details look at Geodesics and generalized geodesics.