Let $U\subset\mathbb R^n$ be a connected [open set](/page/Open%20Set), let $\mu_0\in\mathcal P_2(\mathbb R^n)$ satisfy $\mu_0(\mathbb R^n\setminus U)=0$, and assume that $\mu_0$ is absolutely continuous with respect to $\mathcal L^n$. Let $\psi:\mathbb R^n\to\mathbb R$ be a smooth [convex function](/page/Convex%20Function), define
for every $t\in(0,1)$ and every $x\in U$. For $t=0$ and $t=1$, interpret $\nabla\phi_t$ on $U_t$ by the same identity when needed.
paragraph
admin
Then $(\mu_t)_{t\in[0,1]}$ is a constant-speed geodesic in $(\mathcal P_2(\mathbb R^n),W_2)$ from $\mu_0$ to $\mu_1$. Moreover, with $v_t:=\nabla\phi_t$ on $U_t$ and with any Borel extension of $v_t$ to $\mathbb R^n$, the pair $(\mu_t,v_t)$ solves the continuity equation
in the distributional sense on $(0,1)\times\mathbb R^n$. Finally, after replacing $\phi_t$ by $\phi_t+a(t)$ for a smooth scalar function $a:(0,1)\to\mathbb R$, the Hamilton-Jacobi equation