# Viscosity solutions of centralized control problems in measure spaces

Averil Aussedat, Othmane Jerhaoui, Hasnaa Zidani

► To cite this version:

Averil Aussedat, Othmane Jerhaoui, Hasnaa Zidani. Viscosity solutions of centralized control prob- lems in measure spaces. ESAIM: Control, Optimisation and Calculus of Variations, 2024, 30, pp.91. 10.1051/cocv/2024081 . hal-04335852

HAL Id: hal-04335852

https://hal.science/hal-04335852v1

Submitted on 11 Dec 2023

**HAL** is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons CC BY 4.0 - Attribution - International License
# Viscosity solutions of centralized control problems in measure spaces

Othmane Jerhaoui*, Averil Prost,† Hasnaa Zidani.†

## Abstract

This work focuses on a control problem in the Wasserstein space of probability measures over $\mathbb{R}^d$. Our aim is to link this control problem to a suitable Hamilton-Jacobi-Bellman (HJB) equation. We explore a notion of viscosity solution using test functions that are locally Lipschitz and locally semiconvex or semiconcave functions. This regularity allows to define a notion of viscosity and a Hamiltonian function relying on directional derivatives. Using a generalization of Ekeland's principle, we show that the corresponding HJB equation admits a comparison principle, and deduce that the value function is the unique solution in this viscosity sense. The PDE tools are developed in the general framework of Measure Differential Equations.

**Keywords:** Hamilton-Jacobi, Wasserstein, viscosity solutions.

**MSC Classification:** 35F21, 35R06, 49Lxx.

## 1 Introduction

In this paper, we consider a Mayer control problem over the metric space of probability measures equipped with the Wasserstein distance. This class of problems is particularly suited for modeling physical situations where the state variable is known only up to a density of probability [Coy21]. It also provides a convenient formalism for problems involving the motion of populations, encompassing both discrete and continuous formulations ([PT09; Cor16]; see also the survey [CCH14]).

These problems have been extensively studied in cases where the state variable lies in some finite-dimensional vector space. An effective approach is to connect the control problem with a Hamilton-Jacobi-Bellman (HJB) partial differential equation. These equations are typically understood in the sense of viscosity solutions, which is a dedicated weak formulation adapted to the nonlinear nature of HJB equations. This approach originated in the work of Crandall, Ishii, and Lions [CIL92; Ish85]. The numerical methods developed for the HJB equation can then be employed to solve the original problem. Our objective with this work is to contribute to the extension of Hamilton-Jacobi techniques into the space of measures.

Considering probability measures as the state space poses several difficulties. We examine an infinite-dimensional subset of probability measures endowed with the Monge-Kantorovich distance, also known as the *Wasserstein distance*, derived from optimal transport theory. The Wasserstein space is not a Banach space, and defining a partial differential equation (PDE) within it is not straightforward. Additional technical challenges arise from the lack of local compactness and convexity of the distance function. Despite these challenges, measures are rich objects that can be viewed as points in a geodesic space, laws of random variables, or generalizations of densities. Each interpretation brings its own set of techniques from geometry, analysis, or probability theory.

Establishing a differential calculus in the Wasserstein space has been an actively researched problem over the past two decades. The foundational work by Otto introduced a pseudo-Riemannian calculus [Ott01; Vil09], offering striking reformulations of the porous medium equation as a gradient flow. Simultaneously, gradient flows in the Wasserstein space were investigated using techniques from general metric spaces [AGS05], leading to the construction of a natural tangent cone [Gig08].

The emergence of mean-field games [Lio06] emphasized the necessity for proper generalizations of gradients for functions dependent on measures, as well as the need for a second-order calculus. Two parallel approaches were pursued: the probabilistic school treated measures as laws of random variables and defined a surrogate for the gradient in the Wasserstein space by *lifting* mappings into Hilbert spaces $L_P^2(E; \mathbb{R}^d)$, where $(E, \mathcal{E}, \mathcal{P})$ represents a "reference" atomless probability

<footnote>*Université de Rennes, INSA Rennes, CNRS, IRMAR - UMR 6625, F-35000 Rennes, France.</footnote>

<footnote>†INSA Rouen Normandie, Normandie Univ, LMI UR 3226, F-76000 Rouen, France. Corresponding author: averil.prost@insa-rouen.fr</footnote>
space. This theory has achieved the existence and uniqueness of classical solutions for its primary problems, namely the mean-field games system and the master equation [Car13; CCD15; PW18; BY19; CP20].

On the other hand, a geometric approach relied on a "regular" tangent cone. This perspective primarily focused on mechanical systems arising from the minimization of energy over the space of measures, with the tangent cone emerging as a natural space for the dynamical systems of the minimizers. The elements of the tangent cone allow for the definition of sub and superdifferentials, whose intersection reduces to the so-called Wasserstein gradient [GNT08; CQ08; AG08; GŚ14; MQ18].

These two approaches were reconciled in [CD18] and [GT19], where it is shown that the gradient obtained through the lifting technique and the Wasserstein gradient coincide under quite general assumptions. Thus, both theories share the same limitations, as pointed out in [AF14] regarding the challenge of connecting the metric interpretation of an Eikonal equation with its interpretation using the regular tangent cone. A suitable notion of a tangent cone should describe the set of available directions in which a particle could move starting from a given point. However, for measures that possess atoms, the regular tangent cone does not enable the splitting of mass. This results in inconsistency when formulating an Eikonal equation such as $\partial_t u + |\nabla u| = 0$, where the gradient term encodes the variation of $u$ along all available directions, which belong to the general tangent cone introduced in [Gig08]. As the theory of Eikonal-type equations enjoys a rich corpus of existence, uniqueness, and representation results [GHN15; GŚ15; HK15], such inconsistencies are undesirable. Let us mention the recent work of [DS23], in which an entropic penalization is used to restrain to the dense set of regular measures, in which regular and general tangent cone coincide.

In this work, we explore a reformulation of Hamilton-Jacobi equations that takes into account the entire set of directions. The formal derivation of Hamilton-Jacobi-Bellman equations shows that one can solely rely on the information provided by directional derivatives of the solution. This has the advantage of completely avoiding the discussion about the existence of a gradient or any other generalization of linearization. In the Wasserstein space, this line of investigation was initiated in [JJZ; Jer22], where the underlying space was taken as a compact manifold. The contributions of the present work are the following: we allow the dynamics to depend on the measure variable, which may have full support in the non-compact space $\mathbb{R}^d$. We give a formulation of the Hamilton-Jacobi equation that supports a strong comparison principle, and we show that in the case of Hamilton-Jacobi-Bellman equation, the unique solution is the value function of the control problem. In particular, the comparison principle is valid on Hamiltonians that are defined using directional derivatives along elements of the general tangent cone, and could be used in the context of Eikonal equations.

The paper is organized as follows. The setting of the problem is detailed in Section 2. Section 3 gathers the essential elements of the theory of the Wasserstein space needed in the subsequent sections. The control problem is studied in Section 4, where we introduce the value function and discuss its properties. Section 5 focuses on a general Hamilton-Jacobi equation, providing the definition of a viscosity solution and discussing the comparison principle. Finally, the case of Hamilton-Jacobi-Bellman equations is addressed in Section 6.

## 2 Setting of the problem

In this section, we establish the notations, outline the problem under investigation, and specify the assumptions of the paper.

**Notations. Space of measures** For any Polish space $(\Omega, d)$, $\mathcal{P}(\Omega)$ will denote the space of Borel probability measures on $\Omega$. In the sequel, we consider the subset $\mathcal{P}_2(\Omega)$ of measures with finite second moment, i.e., measures such that for some (thus any) $o \in \Omega$, there holds

$$ \mathcal{P}_2(\Omega) := \left\{ \mu \in \mathcal{P}(\Omega) \mid \int_{x \in \mathbb{R}^d} d^2(o, x) d\mu(x) < \infty \right\}. $$

For any couple $(\mu, v) \in \mathcal{P}_2(\Omega)^2$, we denote by $\Gamma(\mu, v)$ the set of probability measures on $\Omega \times \Omega$ with marginals $\mu$ and $v$, further referred to as the set of transport plans. An example of such plans, or couplings, is given by the product measure $\mu \otimes v$, showing that the set $\Gamma(\mu, v)$ is never empty. We endow $\mathcal{P}_2(\Omega)$ with a metric, here chosen as the Monge-Kantorovitch distance with $p = 2$ - also called 2-Wasserstein distance in the literature - and defined as

$$ d_{W,\Omega}(\mu, v) := \sqrt{\inf_{\eta \in \Gamma(\mu, v)} \int_{(x,y) \in (\Omega)^2} d^2(x, y) d\eta(x, y)}. $$

The set of plans realizing the infimum is denoted $\Gamma_o(\mu, v)$. According to Theorem 4.1 in [Vil09], this set is always nonempty. In the sequel, we will simply denote $d_W$ the Wasserstein distance when the state space is clear from the context.
Throughout this paper, we consider $\mathbb{R}^d$ as the underlying space. Its tangent space is defined as $T\mathbb{R}^d = \bigcup_{x \in \mathbb{R}^d} \{x\} \times T_x \mathbb{R}^d$, where $T_x \mathbb{R}^d$ represents the tangent space to $\mathbb{R}^d$ at the point $x$. To maintain a clear distinction between points and velocities, we refrain from identifying $T_x \mathbb{R}^d$ with $\mathbb{R}^d$. Let $T > 0$ be a fixed final time-horizon. We will use the notation

$$X := ]0, T[ \times \mathcal{P}_2(\mathbb{R}^d), \quad d_X^2((t, \mu), (s, v)) := |t-s|^2 + d_W^2(\mu, v).$$

**Trajectories in the Wasserstein space** Consider a controlled dynamical system of the form

$$\partial_s \mu_s + \operatorname{div}(f(\cdot, \mu_s, u(s)) \# \mu_s) = 0, \quad s \in [t, T], \quad \mu_t = v \qquad (1)$$

where $v \in \mathcal{P}_2(\mathbb{R}^d)$ is an initial configuration of the system at a time $t \in [0, T]$. We denote $(\mu_s^{t,v,u})_{s \in [t,T]}$ the solution of (1), which is understood in the sense of distributions. Here, the control input $u(\cdot)$ is supposed to be a measurable function, i.e.

$$u(\cdot) \in L^0([t, T]; U) := \{v(\cdot) : [t, T] \to U \mid v(\cdot) \text{ is Lebesgue-measurable}\},$$

where $U \subset \mathbb{R}^k$ is a set of admissible controls, and $f: \mathbb{R}^d \times \mathcal{P}_2(\mathbb{R}^d) \times U \to T\mathbb{R}^d$ is a given controlled and measure-dependent dynamic. The study of the dynamical system (1) will be carried out in Section 4.1.

**The control problem and the value function** Now, consider a terminal cost $\mathcal{J}: \mathcal{P}_2(\mathbb{R}^d) \to \mathbb{R}$. The control problem we address in this paper is in Mayer form, and it consists of the following minimization problem:

$$\text{Find } u \in L^0([t, T]; U) \quad \text{such that} \quad \mathcal{J}(\mu_T^{t,v,u}) \le \mathcal{J}(\mu_T^{t,v,v}) \quad \forall v \in L^0([t, T]; U).$$

The value function associated to this control problem is defined as

$$V: [0, T] \times \mathcal{P}_2(\mathbb{R}^d) \to \mathbb{R}, \quad V(t, v) := \inf\{\mathcal{J}(\mu_T^{t,v,u}) \mid u \in L^0([t, T]; U)\}. \qquad (2)$$

The aim of the paper is to characterize the value function as the unique viscosity solution of a suitable Hamilton-Jacobi-Bellman (HJB) equation of the form

$$-\partial_t V(t, \mu) + H(\mu, D_\mu V(t, \mu)) = 0, \quad V(T, \mu) = \mathcal{J}(\mu).$$

The definition of the Hamiltonian $H$ and the meaning of the derivative $D_\mu V(t, \mu)$ will be made precise in Sections 5 & 6. In these sections, we will also develop the notion of viscosity solution in the Wasserstein space.

**Running assumptions** Let us precise the main assumptions of the paper. We say that an application $m: \mathbb{R}^+ \to \mathbb{R}^+$ is a modulus of continuity if it is continuous, nondecreasing and if $m(0) = 0$.

**Assumption [A1] (Control set).** The set $U \subset \mathbb{R}^k$ is compact.

**Assumption [A2] (Structure of the dynamic).** There exists constants $[f], |f|_{0,\infty}$ such that

- $f$ is Lipschitz-continuous in the space and measure variables and locally Lipschitz in the control variable, in the sense that for all $(x, y, \mu, v, u) \in \mathbb{R}^d \times \mathbb{R}^d \times \mathcal{P}_2(\mathbb{R}^d) \times \mathcal{P}_2(\mathbb{R}^d) \times U,$

$$|f(x, \mu, u) - f(y, v, u)| \le [f] (|x-y| + d_W(\mu, v)).$$

- there exists a modulus of continuity $m_{f,u}: \mathbb{R}^+ \to \mathbb{R}^+$ such that for all $(x, \mu, u, v) \in \mathbb{R}^d \times \mathcal{P}_2(\mathbb{R}^d) \times U \times U,$

$$|f(x, \mu, u) - f(x, \mu, v)| \le (1 + |x|) m_{f,u}(|u - v|).$$

- For all $(\mu, u) \in \mathcal{P}_2(\mathbb{R}^d) \times U$, there holds $|f(0, \mu, u)| \le |f|_{0,\infty}$.

**Assumption [A3] (Regularity of the terminal cost).** The terminal cost $\mathcal{J}: \mathcal{P}_2(\mathbb{R}^d) \to \mathbb{R}$ is locally uniformly continuous, i.e. for each $R > 0$, there exists a modulus of continuity $m_{\mathcal{J},R}: \mathbb{R}^+ \to \mathbb{R}^+$ such that

$$|\mathcal{J}(\mu) - \mathcal{J}(v)| \le m_{\mathcal{J},R}(d_W(\mu, v)) \quad \forall (\mu, v) \in (\overline{\mathcal{B}}(\delta_0, R))^2,$$
where $\mathcal{B}(\delta_0, R)$ stands for the ball centered in the Dirac measure $\delta_0$ and with radius $R$.

Under these assumptions, we will aim to demonstrate that the value function is the unique solution to an HJB equation. In the theory of HJB equations in a Banach space, the Hamiltonian is generally defined as a function on gradients, or more generally, on the space of linear functions. Here, we will define the Hamiltonian using a *metric cotangent bundle* $\mathbb{T}$ as a set of local approximations of sufficiently smooth maps, replacing the set of $p \mapsto \nabla\phi, p >$ parametrized by any $\nabla\phi$. This metric cotangent bundle is a subset of continuous and positively homogeneous applications, that may not enjoy the linear properties of their more traditional counterparts. Indeed, in the context of Hamilton-Jacobi-Bellman equations, this linearity is not essential for achieving results regarding the uniqueness and characterization of the value function. The core interpretation of HJB equations lies in imposing growth conditions along the characteristics of the control problem, and this, in turn, only necessitates one-sided derivatives.

The challenges arising in the Wasserstein space are twofold: firstly, the space lacks local compactness. This issue can be addressed by employing adapted Ekeland principles, as previously demonstrated in Hilbert spaces in [FGS17]. Secondly, the Wasserstein space exhibits positive curvature, which proves to be unfavorable for stability, contrasting with the reasoning applicable to negatively curved spaces. The critical aspect here lies in the fact that, broadly speaking, the directional derivative of a convex map enjoys lower semicontinuity, while concave maps have upper semicontinuous directional derivatives. This makes Hypothesis 3.4 in [Jer22], which assumes some upper/lower semicontinuity of the Hamiltonian, unattainable in $\mathcal{P}_2(\mathbb{R}^d)$.

# 3 Preliminaries on the Wasserstein space

Consider $\mathcal{B}_{\mathbb{R}^d}$ the Borel $\sigma$-algebra of $\mathbb{R}^d$, and let $g: \mathbb{R}^d \to \mathbb{R}$ be a Borel-measurable function. The notation $\#$ will be used to denote the push-forward operator on measures, defined for any Borel measure $\mu$ as

$$g\#\mu(A) := \mu(g^{-1}(A)) \quad \forall A \in \mathcal{B}_{\mathbb{R}}.$$

The space $\mathcal{P}_2(\mathbb{R}^d)$, when endowed with the Wasserstein distance, is a geodesic space. A *constant speed geodesic parameterized over* $[0, 1]$, or in short a *geodesic*, is a curve $(\mu_t)_{t \in [0, 1]} \subset \mathcal{P}_2(\mathbb{R}^d)$ satisfying $d_W(\mu_t, \mu_s) \le |t-s|d(\mu_0, \mu_1)$ for all $(s, t) \in [0, 1]^2$. We first recall some results on geodesics, and then define directional derivatives along them.

## 3.1 Representation of geodesics of $\mathcal{P}_2(\mathbb{R}^d)$

Let $\mu, v \in \mathcal{P}_2(\mathbb{R}^d)$, and $\pi_x, \pi_y: (\mathbb{R}^d)^2 \to \mathbb{R}^d$ be the canonical projections $\pi_x((x, y)) = x$ and $\pi_y((x, y)) = y$. In $\mathcal{P}_2(\mathbb{R}^d)$, it is known (see [AGS05, Theorem 7.2.2]) that constant speed geodesics coincide with trajectories of the form

$$\mu_t = ((1-t)\pi_x + t\pi_y)\#\eta \quad \forall t \in [0, 1], \quad \eta = \eta(x, y) \in \Gamma_o(\mu, v). \qquad (3)$$

The uniqueness of geodesics in the space $\mathbb{R}^d$ also allows for another equivalent representation, by means of probability measures over the tangent space $\mathbb{R}^d = \bigcup_{x \in \mathbb{R}^d} \{x\} \times \mathbb{T}_x \mathbb{R}^d$. We will denote $(x, v) \in \mathbb{R}^d$ a generic tangent element, and $\pi_x, \pi_v$ the canonical projections. Let $\mathcal{P}_2(\mathbb{R}^d)_{\mu}$ be the set of initial velocities

$$\mathcal{P}_2(\mathbb{R}^d)_{\mu} = \{\gamma \in \mathcal{P}_2(\mathbb{R}^d) \mid \pi_x\#\gamma = \mu\}.$$

Define the scalar multiplication $\cdot$ of velocities as $t \cdot \gamma = (\pi_x, t\pi_v)\#\gamma$. To each element $\gamma \in \mathcal{P}_2(\mathbb{R}^d)_{\mu}$, we associate a curve of measures by the *exponential map*

$$\exp_{\mu}: \mathcal{P}_2(\mathbb{R}^d)_{\mu} \to \mathcal{P}_2(\mathbb{R}^d), \quad \exp_{\mu}(t \cdot \gamma) := (\pi_x + t\pi_v)\#\gamma.$$

The sets $\mathcal{P}_2(\mathbb{R}^d)_{\mu}$ and $\Gamma(\mu, \mathcal{P}_2(\mathbb{R}^d)) = \bigcup_{v \in \mathcal{P}_2(\mathbb{R}^d)} \Gamma(\mu, v)$ are in bijection through the map

$$\Psi: \Gamma(\mu, \mathcal{P}_2(\mathbb{R}^d)) \to \mathcal{P}_2(\mathbb{R}^d)_{\mu}, \quad \Psi(\eta) = (\pi_x, \pi_y - \pi_x)\#\eta, \quad \Psi^{-1}(\gamma) = (\pi_x, \pi_x + \pi_v)\#\gamma. \qquad (4)$$

The mapping $\Psi$ is bicontinuous in the respective Wasserstein topologies.

**Remark 1 (Manifold case).** Let us stress that $\Psi$ is a bijection owing to the uniqueness of geodesics in $\mathbb{R}^d$. Indeed, if $E$ is a manifold over which an exponential map $\exp: TE \to E$ is defined, there can be several initial velocities of geodesics in the set $\{(x, v) \in TE \mid \exp_x(v) = y\}$. The corresponding theory is developed in [Gig09] (see in particular Definition 1.4), and in [JJZ] for the associated geodesic viscosity and HJB equations in the compact case.
Any geodesic induced by an optimal transport plan $\eta \in \Gamma_o(\mu, \nu)$ via (3) is equivalently represented using (4) as

$$ \exp_{\mu}(t \cdot \Psi(\eta)) = (\pi_x + t\pi_{\nu})\#\Psi(\eta) = (\pi_x + t(\pi_y - \pi_x))\#\eta = \mu_t. $$

We define the set of initial velocities of geodesics through the identification (4):

$$ \mathcal{P}_2(\mathbb{R}^d)_{\mu,o} := \{ \Psi(\eta) \mid \eta \in \Gamma_o(\mu, \nu), \nu \in \mathcal{P}_2(\mathbb{R}^d) \}. $$

Following the notation of [Gig11], we will denote $\exp_{\mu}^{-1}(\nu)$ the set of initial velocities of geodesics linking $\mu$ to $\nu$, i.e.

$$ \exp_{\mu}^{-1}(\nu) := \{ \gamma \in \mathcal{P}_2(\mathbb{R}^d)_{\mu,o} \text{ with } (\pi_x + \pi_{\nu})\#\gamma = \nu \}. \quad (5) $$

We may equivalently define $\exp_{\mu}^{-1}$ as

$$ \exp_{\mu}^{-1}(\nu) = \left\{ \gamma \in \mathcal{P}_2(\mathbb{R}^d)_{\mu} \mid \exp_{\mu}(\gamma) = \nu \text{ and } \int_{(x,v) \in \mathbb{R}^d} |v|^2 d\gamma(x, v) = d_{\mathcal{W}}^2(\mu, v) \right\}. $$

This set is always nonempty, since $\Gamma_o(\mu, \nu)$ is nonempty (see for instance Theorem 1.7 of [San15]). It is compact in $(\mathcal{P}_2(\mathbb{R}^d), d_{\mathcal{W}})$ as the image of the compact $\Gamma_o(\mu, \nu)$ through the continuous identification (4). We refer to it as the set of initial velocities of geodesics issued from $\mu$ and reaching $\nu$.

## 3.2 The tangent cone

In the sequel, we denote

$$ T^2 \mathbb{R}^d := \{ (x, v_1, v_2) \mid x \in \mathbb{R}^d, v_i \in T_x \mathbb{R}^d \}, \quad |(x, v_1, v_2) - (\bar{x}, \bar{v}_1, \bar{v}_2)|^2 := |x - \bar{x}|^2 + \sum_{i=1}^2 |v_i - \bar{v}_i|^2. $$

Given $(\xi_1, \xi_2) \subset \mathcal{P}_2(\mathbb{R}^d)_{\mu}$, we define

$$ \Gamma_{\mu}(\xi_1, \xi_2) := \{ \alpha \in \mathcal{P}(T^2 \mathbb{R}^d) \mid (\pi_x, \pi_{v_i})\#\alpha = \xi_i, i \in \{1, 2\} \}. $$

This particular set of transport plans is only allowing transfer of mass between pairs $(x, v)$ and $(y, w)$ such that $x = y$. For each $\mu \in \mathcal{P}_2(\mathbb{R}^d)$, define the application

$$ W_{\mu} : (\mathcal{P}_2(\mathbb{R}^d)_{\mu})^2 \to \mathbb{R}^+, \quad W_{\mu}^2(\xi, \zeta) := \inf_{\alpha \in \Gamma_{\mu}(\xi, \zeta)} \int_{(x,v,w) \in T^2 \mathbb{R}^d} |v-w|^2 d\alpha(x, v, w). \quad (6) $$

As per [Gig08, Theorem 4.4], $W_{\mu}$ is a metric over $\mathcal{P}_2(\mathbb{R}^d)_{\mu}$ and the infimum is always attained. Moreover, disintegrating $\xi = \xi_x \otimes \mu$ and $\zeta = \zeta_x \otimes \mu$ allows to get a representation of $W_{\mu}$ as ([Gig08, Proposition 4.2])

$$ W_{\mu}^2(\xi, \zeta) := \int_{x \in \mathbb{R}^d} d_W^2(\xi_x, \zeta_x) d\mu(x). \quad (7) $$

As a useful particular case, we record that

$$ W_{\mu}^2(\xi, 0_{\mu}) = \int_{(x,v) \in T^2 \mathbb{R}^d} |v|^2 d\xi(x, v) =: \|\xi\|_{\mu}^2. \quad (8) $$

We denote $\Gamma_{\mu,o}(\xi, \zeta)$ the subset of $\Gamma_{\mu}(\xi, \zeta)$ where the infimum of (6) is realized.

**Definition 1** (Tangent cone [Gig08, Definition 4.1]). For each $\mu \in \mathcal{P}_2(\mathbb{R}^d)$, we define

$$ \mathbf{Tan}'_{\mu} \mathcal{P}_2(\mathbb{R}^d) := \{ \alpha \cdot \xi \mid \alpha \in \mathbb{R}^+, \xi \in \exp_{\mu}^{-1}(\sigma) \text{ for some } \sigma \in \mathcal{P}_2(\mathbb{R}^d) \}, \quad \mathbf{Tan}_{\mu} \mathcal{P}_2(\mathbb{R}^d) := \overline{\mathbf{Tan}'_{\mu} \mathcal{P}_2(\mathbb{R}^d)}^{W_{\mu}}. $$

The pre-tangent cone $\mathbf{Tan}'_{\mu}$ is the set of velocities $\xi$ such that there exists $\varepsilon > 0$ with $s \mapsto \exp_{\mu}(s \cdot \xi)$ being a geodesic between its endpoints over the time interval $[0, \varepsilon]$. Owing to [Gig08, Proposition 4.30], there exists a well-defined projection

$$ \pi^{\mu}: \mathcal{P}_2(\mathbb{R}^d)_{\mu} \to \mathbf{Tan}_{\mu} \mathcal{P}_2(\mathbb{R}^d), \quad \pi^{\mu}(\gamma) = \underset{\bar{\gamma} \in \mathbf{Tan}_{\mu} \mathcal{P}_2(\mathbb{R}^d)}{\operatorname{argmin}} W_{\mu}(\gamma, \bar{\gamma}). \quad (9) $$
Note that by picking some $\alpha \in \Gamma_{\mu,o}(\xi, \zeta)$, we directly have

$$d_{W, \mathbb{R}^d}^2(\xi, \zeta) \le \int_{((x,v), (y,w)) \in (\mathbb{R}^d)^2} |x-y|^2 + |v-w|^2 d[(\pi_x, \pi_v), (\pi_x, \pi_w)] \#\alpha((x, v), (y, w)) = W_{\mu}^2(\xi, \zeta). \quad (10)$$

Moreover, each transport plan $\alpha \in \Gamma(t \cdot \xi, t \cdot \zeta)$ induces a transport plan between $\exp_{\mu}(t \cdot \xi)$ and $\exp_{\mu}(t \cdot \zeta)$ by $\beta := (\pi_x + t\pi_v, \pi_x + t\pi_w) \#\alpha$. Consequently

$$d_{W}^{2}(\exp_{\mu}(t \cdot \xi), \exp_{\mu}(t \cdot \zeta)) \le W_{\mu}^{2}(t \cdot \xi, t \cdot \zeta) = t^{2} W_{\mu}(\xi, \zeta). \quad (11)$$

Let $(\mu, v) \in (\mathcal{P}_2(\mathbb{R}^d))^2$. Following [Pic19, Definition 4.1], we define an application $W_{(\mu,v)}: \mathcal{P}(\mathbb{R}^d)_{\mu} \times \mathcal{P}(\mathbb{R}^d)_v \to \mathbb{R}^+$ by

$$W_{(\mu,v)}^2(\xi, \zeta) := \inf \left\{ \int_{(x,v) \in \mathbb{R}^d, (y,w) \in \mathbb{R}^d} |v-w|^2 d\omega(x,v,y,w) \mid \omega \in \Gamma(\xi, \zeta), \pi_{(x,y)}\#\omega \in \Gamma_o(\mu,v) \right\}. \quad (12)$$

The map $W_{(\mu,v)}$ computes the difference between $\xi$ and $\zeta$ by taking only paths whose projection on the base space is a geodesic. It is coherent with the tangent cone structure, since $W_{(\mu,\mu)}(\xi, \zeta) = W_{\mu}(\xi, \zeta)$ for all $\xi, \zeta \in \mathcal{P}(\mathbb{R}^d)_{\mu}$. However, the application $W_{(\mu,v)}$ does not satisfy the triangular inequality (see [Pic19, Remark 4]).

## 3.3 The metric cotangent bundle

**Definition 2** (Directionally differentiable map). We say that an application $\varphi: \mathcal{P}_2(\mathbb{R}^d) \to \mathbb{R}$ is directionally differentiable at $\mu \in \mathcal{P}_2(\mathbb{R}^d)$ if for all $\xi \in \mathbf{Tan}_{\mu}\mathcal{P}_2(\mathbb{R}^d)$, the limit

$$\lim_{t \searrow 0} \frac{\varphi(\exp_{\mu}(t \cdot \xi)) - \varphi(\mu)}{t} := D_{\mu}\varphi(\xi) \quad (13)$$

exists. The application $D_{\mu}\varphi: \mathbf{Tan}_{\mu}\mathcal{P}_2(\mathbb{R}^d) \to \mathbb{R}$ is called the differential at $\mu$ of $\varphi$.

Notice that in (13), we do not assume the limit to be uniform in $\xi \in \mathbf{Tan}_{\mu}\mathcal{P}_2(\mathbb{R}^d)$. It is immediate that $D_{\mu}\varphi$ is positively homogeneous, i.e. $D_{\mu}\varphi(\alpha \cdot \xi) = \alpha D_{\mu}\varphi(\xi)$ for any $\alpha \ge 0$. Moreover, assume that $\varphi$ is Lipschitz with constant $[\varphi]$ in some ball centered in $\mu$. Then using (11),

$$|D_{\mu}\varphi(\xi) - D_{\mu}\varphi(\bar{\xi})| \le [\varphi] \lim_{t \searrow 0} \frac{d_{W}(\exp_{\mu}(t \cdot \xi), \exp_{\mu}(t \cdot \bar{\xi}))}{t} \le [\varphi] \lim_{t \searrow 0} \frac{t W_{\mu}(\xi, \bar{\xi})}{t} = [\varphi] W_{\mu}(\xi, \bar{\xi}). \quad (14)$$

Hence $D_{\mu}\varphi$ is Lipschitz in $(\mathbf{Tan}_{\mu}\mathcal{P}_2(\mathbb{R}^d), W_{\mu})$. The above leads us to the following definition.

**Definition 3** (Metric cotangent bundle). Let

$$\mathbb{T}_{\mu} := \{ p : \mathbf{Tan}_{\mu}\mathcal{P}_2(\mathbb{R}^d) \to \mathbb{R} \mid p \text{ is Lipschitz in } W_{\mu} \text{ and positively homogeneous} \}, \quad \mathbb{T} := \bigcup_{\mu \in \mathcal{P}_2(\mathbb{R}^d)} \{\mu\} \times \mathbb{T}_{\mu}. \quad (15)$$

The sets $\mathbb{T}_{\mu}$ are stable by the pointwise operations $(p+q)(\xi) := p(\xi) + q(\xi)$ and $(\alpha p)(\xi) := \alpha p(\xi)$. We endow $\mathbb{T}$ with the application

$$\| \cdot \| : \mathbb{T} \to \mathbb{R}^+, \quad (\mu, p) \mapsto \|p\|_{\mu} := \sup_{\xi \in \mathbf{Tan}_{\mu}\mathcal{P}_2(\mathbb{R}^d), \|\xi\|_{\mu}=1} |p(\xi)|. \quad (16)$$

The application $\| \cdot \|_{\mu}$ induces a norm on $\mathbb{T}_{\mu}$, and we recover $|p(\xi)| \le \|p\|_{\mu}\|\xi\|_{\mu}$. The metric cotangent bundle contains all the infinitesimal approximations of "sufficiently smooth maps", generalizing the set of linear applications. A partial differential equation in the space of measures involves elements of $\mathbb{T}$, and we will naturally define the Hamiltonian as a function of $\mathbb{T}$ into $\mathbb{R}$.

# 4 The control problem

## 4.1 Trajectories

The celebrated results of [AGS05] indicate that absolutely continuous curves in the Wasserstein space coincide with the solutions of the continuity equation in the sense of distributions. The recent work of [BF21; BF23] raised the theory of
continuity equations and continuity inclusions in $\mathcal{P}_2(\mathbb{R}^d)$ to a level comparable to that of the Caratheodory differential inclusions in $\mathbb{R}^d$. Let us mention that the study of dynamical systems driven by measure-valued, discontinuous dynamics is drawing attention (see the Measure Differential Equations (MDE) of [CMP18; Pic19]), although it is known that in the Lipschitz setting, solutions of MDEs and continuity equations coincide ([CMP18, Theorem 1]). In this section, we first reformulate the controlled dynamical system (1) in order to apply the results of [BF23], gather some estimates and properties needed in the sequel, and study the properties of the value function.

### 4.1.1 Existence, representation and regularity

Denote $\mathcal{P}(U)$ the set of probability measures over the compact $U$, which is itself a compact set when endowed with the squared Wasserstein distance. Let $L^0([t, T]; \mathcal{P}(U))$ be the space of Lebesgue-measurable curves $\omega: [t, T] \to \mathcal{P}(U)$. Define

$$F: \mathcal{P}_2(\mathbb{R}^d) \times \mathcal{P}(U) \to \mathcal{C}(\mathbb{R}^d; \mathbb{R}^d), \quad (\mu, \omega) \mapsto F_\omega[\mu] := \int_{u \in U} f(\cdot, \mu, u) d\omega(u).$$

Under [A2], routine computations show that for all $\mu \in \mathcal{P}_2(\mathbb{R}^d)$, all $\omega, \bar{\omega} \in \mathcal{P}(U)$ and $x \in \mathbb{R}^d$, there holds

$$|F_{\omega}[\mu](x) - F_{\bar{\omega}}[\mu](x)| \le [f](1 + |x|) \sqrt{\inf_{\alpha \in \Gamma(\omega, \bar{\omega})} \int_{(u, v) \in U^2} m_{f, u}^2(|u - v|) d\alpha(u, v)}.$$

As $m_{f,u}$ is continuous and $U$ compact, the Wasserstein distance with cost $m_{f,u}$ is continuous with respect to $d_{W,U}$. Consequently, the application $\omega \mapsto F_\omega[\mu]$ is continuous from $(\mathcal{P}(U), d_{W,U})$ to $\mathcal{C}(\mathbb{R}^d; \mathbb{R}^d)$ endowed with the topology of convergence over compact sets. Therefore, $[t, T] \ni s \mapsto F_{\omega(s)}[\mu]$ is Lebesgue-measurable for each $\omega \in L^0([t, T]; \mathcal{P}(U))$. For some fixed $v \in \mathcal{P}_2(\mathbb{R}^d)$, consider the associated continuity equation

$$\partial_s \mu_s + \operatorname{div} (F_{\omega(s)}[\mu_s] \# \mu_s) = 0 \quad s \in [t, T], \quad \mu_t = v. \qquad (17)$$

Combining Theorems 2.18, Proposition 2.22 and Theorem 4.2 of [BF23], we get the following.

**THEOREM 1 (EXISTENCE, UNIQUENESS AND REPRESENTATION OF THE SOLUTION).** Assume [A1] and [A2]. For each $\omega \in L^0([t, T]; \mathcal{P}(U))$, there exists an unique trajectory $(\mu_s^{t,v,\omega})_{s \in [t,T]} \in \mathcal{AC}([t,T]; \mathcal{P}_2(\mathbb{R}^d))$ solution of (17) in the sense of distributions. Moreover $s \mapsto F_{\omega(s)}[\mu_s^{t,v,\omega}]$ is Lebesgue-measurable, there exist constants $m = m_{f,T}$ and $M = M_{v,f,T}$ such that

$$d_W(\mu_s^{t,v,\omega}, \delta_0) \le m(1 + d_W(v, \delta_0)), \quad d_W(\mu_s^{t,v,\omega}, \mu_t^{t,v,\omega}) \le M|\tau - s| \quad \forall t \le s, \tau \le T,$$

and the solution is given by the pushforward $\mu_s^{t,v,\omega} = \Phi_s^t \# v$, where $\Phi_s^t: \mathbb{R}^d \to \mathbb{R}^d$ is the well-defined flow of

$$\frac{d}{ds} \Phi_s^t(x) = F_{\omega(s)}[\mu_s^{t,v,\omega}](\Phi_s^t(x)), \quad \Phi_t^t(x) = x. \qquad (18)$$

Choosing $\omega(s) = \delta_{u(s)}$ for some $u \in L^0([t, T]; U)$, Theorem 1 brings well-posedness of the controlled system (1). The pushforward representation allows to obtain various estimates directly from the underlying dynamical system. In particular, a Grönwall estimate yields that

$$|\Phi_s^{0,x}(x) - x| \le s([f]|x| + |f|_{0,\infty})e^{[f]s}, \quad \text{and} \quad d_W(\mu_{t+s}^{t,v,\omega}, v) \le s([f]d_W(v, \delta_0) + |f|_{0,\infty})e^{[f]s} \qquad (19)$$

for all $\omega \in L^0([t, T]; \mathcal{P}(U))$, $v \in \mathcal{P}_2(\mathbb{R}^d)$, $x \in \mathbb{R}^d$ and $0 \le t, s, t+s \le T$ (see Appendix D). Define the reachable sets from $(t, v)$ at time $T$ by the flow of (17) as

$$\mathcal{R}_T^{t,v} := \{\mu_T^{t,v,\omega} \mid \omega \in L^0([t, T]; \mathcal{P}(U))\}. \qquad (20)$$

**Lemma 1 (Lipschitz-continuity of the reachable sets).** Assume [A1] and [A2]. There exists a constant $[\mathcal{R}]$ depending only on $f$ and $T$ such that

$$\max \left( \sup_{\mu \in \mathcal{R}_T^{t,v}} \inf_{\bar{\mu} \in \mathcal{R}_T^{t,v}} d_W(\mu, \bar{\mu}), \sup_{\bar{\mu} \in \mathcal{R}_T^{t,v}} \inf_{\mu \in \mathcal{R}_T^{t,v}} d_W(\mu, \bar{\mu}) \right) \le [\mathcal{R}] d_W(v, \bar{v}) \quad \forall t \in [0, T], v, \bar{v} \in \mathcal{P}_2(\mathbb{R}^d).$$

*Demonstration.* Using chained Grönwall estimates (see Appendix D), we have that two solutions $s \mapsto \mu_s^{t,v,\omega}$ and $s \mapsto \mu_s^{t,v,\omega}$ associated to the same control $\omega \in L^0([t, T]; \mathcal{P}(U))$ satisfy

$$d_W(\mu_T^{t,v,\omega}, \mu_T^{t,v,\omega}) \le \exp([f](T-t)(e^{[f](T-t)} + 1)) d_W(v, \bar{v}).$$

The claim follows by approximating each $\mu = \mu_T^{t,v,\omega} \in \mathcal{R}_T^{t,v}$ by $\mu_T^{t,v,\omega}$, and defining $[\mathcal{R}] := \exp([f]T(\exp([f]T) + 1))$. $\square$
### 4.1.2 Convex relaxation of the dynamic

Let $\overline{\text{co}}F: \mathcal{P}_2(\mathbb{R}^d) \Rightarrow \mathcal{C}(\mathbb{R}^d; \mathbb{T}\mathbb{R}^d)$ be given by

$$ \overline{\text{co}}F[\mu] := \{F_{\omega}[\mu] \mid \omega \in \mathcal{P}(U)\} = \left\{ \int_{u \in U} f(\cdot, \mu, u) d\omega(u) \mid \omega \in \mathcal{P}(U) \right\}. \quad (21) $$

For each $\mu$, the set $\overline{\text{co}}F[\mu] \subset \mathcal{C}(\mathbb{R}^d; \mathbb{T}\mathbb{R}^d)$ is closed in the topology of uniform convergence on compact sets; indeed, as this topology is metrizable, it suffices to show that $(b_n)_n \subset \overline{\text{co}}F[\mu]$ and $b_n \to_n b$ uniformly over the compacts implies $b \in \overline{\text{co}}F[\mu]$. As $\mathcal{P}(U)$ is compact ([AGS05, Proposition 7.1.5]), some subsequence of $\omega_n$ converges to a measure $\omega \in \mathcal{P}(U)$, and [A2] yields that for each $R > 0$,

$$ \sup_{x \in \mathbb{R}^d, |x| \le R} \left| \int_{u \in U} f(x, \mu, u) d[\omega_n - \omega](u) \right| \le (1 + R) \inf_{\alpha \in \Gamma(\omega_n, \omega)} \int_{(u, v) \in U^2} m_{f, u}(|u - v|) d\alpha(u, v) \underset{n \to \infty}{\longrightarrow} 0. $$

By uniqueness of the limit, $b(x) = \int_{u \in U} f(x, \mu, u) d\omega(u)$, and $b \in \overline{\text{co}}F[\mu]$.

**Remark 2** (Link with the closed convex envelope of [BF23]). In our case, $\overline{\text{co}}F[\mu]$ is equal to the closure of $\mathcal{M}$ in the topology of uniform convergence over compact sets, where

$$ \mathcal{M} := \bigcup_{N \in \mathbb{N}} \left\{ \sum_{i=1}^{N} \alpha_i f(\cdot, \mu, u_i) \mid \sum_{i=1}^{N} \alpha_i = 1, \alpha_i \ge 0, u_i \in U \right\}. $$

Indeed, we trivially have $\mathcal{M} \subset \overline{\text{co}}F$ through the representation $\omega := \sum_{i=1}^N \alpha_i \delta_{u_i}$. On the other hand, let $\bar{b} = F_{\omega}[\mu] \in \overline{\text{co}}F$ for some $\omega \in \mathcal{P}(U)$. For each $n \in \mathbb{N}$, cover the compact $U$ by a finite measurable partition $(U_i^n)_{i \in [1, N_n]}$ of diameter inferior to $1/n$, and pick $u_i^n \in U_i^n$. Owing to [A2], there holds for each $R > 0$

$$ \left\| \int_{u \in U} f(\cdot, \mu, u) d\omega(u) - \sum_{i=1}^{N_n} \omega(U_i^n) f(\cdot, \mu, u_i^n) \right\|_{\mathcal{C}} \le \sup_{x \in \mathbb{R}^d, |x| \le R} \int_{u \in U} |f(x, \mu, u) - f(x, \mu, u_i^n)| d\omega(u) \\ \le (1 + R) \int_{u \in U} m_{f, u}(|u - u_i^n|) d\omega(u) \le (1 + R) m_{f, u} \left(\frac{1}{n}\right), $$

and $\bar{b}$ is the uniform limit over the each compact of the sequence $(\sum_{i=1}^{N_n} \omega(U_i^n) f(\cdot, \mu, u_i^n))_n \subset \mathcal{M}$. Thus $\bar{b} \in \mathcal{M}$, and equality holds.

Using a selection argument, the set of solutions $\{(\mu_s^{t,v,\omega})_{s \in [t,T]} \mid \omega \in L^0([t,T]; \mathcal{P}(U))\}$ coincides with the set of solutions of the continuity inclusion

$$ \partial_s \mu_s \in -\operatorname{div}(\overline{\text{co}}F[\mu_s] \# \mu_s) \quad s \in [t, T], \quad \mu_t = v. $$

Consequently, we have the following.

**THEOREM 2** (RELAXATION (THEOREMS 4.5 AND 4.6 OF [BF23])) . Assume [A1] and [A2], and let $v \in \mathcal{P}_2(\mathbb{R}^d)$. The set

$$ \{(\mu_s^{t,v,\omega})_{s \in [t,T]} \mid \omega \in L^0([t,T]; \mathcal{P}(U))\} \subset \text{AC}([t,T]; \mathcal{P}_2(\mathbb{R}^d)) $$

is compact in the topology of the uniform convergence, and is the closure in this topology of the set of trajectories of (1), namely

$$ \{(\mu_s^{t,v,u})_{s \in [t,T]} \mid u \in L^0([t,T]; U)\}. $$

### 4.1.3 Linearization of the trajectory

The following technical Lemma allows us to elude the lack of differentiability of a solution of the dynamical system (17), by approximating the said curve only along some sequence.

**Lemma 2** (Right linear approximation). Assume [A1] and [A2]. Let $\bar{s} > 0$, $(\mu_s)_{s \in [0, \bar{s}]}$ be the solution of (17) for some control $\omega \in L^0([0, \bar{s}]; \mathcal{P}(U))$. Then there exists $b \in \overline{\text{co}}F[\mu_0]$ and a sequence $(s_n) \searrow 0$ such that

$$ \lim_{n \to \infty} \frac{d\mathcal{W}(\mu_{s_n}, m_{s_n} \# \mu_0)}{s_n} = 0, \quad \text{where } m_s: \mathbb{R}^d \to \mathbb{R}^d \text{ is given by } m_s(x) := x + sb(x). $$
Demonstration. Let $(s_n)_n \subset \mathbb{R}^d$, and define $b_n: \mathbb{R}^d \to \mathbb{R}^d$ by

$$b_n(x) := \frac{1}{s_n} \int_{s=0}^{s_n} F_{\omega(s)}[\mu_0](x) ds = F_{\bar{\omega}_n}[\mu_0](x), \quad \text{where} \quad \bar{\omega}_n := \frac{1}{s_n} \int_{s=0}^{s_n} \omega(s) ds \in \mathcal{P}(U).$$

Since $U$ is compact, so is $\mathcal{P}(U)$ (see [Vil09], Remark 6.19). Then, along a (non relabeled) subsequence, $\bar{\omega}_n$ converges to some $\bar{\omega} \in \mathcal{P}(U)$ for any Monge-Kantorovich distance, and in particular for the Wasserstein distance over $\mathcal{P}(U)$. Let $b \in \overline{\mathbb{C}}F(\mu_0)$ be given by $b = F_{\bar{\omega}}[\mu_0]$. For each $n \in \mathbb{N}$, let $\eta_n \in \Gamma(\omega_n, \omega)$ such that

$$d_{\mathcal{W},m_{f,u}}(\omega_n, \bar{\omega}) := \inf_{\eta \in \Gamma(\omega_n, \bar{\omega})} \int_{(u,v) \in U^2} m_{f,u}(|u-v|) d\alpha(x, v) \geq \int_{(u,v) \in U^2} m_{f,u}(|u-v|) d\eta_n(x, v) - \frac{1}{n}.$$

Using [A2], we have that

$$|b_n(x) - b(x)| \leq \int_{(u,v) \in U^2} |f(x, \mu_0, u) - f(x, \mu_0, v)| d\eta_n(u, v) \leq (1 + |x|) \left[ d_{\mathcal{W},m_{f,u}}(\omega_n, \bar{\omega}) + \frac{1}{n} \right],$$

and we conclude to the local uniform convergence of $b_n$ towards $b$. We know from Theorem 1 that $\mu_s = \Phi_s^{0,\omega}\#\mu_0$, where the semigroup $\Phi_s^{0,\omega}$ is defined in (18). Let $m_s: \mathbb{R}^d \to \mathbb{R}^d$ be given by $m_s(x) = x + sb(x)$. Along the sequence $(s_n)_n$, we have that

$$\begin{aligned} |\Phi_{s_n}^{0,\omega}(x) - m_{s_n}(x)| &= \left| \int_{s=0}^{s_n} F_{\omega(s)}[\mu_s](\Phi_s^{0,\omega}(x)) ds - s_n b(x) \right| \\ &\leq \int_{s=0}^{s_n} \left| F_{\omega(s)}[\mu_s](\Phi_s^{0,\omega}(x)) - F_{\omega(s)}[\mu_0](x) \right| ds + s_n \left| F_{\bar{\omega}_n}[\mu_0](x) - F_{\bar{\omega}}[\mu_0](x) \right| \\ &\leq [f] \int_{s=0}^{s_n} d_{\mathcal{W}}(\mu_s, \mu_0) + |\Phi_s^{0,\omega}(x) - x| ds + s_n [f] (1 + |x|) \left( d_{\mathcal{W},m_{f,u}}(\bar{\omega}_n, \bar{\omega}) + \frac{1}{n} \right). \end{aligned}$$

By (19), we have $d_{\mathcal{W}}(\mu_s, \mu_0) \leq se^{[f]s} ([f] d_{\mathcal{W}}(\mu_0, \delta_0) + |f|_{0,\infty})$. Plugging this into the above, we get after simplification

$$\frac{d_{\mathcal{W}}(\mu_{s_n}, m_{s_n}\#\mu_0)}{s_n} \leq 2[f] \left[ s_n e^{[f]s_n} ([f] d_{\mathcal{W}}(\mu_0, \delta_0) + |f|_{0,\infty}) + d_{\mathcal{W},m_{f,u}}(\bar{\omega}_n, \bar{\omega}) + \frac{1}{n} \right] \underset{n \to \infty}{\longrightarrow} 0.$$

Hence the result.

<figure><img src="image_2.png" /></figure>

## 4.2 Properties of the value function

Recall that the value function is defined as

$$V: [0, T] \times \mathcal{P}_2(\mathbb{R}^d) \to \mathbb{R}, \quad V(t, v) := \inf \{ \tilde{\mathcal{J}}(\mu_T^{t,v,u}) \mid u \in L^0([t, T]; U) \}.$$

From Theorem 2 and the assumption [A3] of local uniform continuity of $\tilde{\mathcal{J}}$, we obtain that the set of solutions of the relaxed system (17) may be substituted to the set of solutions of the original problem (1) without changing the value function, that is,

$$V(t, v) = \inf \{ \tilde{\mathcal{J}}(\mu_T^{t,v,\omega}) \mid \omega \in L^0([t, T]; \mathcal{P}(U)) \} = \inf_{\mu \in \mathcal{R}_T^{t,v}} \tilde{\mathcal{J}}(\mu),$$

where the reachable set $\mathcal{R}_T^{t,v}$ is defined in (20). Notice that this equality would stand as well with a running cost, since the relaxation result concerns the whole trajectories and not only the reachable sets. In this deterministic setting, we retrieve the classical Dynamic Programming Principle (DPP): for each $0 < h \leq T - t$,

$$V(t, v) = \inf_{\mu \in \mathcal{R}_{t+h}^{t,v}} V(t+h, \mu). \qquad (22)$$

**Lemma 3** (Local uniform continuity of the value function). Under the assumptions [A1], [A2] and [A3], the function $V$ is locally uniformly continuous in time and space, i.e. for all $R > 0$, there exists a modulus $m_{V,R}: \mathbb{R}^+ \to \mathbb{R}^+$ such that

$$|V(s, v) - V(t, \mu)| \leq m_{V,R}(|t - s| + d_{\mathcal{W}}(\mu, v)) \quad \forall (t, s) \in [0, T]^2, (\mu, v) \in (\overline{\mathcal{B}}(\delta_0, R))^2.$$
Demonstration. Let $R > 0$, and denote $R_T := R + T \exp[f] T ([f]R + |f|_{0,\infty})$ a radius large enough so that $\mathcal{R}_T^{0,v} \subset \bar{\mathcal{B}}(\delta_0, R_T)$ for all $v \in \bar{\mathcal{B}}(\delta_0, R)$. Let $m_{\mathfrak{J},R_T}$ be a local modulus of continuity of $\mathfrak{J}$ in the ball $\bar{\mathcal{B}}(\delta_0, R_T)$. According to the $[\mathcal{R}]$-Lipschitz continuity of the reachable sets given by Lemma 1, we have for all $t \in [0, T]$ and $v, \bar{v} \in \bar{\mathcal{B}}(\delta_0, R)$ that

$$V(t, v) - V(t, \bar{v}) \le \sup_{\bar{\mu} \in \mathcal{R}_T^{t, \bar{v}}} \inf_{\mu \in \mathcal{R}_T^{t, v}} \mathfrak{J}(\mu) - \mathfrak{J}(\bar{\mu}) \le \sup_{\bar{\mu} \in \mathcal{R}_T^{t, \bar{v}}} \inf_{\mu \in \mathcal{R}_T^{t, v}} m_{\mathfrak{J}, R_T}(d_W(\mu, \bar{\mu})) \le m_{\mathfrak{J}, R_T}([\mathcal{R}]d_W(v, \bar{v})).$$

On the other hand, let $0 \le t \le s \le T$ and $v \in \bar{\mathcal{B}}(\delta_0, R)$. The DPP (22) and the Grönwall estimate (19) give us

$$V(t, v) - V(s, v) = \inf_{\mu \in \mathcal{R}_s^{t,v}} V(s, \mu) - V(s, v) \le \inf_{\mu \in \mathcal{R}_s^{t,v}} m_{\mathfrak{J}, R_T} ([\mathcal{R}]d_W(\mu, v)) \le m_{\mathfrak{J}, R_T} ([\mathcal{R}]|s-t|\exp([f]T) ([f]R + |f|_{0,\infty})).$$

$$V(s, v) - V(t, v) = \sup_{\mu \in \mathcal{R}_s^{t,v}} V(s, \mu) - V(s, v) \le \sup_{\mu \in \mathcal{R}_s^{t,v}} m_{\mathfrak{J}, R_T} ([\mathcal{R}]d_W(\mu, v)) \le m_{\mathfrak{J}, R_T} ([\mathcal{R}]|s-t|\exp([f]T) ([f]R + |f|_{0,\infty})).$$

Hence $V$ is locally uniformly continuous with a modulus depending only on $\mathfrak{J}$, $f$ and $T$. $\square$

# 5 The Hamilton-Jacobi equation

In this section, we are interested into the following generic Hamilton-Jacobi equation

$$-\partial_t u(t, \mu) + H(\mu, D_{\mu}u(t, \mu)) = 0, \quad u(T, \mu) = \mathfrak{J}(\mu). \qquad (23)$$

Regularity assumptions on the Hamiltonian $H: \mathbb{T} \to \mathbb{R}$ will be precised further.

## 5.1 Notion of viscosity solutions

Recall that $X := ]0, T \times \mathcal{P}_2(\mathbb{R}^d)$ and $d_X^2((t, \mu), (s, v)) := |s-t|^2 + d_W^2(\mu, v)$. In this section, we precise the definition of a viscosity solution of (23). To this aim, we will use a class of test functions, that will be more regular than the viscosity solution in order to bear the derivatives. The time variable and the measure variable of the test functions do not play symmetric roles, as weaker regularity on the measure dimension will be compensated by stronger assumptions on the time dimension.

### 5.1.1 Regularity in the measure variable

**Definition 4** (Locally semiconcave/convex maps). An application $u: \mathcal{P}_2(\mathbb{R}^d) \to \mathbb{R}$ is locally semiconcave in $\mathcal{P}_2(\mathbb{R}^d)$ if for all $R > 0$, there exists $\lambda_R \in \mathbb{R}$ such that for all $\mu, v \in \bar{\mathcal{B}}(\delta_0, R)$ and $\eta = \eta(x, y) \in \Gamma_o(\mu, v)$, there holds

$$u((1-h)\pi_x + h\pi_y)\#\eta) \ge (1-h)u(\mu) + hu(v) - \frac{\lambda_R}{2}h(1-h)d_W^2(\mu, v) \quad \forall h \in [0, 1].$$

An application $u: \mathcal{P}_2(\mathbb{R}^d) \to \mathbb{R}$ is semiconvex if $u$ is semiconcave.

Locally semiconcave/convex maps are directionally differentiable at all points. As an important example, the squared Wasserstein distance is directionally differentiable (see [Gig08, §4.2]) and for any $\sigma \in \mathcal{P}_2(\mathbb{R}^d)$ and $\xi \in \mathcal{P}_2(\mathbb{R}^d)_{\mu}$,

$$D_{\mu}d_{W}^{2}(\cdot, \sigma)(\xi) = \inf_{\eta \in \exp_{\mu}^{-1}(\sigma)} \inf_{\alpha \in \Gamma_{\mu}(\xi, \eta)} -2 \int_{(x,v,w) \in \mathbb{T}^2 \mathbb{R}^d} \langle v, w \rangle d\alpha(x, v, w). \qquad (24)$$

Moreover, given $\sigma \in \mathcal{P}_2(\mathbb{R}^d)$, we may compute $\|D_{\mu}d_W^2(\cdot, \sigma)\|_{\mu}$ as defined in (16). Indeed,

$$\begin{aligned} |D_{\mu}d_W^2(\cdot, \sigma)(\xi)| &= \left| \inf_{\alpha \in \Gamma_{\mu}(\xi, \exp_{\mu}^{-1}(\sigma))} \int_{(x,v,w)} -2\langle v, w \rangle d\alpha(x, v, w) \right| \le 2 \sup_{\alpha \in \Gamma_o(\xi, \exp_{\mu}^{-1}(\sigma))} \int_{(x,v,w)} |v||w| d\alpha(x, v, w) \\ &\le 2 \left( \int_{(x,v) \in \mathbb{T}^d} |v|^2 d\xi(x, v) \right)^{1/2} \sup_{\eta \in \exp_{\mu}^{-1}(\sigma)} \left( \int_{(x,w) \in \mathbb{R}^d} |w|^2 d\eta(x, w) \right)^{1/2} = 2 \|\xi\|_{\mu} d_W(\mu, \sigma). \end{aligned}$$
Hence $\|D_\mu d_{\mathcal{W}}^2(\cdot, \sigma)\|_{\mu} \le 2d_{\mathcal{W}}(\mu, \sigma)$. On the other hand, if $\sigma \ne \mu$, letting $\xi \in \exp_{\mu}^{-1}(\sigma)$,

$$ \|D_{\mu} d_{\mathcal{W}}^{2}(\cdot, \sigma)\|_{\mu} \ge \left| \frac{D_{\mu} d_{\mathcal{W}}^{2}(\cdot, \sigma)(\xi)}{\|\xi\|_{\mu}} \right| = \frac{1}{d_{\mathcal{W}}(\mu, \sigma)} \left| \lim_{h \searrow 0} \frac{(1-h)^{2} d_{\mathcal{W}}^{2}(\mu, \sigma) - d_{\mathcal{W}}^{2}(\mu, \sigma)}{h} \right| = 2d_{\mathcal{W}}(\mu, \sigma), \quad (25) $$

showing equality.

**Remark 3 (Composition rule).** Let $\varphi \in C^2(\mathbb{R}^+; \mathbb{R}^+)$ be nondecreasing, and consider the composition $\psi : \mu \to \varphi(d_{\mathcal{W}}^2(\delta_0, \mu))$. Denote $\lambda_R$ a local constant of semiconcavity of $\varphi$ over $[0, 3R]$, and $[\varphi_R]$ a local constant of Lipschitz-continuity of $\varphi$ over the same domain. Then $\psi$ is semiconcave with modulus $R\lambda_R + [\varphi_R]$ (see [CS04, Proposition 2.1.12]).

In addition to the above, we ask for the following consistency with the tangent cone.

**Definition 5 (Geometrically consistent application).** We say that an application $u : \mathcal{P}_2(\mathbb{R}^d) \to \mathbb{R}$ is consistent with the geometric structure if it is directionally differentiable and if

$$ \forall \mu \in \mathcal{P}_2(\mathbb{R}^d), \quad \forall \xi \in \mathcal{P}_2(\mathbb{R}^d)_{\mu}, \quad D_{\mu}u(\xi) = D_{\mu}u(\pi^{\mu}\xi). $$

The fact that the squared Wasserstein distance is geometrically consistent is given by [JJZ, Theorem 3.8].

### 5.1.2 Regularity in the time variable

**Definition 6 (Locally Lipschitz time derivative).** We say that $\varphi : X \to \mathbb{R}$ has locally Lipschitz time derivative if for all $\mu \in \mathcal{P}_2(\mathbb{R}^d)$, $\varphi(\cdot, \mu) \in C^1([0, T]; \mathbb{R})$, and if the application $(t, \mu) \mapsto \partial_t \varphi(t, \mu)$ is locally Lipschitz in $(X, d_X)$.

**Lemma 4 (Partial derivatives).** Let $\varphi : X \to \mathbb{R}$ satisfy Definition 6. Let $(t, \mu) \in X$ such that $\varphi(t, \cdot)$ is directionally differentiable at $\mu$, and $\xi \in \text{Tan}_\mu \mathcal{P}_2(\mathbb{R}^d)$. Then

$$ \lim_{h \searrow 0} \frac{\varphi(t+h, \exp_\mu(h \cdot \xi)) - \varphi(t, \mu)}{h} = \partial_t \varphi(t, \mu) + D_\mu \varphi(t, \mu)(\xi). $$

*Demonstration.* Let $C$ be a Lipschitz constant for $\partial_s \varphi$ in the ball $\mathcal{B}((t, \mu), \sqrt{1 + \|\xi\|_{\mu}^2})$. Then for all $0 < h \le 1$,

$$ \begin{aligned} \frac{\varphi(t+h, \exp_\mu(h \cdot \xi)) - \varphi(t, \mu)}{h} &= \frac{\varphi(t+h, \exp_\mu(h \cdot \xi)) - \varphi(t, \exp_\mu(h \cdot \xi))}{h} + \frac{\varphi(t, \exp_\mu(h \cdot \xi)) - \varphi(t, \mu)}{h} \\ &= \frac{1}{h} \int_{r=t}^{t+h} \partial_r \varphi(r, \exp_\mu(h \cdot \xi)) dr + \frac{\varphi(t, \exp_\mu(h \cdot \xi)) - \varphi(t, \mu)}{h} \\ &\in \partial_t \varphi(t, \mu) \pm \frac{C}{h} \int_{r=t}^{t+h} |r-t| + d_{\mathcal{W}}(\exp_\mu(h \cdot \xi), \mu) dr + \frac{\varphi(t, \exp_\mu(h \cdot \xi)) - \varphi(t, \mu)}{h} \\ &\subset \partial_t \varphi(t, \mu) \pm Ch(1 + \|\xi\|_{\mu}) + \frac{\varphi(t, \exp_\mu(h \cdot \xi)) - \varphi(t, \mu)}{h}. \end{aligned} $$

Letting $h \searrow 0$ and using the directional differentiability of $\varphi(t, \cdot)$ at $\mu$, we obtain the result. $\square$

### 5.1.3 Locally uniform upper semicontinuity

Due to the lack of local compactness of $\mathcal{P}_2(\mathbb{R}^d)$, we consider a stronger definition than upper semicontinuity.

**Definition 7 (Locally uniformly upper semicontinuous).** Let $(Y, d)$ be a complete metric space. A locally bounded application $u : Y \to \mathbb{R}$ is said to be locally uniformly upper semicontinuous (luusc) if for any decreasing family of closed bounded sets $(B_n)_{n \in \mathbb{N}}$ such that $B := \bigcap_{n \in \mathbb{N}} B_n \ne \emptyset$ and $\lim_{n \to \infty} \sup_{x \in B_n} \inf_{y \in B} d_Y(x, y) \to 0$, there holds

$$ \lim_{n \to \infty} \sup_{y \in B_n} u(y) \le \sup_{x \in B} u(x). \quad (26) $$

Similarly, we say that $u$ is locally uniformly lower semicontinuous (lulsc) if $-u$ is luusc.

**Remark 4 (Link with other notions of upper semicontinuity).** We gather here some properties, whose proofs are postponed to Appendix A.
- Definition 7 is strictly weaker than continuity.

- In general, Definition 7 is strictly stronger than upper semicontinuity. However both definitions whenever Y is locally compact.

- Let S be the set of nonempty closed and bounded subsets of Y. Then Definition 7 is equivalent to the upper semicontinuity of the set function U : B ↦ sup$_{x}$$_{∈}$$_{B}$ u(x) in the Hausdorff topology. This definition makes sense in connection with the (min,+ ) interpretation of Hamilton-Jacobi equations, as it exactly says that the Maslov measure of density u is upper semicontinuous (see [KM97; DMD99]).

- The applications that are simultaneously luusc and lulsc are exactly the locally uniformly continuous applications.

- In Y = P$_{2}$ ( R $^{d}$) , there is no comparison with upper semicontinuity in the narrow topology (see counterexamples in Appendix A).

5.1.4 Definition of viscosity solutions

Gathering the above definitions, we arrive at the following.

Definition 8 (Test functions) . We define

$$
\mathcal{T}_{+} := \left\{ \varphi : [0, T] \times \mathcal{P}_2(\mathbb{R}^d) \to \mathbb{R} \;\middle|\; \begin{array}{l} \varphi \text{ and } \partial_t \varphi \text{ are locally Lipschitz, and } \forall s \in [0, T], \\ \varphi(s, \cdot) \text{ is locally semiconcave and geometrically consistent} \end{array} \right\}.
$$

Similarly, we denote T − := {− ϕ | ϕ ∈ T + } , that is,

$$
\mathcal{T}_{-} := \left\{ \varphi : [0, T] \times \mathcal{P}_2(\mathbb{R}^d) \to \mathbb{R} \;\middle|\; \begin{array}{l} \varphi \text{ and } \partial_t \varphi \text{ are locally Lipschitz, and } \forall s \in [0, T], \\ \varphi(s, \cdot) \text{ is locally semiconvex and geometrically consistent} \end{array} \right\}.
$$

Distinguished members of T ± are the applications of the form ϕ ( t, µ ) = ψ ( t ) ± αd 2 $_{W}$( µ, σ ) , where ψ ∈ C $^{2}$( [0 , T ; R ) , α ≥ 0 and σ ∈ P $_{2}$( R $^{d}$) is fixed. Once given T ± , the definition of viscosity solutions is a natural generalization of the finite- dimensional case.

Definition 9 (Viscosity solutions) . We say that u : [0 , T ] × P $_{2}$( R $^{d}$) → R is a viscosity

- subsolution if it is locally uniformly upper semicontinuous, if u ( T, · ) ≤ J , and if for any φ ∈ T + such that u − φ reaches a maximum at ( t, µ ) ∈ X = ] 0 , T [ × P $_{2}$( R $^{d}$) , there holds

$$
-\partial_t \varphi(t, \mu) + H(\mu, D_\mu \varphi(t, \mu)) \le 0. \tag{27}
$$

- supersolution if it is locally uniformly lower semicontinuous, if u ( T, · ) ≥ J , and if for any ψ ∈ T − such that u − ψ reaches a minimum at ( t, µ ) ∈ X , there holds

$$
-\partial_t \psi(t, \mu) + H(\mu, D_\mu \psi(t, \mu)) \ge 0. \quad (28)
$$

- solution if it is both a sub and a supersolution.

5.2 Comparison principle

The comparison principles, or maximum principles in the literature of elliptic equations, are used in the viscosity theory to provide uniqueness of the viscosity solutions. They draw their name from the corresponding results used over the vis- cous approximations of the PDE, and evolved jointly with the growing scope of HJB equations. When addressing equations in non-locally compact spaces, it is now common to rely on variations over Ekeland’s variational principle [Eke74]: see [LY95; AF14; GŚ15]. This is not the only strategy in use in the literature: one could also modify the definition in order to stay over compact sets, as in [FK09] or [WZ19] in the pathwise setting.

The perturbed optimization principle will bring, as announced, perturbations. To cope with these additional terms, [MQ18; JMQ20] consider an "enlarged" set of semidifferentials, and a strengthened notion of viscosity solutions. We take another point of view by using the Borwein-Preiss principle, also called smooth Ekeland principle , that allows to choose the perturbation in a way that they can be embedded into the test functions. To ease the reading, we factorize the application of this theorem in the following Lemma.
**Lemma 5** (Perturbed optimization). Denote $Y = \bar{X}^2 = [0, T] \times \mathcal{P}_2(\mathbb{R}^d) \times [0, T] \times \mathcal{P}_2(\mathbb{R}^d)$, endowed with the distance

$$d_Y^2((t, \mu, s, v), (\bar{t}, \bar{\mu}, \bar{s}, \bar{v})) := |t - \bar{t}|^2 + d_{\bar{Y}}^2(\bar{\mu}, \bar{\mu}) + |s - \bar{s}|^2 + d_{\bar{Y}}^2(v, \bar{v}).$$

Let $\Phi: Y \to \mathbb{R} \cup \{-\infty\}$ be upper semicontinuous, proper and upper bounded, $z^0 \in Y$ be fixed such that $A := \sup \Phi - \Phi(z_0) < \infty$, and assume that there exists $R > 0$ such that

$$\{z \in Y \mid \Phi(z) \ge \Phi(z^0)\} \subset \bar{\mathcal{B}}(z^0, R). \qquad (29)$$

Hence for each $n \in \mathbb{N}_*$, there exists $z_n \in Y$ and a perturbation $p_n: Y \to \mathbb{R}^+$ such that

1. the perturbed map $\Phi - p_n$ reaches a global strict maximum in $z_n$,

2. The map $(t, \mu) \mapsto p_n(t, \mu, s_n, v_n)$ belongs to $\mathcal{T}_+$, and $(s, v) \mapsto -p_n(t_n, \mu_n, s, v)$ belongs to $\mathcal{T}_-$,

3. There exists an application $\omega_{T,R,A}: \mathbb{N} \to \mathbb{R}^+$ such that

$$\sum_{r \in \{t, s\}} |\partial_r p_n(z_n)| + \sum_{\sigma \in \{\mu, v\}} (1 + d_{\bar{Y}}(\sigma, \delta_0)) \|D_\sigma p_n(z_n)\|_{\sigma} \le \omega_{T,R,A}(n) \underset{n \to \infty}{\longrightarrow} 0,$$

4. There holds $\sup \Phi \le \Phi(z_n) + C_{R,A}(n)$, where $C_{R,A}$ is decreasing towards 0 when $n \to \infty$.

The proof of Lemma 5 is delayed to Appendix B.

**Assumption [A4]** (Structure of the Hamiltonian). There exists a constant $[H]$ such that for any $\mu, v \in \mathcal{P}_2(\mathbb{R}^d)$, any $a > 0$ and $p, q \in \mathbb{T}_\mu$,

$$|H(\mu, p+q) - H(\mu, p)| \le [H](1 + d_{\bar{Y}}(\mu, \delta_0)) \|q\|_{\mu}, \qquad (30)$$

$$H(\mu, -aD_{\mu}d_{\bar{Y}}^2(\cdot, v)) - H(v, aD_{v}d_{\bar{Y}}^2(\mu, \cdot)) \le 2a[H]d_{\bar{Y}}^2(\mu, v). \qquad (31)$$

The condition (30) is classical, and traduces a locally Lipschitz behavior of the Hamiltonian. The condition (31) could be interpreted as a one-sided Lipschitz control on the variation with respect to the first argument only.

**THEOREM 3** (COMPARISON PRINCIPLE). Assume [A4]. Let $u : [0, T] \times \mathcal{P}_2(\mathbb{R}^d) \to \mathbb{R}$ be a subsolution of (23) and $v : [0, T] \times \mathcal{P}_2(\mathbb{R}^d) \to \mathbb{R}$ be a supersolution of (23), which are such that $u(T, \mu) \le v(T, \mu)$ for all $\mu \in \mathcal{P}_2(\mathbb{R}^d)$. Then

$$u(t, \mu) \le v(t, \mu) \quad \forall (t, \mu) \in [0, T] \times \mathcal{P}_2(\mathbb{R}^d). \qquad (32)$$

This proof builds on the ideas of [FGŠ17, Theorem 3.50, p. 206] developed in Hilbert spaces. The structure is the following: assume by contradiction that the inequality (32) is not satisfied. Thus we have an information on the sign of the maximum $(t, \mu, s, v) \mapsto u(t, \mu) - v(s, v)$ on the diagonal $t = s, \mu = v$. As in the classical proof, this maximum over the diagonal is approximated by the maximum over the doubled space $\bar{X}^2$ of a perturbation of $u \oplus v$ that penalizes the distance to the diagonal. At the point of maximum, freezing two of the four variables of $\bar{X}^2$ allows to apply the definition of viscosity sub and supersolution, giving two inequalities whose combination will eventually lead to a contradiction.

The proof below has several specificities with respect to the canonical arguments (see [CIL92, Section 3]). In the argument adapted to $\mathbb{R}^d$, the points of maximum over the doubled space exist, and admit cluster points on the diagonal. In $\bar{X} = [0, T] \times \mathcal{P}_2(\mathbb{R}^d)$, balls are not compact, and there is no reason for the maxima to be attained. This is circumvented by the use of variational principle in the vein of Ekeland's principle. Secondly, the so-constructed sequence of "almost maxima" do not necessarily contain converging subsequences. This is where the stronger form of upper semicontinuity of Definition 7 replaces the standard extraction, by working with limits over sets that decrease towards the diagonal. As opposite to the Hilbertian setting, we are not able to use a linear perturbation into the Ekeland principle, and we have to manipulate series of squared distances in order to get sufficient smoothness to embed the perturbation into test functions.

**Demonstration.** Denote again $X = [0, T] \times \mathcal{P}_2(\mathbb{R}^d)$. By abuse of notation, let $X^2 := [0, T] \times \mathcal{P}_2(\mathbb{R}^d) \times [0, T] \times \mathcal{P}_2(\mathbb{R}^d)$ and

$$d_X^2((t, \mu), (\bar{t}, \bar{\mu})) := |t - \bar{t}|^2 + d_{\bar{Y}}^2(\bar{\mu}, \bar{\mu}), \quad d_{X^2}^2((t, \mu, s, v), (\bar{t}, \bar{\mu}, \bar{s}, \bar{v})) := d_X^2((t, \mu), (\bar{t}, \bar{\mu})) + d_X^2((s, v), (\bar{s}, \bar{v})).$$

Assume by contradiction that

$$\Gamma := \min \{1, \sup \{u(t, \mu) - v(t, \mu) \mid (t, \mu) \in \bar{X}\} \} > 0. \qquad (33)$$
**Penalizations** As $u$ and $-v$ are locally uniformly upper semicontinuous, we may build an application $g: \mathbb{R}^+ \to \mathbb{R}^+$ controlling the growth of both $u$ and $-v$, i.e. such that

$$ \max(u(t, \mu), -v(t, \mu)) \le g(d_W(\mu, \delta_0)) \quad \forall \mu \in \mathcal{P}_2(\mathbb{R}^d). \quad (34) $$

Up to regularization, we may assume that $g$ is increasing, of class $C^2$ and with $g'(\cdot) \ge 1$. Denote

$$ h: \mathbb{R}^2 \to \mathbb{R}, \quad h(t, r) := g^2((1+r)e^{-4|H|t}) + \frac{1}{t}. $$

As the composition $\mu \mapsto h(t, d_{W}^{2}(\delta_{0}, \mu))$ grows strictly faster than $u$ and $-v$ by (34), for any $\iota > 0$,

$$ \max[u(t, \mu), -v(t, \mu)] - \iota h(t, d_{W}^{2}(\delta_{0}, \mu)) \le \sup_{r \in \mathbb{R}^{+}} g(r) - \iota g^{2}((1+r^{2})e^{-4|H|T}) =: \|g - \iota h\| < \infty. \quad (35) $$

Since $g \ge 1$ and $g' \ge 1$, there holds

$$ \partial_t h(t, r) = -8[H](1+r)e^{-4|H|t}(gg')((1+r)e^{-4|H|t}) - \frac{1}{t^2} \le -8[H]e^{-4|H|T}. \quad (36) $$

Moreover, for any $t > 0$ and $r \in \mathbb{R}^+$,

$$ 2[H](1+r)\partial_r h(t,r) = 4[H](1+r)g((1+r)e^{-4|H|t})\partial_r g((1+r)e^{-4|H|t})e^{-4|H|t} = -\frac{1}{2}\partial_t h(t,r) - \frac{1}{2t^2} \le -\frac{1}{2}\partial_t h(t,r). \quad (37) $$

As $g$ is $C^2$, the map $h$ has locally Lipschitz time derivatives in $X=]0, T \times \mathcal{P}_2(\mathbb{R}^d)$. Moreover, owing to Remark 3, the composition $\mu \mapsto h(t, d_{W}^{2}(\delta_{0}, \mu))$ is locally semiconcave for all $t$, and locally Lipschitz. Therefore $(t, \mu) \mapsto \pm h(t, d_{W}^{2}(\mu, \delta_{0}))$ belongs to $\mathcal{T}_{\pm}$.

We consider

$$ \Gamma_{\iota} := \lim_{r \to 0} \sup \left\{ u(t, \mu) - v(s, v) - \iota \left( h(t, d_{W}^{2}(\mu, \delta_{0})) + h(s, d_{W}^{2}(v, \delta_{0})) \right) \mid (t, \mu, s, v) \in \bar{X}^{2}, d_{X}((t, \mu), (s, v)) \le r \right\}, \quad (38) $$

$$ \Gamma_{\iota\varepsilon} := \sup \left\{ u(t, \mu) - v(s, v) - \iota \left( h(t, d_{W}^{2}(\mu, \delta_{0})) + h(s, d_{W}^{2}(v, \delta_{0})) \right) - \frac{d_{X}^{2}((t, \mu), (s, v))}{\varepsilon} \mid (t, \mu, s, v) \in \bar{X}^{2} \right\}. \quad (39) $$

Then one has

$$ \Gamma_{\iota\varepsilon} \searrow \Gamma_{\iota} \quad \text{for all } \iota > 0, \quad \text{and} \quad \Gamma_{\iota} \nearrow \Gamma_{0} \ge \Gamma. \quad (40) $$

Here $\Gamma_0$ may be equal to $+\infty$. The arguments of (40) are easy but tedious, and devolved in Appendix C to lighten the presentation.

**The perturbed maximization** Let $\Phi_{\iota\varepsilon}: \bar{X}^2 \to \{-\infty\} \cup \mathbb{R}$ be given by

$$ \Phi_{\iota\varepsilon}(t, \mu, s, v) := u(t, \mu) - v(s, v) - \iota \left( h(t, d_{W}^{2}(\mu, \delta_{0})) + h(s, d_{W}^{2}(v, \delta_{0})) \right) - \frac{d_{X}^{2}((t, \mu), (s, v))}{\varepsilon}. $$

Let $z^0 := (T, \delta_0, T, \delta_0)$. For each fixed $\iota, \varepsilon$, the application $\Phi_{\iota\varepsilon}$ is upper semicontinuous, proper and - using (35) - upper bounded in the complete metric space $(\bar{X}^2, d_{X^2})$. Moreover, if $\Phi_{\iota\varepsilon}(z) \ge \Phi_{\iota\varepsilon}(z^0)$, then

$$ \frac{\iota}{2} \left( h(t, d_{W}^{2}(\mu, \delta_{0})) + h(s, d_{W}^{2}(v, \delta_{0})) \right) \le \|u - \frac{\iota}{2}h\| + \|v - \frac{\iota}{2}h\| + 0 - (u(T, \delta_{0}) - v(T, \delta_{0}) - 2\iota h(T, 0) - 0), \quad (41) $$

and there exists $R_\iota > 0$ such that $d_{X^2}(z, z^0) \le R_\iota$. Notice that

$$ \sup \Phi_{\iota\varepsilon} - \Phi_{\iota\varepsilon}(z^0) \le \|u - \iota h\| + \|v - \iota h\| - (u(T, \delta_0) - v(T, \delta_0) - 2\iota h(T, 0)) =: A_\iota $$

does not depend on $\varepsilon$.

Hence we may apply Lemma 5: for each $n \in \mathbb{N}_*$, there exist $z_{\iota\varepsilon n} \in \bar{X}^2$ and a perturbation $p_{\iota\varepsilon n}: \bar{X}^2 \to \mathbb{R}^+$ such that $\Phi_{\iota\varepsilon} - p_{\iota\varepsilon n}$ reaches a maximum at $z_{\iota\varepsilon n}$, the partial functions $(t, \mu) \mapsto p_{\iota\varepsilon n}(t, \mu, s_{\iota\varepsilon n}, v_{\iota\varepsilon n})$ and $(s, v) \mapsto -p_{\iota\varepsilon n}(t_{\iota\varepsilon n}, \mu_{\iota\varepsilon n}, s, v)$ belong respectively to $\mathcal{T}_+$, $\mathcal{T}_-$, and there exist maps $\omega_l, C_l: \mathbb{N}_* \to \mathbb{R}^+$ satisfying

$$ \sum_{r \in [s, t]} |\partial_r p_{\iota\varepsilon n}(z_{\iota\varepsilon n})| + \sum_{\sigma \in \{\mu, v\}} (1 + d_{W}(\sigma_{\iota\varepsilon n}, \delta_{0})) \|D_{\sigma} p_{\iota\varepsilon n}(z_{\iota\varepsilon n})\|_{\sigma_{\iota\varepsilon n}} \le \omega_{l}(n) \underset{n \to \infty}{\longrightarrow} 0, \quad (42) $$

$$ \Gamma_{\iota\varepsilon} - \Phi_{\iota\varepsilon}(z_{\iota\varepsilon n}) = \sup \Phi_{\iota\varepsilon} - \Phi_{\iota\varepsilon}(z_{\iota\varepsilon n}) \le C_l(n) \underset{n \to \infty}{\longrightarrow} 0. $$
Notice that

$$ \Gamma_{i\epsilon} + \frac{d_X^2((t_{i\epsilon n}, \mu_{i\epsilon n}), (s_{i\epsilon n}, v_{i\epsilon n}))}{2\epsilon} \le \Phi_{i\epsilon}(z_{i\epsilon n}) + C_t(n) + \frac{d_X^2((t_{i\epsilon n}, \mu_{i\epsilon n}), (s_{i\epsilon n}, v_{i\epsilon n}))}{2\epsilon} \le \Gamma_{i\frac{\epsilon}{2}} + C_t(n) $$

so that for each fixed $t$, there holds by (40)

$$ \frac{d_X^2((t_{i\epsilon n}, \mu_{i\epsilon n}), (s_{i\epsilon n}, v_{i\epsilon n}))}{\epsilon} \le 2 \left( \Gamma_{i\frac{\epsilon}{2}} - \Gamma_{i\epsilon} + C_t(n) \right) \underset{\epsilon \to 0, n \to \infty}{\longrightarrow} 0. \quad (43) $$

**Staying away from** $T$ Let us show that for sufficiently small $t$ and large $n$, the points $t_{i\epsilon n}, s_{i\epsilon n}$ belong to $]0, T[$. Since $h(0, r) = +\infty$ for all $r \ge 0$, the construction of $z_{i\epsilon n}$ implies $t_{i\epsilon n}, s_{i\epsilon n} > 0$. On the other hand, recalling (40), let $t_0 > 0$ be small enough so that $\Gamma_t \ge \Gamma/2$ for all $0 < t \le t_0$. Hence, as $\epsilon \mapsto \Gamma_{i\epsilon}$ is nonincreasing,

$$ u(t_{i\epsilon n}, \mu_{i\epsilon n}) - v(s_{i\epsilon n}, v_{i\epsilon n}) \ge \Phi_{i\epsilon}(z_{i\epsilon n}) \ge \Gamma_{i\epsilon} - C_t(n) \ge \Gamma_t - C_t(n) \ge \frac{\Gamma}{2} - C_t(n) $$

and there exists $n_l \in \mathbb{N}_*$ large enough such that $u(t_{i\epsilon n}, \mu_{i\epsilon n}) - v(s_{i\epsilon n}, v_{i\epsilon n}) \ge \frac{\Gamma}{4}$ for all $n \ge n_l$.

Then for each $0 < t \le t_0$, $\epsilon > 0$ sufficiently small and $n$ sufficiently large, $t_{i\epsilon n}, s_{i\epsilon n} < T$ simultaneously. Indeed, recall from (41) that $\mu_{i\epsilon n}, v_{i\epsilon n} \in \mathcal{B}(\delta_0, R_t)$ for all $\epsilon, n$. If there exists a sequence $(\epsilon_m, n_m) \to m (0, \infty)$ such that $n_m \ge n_l$ and $T \in \{t_{i\epsilon_m n_m}, s_{i\epsilon_m n_m}\}$ for all $m$, then using (43),

$$ \begin{aligned} \frac{\Gamma}{4} &\le \lim_{m \to \infty} u(t_{i\epsilon_m n_m}, \mu_{i\epsilon_m n_m}) - v(t_{i\epsilon_m n_m}, v_{i\epsilon_m n_m}) \\ &\le \limsup_{r \searrow 0} \{ u(t, \mu) - v(s, v) \mid d_X^2((t, \mu), (s, v)) \le r, \mu, v \in \bar{\mathcal{B}}(\delta_0, R_t), (t, s) \in [T-r, T]^2 \} \\ &\le \sup \{ u(t, \mu) - v(s, v) \mid t = s = T, \mu = v \in \bar{\mathcal{B}}(\delta_0, R_t) \} = \sup_{\mu \in \bar{\mathcal{B}}(\delta_0, R_t)} u(T, \mu) - v(T, \mu). \end{aligned} $$

The last inequality holds since $(t, \mu, s, v) \mapsto u(t, v) - v(s, v)$ is locally uniformly upper semicontinuous (see Definition 7). But this contradicts the assumption that $u(T, \cdot) - v(T, \cdot) \le 0$.

**Application of the definition of semisolutions** Define $\varphi_{i\epsilon n}, \psi_{i\epsilon n} : X = ]0, T[ \times \mathcal{P}_2(\mathbb{R}^d) \to \mathbb{R}$ as

$$ \begin{aligned} \varphi_{i\epsilon n}(t, \mu) &:= v(s_{i\epsilon n}, v_{i\epsilon n}) + \iota(h(t, d_W^2(\mu, \delta_0)) + h(s_{i\epsilon n}, d_W^2(v_{i\epsilon n}, \delta_0))) + \frac{d_X^2((t, \mu), (s_{i\epsilon n}, v_{i\epsilon n}))}{\epsilon} + p_{i\epsilon n}(t, \mu, s_{i\epsilon n}, v_{i\epsilon n}), \\ \psi_{i\epsilon n}(s, v) &:= u(t_{i\epsilon n}, \mu_{i\epsilon n}) - \iota(h(t_{i\epsilon n}, d_W^2(\mu_{i\epsilon n}, \delta_0)) + h(s, d_W^2(v, \delta_0))) - \frac{d_X^2((t_{i\epsilon n}, \mu_{i\epsilon n}), (s, v))}{\epsilon} - p_{i\epsilon n}(t_{i\epsilon n}, \mu_{i\epsilon n}, s, v). \end{aligned} $$

By construction, $\varphi_{i\epsilon n} \in \mathcal{F}_+$ and $\psi_{i\epsilon n} \in \mathcal{F}_-$. Recalling that $u - \varphi_{i\epsilon n}$ reaches a maximum at $(t_{i\epsilon n}, \mu_{i\epsilon n}) \in X$, we have

$$ \begin{aligned} & - \iota \partial_t h(t_{i\epsilon n}, d_W^2(\mu_{i\epsilon n}, \delta_0)) - \frac{2(t_{i\epsilon n} - s_{i\epsilon n})}{\epsilon} - \partial_t p_{i\epsilon n}(z_{i\epsilon n}) \\ & + H \left( \mu_{i\epsilon n}, \iota \partial_r h(t_{i\epsilon n}, d_W^2(\mu_{i\epsilon n}, \delta_0)) D_\mu d_W^2(\mu_{i\epsilon n}, \delta_0) + \frac{D_\mu d_W^2(\mu_{i\epsilon n}, v_{i\epsilon n})}{\epsilon} + D_\mu p_{i\epsilon n}(z_{i\epsilon n}) \right) \le 0. \end{aligned} \quad (44) $$

Let momentaneously $c_{i\epsilon n} := [H](1 + d_W(\mu_{i\epsilon n}, \delta_0))$. Using the Lipschitz assumption (30) and the estimate (25) on the differential of the squared distance, since $\partial_r h \ge 0$,

$$ H \left( \mu_{i\epsilon n}, \iota \partial_r h(t_{i\epsilon n}, d_W^2(\mu_{i\epsilon n}, \delta_0)) D_\mu d_W^2(\mu_{i\epsilon n}, \delta_0) + \frac{D_\mu d_W^2(\mu_{i\epsilon n}, v_{i\epsilon n})}{\epsilon} + D_\mu p_{i\epsilon n}(z_{i\epsilon n}) \right) \quad (45) $$

$$ \ge H \left( \mu_{i\epsilon n}, \frac{D_\mu d_W^2(\mu_{i\epsilon n}, v_{i\epsilon n})}{\epsilon} \right) - c_{i\epsilon n} \left( \iota \partial_r h(t_{i\epsilon n}, d_W^2(\mu_{i\epsilon n}, \delta_0)) \|D_\mu d_W^2(\mu_{i\epsilon n}, \delta_0)\|_{\mu_{i\epsilon n}} + \|D_\mu p_{i\epsilon n}(z_{i\epsilon n})\|_{\mu_{i\epsilon n}} \right) \quad (46) $$

$$ \ge H \left( \mu_{i\epsilon n}, \frac{D_\mu d_W^2(\mu_{i\epsilon n}, v_{i\epsilon n})}{\epsilon} \right) - c_{i\epsilon n} \left( 2 \iota d_W(\mu_{i\epsilon n}, \delta_0) \partial_r h(t_{i\epsilon n}, d_W^2(\mu_{i\epsilon n}, \delta_0)) + \|D_\mu p_{i\epsilon n}(z_{i\epsilon n})\|_{\mu_{i\epsilon n}} \right). \quad (47) $$

Recalling that the partial derivatives of $h$ satisfy (37), we get that

$$ 2[H](1 + d_W(\mu_{i\epsilon n}, \delta_0))d_W(\mu_{i\epsilon n}, \delta_0)\partial_r h(t_{i\epsilon n}, d_W^2(\mu_{i\epsilon n}, \delta_0)) \le -\frac{1}{2}\partial_t h(t_{i\epsilon n}, d_W^2(\mu_{i\epsilon n}, \delta_0)). \quad (48) $$
On the other hand, $v - \psi_{i\epsilon n}$ admits a minimum in $(s_{i\epsilon n}, v_{i\epsilon n}) \in X$. Applying the definition of supersolution and repeating the argument of (47) and (42), we get

$$ \begin{aligned} & \iota \partial_s h(s_{i\epsilon n}, d_{\mathcal{W}}^2(v_{i\epsilon n}, \delta_0)) + \frac{2(s_{i\epsilon n} - t_{i\epsilon n})}{\epsilon} + \partial_s p_{i\epsilon n}(z_{i\epsilon n}) - \frac{\iota}{2} \partial_s h(s_{i\epsilon n}, d_{\mathcal{W}}^2(v_{i\epsilon n}, \delta_0)) \\ & \qquad + [H](1 + d_{\mathcal{W}}(v_{i\epsilon n}, \delta_0)) \|D_v p_{i\epsilon n}(z_{i\epsilon n})\|_{v_{i\epsilon n}} + H\left(v_{i\epsilon n}, -\frac{D_v d_{\mathcal{W}}^2(\mu_{i\epsilon n}, v_{i\epsilon n})}{\epsilon}\right) \ge 0. \end{aligned} \quad (49) $$

Taking the difference between (49) and the inequality resulting from plugging (47) and (42) into (44), we get after simplification

$$ -\frac{\iota}{2} [\partial_s h(s_{i\epsilon n}, d_{\mathcal{W}}^2(v_{i\epsilon n}, \delta_0)) + \partial_t h(t_{i\epsilon n}, d_{\mathcal{W}}^2(\mu_{i\epsilon n}, \delta_0))] \le H\left(v_{i\epsilon n}, -\frac{D_v d_{\mathcal{W}}^2(\mu_{i\epsilon n}, v_{i\epsilon n})}{\epsilon}\right) - H\left(\mu_{i\epsilon n}, \frac{D_\mu d_{\mathcal{W}}^2(\mu_{i\epsilon n}, v_{i\epsilon n})}{\epsilon}\right) \quad (50) $$

$$ + \partial_s p_{i\epsilon n}(z_{i\epsilon n}) + \partial_t p_{i\epsilon n}(z_{i\epsilon n}) + [H](1 + d_{\mathcal{W}}(v_{i\epsilon n}, \delta_0)) \|D_v p_{i\epsilon n}(z_{i\epsilon n})\|_{v_{i\epsilon n}} + [H](1 + d_{\mathcal{W}}(\mu_{i\epsilon n}, \delta_0)) \|D_\mu p_{i\epsilon n}(z_{i\epsilon n})\|_{\mu_{i\epsilon n}}. \quad (51) $$

**Estimates and conclusion** Recall from (36) that $-\frac{1}{2}\partial_t h(t, r) \ge 4[H]e^{-4[H]T} > 0$ for all $t > 0$ and $r \in \mathbb{R}^+$. Using the assumption (31) on $H$, we get

$$ H\left(v_{i\epsilon n}, -\frac{D_v d_{\mathcal{W}}^2(\mu_{i\epsilon n}, v_{i\epsilon n})}{\epsilon}\right) - H\left(\mu_{i\epsilon n}, \frac{D_\mu d_{\mathcal{W}}^2(\mu_{i\epsilon n}, v_{i\epsilon n})}{\epsilon}\right) \le 2[H] \frac{d_{\mathcal{W}}^2(\mu_{i\epsilon n}, v_{i\epsilon n})}{\epsilon}. $$

Using (42) to estimate (51), we arrive at

$$ 4\iota[H]e^{-4[H]T} \le 2[H] \frac{d_{\mathcal{W}}^2(\mu_{i\epsilon n}, v_{i\epsilon n})}{\epsilon} + \omega_t(n). \quad (52) $$

Hence keeping $\iota$ fixed, letting $\epsilon \to 0$ and $n \to \infty$, we get from (43) that $4\iota[H]e^{-4[H]T} \le 0$, which is absurd. Thus $\Gamma \le 0$. $\square$

# 6 The case of Hamilton-Jacobi-Bellman equations

We now return to the case of control problems. Consider the dynamic $\overline{coF}$ defined in (21), and let

$$ H: \mathbb{T} \to \mathbb{R}, \quad H(\mu, p) := \sup_{f \in \overline{coF}[\mu]} -p(\pi^\mu(f\#\mu)). \quad (53) $$

The Hamilton-Jacobi-Bellman equation associated to (53) then writes

$$ \left\{ \begin{array}{l} -\partial_t u(t, \mu) + \sup_{f \in \overline{coF}[\mu]} -D_\mu u(t, \mu) (\pi^\mu(f\#\mu)) = 0 & (t, \mu) \in X =]0, T[ \times \mathcal{P}_2(\mathbb{R}^d), \\ u(T, \mu) = \mathfrak{J}(\mu) & \mu \in \mathcal{P}_2(\mathbb{R}^d). \end{array} \right. \quad (54a) $$

$$ u(T, \mu) = \mathfrak{J}(\mu) \quad \mu \in \mathcal{P}_2(\mathbb{R}^d). \quad (54b) $$

In the sequel, we verify that the control Hamiltonian (53) satisfies the assumptions of the comparison principle, and we then show that the value function is a solution of (54).

## 6.1 Properties of the control Hamiltonian

Let $G: \mathcal{P}_2(\mathbb{R}^d) \Rightarrow \mathcal{P}_2(T\mathbb{R}^d)$ the probability vector field (in the spirit of [Pic19, Definition 2.1]) given by

$$ G[\mu] := \{b\#\mu \mid b \in \overline{coF}[\mu]\}. $$

Under [A2], this PVF is Lipschitz-continuous in the Hausdorff sense with respect to the application $W_{(\mu, v)}$ defined in (12), with constant $2[f]$. Indeed, given $\mu_0, \mu_1 \in \mathcal{P}_2(\mathbb{R}^d)$ and $b_0 \in \overline{coF}[\mu_0]$ defined by $b_0(x) = \int_{u \in U} f(x, \mu_0, u)d\omega(u)$, define $b_1 := \int_{u \in U} f(x, \mu_1, u)d\omega(u)$. Denote $\eta \in \Gamma_0(\mu, v)$. Then

$$ W_{(\mu_0, \mu_1)}^2(b_0\#\mu_0, b_1\#\mu_1) \le \int_{(x,y) \in (\mathbb{R}^d)^2} \int_{u \in U} |f(x, \mu_0, u) - f(y, \mu_1, u)|^2 d\omega(u) d\eta(x, y) \le 4[f]^2 d_{\mathcal{W}}^2(\mu_0, \mu_1). $$
**Remark 5** (Why using G). Our motivation in using a general probability vector field is to recover the connection between the metric slope and the directional derivatives. Indeed, in [AF14, Section 4.3], it is explicit that the regular tangent cone does not provide enough directions, in the sense that there exists measures $\mu, v$ such that

$$ \sup_{f \in \text{Tan}_\mu \mathcal{P}_2(\mathbb{R}^d)} D_\mu d_{\mathcal{W}}^2(\cdot, v)(f \# \mu) < \sup_{\xi \in \text{Tan}_\mu \mathcal{P}_2(\mathbb{R}^d)} D_\mu d_{\mathcal{W}}^2(\cdot, v)(\xi) = |D_\mu d_{\mathcal{W}}^2(\cdot, v)|. $$

Here the last term is the metric slope. The strict inequality comes from the strong convexity of the squared distance of $\mathbb{R}^d$, which makes it sometimes more optimal to split mass than not to, as in the example $\mu = \delta_0$ and $v = \frac{1}{2}\delta_{-1} + \frac{1}{2}\delta_1$ in dimension one. Hence, although we restrain to $\text{Tan}_\mu$ by using the theory of continuity equations to formulate the control problem, our HJB tools are formulated in the general case.

**Lemma 6** (Locally Lipschitz behavior of H). Assume [A2]. There exists a constant $[H]$ such that

$$ |H(\mu, p+q) - H(\mu, p)| \le [H](1 + d_W(\mu, \delta_0)) \|q\|_{\mu} \quad \forall \mu \in \mathcal{P}_2(\mathbb{R}^d), p, q \in \mathbb{T}_{\mu}. $$

*Demonstration.* Using that $|\sup_{a \in A} f(a) - \sup_{b \in A} g(b)| \le \sup_{a \in A} |f(a) - g(a)|$, one gets

$$ |H(\mu, p+q) - H(\mu, p)| \le \sup_{\xi \in G[\mu]} |-p(\pi^{\mu}\xi) - q(\pi^{\mu}\xi) + p(\pi^{\mu}\xi)| \le \|q\|_{\mu} \sup_{\xi \in G[\mu]} \|\pi^{\mu}\xi\|_{\mu}. $$

Using the non-expansivity of the projection (see [Gig08, Corollary 4.37]),

$$ \sup_{\xi \in G[\mu]} \|\pi^{\mu}\xi\|_{\mu} = \sup_{f \in \overline{\text{CO}}F[\mu]} \|\pi^{\mu}(f \# \mu)\|_{\mu} \le \sup_{f \in \overline{\text{CO}}F[\mu]} \|f \# \mu\|_{\mu} = \sup_{f \in \overline{\text{CO}}F[\mu]} \left( \int_{x \in \mathbb{R}^d} |f(x)|^2 d\mu(x) \right)^{1/2} \\ \le (|f|_{0,\infty} + [f] d_{\mathcal{W}}^2(\mu, \delta_0))^{1/2} \le \sqrt{|f|_{0,\infty} + [f]} (1 + d_{\mathcal{W}}(\mu, \delta_0)). $$

We may then take $[H] := \sqrt{|f|_{0,\infty} + [f]}$. $\square$

<figure><img src="image_3.png" /></figure>

**Lemma 7** (Behavior on the squared distance). Assume [A2]. There exists a constant $C_H$ such that

$$ H(\mu, -aD_{\mu}d_{\mathcal{W}}^2(\cdot, v)) - H(v, aD_{\nu}d_{\mathcal{W}}^2(\mu, \cdot)) \le 2aC_H d_{\mathcal{W}}^2(\mu, v) \quad \forall a \ge 0, (\mu, v) \in \mathcal{P}_2(\mathbb{R}^d)^2. $$

*Demonstration.* As $H$ is positively homogeneous, we may take $a = 1$. Let $\xi \in G[\mu]$ and $\zeta \in G[v]$. Using the bijection between $\exp_{\mu}^{-1}(v)$ and $\Gamma_o(\mu, v)$, the directional derivative of the squared Wasserstein distance (24) writes

$$ D_{\mu}d_{\mathcal{W}}^{2}(\cdot, v)(\pi^{\mu}\xi) = D_{\mu}d_{\mathcal{W}}^{2}(\cdot, v)(\xi) = \inf_{\eta \in \Gamma_{o}(\mu, v)} \inf_{\alpha \in \Gamma(\xi, v), (\pi_{x}, \pi_{y})\#\alpha = \eta} \int_{(x, v, y)} \langle v, -2(y-x) \rangle d\alpha, $$

$$ D_{\nu}d_{\mathcal{W}}^{2}(\nu, \cdot)(\pi^{\mu}\zeta) = D_{\nu}d_{\mathcal{W}}^{2}(\mu, \cdot)(\zeta) = \inf_{\eta \in \Gamma_{o}(\mu, \nu)} \inf_{\beta \in \Gamma(\zeta, \mu), (\pi_{y}, \pi_{x})\#\beta = \eta} \int_{(x, v, y)} \langle v, -2(y-x) \rangle d\beta. $$

By disintegration, for each $\eta \in \Gamma_o(\mu, v)$ and $(\alpha, \beta) \in \Gamma(\xi, v) \times \Gamma(\zeta, \mu)$ such that $(\pi_x, \pi_y)\#\alpha = (\pi_y, \pi_x)\#\beta = \eta$, there exists at least one plan $\omega = \omega(x, v, y, w) \in \Gamma(\xi, \zeta) \subset \mathcal{P}((T\mathbb{R}^d)^2)$ such that $(\pi_x, \pi_v, \pi_y) = \alpha$ and $(\pi_y, \pi_w, \pi_x)\#\omega = \beta$. Then

$$ \begin{aligned} D_{\mu}d_{\mathcal{W}}^{2}(\cdot, v)(\pi^{\mu}\xi) + D_{\nu}d_{\mathcal{W}}^{2}(\mu, \cdot)(\pi^{\nu}\zeta) &= \inf_{\eta \in \Gamma_{o}(\mu, v)} \inf_{\omega \in \Gamma(\xi, \zeta), (\pi_{x}, \pi_{y})\#\omega = \eta} \int_{(x, v, y, w)} \langle v, -2(y-x) \rangle + \langle w, -2(x-y) \rangle d\omega \\ &= \inf_{\eta \in \Gamma_{o}(\mu, v)} \inf_{\omega \in \Gamma(\xi, \zeta), (\pi_{x}, \pi_{y})\#\omega = \eta} 2 \int_{(x, v, y, w)} \langle v - w, x - y \rangle d\omega \\ &\le \inf_{\eta \in \Gamma_{o}(\mu, v)} \inf_{\omega \in \Gamma(\xi, \zeta), (\pi_{x}, \pi_{y})\#\omega = \eta} 2 \sqrt{\int_{(x, v, y, w)} |v-w|^2 d\omega \int_{(x, y)} |x-y|^2 d\eta} \\ &= 2W_{(\mu, v)}(\xi, \zeta)d_{\mathcal{W}}(\mu, v). \end{aligned} $$

Hence

$$ \begin{aligned} H(\mu, -D_{\mu}d_{\mathcal{W}}^2(\cdot, v)) - H(v, D_{\nu}d_{\mathcal{W}}^2(\mu, \cdot)) &= \sup_{\xi \in G[\mu]} D_{\mu}d_{\mathcal{W}}^2(\cdot, v)(\pi^{\mu}\xi) - \sup_{\zeta \in G[v]} -D_{\nu}d_{\mathcal{W}}^2(\mu, \cdot)(\pi^{\nu}\zeta) \\ &= \sup_{\xi \in G[\mu]} \inf_{\zeta \in G[v]} D_{\mu}d_{\mathcal{W}}^2(\cdot, v)(\xi) + D_{\nu}d_{\mathcal{W}}^2(\mu, \cdot)(\zeta) \\ &\le 2d_{\mathcal{W}}(\mu, v) \sup_{\xi \in G[\mu]} \inf_{\zeta \in G[v]} W_{(\mu, v)}(\xi, \zeta) \\ &\le 4[f] d_{\mathcal{W}}^2(\mu, v) \end{aligned} $$

by the Lipschitz-continuity in $W_{(\mu, v)}$ of G. Taking $C_H = 2[f]$ proves the claim. $\square$

<figure><img src="image_4.png" /></figure>
## 6.2 Characterization of the solution

**THEOREM 4 (COMPLETE CHARACTERIZATION OF (54)).** Assume [A1], [A2] and [A3]. The value function is the unique viscosity solution in the sense of Definition 9 of the Hamilton-Jacobi-Bellman equation (54).

*Demonstration.* Let us show that it is a viscosity solution of (54). By Lemma 3, $V$ is locally uniformly continuous, hence simultaneously luusc and lulsc. By definition, $V(T, \cdot) = \mathfrak{J}$, so that we only have to verify inequalities (27) and (28).

**Subsolution inequality** Let $\varphi \in \mathcal{T}_+$ such that $V-\varphi$ reaches a maximum at $(t, \mu) \in X$, and $[\varphi]$ a local Lipschitz constant in a ball of radius $\max(MT, [f](|f|_{0,\infty} + d_W(v, \delta_0)))$, where $M$ is the constant of Theorem 1. For each $\varrho \in \mathcal{P}(U)$, the constant measure $\omega \in L^0([t, T]; \mathcal{P}(U))$ given by $\omega(s) \equiv \varrho$ generates a smooth solution $(\mu_s^{t,v,\omega})_{s \in [t,T]}$, in the sense that

$$ \lim_{s \searrow t} \frac{d_W(\mu_s^{t,v,\omega}, (id + (s-t)F_\varrho[v])\#v)}{s} = 0. $$

This is easily seen by recalling that $\mu_s^{t,v,\omega}$ is then the pushforward of $v$ by the flow of an autonomous ODE associated to a globally Lipschitz dynamic. Consequently, along the curve $h \mapsto \hat{\mu}_{t+h}^{t,v,\omega} := (id + hF_\varrho)\#v$, the DPP (22) gives

$$ \frac{\varphi(t+h, \hat{\mu}_{t+h}^{t,v,\omega}) - \varphi(t,v)}{h} \ge \frac{\varphi(t+h, \hat{\mu}_{t+h}^{t,v,\omega}) - \varphi(t+h, \mu_{t+h}^{t,v,\omega})}{h} + \frac{V(t+h, \hat{\mu}_{t+h}^{t,v,\omega}) - V(t,h)}{h} \ge -[\varphi] \frac{d_W(\mu_{t+h}^{t,v,\omega}, \hat{\mu}_{t+h}^{t,v,\omega})}{h} + 0. $$

Multiplying by $-1$ and using the chain rule of Lemma 4 to take the limit in $h \searrow 0$, we obtain

$$ -\partial_t \varphi(t, v) - D_v \varphi(t, v) (F_\varrho[v] \# v) \le 0. $$

As $\varphi(t, \cdot)$ is chosen geometrically consistent, we have $D_v \varphi(t, v)(F_\varrho[v] \# v) = D_v \varphi(t, v)(\pi^\mu F_\varrho[v] \# v)$. As this is valid for all $b = F_{\omega_t}[v] \in \overline{\mathbb{C}}\overline{\mathbb{O}}F[v]$, we may take the supremum to recover the inequality (27), so that $V$ is a subsolution.

**Supersolution inequality** Let $\psi \in \mathcal{T}_-$ such that $V - \psi$ reaches a minimum in $(t, v) \in X$. Since under [A2], the set of solutions issued from $(t, \mu)$ is compact in the topology of uniform convergence (see [BF23, Theorem 4.5]), we may find $\omega \in L^0([t, T]; \mathcal{P}(U))$ such that $V(t, v) = V(t+h, \mu_{t+h}^{t,v,\omega})$ for all $h \in [0, T-t]$. Let $[\psi]$ be a local Lipschitz constant of $\psi$ as above.

Applying Lemma 2, there exist $(h_n)_n \searrow 0$ and $b \in \overline{\mathbb{C}}\overline{\mathbb{O}}F[v]$ such that $d_W(\mu_{h_n}^{t,v,\omega}, \hat{\mu}_{h_n}) = o(h_n)$, where $\hat{\mu}_{h_n} := (id + h_n b) \# v$. Then

$$ -[\psi] \frac{d_W(\mu_{h_n}^{t,v,\omega}, \hat{\mu}_{h_n})}{h_n} + \frac{\psi(t+h_n, \mu_{h_n}^{t,v,\omega}) - \psi(t,v)}{h_n} \le \frac{\psi(t+h_n, \mu_{h_n}^{t,v,\omega}) - \psi(t,v)}{h_n} \le \frac{V(t+h_n, \mu_{h_n}^{t,v,\omega}) - V(t,v)}{h_n} = 0. $$

Taking the limit in $n \to \infty$ and using again the chain rule of Lemma 4, we get $\partial_t \psi(t, v) + D_v \psi(b) \le 0$. Multiplying by $-1$ and taking the supremum over $b \in \overline{\mathbb{C}}\overline{\mathbb{O}}F[v]$, we obtain

$$ -\partial_t \psi(t, v) + \sup_{b \in \overline{\mathbb{C}}\overline{\mathbb{O}}F[v]} -D_v \psi(b) = -\partial_t \psi(t, v) + \sup_{b \in \overline{\mathbb{C}}\overline{\mathbb{O}}F[v]} -D_v \psi(\pi^\mu b) = -\partial_t \psi(t, v) + H(v, D_v \psi(t, v)) \ge 0. $$

To conclude, assume that there exists another viscosity solution $W: [0, T] \times \mathcal{P}_2(\mathbb{R}^d) \to \mathbb{R}$ of (54). By Lemmata 6 and 7, the control Hamiltonian defined in (53) satisfies the assumption [A4]. Applying Theorem 3 to the couples $(V, W)$ and $(W, V)$, we have $V \ge W$ and $W \ge V$ pointwise over $[0, T] \times \mathcal{P}_2(\mathbb{R}^d)$, so that they coincide. As both are continuous, the equality extends to $t = 0$, and the solution is unique. $\square$

# Appendices

## Appendix A Details on locally uniform upper semicontinuity

Recall that a locally bounded map $u: Y \to \mathbb{R}$ of a complete metric space $(Y, d_Y)$ is luusc if for any decreasing family of closed sets $(B_n)_n$ such that $B = \cap_n B_n \ne \emptyset$ and $\sup_{x \in B_n} \inf_{y \in B} d_Y(x, y) \to 0$, there holds

$$ \lim_{n \to \infty} \sup_{y \in B_n} u(y) \le \sup_{x \in B} u(x). \qquad (55) $$

It turns out that we have the following.
**Lemma 8 (Link with other notions of upper semicontinuity).** The following holds.

1. The condition (55) is strictly weaker than continuity.

2. Let $S$ be the set of nonempty closed and bounded subsets of $Y$. Then (55) is equivalent to the upper semicontinuity of the set function $U: B \to \sup_{x \in B} u(x)$ in the Hausdorff topology.

3. The applications that are luusc and lulsc are exactly the locally uniformly continuous applications.

4. In general, the condition (55) is strictly stronger than upper semicontinuity. However both definitions coincide in locally compact spaces.

5. In $Y = \mathcal{P}_2(\mathbb{R}^d)$, there is no comparison with upper semicontinuity in the narrow topology.

*Demonstration.* Point 1 is easily seen with the luusc map $u := \mathbb{I}_{[0]}$, where $o \in Y$ is some fixed point. Consider the notations of Point 2. If $U$ is locally upper semicontinuous, then (55) directly stands. On the other hand, assume that $u$ is luusc. Consider a sequence of nonempty closed sets $A_n \subset Y$ that converge in the Hausdorff distance, that is, there exists $A \subset S$ such that

$$d_{H,Y}(A_n, A) := \max \left( \sup_{x \in A_n} \inf_{y \in A} d_Y(x, y), \sup_{y \in A} \inf_{x \in A_n} d_Y(x, y) \right) \underset{n \to \infty}{\longrightarrow} 0.$$

As $A$ is bounded, the sequence $(A_n)_n$ is contained in some bounded set. Consider $B_n := \bigcup_{m \ge n} A_n$. Then $(B_n)_n$ is a family of closed nonempty sets, uniformly bounded, with nonempty intersection equal to $A$ and such that

$$d_{H,Y}(B_n, A) = \sup_{x \in B_n} \inf_{y \in A} d_Y(x, y) = \sup_{m \ge n} \sup_{x \in A_n} \inf_{y \in A} d_Y(x, y) = \sup_{m \ge n} d_{H,Y}(A_n, A) \underset{n \to \infty}{\longrightarrow} 0.$$

Hence

$$\overline{\lim}_{n \to \infty} U(A_n) = \lim_{n \to \infty} \sup_{m \ge n} \sup_{y \in A_m} u(y) \le \lim_{n \to \infty} \sup_{y \in B_n} u(y) \le \sup_{x \in A} u(x) = U(A),$$

and $U$ is locally upper semicontinuous, proving 2.

We turn to Point 3. If $u$ is locally uniformly continuous, let $m_u: \mathbb{R}^+ \to \mathbb{R}^+$ be a local modulus of continuity in a ball containing all the $B_n$. If $(y_n)_n$ is a maximizing sequence with $y_n \in B_n$, there exists $x_n \in B$ such that $d_Y(y_n, x_n) \le \varepsilon_n \to_n 0$, and

$$\lim_{n \to \infty} \sup_{y \in B_n} u(y) = \lim_{n \to \infty} u(y_n) \le \overline{\lim}_{n \to \infty} u(x_n) + m(d_Y(y_n, x_n)) \le \sup_{x \in B} u(x) + 0.$$

Thus $u$ satisfies (55). On the other hand, if a locally bounded map $u$ is both luusc and lulsc, then $(x, y) \mapsto s(u(x) - u(y))$ is luusc for $s \in \{-1, 1\}$. The definition of luusc implies then that for some fixed $o \in Y$ and all $R > 0$,

$$\lim_{r \to 0} \sup \left\{ |u(x) - u(y)| \mid x, y \in \overline{\mathcal{B}}(o, R), d(x, y) \le r \right\} \le \max_{s \in \{-1, 1\}} \lim_{n \to \infty} \sup_{\substack{(x,y) \in \overline{\mathcal{B}}(o,R)^2 \\ d(x,y) \le 1/n}} s(u(x) - u(y)) \le 0.$$

Any continuous modulus superior to $r \mapsto \sup\{|u(x) - u(y)| \mid x, y \in \overline{\mathcal{B}}(o, R), d(x, y) \le r\}$ furnishes a local modulus of continuity.

Points 4 and 5 will use similar counterexamples. Notice first that taking $B_n = \overline{\mathcal{B}}(x, 1/n)$ in (55) for each $x \in \mathbb{R}^d$, we see that luusc always imply usc. On the other hand, if $Y$ is locally compact, let $u: Y \to \mathbb{R}$ be upper semicontinuous. Then any maximizing sequence $(y_n)_n$ with $y_n \in B_n$ contains a converging subsequence, whose limit belongs to $\overline{B} = B$ owing to the uniform approximation of $B$ by $B_n$, and (55) is satisfied.

Stays to exhibit an usc map that is not luusc. By now, we take $Y = \mathcal{P}_2(\mathbb{R}^d)$, and we define

$$G_r := \left\{ \mu_\alpha := \left(1 - \frac{1}{\alpha^2}\right) \delta_0 + \frac{1}{\alpha^2} \delta_{(\alpha, 0, \dots, 0)} \mid \alpha \ge r \right\}, \quad \text{and} \quad H := \left\{ \nu_\beta := \left(1 - \frac{1}{\beta}\right) \mu_\beta + \frac{1}{\beta} \delta_{(0, 1, 0, \dots, 0)} \mid \beta \ge 1 \right\}.$$

We have that for all $r \ge 1$, the sets $G_r$, $H$ are nonempty, disjoint and included in $\overline{\mathcal{B}}(\delta_0, 1)$. Moreover, $G_r$ and $H$ are closed in $\mathcal{P}_2(\mathbb{R}^d)$ for each $r \ge 1$: indeed, let $(\mu_{\alpha_i})_i \subset G_r$ be a Cauchy sequence. If $(\alpha_i)_i$ is unbounded, then $(\mu_{\alpha_i})_i$ should converge to its narrow limit $\delta_0$: but this is absurd since $d_W(\mu_\alpha, \delta_0) = 1$ for all $\alpha > 0$. Thus $(\alpha_i)_i$ is bounded by some constant $C > 0$, and some (non relabeled) subsequence converges towards some $\bar{\alpha} \ge r$. Computing

$$d_W(\mu_{\alpha_n}, \mu_{\bar{\alpha}}) = \sqrt{2 \left(1 - \frac{\alpha_n \wedge \bar{\alpha}}{\alpha_n \vee \bar{\alpha}}\right)},$$
we see that $\mu_{\alpha_i} \to_i \mu_\alpha \in G_r$. Let us note that here, we proved that the sets $\{\mu_\alpha | \alpha \in [r, C]\}$ are compact in $\mathcal{P}_2(\mathbb{R}^d)$. By a similar argument, the set $H$ is closed as well.

Consider $u: \mathcal{P}_2(\mathbb{R}^d) \to \mathbb{R}$ given by $u(\mu) = \mathbb{I}_{G_1}$. As the indicator of a closed set, $u$ is upper semicontinuous. We claim that it is not locally uniformly upper semicontinuous: indeed, define

$$B_n := \{ \mu \in \bar{\mathcal{B}}(\delta_0, 1) \mid |\text{Bary}_{\mathbb{R}^d}(\mu)| := \left| \int_{x \in \mathbb{R}^d} x d\mu(x) \right| \le \frac{1}{n} \}.$$

It is easily verified that $\mu \mapsto |\text{Bary}_{\mathbb{R}^d}(\mu)|$ is continuous, so that $(B_n)_n$ is a globally bounded decreasing sequence of closed sets, whose intersection $B = |\text{Bary}_{\mathbb{R}^d}(\cdot)|^{-1}(\{0\}) \cap \bar{\mathcal{B}}(\delta_0, 1)$ is nonempty, and such that

$$\begin{align*}
\sup_{\mu \in B_n} \inf_{v \in B} d_{\mathcal{W}}(\mu, v) &\le \sup_{\mu \in B_n} d_{\mathcal{W}} \left( \mu, \left( \frac{n}{\sqrt{1+n^2}} (id - \text{Bary}_{\mathbb{R}^d}(\mu)) \right) \#\mu \right) \\
&\le \sup_{\mu \in B_n} \sqrt{ \left( 1 - \frac{n}{\sqrt{1+n^2}} \right)^2 d_{\mathcal{W}}^2(\mu, \delta_0) + \frac{n^2}{1+n^2} |\text{Bary}_{\mathbb{R}^d}(\mu)|^2 } \\
&\le \sqrt{ \left( 1 - \frac{n}{\sqrt{1+n^2}} \right)^2 + \frac{1}{1+n^2} } \xrightarrow{n \to \infty} 0.
\end{align*}$$

As $|\text{Bary}_{\mathbb{R}^d}(\mu_\alpha)| = 1/\alpha$, for any $n$, the intersection $B_n \cap G_1$ is nonempty. However $B \cap G_1 = \emptyset$, so that

$$\lim_{n \to \infty} \sup_{\mu \in B_n} u(\mu) \ge \lim_{n \to \infty} u(\mu_n) = 1, \quad \sup_{x \in B} u(\mu) = 0.$$

Hence $u$ is not luosc, proving Point 4.

We finally turn to Point 5. Let us build an application that is bounded and narrowly upper semicontinuous, but not locally uniformly upper semicontinuous. The strategy is similar to that of Point 4, with the additional requirement to work with narrowly closed sets. Let us show that the narrow closure of $G_1$ is $G_1 \cup \{\delta_0\}$: indeed, $(\mu_{\alpha_i})_i \subset G_1$ be a narrowly converging sequence. If $(\alpha_i)_i$ is unbounded, the narrow limit is $\delta_0$. If $(\alpha_i)_i$ is bounded, then we showed in Point 4 that $\{\mu_\alpha | \alpha \in [1, C]\}$ is compact in $\mathcal{P}_2(\mathbb{R}^d)$, thus narrowly compact, and the narrow limit stays in $G_1$.

Consider the bounded and narrowly upper semicontinuous function $u := \mathbb{I}_{\{\delta_0\} \cup G_1}$. To show that $u$ is not luosc, we consider the family of sets

$$B_n := H \cup G_n.$$

We immediately have that $(B_n)_n$ is a decreasing family of nonempty closed sets, whose intersection is $H$, and all contained in the Wasserstein unit ball centered in $\delta_0$. Moreover,

$$\sup_{\mu \in B_n} \inf_{v \in B} d_{\mathcal{W}}(\mu_n, v) = \sup_{\alpha \ge n} \inf_{v \in H} d_{\mathcal{W}}(\mu_\alpha, v) \le \sup_{\alpha \ge n} d_{\mathcal{W}} \left( \mu_\alpha, \left(1 - \frac{1}{\alpha}\right) \mu_\alpha + \frac{1}{\alpha} \delta_{(0,1,0,\dots,0)} \right) \le \sup_{\alpha \ge n} \frac{1}{\alpha} = \frac{1}{n} \xrightarrow{n \to \infty} 0.$$

For each $n$, we have $B_n \cap \{\delta_0\} \cup G_1 = G_n \ne \emptyset$. However, $H \cap \{\delta_0\} \cup G_1 = \emptyset$. Then

$$\lim_{n \to \infty} \sup_{\mu \in B_n} u(\mu) = 1 \quad \text{but} \quad \sup_{\mu \in H} u(\mu) = 0.$$

Hence $u$ is not locally uniformly upper semicontinuous. The application $\mu \mapsto d_{\mathcal{W}}^2(\mu, \delta_0)$ furnishes an example of map that is luosc, since locally uniformly continuous, but not narrowly upper semicontinuous. Consequently, there is no hierarchy between narrow upper semicontinuity and Definition 7. $\square$

# Appendix B Perturbed optimization

**Lemma 9 (Perturbed optimization).** *Denote $Y = \bar{X}^2 = [0, T] \times \mathcal{P}_2(\mathbb{R}^d) \times [0, T] \times \mathcal{P}_2(\mathbb{R}^d)$, endowed with the distance*

$$d_{\mathcal{W}}^2((t, \mu, s, v), (\bar{t}, \bar{\mu}, \bar{s}, \bar{v})) := |t - \bar{t}|^2 + d_{\mathcal{W}}^2(\mu, \bar{\mu}) + |s - \bar{s}|^2 + d_{\mathcal{W}}^2(v, \bar{v}).$$

Let $\Phi: Y \to \mathbb{R} \cup \{-\infty\}$ be upper semicontinuous, proper and upper bounded, $z^0 \in Y$ be fixed such that $A := \sup \Phi - \Phi(z_0) < \infty$, and assume that there exists $R > 0$ such that

$$\{z \in Y \mid \Phi(y) \ge \Phi(z^0)\} \subset \bar{\mathcal{B}}(z^0, R). \qquad (56)$$

Hence for each $n \in \mathbb{N}_*$, there exists $z_n \in Y$ and a perturbation $p_n: Y \to \mathbb{R}^+$ such that
1. the perturbed map $\Phi - p_n$ reaches a global strict maximum in $z_n$,

2. There exists an application $\omega_{T,R,A}: \mathbb{N} \to \mathbb{R}^+$ such that

$$ \sum_{r \in \{t,s\}} |\partial_r p_n(z_n)| + \sum_{\sigma \in \{\mu,v\}} (1 + d_W(\sigma, \delta_0)) \|D_\sigma p_n(z_n)\|_{\sigma} \le \omega_{T,R,A}(n) \underset{n \to \infty}{\longrightarrow} 0, $$

3. The map $(t, \mu) \mapsto p_n(t, \mu, s_n, v_n)$ belongs to $\mathcal{T}_+$, and $(s, v) \mapsto -p_n(t_n, \mu_n, s, v)$ belongs to $\mathcal{T}_-$,

4. There holds $\sup \Phi \le \Phi(z_n) + C_{R,A}(n)$, where $C_{R,A}$ is decreasing towards 0 when $n \to \infty$.

**Demonstration.** The metric space $(Y, d_Y)$ is complete, and $\Phi$ satisfies all the assumptions of the Ekeland-Borwein-Preiss-Zhu theorem [BZ05, Theorem 2.5.2]. We consider the gauge-type function $d_Y^2$, and the choice of ponderation

$$ \alpha_{n,m} := \frac{1}{n2^{m+1}}, \quad \text{so that} \quad \alpha_{n,0} = \frac{1}{2n} \quad \text{and} \quad \sum_{m \in \mathbb{N}} \alpha_{n,m} = \frac{1}{n}. $$

Applying Ekeland-Borwein-Preiss-Zhu, we get the existence of some $z_n \in Y$ and a sequence $(z_{n,m})_{m \in \mathbb{N}} \subset Y$ such that

$$ d_Y^2(z_0, z_n) \le \frac{A}{\alpha_0}, \quad d_Y^2(z_{n,m}, z_n) \le \frac{A}{2^m \alpha_0} \quad \forall m \in \mathbb{N}, \quad (57a) $$

$$ \Phi(z_n) \ge \Phi(z^0) + \sum_{m \in \mathbb{N}} \alpha_{n,m} d_Y^2(z^0, z_{n,m}), \quad (57b) $$

$$ \Phi(z_n) - \sum_{m \in \mathbb{N}} \alpha_{n,m} d_Y^2(z_n, z_{n,m}) > \Phi(z) - \sum_{m \in \mathbb{N}} \alpha_{n,m} d_Y^2(z, z_{n,m}) \quad \forall z \ne z_n. \quad (57c) $$

Define $p_n: z \mapsto \sum_{m \in \mathbb{N}} \alpha_{n,m} d_Y^2(z, z_{n,m}) \ge 0$. Then using (57a),

$$ \begin{aligned} p_n(z) &\le \sum_{m \in \mathbb{N}} \alpha_{n,m} d_Y^2(z, z_{n,m}) \le 2 \sum_{m \in \mathbb{N}} \alpha_{n,m} (d_Y^2(z, z_n) + d_Y^2(z_n, z_{n,m})) \\ &\le 2 \frac{d_Y^2(z, z_n)}{n} + \frac{A}{n \alpha_0} \sum_{m=0}^{4-m} 2 \frac{d_Y^2(z, z_n)}{n} + \frac{8A}{3} < \infty. \end{aligned} $$

Hence the application $p_n$ is well-defined from $Y$ to $\mathbb{R}^+$. By (57c), $\Phi - p_n$ reaches a global strict maximum in $z_n$.

We turn to Points 2 and 3. The application $p_n(\cdot, \mu, s, v)$ is of the form $c + \sum_{m \in \mathbb{N}} 2^{-m-1} \frac{|-t_{n,m}|^2}{n}$, over a bounded interval, so uniformly convergent. By direct computation, its derivative is Lipschitz in $[0, T]$ with constant $2/n$, and

$$ |\partial_t p_n(t, \mu_n, s_n, v_n)| \le \frac{1}{n} \sum_{m \in \mathbb{N}} 2^{-m} |t - t_{n,m}| \le \frac{2T}{n} \quad \forall t \in [0, T]. \quad (58) $$

As $(t, \mu) \mapsto p_n(t, \mu, s_n, v_n)$ writes as a sum of time and measure contributions, its derivative with respect to $t$ is Lipschitz in the whole domain $\bar{X}$. Moreover, by (57b), $z_n \in \{\Phi \ge \Phi(z^0)\}$. As $\mu_{n,m} \to_m \mu_n$, the sequence $(\mu_{n,m})_m$ stays in a bounded set of $\mathcal{P}_2(\mathbb{R}^d)$, and the partial function $p_n(t, \cdot, s, v)$ is uniformly convergent for each $n$. Using the semiconcavity of $d_{W}^2(\cdot, \mu_{n,m})$ (see [AGS05, Theorem 7.3.2]), there holds for any $(\sigma, \xi) \in \text{Tan} \mathcal{P}_2(\mathbb{R}^d)$ and $h \in [0, 1]$ that

$$ \begin{aligned} p_n(t_n, \exp_{\sigma}(h \cdot \xi), s_n, v_n) &\ge c + \sum_{m \in \mathbb{N}} \alpha_{n,m} [(1-h)d_W^2(\sigma, \mu_{n,m}) + h d_W^2(\exp_{\sigma}(\xi), \mu_{n,m}) - h(1-h)d_W^2(\sigma, \exp_{\sigma}(\xi))] \\ &= c + (1-h)p_n(t_n, \sigma, s_n, v_n) + h p_n(t_n, \exp_{\sigma}(\xi), s_n, v_n) - \frac{h(1-h)}{n} d_W^2(\sigma, \exp_{\sigma}(\xi)). \end{aligned} $$

Thus $p_n(t_n, \cdot, s_n, v_n)$ is locally semiconcave. As its directional derivative is a combination of that of squared distances, it is geometrically consistent in the sense of Definition 5. To prove that $(t, \mu) \mapsto p_n(t, \mu, s_n, v_n) \in \mathcal{T}_+$, there only stays to show the local Lipschitzianity in the measure variable. By direct computation, for any $S > 0$ and $\mu, \sigma \in \mathcal{B}(\delta_0, S)$, one has

$$ \begin{aligned} |p_n(t_n, \mu, s_n, v_n) - p_n(t_n, \sigma, s_n, v_n)| &\le d_W(\mu, \sigma) \sum_{m \in \mathbb{N}} \alpha_{n,m} (d_W(\mu, \mu_{n,m}) + d_W(\sigma, \mu_{n,m})) \\ &\le d_W(\mu, \sigma) \sum_{m \in \mathbb{N}} 2\alpha_{n,m} (S + d_W(\delta_0, \mu_n) + d_W(\mu_n, \mu_{n,m})) \\ &\le d_W(\mu, \sigma) \frac{S + \sqrt{2nA}}{n} \sum_{m \in \mathbb{N}} \frac{1 + 2^{-m/2}}{2^m}. \end{aligned} $$
Here we used (57a). Let $R > 0$ be given by the assumption (56) such that $d_Y(z_n, z^0) \le R$ independantly of $n$. By the above, there holds

$$ (1 + d_W(\mu_n, \delta_0)) \|D_\mu p_n(z_n)\|_{\mu_n} \le (1 + R) \frac{R + \sqrt{2nA}}{n} \sum_{m \in \mathbb{N}} \frac{1 + 2^{-m/2}}{2^m}. \quad (59) $$

Gathering (58) and (59), we obtain the application $\omega_{T,R,A}$ that decreases in $n^{-1/2}$. The reasoning over $p_n(t, \mu, \cdot, v)$ and $p_n(t, \mu, s, \cdot)$ is symmetric.

Finally, notice that the supremum of $\Phi$ over $Y$ is the same as the supremum of $\Phi$ over $\bar{\mathcal{B}}(z^0, R)$. In consequence, (57c) gives

$$ \begin{aligned} \sup \Phi &\le \Phi(z_n) + \sup_{z \in \bar{\mathcal{B}}(z^0, R)} \sum_{m \in \mathbb{N}} \alpha_{n,m} [d_Y^2(z, z_{n,m}) - d_Y^2(z_n, z_{n,m})] \\ &\le \Phi(z_n) + \sup_{z \in \bar{\mathcal{B}}(z^0, R)} \sum_{m \in \mathbb{N}} \alpha_{n,m} [d_Y(z, z_{n,m}) + d_Y(z_n, z_{n,m})] d_Y(z, z_n) \\ &\le \Phi(z_n) + \sum_{m \in \mathbb{N}} \alpha_{n,m} [2R + 2d_Y(z_n, z_{n,m})] 2R \le \Phi(z_n) + \sum_{m \in \mathbb{N}} \frac{1}{2^{m+1}n} \left[ 2R + 2\sqrt{\frac{nA}{2^{m+1}}} \right] 2R. \end{aligned} $$

Hence Point 4 by choosing $C_{R,A}: n \mapsto \frac{4R^2}{n} + \frac{2R\sqrt{A}}{\sqrt{n}(2\sqrt{2}-1)}$. $\square$

# Appendix C Monotonicities

**Lemma 10 (Monotonicities).** Assume (33), and that $u, -v$ are bounded from above. Let $\Gamma$, $\Gamma_l$ and $\Gamma_{l\varepsilon}$ be defined as in (33), (38) and (39). Then

$$ \Gamma_{l\varepsilon} \searrow_{\varepsilon\searrow 0} \Gamma_l \quad \text{for all } l > 0, \quad \text{and} \quad \Gamma_l \nearrow_{l\nearrow 0} \Gamma_0 \ge \Gamma. $$

*Demonstration.* Define the additional variables

$$ \begin{aligned} \Gamma_r &:= \min \left( 1, \sup \left\{ u(t, \mu) - v(s, v) \mid (t, \mu, s, v) \in \bar{X}^2, d_X((t, \mu), (s, v)) \le r \right\} \right) \\ \Gamma_{lr} &:= \sup \left\{ u(t, \mu) - v(s, v) - l \left( h(t, d_{\bar{W}}^2(\mu, \delta_0)) + h(s, d_{\bar{W}}^2(v, \delta_0)) \right) \mid (t, \mu, s, v) \in \bar{X}^2, d_X((t, \mu), (s, v)) \le r \right\}, \end{aligned} $$

so that $\Gamma = \lim_{r \to 0} \Gamma_r$ and $\Gamma_l = \lim_{r \to 0} \Gamma_{lr}$. For each fixed $l > 0$, using the growth of $h$, the variables $\Gamma_{lr}$ and $\Gamma_{l\varepsilon}$ are upper bounded. Restricting $l, \varepsilon$ and $r$ to $[0, 1]$, (33) gives us that each term is lower bounded. Moreover, we have the monotonicities

$$ \Gamma_r \searrow_r, \quad \Gamma_l \nearrow_l, \quad \Gamma_{lr} \searrow_r, \quad \Gamma_{l\varepsilon} \nearrow_\varepsilon. $$

In consequence, the limits $\lim_r \Gamma_r$, $\lim_l \Gamma_{lr}$ and $\lim_\varepsilon \Gamma_{l\varepsilon}$ are finite, and $\lim_l \Gamma_l$ exists in $\mathbb{R} \cup \{+\infty\}$.

Assume that $\Gamma_0 := \lim_{l \searrow 0} \Gamma_l < \Gamma$. Then there exists $r_0$ and $\alpha > 0$ sufficiently small so that $\Gamma_l \le \Gamma_{lr} \le \Gamma - \alpha \le \Gamma_r - \alpha$ for all $0 < r \le r_0$ and $l$. Consequently, for some $\frac{\alpha}{2}$-optimal point $z_\alpha = (t_\alpha, \mu_\alpha, s_\alpha, v_\alpha)$ for the definition of $\Gamma_r$, we have (independently of $l$)

$$ u(t_\alpha, \mu_\alpha) - v(s_\alpha, v_\alpha) - l \left( h(t_\alpha, d_{\bar{W}}^2(\mu_\alpha, \delta_0)) + h(s_\alpha, d_{\bar{W}}^2(v_\alpha, \delta_0)) \right) \le u(t_\alpha, \mu_\alpha) - v(s_\alpha, v_\alpha) - \frac{\alpha}{2} \quad \forall l. $$

Letting $l \searrow 0$, we obtain a contradiction. Hence $\Gamma_0 \ge \Gamma$.

Assume now that for some fixed $l$, $\Gamma_{l0} := \lim_{\varepsilon \searrow 0} \Gamma_{l\varepsilon} < \Gamma_l$. Then for sufficiently small $\varepsilon$, there exists $\alpha > 0$ such that $\Gamma_{l\varepsilon} \le \Gamma_l - \alpha \le \Gamma_{lr} - \alpha$ for all $r$. For each $r$, denote $z_{\alpha r}$ some $\frac{\alpha}{2}$-optimal point for the definition of $\Gamma_{lr}$, with $d_X(t_{\alpha r}, \mu_{\alpha r}, s_{\alpha r}, v_{\alpha r}) \le r$ by construction. There holds

$$ \begin{aligned} & u(t_{\alpha r}, \mu_{\alpha r}) - v(s_{\alpha r}, v_{\alpha r}) - l \left( h(t_{\alpha r}, d_{\bar{W}}^2(\mu_{\alpha r}, \delta_0)) + h(s_{\alpha r}, d_{\bar{W}}^2(v_{\alpha r}, \delta_0)) \right) - \frac{d_X^2((t_{\alpha r}, \mu_{\alpha r}), (s_{\alpha r}, v_{\alpha r}))}{\varepsilon} \\ &\le u(t_{\alpha r}, \mu_{\alpha r}) - v(s_{\alpha r}, v_{\alpha r}) - l \left( h(t_{\alpha r}, d_{\bar{W}}^2(\mu_{\alpha r}, \delta_0)) + h(s_{\alpha r}, d_{\bar{W}}^2(v_{\alpha r}, \delta_0)) \right) - \frac{\alpha}{2}. \end{aligned} $$

Hence

$$ \frac{\alpha}{2} \le \frac{d_X^2((t_{\alpha r}, \mu_{\alpha r}), (s_{\alpha r}, v_{\alpha r}))}{\varepsilon} \le \frac{r^2}{\varepsilon}, $$

and letting $r \searrow 0$, we obtain the desired contradiction.

Finally, assume that for some fixed $l$, $\Gamma_{l0} := \lim_{\varepsilon \searrow 0} \Gamma_{l\varepsilon} > \Gamma_l$. Then for sufficiently small $r$, there exists $\alpha > 0$ such that $\Gamma_{l\varepsilon} \ge \Gamma_{l0} \ge \Gamma_{lr} + \alpha \ge \Gamma_l$ for all $\varepsilon > 0$. For each $\varepsilon > 0$, let $z_{\varepsilon\alpha} \in X^2$ be $\frac{\alpha}{2}$-optimal for the definition of $\Gamma_{l\varepsilon}$. Hence

$$ u(t_{\varepsilon\alpha}, \mu_{\varepsilon\alpha}) - v(s_{\varepsilon\alpha}, v_{\varepsilon\alpha}) - l \left( h(t_{\varepsilon\alpha}, d_{\bar{W}}^2(\mu_{\varepsilon\alpha}, \delta_0)) + h(s_{\varepsilon\alpha}, d_{\bar{W}}^2(v_{\varepsilon\alpha}, \delta_0)) \right) - \frac{d_X^2((t_{\varepsilon\alpha}, \mu_{\varepsilon\alpha}), (s_{\varepsilon\alpha}, v_{\varepsilon\alpha}))}{\varepsilon} \ge \Gamma_{l\varepsilon} - \frac{\alpha}{2} \ge \Gamma_l + \frac{\alpha}{2} $$
implies

$$ \frac{d_X^2((t_{\varepsilon\alpha}, \mu_{\varepsilon\alpha}), (s_{\varepsilon\alpha}, v_{\varepsilon\alpha}))}{\varepsilon} \le \|u\| + \|v\| + 0 - \Gamma_t + \frac{\alpha}{2}, $$

and for sufficiently small $\varepsilon$, we have $d_X((t_{\varepsilon\alpha}, \mu_{\varepsilon\alpha}), (s_{\varepsilon\alpha}, v_{\varepsilon\alpha})) < r$. For this choice of parameters, we get

$$ \begin{aligned} & u(t_{\varepsilon\alpha}, \mu_{\varepsilon\alpha}) - v(s_{\varepsilon\alpha}, v_{\varepsilon\alpha}) - \iota(h(t_{\varepsilon\alpha}, d_{\mathcal{W}}^2(\mu_{\varepsilon\alpha}, \delta_0)) + h(s_{\varepsilon\alpha}, d_{\mathcal{W}}^2(v_{\varepsilon\alpha}, \delta_0))) - \frac{d_{X_1}^2((t_{\varepsilon\alpha}, \mu_{\varepsilon\alpha}), (s_{\varepsilon\alpha}, v_{\varepsilon\alpha}))}{\varepsilon} \\ & \ge u(t_{\varepsilon\alpha}, \mu_{\varepsilon\alpha}) - v(s_{\varepsilon\alpha}, v_{\varepsilon\alpha}) - \iota(h(t_{\varepsilon\alpha}, d_{\mathcal{W}}^2(\mu_{\varepsilon\alpha}, \delta_0)) + h(s_{\varepsilon\alpha}, d_{\mathcal{W}}^2(v_{\varepsilon\alpha}, \delta_0))) + \frac{\alpha}{2}, \end{aligned} $$

a flagrant contradiction.

□

## Appendix D Grönwall estimates

**Lemma 11 (Grönwall estimates).** Assume [A1] and [A2]. Let $(\mu_s^{t,v,\omega})_{s\in[t,T]}$ denote the solution of (17) issued from $(t,v) \in [0, T] \times \mathcal{P}_2(\mathbb{R}^d)$ and driven by the control $\omega \in L^0([t, T]; \mathcal{P}(U))$. Let $0 \le t \le \bar{s} \le s \le T$, $(v, \bar{v}) \in (\mathcal{P}_2(\mathbb{R}^d))^2$ and $(\omega, \bar{\omega}) \in (L^0([t, T]; \mathcal{P}(U)))^2$. Then

$$ d_W(\mu_s^{t,v,\omega}, \mu_{\bar{s}}^{t,\bar{v},\bar{\omega}}) \le (s-\bar{s}) \left( [f](\bar{s}-t) \left( \left[f\right] d_W(\delta_0, v) + \left|f\right|_{0,\infty} \right) e^{(\bar{s}-t)[f]} + [f] d_W(\delta_0, v) + \left|f\right|_{0,\infty} \right) e^{(s-\bar{s})[f]} \\ + e^{[f](\bar{s}-t)} (1+e^{[f](\bar{s}-t)}) (d_W(v, \bar{v}) + E_{t,\bar{s},\bar{v},\bar{\omega},\bar{\omega}}), $$

where

$$ E_{t, \bar{s}, \bar{v}, \omega, \bar{\omega}} := \left(1 + (\bar{s} - t) \left(\left|f\right|_{0,\infty} + \left[f\right] d_W(\delta_0, \bar{v})\right) e^{(\bar{s}-t)[f]}\right) \int_{r=t}^{\bar{s}} d_{W, m_{f,u}}(\omega(r), \bar{\omega}(r)) dr, $$

and

$$ d_{W,m_{f,u}}^2(\omega, \bar{\omega}) := \inf_{\alpha \in \Gamma(\omega, \bar{\omega})} \int_{(u,v) \in U^2} m_{f,u}^2(|u-v|) d\alpha(u,v). $$

As particular cases, we record that

$$ d_W(\mu_{t+h}^{t,v,\omega}, v) \le h([f] d_W(\delta_0, v) + |f|_{0,\infty}) e^{h[f]} \quad \text{and} \quad d_W(\mu_T^{t,v,\omega}, \mu_T^{t,\bar{v},\bar{\omega}}) \le e^{[f](T-t)} (1+e^{[f](T-t)}) d_W(v, \bar{v}). $$

**Demonstration.** Assume w.l.o.g that $s \ge \bar{s}$. Denote $(\Phi_{\tau}^{t,v,\omega})_{\tau \in [t,s]}$ and $(\Phi_{\tau}^{t,\bar{v},\bar{\omega}})_{\tau \in [t,\bar{s}]}$ the respective fluxes of the ODEs

$$ \dot{y}_{\tau} = F_{\omega(\tau)}[\mu_{\tau}^{t,v,\omega}](y_{\tau}), \quad \dot{\bar{y}}_{\tau} = F_{\bar{\omega}(\tau)}[\mu_{\tau}^{t,\bar{v},\bar{\omega}}](\bar{y}_{\tau}). $$

On the one hand, for $t \le r \le \tau \le s$,

$$ \begin{aligned} |\Phi_{\tau}^{t,v,\omega}(x) - \Phi_{r}^{t,v,\omega}(x)| &\le \int_{\theta=r}^{\tau} \int_{u \in U} |f(\Phi_{\theta}^{t,v,\omega}(x), \mu_{\theta}^{t,v,\omega}, u)| d\omega(\theta)(u) d\theta \\ &\le \int_{\theta=r}^{\tau} \int_{u \in U} |f(\Phi_{\theta}^{t,v,\omega}(x), \mu_{\theta}^{t,v,\omega}, u) - f(\Phi_{r}^{t,v,\omega}(x), \mu_{\theta}^{t,v,\omega}, u)| + |f(\Phi_{r}^{t,v,\omega}(x), \mu_{\theta}^{t,v,\omega}, u)| d\omega(\theta)(u) d\theta \\ &\le \int_{\theta=r}^{\tau} \left[ |f| |\Phi_{\theta}^{t,v,\omega}(x) - \Phi_{r}^{t,v,\omega}(x)| + |f| |\Phi_{r}^{t,v,\omega}(x)| + |f|_{0,\infty} \right] d\theta, \end{aligned} $$

so that a Grönwall lemma yields

$$ |\Phi_{\tau}^{t,v,\omega}(x) - \Phi_{r}^{t,v,\omega}(x)| \le (\tau - r) \left( [f] |\Phi_{r}^{t,v,\omega}(x)| + |f|_{0,\infty} \right) \exp \left( (\tau - r) [f] \right). \quad (60) $$

In particular,

$$ \begin{aligned} |\Phi_{\tau}^{t,v,\omega}(x) - \Phi_{r}^{t,v,\omega}(x)| &\le (\tau - r) \left( [f] |\Phi_{r}^{t,v,\omega}(x) - x| + |f| |x| + |f|_{0,\infty} \right) \exp \left( (\tau - r) [f] \right) \\ &\le (\tau - r) \left( [f] (r-t) \left( [f] |x| + |f|_{0,\infty} \right) \exp \left( (r-t) [f] \right) + [f] |x| + |f|_{0,\infty} \right) \exp \left( (\tau - r) [f] \right). \end{aligned} $$
Taking the square of each side and integrating with respect to v, we get

$$
\begin{align}
d_W(\mu_r^{t,v,\omega}, \mu_r^{t,v,\omega}) &\le \sqrt{\int_{x \in \mathbb{R}^d} |\Phi_r^{t,v,\omega}(x) - \Phi_r^{t,v,\omega}(x)|^2 dv(x)} \tag{61} \\
&\le (\tau - r) \left( [f](r-t) \left( [f] d_W(\delta_0, v) + |f|_{0,\infty} \right) \exp\left( (r-t)[f] \right) + [f] d_W(\delta_0, v) + |f|_{0,\infty} \right) \exp\left( (\tau - r)[f] \right). \nonumber
\end{align}
$$

On the other hand, for $\tau \in [t, \bar{s}]$,

$$
\begin{align*}
& |\Phi_{\tau}^{t,v,\omega}(x) - \Phi_{\tau}^{t,\bar{v},\bar{\omega}}(y)| \\
&\le |x-y| + \int_{r=t}^{\tau} \left| \int_{u \in U} f(\Phi_{r}^{t,v,\omega}(x), \mu_{r}^{t,v,\omega}, u) d\omega(r)(u) - \int_{v \in U} f(\Phi_{r}^{t,\bar{v},\bar{\omega}}(y), \mu_{r}^{t,\bar{v},\bar{\omega}}, v) d\bar{\omega}(r)(v) \right| dr \\
&\le |x-y| + \int_{r=t}^{\tau} \left| \int_{u \in U} \left[ f(\Phi_{r}^{t,v,\omega}(x), \mu_{r}^{t,v,\omega}, u) - f(\Phi_{r}^{t,\bar{v},\bar{\omega}}(y), \mu_{r}^{t,\bar{v},\bar{\omega}}, u) \right] d\omega(r)(u) \right| dr \\
&\quad + \int_{r=t}^{\tau} \left( 1 + |\Phi_{r}^{t,\bar{v},\bar{\omega}}(x)| \right) d\mathcal{W}_{m,f,u}(\omega(r), \bar{\omega}(r)) dr \\
&\le |x-y| + [f] \int_{r=t}^{\tau} \left| \Phi_{r}^{t,v,\omega}(x) - \Phi_{r}^{t,\bar{v},\bar{\omega}}(y) \right| + d\mathcal{W}(\mu_{r}^{t,v,\omega}, \mu_{r}^{t,\bar{v},\bar{\omega}}) dr \\
&\quad + (1 + (\tau - t) (|f|_{0,\infty} + |f| |y|) e^{(\tau - t)[f]}) \int_{r=t}^{\tau} d\mathcal{W}_{m,f,u}(\omega(r), \bar{\omega}(r)) dr.
\end{align*}
$$

Applying a second Grönwall lemma,

$$
\begin{gather*}
\left| \Phi_{\tau}^{t,v,\omega}(x) - \Phi_{\tau}^{t,\bar{v},\bar{\omega}}(y) \right| \le \left( \left| x-y \right| + \int_{r=t}^{\tau} [f] d\mathcal{W}(\mu_r^{t,v,\omega}, \mu_r^{t,\bar{v},\bar{\omega}}) dr + E_{t,\tau,y,\omega,\bar{\omega}} \right) \exp([f](\tau-t)), \\
\text{where } E_{t,\tau,y,\omega,\bar{\omega}} := \left( 1 + (\tau-t) \left( \left| f \right|_{0,\infty} + \left| f \right| |y| \right) e^{(\tau-t)[f]} \right) \int_{r=t}^{\tau} d\mathcal{W}_{m,f,u}(\omega(r), \bar{\omega}(r)) dr. \text{ Now, let } \eta \in \Gamma_o(v, \bar{v}). \text{ The plan} \\
\eta_{\bar{s}} := (\Phi_{\bar{s}}^{t,v,\omega}, \Phi_{\bar{s}}^{t,\bar{v},\bar{\omega}}) \#\eta
\end{gather*}
$$

belongs to $\Gamma(\mu_{\bar{s}}^{t,v,\omega}, \mu_{\bar{s}}^{t,\bar{v},\bar{\omega}})$, so that

$$
\begin{align*}
d_W(\mu_{\bar{s}}^{t,v,\omega}, \mu_{\bar{s}}^{t,\bar{v},\bar{\omega}}) &\le \sqrt{\int_{(x,y) \in (\mathbb{R}^d)^2} |\Phi_{\bar{s}}^{t,v,\omega}(x) - \Phi_{\bar{s}}^{t,\bar{v},\bar{\omega}}(y)|^2 d\eta(x, y)} \\
&\le \exp([f](\bar{s}-t)) \sqrt{\int_{(x,y) \in (\mathbb{R}^d)^2} \left( |x-y| + \int_{r=t}^{\bar{s}} [f] dW(\mu_r^{t,v,\omega}, \mu_r^{t,\bar{v},\bar{\omega}}) dr + E_{t,\bar{s},y,\omega,\bar{\omega}} \right)^2 d\eta(x, y)} \\
&\le \exp([f](\bar{s}-t)) \left( dW(v, \bar{v}) + \int_{r=t}^{\bar{s}} [f] dW(\mu_r^{t,v,\omega}, \mu_r^{t,\bar{v},\bar{\omega}}) dr + \sqrt{\int_{y \in \mathbb{R}^d} E_{t,\bar{s},y,\omega,\bar{\omega}}^2 d\bar{v}(y)} \right).
\end{align*}
$$

As

$$
\begin{align*}
\sqrt{\int_{y \in \mathbb{R}^d} E_{t, \bar{s}, y, \omega, \bar{\omega}}^2 d\bar{v}(y)} &= \sqrt{\int_{y \in \mathbb{R}^d} \left( 1 + (\bar{s} - t) \left( |f|_{0, \infty} + |f| |y| \right) e^{(\bar{s} - t)[f]} \right)^2 \left( \int_{r=t}^{\tau} d\mathcal{W}_{m, f, u}(\omega(r), \bar{\omega}(r)) dr \right)^2 d\bar{v}(y)} \\
&\le \left( 1 + (\bar{s} - t) \left( |f|_{0, \infty} + |f| d\mathcal{W}(\delta_0, \bar{v}) \right) e^{(\bar{s} - t)[f]} \right) \int_{r=t}^{\tau} d\mathcal{W}_{m, f, u}(\omega(r), \bar{\omega}(r)) dr := E_{t, \bar{s}, \bar{v}, \omega, \bar{\omega}} < \infty,
\end{align*}
$$

we are ready to apply our third Grönwall lemma to get

$$
d_W(\mu_{\bar{s}}^{t,v,\omega}, \mu_{\bar{s}}^{t,\bar{v},\bar{\omega}}) \le \exp([f](\bar{s}-t)) (d_W(v,\bar{v}) + E_{t,\bar{s},\bar{v},\omega,\bar{\omega}}) \exp(\exp([f](\bar{s}-t))[f](\bar{s}-t)). \quad (62)
$$

Combining (61) and (62), we get

$$
\begin{align*}
d_W(\mu_s^{t,v,\omega}, \mu_s^{t,\bar{v},\bar{\omega}}) &\le d_W(\mu_s^{t,v,\omega}, \mu_s^{t,v,\omega}) + d_W(\mu_s^{t,v,\omega}, \mu_s^{t,\bar{v},\bar{\omega}}) \\
&\le (s-\bar{s}) \left( [f](\bar{s}-t) \left( [f] d_W(\delta_0, v) + |f|_{0,\infty} \right) e^{(\bar{s}-t)[f]} + [f] d_W(\delta_0, v) + |f|_{0,\infty} \right) e^{(s-\bar{s})[f]} \\
&\quad + e^{[f](\bar{s}-t)} (d_W(v,\bar{v}) + E_{t,\bar{s},\bar{v},\omega,\bar{\omega}}) e^{[f](\bar{s}-t)} e^{[f](\bar{s}-t)},
\end{align*}
$$

the desired result.

<figure><img src="image_5.png" /></figure>
References

[AF14] L. Ambrosio and J. Feng. On a class of first order Hamilton–Jacobi equations in metric spaces. *Journal of Differential Equations*, April 2014.

[AG08] L. Ambrosio and W. Gangbo. Hamiltonian ODEs in the Wasserstein space of probability measures. *Communications on Pure and Applied Mathematics*, 2008.

[AGS05] L. Ambrosio, N. Gigli, and G. Savaré. *Gradient Flows*. Lectures in Mathematics ETH Zürich. Birkhäuser-Verlag, Basel, 2005.

[BF21] B. Bonnet and H. Frankowska. Differential inclusions in Wasserstein spaces: The Cauchy-Lipschitz framework. *Journal of Differential Equations*, January 2021.

[BF23] B. Bonnet and H. Frankowska. Carathédory Theory and A Priori Estimates for Continuity Inclusions in the Space of Probability Measures, May 2023.

[BY19] A. Bensoussan and S. C. P. Yam. Control problem on space of random variables and master equation. *ESAIM: Control, Optimisation and Calculus of Variations*, 2019.

[BZ05] J. M. Borwein and Q. J. Zhu. *Techniques of Variational Analysis*. CMS Books in Mathematics. Springer-Verlag, New York, 2005.

[Car13] P. Cardaliaguet. Notes on Mean Field Games, 2013.

[CCD15] J.-F. Chassagneux, D. Crisan, and F. Delarue. A Probabilistic approach to classical solutions of the master equation for large population equilibria, April 2015.

[CCH14] J. A. Carrillo, Y.-P. Choi, and M. Hauray. The derivation of swarming models: Mean-field limit and Wasserstein distances. In *Collective Dynamics from Bacteria to Crowds: An Excursion Through Modeling, Analysis and Simulation*, CISM International Centre for Mechanical Sciences. Springer, Vienna, 2014.

[CD18] R. Carmona and F. Delarue. *Probabilistic Theory of Mean Field Games with Applications I*. Probability Theory and Stochastic Modelling. Springer International Publishing, Cham, 2018.

[CIL92] M. G. Crandall, H. Ishii, and P.-L. Lions. User's guide to viscosity solutions of second order partial differential equations, June 1992.

[CMP18] G. Cavagnari, A. Marigonda, and B. Piccoli. Superposition Principle for Differential Inclusions. In *Large-Scale Scientific Computing*. Springer International Publishing, Cham, 2018.

[Cor16] A. Corbetta. Multiscale crowd dynamics: physical analysis, modeling and applications, 2016.

[Coy21] R. Coyaud. *Study of Approximations of Optimal Transport Problems and Application to Physics*. These de Doctorat, Paris Est, January 2021.

[CP20] P. Cardaliaguet and A. Porretta. An Introduction to Mean Field Game Theory. In *Mean Field Games: Cetraro, Italy 2019*, Lecture Notes in Mathematics. Springer International Publishing, Cham, 2020.

[CQ08] P. Cardaliaguet and M. Quincampoix. Deterministic differential games under probability knowledge of initial condition. *International Game Theory Review*, March 2008.

[CS04] P. Cannarsa and C. Sinestrari. *Semiconcave Functions, Hamilton–Jacobi Equations, and Optimal Control*. Birkhäuser, Boston, MA, 2004.

[DMD99] P. Del Moral and M. Doisy. Maslov Idempotent Probability Calculus, I. *Theory of Probability & Its Applications*, January 1999.

[DS23] S. Daudin and B. Seeger. A comparison principle for semilinear Hamilton-Jacobi-Bellman equations in the Wasserstein space, August 2023.

[Eke74] I. Ekeland. On the variational principle. *Journal of Mathematical Analysis and Applications*, August 1974.

[FGŚ17] G. Fabbri, F. Gozzi, and A. Święch. *Stochastic Optimal Control in Infinite Dimension*. Probability Theory and Stochastic Modelling. Springer International Publishing, Cham, 2017.

[FK09] J. Feng and M. Katsoulakis. A Comparison Principle for Hamilton–Jacobi Equations Related to Controlled Gradient Flows in Infinite Dimensions. *Archive for Rational Mechanics and Analysis*, May 2009.

[GHN15] Y. Giga, N. Hamamuki, and A. Nakayasu. Eikonal equations in metric spaces. *Transactions of the American Mathematical Society*, January 2015.
[Gig08] N. Gigli. *On the Geometry of the Space of Probability Measures Endowed with the Quadratic Optimal Transport Distance*. PhD thesis, Scuola Normale Superiore di Pisa, Pisa, 2008.

[Gig09] N. Gigli. Second order analysis on $(P_2(M), W_2)$, 2009.

[Gig11] N. Gigli. On the inverse implication of Brenier-McCann theorems and the structure of $(P_2(M), W_2)$. *Methods and Applications of Analysis*, 2011.

[GNT08] W. Gangbo, T. Nguyen, and A. Tudorascu. Hamilton-Jacobi Equations in the Wasserstein Space. *Methods and Applications of Analysis*, 2008.

[GŚ14] W. Gangbo and A. Świech. Optimal transport and large number of particles. *Discrete and Continuous Dynamical Systems*, 2014.

[GŚ15] W. Gangbo and A. Święch. Metric viscosity solutions of Hamilton-Jacobi equations depending on local slopes. *Calculus of Variations and Partial Differential Equations*, September 2015.

[GT19] W. Gangbo and A. Tudorascu. On differentiability in the Wasserstein space and well-posedness for Hamilton-Jacobi equations. *Journal de Mathématiques Pures et Appliquées*, May 2019.

[HK15] R. Hynd and H. K. Kim. Value functions in the Wasserstein spaces: finite time horizons. *Journal of Functional Analysis*, August 2015.

[Ish85] H. Ishii. Hamilton-Jacobi Equations with Discontinuous Hamiltonians on Arbitrary Open Sets, 1985.

[Jer22] O. Jerhaoui. *Viscosity Theory of First Order Hamilton Jacobi Equations in Some Metric Spaces*. PhD thesis, Institut Polytechnique de Paris, Paris, 2022.

[JJZ] F. Jean, O. Jerhaoui, and H. Zidani. Deterministic optimal control on Riemannian manifolds under probability knowledge of the initial condition.

[JMQ20] C. Jimenez, A. Marigonda, and M. Quincampoix. Optimal control of multiagent systems in the Wasserstein space. *Calculus of Variations and Partial Differential Equations*, March 2020.

[KM97] V. N. Kolokoltsov and V. P. Maslov. *Idempotent Analysis and Its Applications*. Springer Netherlands, Dordrecht, 1997.

[Lio06] P.-L. Lions. Jeux à champ moyen, 2006.

[LY95] X. Li and J. Yong. *Optimal Control Theory for Infinite Dimensional Systems*. Birkhäuser, Boston, MA, 1995.

[MQ18] A. Marigonda and M. Quincampoix. Mayer control problem with probabilistic uncertainty on initial positions. *Journal of Differential Equations*, March 2018.

[Ott01] F. Otto. The Geometry of Dissipative Evolution Equations: The Porous Medium Equation. *Communications in Partial Differential Equations*, January 2001.

[Pic19] B. Piccoli. Measure Differential Equations. *Archive for Rational Mechanics and Analysis*, September 2019.

[PT09] B. Piccoli and A. Tosin. Pedestrian flows in bounded domains with obstacles. *Continuum Mechanics and Thermodynamics*, July 2009.

[PW18] H. Pham and X. Wei. Bellman equation and viscosity solutions for mean-field stochastic control problem. *ESAIM: Control, Optimisation and Calculus of Variations*, January 2018.

[San15] F. Santambrogio. *Optimal Transport for Applied Mathematicians*. Progress in Nonlinear Differential Equations and Their Applications. Springer International Publishing, Cham, 2015.

[Vil09] C. Villani. *Optimal Transport*. Grundlehren Der Mathematischen Wissenschaften. Springer Berlin Heidelberg, Berlin, Heidelberg, 2009.

[WZ19] C. Wu and J. Zhang. Viscosity Solutions to Parabolic Master Equations and McKean-Vlasov SDEs with Closed-Loop Controls, April 2019.