Compatibility of state constraints and dynamics for multiagent control systems

This study concerns the problem of compatibility of state constraints with a multiagent control system. Such a system deals with a number of agents so large that only a statistical description is available. For this reason, the state variable is described by a probability measure on \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathbb {R}}^d$$\end{document}Rd representing the density of the agents and evolving according to the so-called continuity equation which is an equation stated in the Wasserstein space of probability measures. The aim of the paper is to provide a necessary and sufficient condition for a given constraint (a closed subset of the Wasserstein space) to be compatible with the controlled continuity equation. This new condition is characterized in a viscosity sense as follows: the distance function to the constraint set is a viscosity supersolution of a suitable Hamilton–Jacobi–Bellman equation stated on the Wasserstein space. As a byproduct and key ingredient of our approach, we obtain a new comparison theorem for evolutionary Hamilton–Jacobi equations in the Wasserstein space.


Introduction
In classical control theory, a single agent controls a dynamics (here represented by a differential inclusion) x(t) ∈ F(x(t)), where F : R d ⇒ R d is a set valued map, associating with each x ∈ R d the subset F(x) of R d of the admissible velocities from x. A multiagent system involves a large number of agents having all a dynamics of the form (1.1). In this model, the number of agents is so large that at each time only a statistical (macroscopic) description of the state is available. We thus describe the configuration of the system at time t by a Borel measure μ t on R d , where for every Borel set A ⊆ R d the quotient μ t (A) μ t (R d ) represents the fraction of the total amount of agents that are present in A at the time t. Since the total amount of agents is supposed to be fixed in time, μ t (R d ) is constant, and thus, we choose to normalize the measure μ t assuming μ t (R d ) = 1, i.e., μ t ∈ P(R d ), the set of Borel probability measures on R d . Hence, the evolution of the controlled multi-agent system can be represented by the following two-scale dynamics • Microscopic dynamics: each agent's position at time t is given by x(t), which evolves according to the dynamical systeṁ x(t) ∈ F(μ t , x(t)), for a.e. t > 0 , (1.2) where F is a set-valued map. It is worth pointing out that each agent's dynamics is nonlocal since it depends also on the instantaneous configuration μ t of the crowd of agents at time t, described by a probability measure on R d . • Macroscopic dynamics: the configuration of the crowd of agents at time t is given by a time-depending measure μ t ∈ P(R d ) whose evolution satisfies the following continuity equation (to be understood in the sense of distributions) coupled with the control constraint v t (x) ∈ F(μ t , x) for μ t -a.e. x ∈ R d and for a.e. t ≥ 0. (1.4) which represents the possible (Eulerian) velocity v t (x) chosen by an external planner for an agent at time t and at the position x.
The investigation of (deterministic) optimal control problems in the space of measures is attracting an increasing interest by the mathematical community in the last years, due to the potential applications in the study of complex systems, or multi-agent systems (see, e.g., [16,18,19]). Indeed, in the framework of mean field approximation of multi agent system, starting from a control problem for a large number of the (discrete) agents, the problem is recasted in the framework of probability measures (see the recent [15] or the preprint [12] for -convergence results for optimal control problems with nonlocal dynamics). This procedure reduces the dimensionality and the number of equations, possibly leading to a simpler and treatable problem from the point of view of numerics. The reader can find a comprehensive overview of the literature about such formulations and applications, together with some insights on research perspective, in the recent survey [1], and references therein. We refer to [7] for further results on mean field control problems.
The problem we address in this paper is the compatibility of the above dynamical system (1.3)-(1.4) with a given closed constraint K ⊆ P 2 (R d ). Here, P 2 (R d ) is the set of Borel probability measures with finite second moment; this set is equipped with the 2-Wasserstein distance (see Sect. 2). This compatibility property could be understood in two ways • K is viable for the dynamics F if and only if for any μ ∈ K there exists a solution t → μ t of the controlled continuity Eqs. (1.3)-(1.4) with μ 0 = μ such that μ t ∈ K for all t ≥ 0; • K is invariant for the dynamics F if and only if for any μ ∈ K and for any solution t → μ t of the controlled continuity Eqs. (1.3)-(1.4) with μ 0 = μ we have μ t ∈ K for all t ≥ 0.
Inspired by a characterization of the viability property via supersolution of Hamilton-Jacobi-Bellman equations, which was first obtained in [9] in the framework of stochastic control, we develop an approach for the present multiagent control problem with deterministic dynamics (1.3)- (1.4).
The main result of our paper (Theorems 6.6 and 6.7) can be roughly summarized as follows Theorem 1.1. Let K ⊆ P 2 (R d ) be a closed set and d K the associated distance function. Assume that the set valued map F is L-Lipschitz.
• K is viable iff the function μ → d K (μ) is a viscosity supersolution of where, for all μ ∈ P 2 (R d ), p ∈ L 2 μ (R d ; R d ), where, for all μ ∈ P 2 (R d ), p ∈ L 2 μ (R d ; R d ), For a completely different approach to the viability problem, we refer to [5], where the author provides a characterization of the viability property for a closed set K ⊆ P 1 (T d ) by mean of a condition involving a suitable notion of tangent cone to K in the Wasserstein space P 1 (T d ), where T d denotes the d-dimensional torus.
The paper is organized as follows: in Sect. 2, we fix the notations and provide some background results; Sect. 3 is devoted to the properties of the set of solutions of the controlled continuity Eqs. (1.3)-(1.4); Sect. 4 establishes the link between the viability/invariance problem with the value function of a suitable control problem in Wasserstein space; Sect. 5 introduces the viscosity solutions of Hamilton-Jacobi-Bellman equations in the Wasserstein space, together with a uniqueness result; in Sect. 6, we apply the results of Sect. 5 to the problem outlined in Sect. 4 deriving our main characterization of viability/invariance. Finally, in Sect. 7 we provide an example illustrating the main results. Some proofs of technical results are postponed to "Appendix."

Notations
Throughout the paper, we will use the following notation and we address to [2] as a relevant resource for preliminaries on measure theory.

B(x, r )
the open ball of radius r of a metric space (X, d X ), i.e., B(x, r ) := {y ∈ X : d X (y, x) < r }; K the closure of a subset K of a topological space X ; d K (·) the distance function from a subset K of a metric space (X, d), i.e., d K (x) := inf{d(x, y) : y ∈ K }; C 0 b (X ; Y ) the set of continuous bounded functions from a Banach space X to Y , endowed with f ∞ = sup the space of bounded real-valued uniformly continuous functions defined on X I the set of continuous curves from a real interval I to R d ; the set of Borel probability measures on a Banach space X , endowed with the weak * topology induced from C 0 b (X ); the set of vector-valued Borel measures on R d with values in R d , endowed with the weak * topology induced from C 0 c (R d ; R d ); |ν| the total variation of a measure ν ∈ M (R d ; R d ); the absolutely continuity relation between measures defined on the same σ -algebra; m 2 (μ) the second moment of a probability measure μ ∈ P(X ); r μ the push-forward of the measure μ by the Borel map r ; μ ⊗ π x the product measure of μ ∈ P(X ) with the Borel family of mea- the set of admissible transport plans from μ to ν; o (μ, ν) the set of optimal transport plans from μ to ν; W 2 (μ, ν) the 2-Wasserstein distance between μ and ν; P 2 (X ) the subset of the elements P(X ) with finite second moment, endowed with the 2-Wasserstein distance; ν μ the Radon-Nikodym derivative of the measure ν w.r.t. the measure μ; the Lipschitz constant of a function f ; ( f ) + the positive part of a real valued function f , i.e., ( f ) + = max{0, f }.
Given Banach spaces X, Y , we denote by P(X ) the set of Borel probability measures on X endowed with the weak * topology induced by the duality with the Banach space C 0 b (X ) of the real-valued continuous bounded functions on X with the uniform convergence norm. The second moment of μ ∈ P(X ) is defined by , and we set P 2 (X ) = {μ ∈ P(X ) : m 2 (μ) < +∞}. For any Borel map r : X → Y and μ ∈ P(X ), we define the push forward measure r μ ∈ P(Y ) by setting r μ(B) = μ(r −1 (B)) for any Borel set B of Y . In other words, for any bounded Borel measurable function ϕ : Y → R.
We denote by M (X ; Y ) the set of Y -valued Borel measures defined on X . The total variation measure of ν ∈ M (X ; Y ) is defined for every Borel set B ⊆ X as where the sup ranges on countable Borel partitions of B.
We now recall the definitions of transport plans and Wasserstein distance (cf. for instance Chapter 6 in [2]). Let X be a complete separable Banach space, μ 1 , μ 2 ∈ P(X ). The set of admissible transport plans between μ 1 and μ 2 is Wasserstein distance between μ 1 and μ 2 is If μ 1 , μ 2 ∈ P 2 (X ), then the above infimum is actually a minimum, and the set of minima is denoted by Recall that P 2 (X ) endowed with the W 2 -Wasserstein distance is a complete separable metric space. The following result is Theorem 5.3.1 in [2].
Theorem 2.1. (Disintegration) Let X, X be complete separable metric spaces. Given a measure μ ∈ P(X) and a Borel map r : X → X , there exists a Borel family of probability measures {μ x } x∈X ⊆ P(X), uniquely defined for r μ-a.e. x ∈ X, such that μ x (X\r −1 (x)) = 0 for r μ-a.e. x ∈ X , and for any Borel map ϕ : We will write μ = (r μ) ⊗ μ x . If X = X × Y and r −1 (x) ⊆ {x} × Y for all x ∈ X, we can identify each measure μ x ∈ P(X × Y ) with a measure on Y .

Admissible trajectories
The goal of this section is to give a precise definition of the macroscopic dynamics (1.3 , 1.4) and to study its trajectories. To maintain the flow of the paper, the proofs of the results of this section are postponed to "Appendix A." We say that μ is an admissible trajectory driven by ν defined on I with underlying dynamics F if Given μ ∈ P 2 (R d ), we define the set of admissible trajectories as driven by ν, defined on I with underlying dynamics F and μ a = μ .
We make the following assumptions on the set-valued map F: (F 2 ) there exists L > 0, a compact metric space U and a continuous map f : such that the set-valued map F can be represented as As pointed out also in Remark 2 of [16], from the Lipschitz continuity of the setvalued map F coming from assumption (F 2 ), we easily get for all μ, ν ∈ P 2 (R d ) and x, y ∈ R d . From which, for all μ ∈ P 2 (R d ) and x ∈ R d , we have where C := max{1, L max{|y| : y ∈ F(δ 0 , 0)}}.
We recall the following result taken from [16].
where L is as in (F 2 ).
such that e t η = μ t for all t ∈ [a, b], and for η-a.e. (x, γ ) Moreover, for any η as above and for all t, s ∈ [a, b] with s < t, we have h(t, s); where L = Lip(F) and K = max{|y| : y ∈ F(δ 0 , 0)}. In particular, there exists a Borel map w :

Viability problem and the value function
Throughout the paper, let K ⊆ P 2 (R d ) be closed w.r.t. the metric W 2 . We are interested in the definitions of compatibility of our dynamics w.r.t. the state constraint given by K (cf. introduction of the present paper).
Notice that, since concatenation of admissible trajectories is an admissible trajectory (see the note before Prop. 3 in [16] As we will investigate in Sect. 5, the viability and invariance properties of a closed set K ⊆ P 2 (R d ) are closely related to the following optimal control problems, with fixed time-horizon T > 0.
We say that μ ∈ A [t 0 ,T ] (μ) is an optimal trajectory for V viab starting from μ at time t 0 if it achieves the minimum in (4.1).
We say that μ ∈ A [t 0 ,T ] (μ) is an optimal trajectory for V inv starting from μ at time t 0 if it achieves the maximum in (4.2).
The main interest in the above value functions lies in the fact that they give a characterization of the viability/invariance as explained in Proposition 4.3. We first state a regularity result of the above value functions and the existence of optimal trajectories. Proof. We prove the existence of an optimal trajectory for V viab . Take any μ 1 , μ 2 ∈ P 2 (R d ). By passing to the infimum over σ ∈ K on the triangular inequality . Reversing the roles of μ 1 and μ 2 , we get the 1-Lipschitz continuity of d K . Hence, by Fatou's Lemma, we get the l.s.c. of the cost functional, i.e., Combining this with the W 2 -compactness property of Proposition 3.5, we get the desired result.
We prove the existence of an optimal trajectory for V inv . We fix For any t ∈ [t 0 , T ], by triangular inequality and recalling that by definition we have the equivalence m 1/2 2 (ρ) = W 2 (ρ, δ 0 ), we get the following uniform bound for some constantC > 0 coming from estimate (A.2) proved in "Appendix A". Thus, as for the proof of the existence of a minimizer for V viab , we can apply Fatou's Lemma to get the u.s.c. of the cost functional and conclude.
We state here a first characterization of viability/invariance in terms of the optimal control problems introduced in Definition 4.1.
Proof. We just prove (1), since the proof of (2) is similar. One implication follows directly by definition, so we prove the other direction assuming V viab (t 0 , μ 0 ) = 0 for all μ 0 ∈ K . By Proposition 4.2, for all μ 0 ∈ K , there exists an optimal trajectorȳ μ ∈ A [t 0 ,T ] (μ 0 ) such that This implies that d K (μ t ) = 0 for a.e. t ∈ [t 0 , T ]. By continuity ofμ and by closedness of K w.r.t. W 2 -topology, we obtain the viability property for K .
As usual, the value function satisfies a Dynamic Programming Principle.

Lemma 4.4. (DPP) The function V
is nondecreasing in [t 0 , T ], and it is constant if and only if μ is an optimal trajectory.
Concerning the other inequality, fix any μ ∈ By passing to the inf on μ ∈ A [t 0 ,T ] (μ), and then letting ε → 0 + , we conclude. The proof of the second part of the statement is standard and follows straightforwardly from (4.3) (see for instance Prop. 3 in [16]).
We come now to the formulation of a Dynamic Programming Principle for the value function V inv whose proof is omitted since it is similar to that of Lemma 4.4.
, and it is constant if and only if μ is an optimal trajectory.
As in the classical case, the infinitesimal version of the Dynamic Programming Principle gives rise to a Hamilton-Jacobi-Bellman equation. The next section is devoted to such a Hamilton-Jacobi equation.
Proof. We prove the statement for V viab , since the proof for V inv is analogous. Fix t 0 ∈ [0, T ] and take any μ 1 , μ 2 ∈ P 2 (R d ). By Proposition 4.2, there exists an optimal trajectoryμ 2 ∈ A [t 0 ,T ] (μ 2 ) starting from μ 2 . Thus, for any admissible μ 1 We can now choose μ 1 ∈ A [t 0 ,T ] (μ 1 ) such that the Grönwall-like inequality of Lemma 3.3 holds, thus getting (4.5) We now prove the uniform continuity in time of an optimal trajectory. Then by the second part of the statement of Lemma 4.4, noticing that in particular By continuity of d K (·) and of t → μ t we have the convergence to zero of the righthand-side as t 2 → t 1 . Reversing the roles of t 1 and t 2 we conclude.

Hamilton Jacobi Bellman equation
As reported in p. 352 in [11] and at the beginning of Sec. 6.1 in [10], we recall the following crucial fact. Throughout the paper, let ( , B, P) be a sufficiently "rich" probability space, i.e., is a complete, separable metric space, B is the Borel σ -algebra on , and P is an atomless Borel probability measure. We use the notation L 2 We say that the Hamiltonian function H :

Definition 5.2. (Viscosity solution)
Let H and H be as in Definition 5.1 (2). Given λ ≥ 0, we consider a first-order HJB equation of the form and its lifted form We say that u : • viscosity solution of (5.2) if it is both a supersolution and a subsolution.
Moreover, the test functions in Definition 5.2 can be taken independent of t, i.e., • U is a viscosity subsolution of (5.

3) if for any test function
• U is a viscosity solution of (5.3) if it is both a supersolution and a subsolution.

Theorem 5.4. (Comparison principle)
Assume that there exists L , C > 0 such that the Hamiltonian function H : L 2 P ( ) × L 2 P ( ) → R satisfies the following assumption: .
are a subsolution and a supersolution of (5.1), respectively, we have Proof. The proof follows the line of the corresponding classical finite-dimensional argument (see, e.g., Theorem II.2.12 p. 107) in [6]. In the following, we define G := R × L 2 P ( ) and, for any Let U 1 , U 2 : A → R be, respectively, the lift functionals for u 1 and u 2 as in Definition 5.1(1). We define the functional : where ε, β, m, η > 0 are positive constants which will be chosen later. Notice that since where ω u i (·) is the modulus of continuity of u i and where we used the fact that by uniform continuity we have Thus, The proof proceeds by contradiction: assume that there exist (t,μ) Noting that ∈ C 0 (A 2 ), by taking ε < 1 2C and recalling (5.6), we have lim for any t, s ∈ [0, T ]. Therefore, there exists R > 0 such that Thus, by Stegall's Variational Principle (see, e.g., Theorem 6.3.5 in [8]) for any fixed ξ > 0, there exists a linear and continuous functional : Vol. 21 (2021) Compatibility of state constraints 4505 and so .
and so which leads to Take 0 < ξ < ε < 1. From the previous inequality, the boundedness of for suitable constants B , B > 0 independent on ε. By uniform continuity of U i , i = 1, 2, and by plugging the previous relation in (5.10), we can build a modulus of continuity ω(·) such that We show that neithert nors can be equal to T . Indeed, int = T , by definition of A. We thus get a contradiction with (5.8) by choosing ε and η small enough The same reasoning applies for provings < T .
and we can choose η sufficiently small so that A + δ 4 − 2T η ≥ 0. Then, we get We can now invoke assumption (H) with recalling that λ 1 , λ 3 ≤ ε and λ 2 L 2 P , λ 4 L 2 P ≤ ε by the bound on the dual norm of the operator . We get By (5.11), (5.12) and recalling thatX ,Ȳ ∈ B L 2 where for the last passage we choose m ≤ η D R d , and o(1) is a function of ε going to 0 as ε → 0 + . This leads to a contradiction as ε → 0 + . Remark 5.5. As highlighted also in Remark 3.8 p. 154 of [6], if λ = 0 in (5.1), we can drop the symbol of the positive part in (5.4) and conclude that

Viscosity characterization of viability and invariance
We now provide the main results of the paper: Theorems 6.6 and 6.7. As pointed out also in Remark 4.2 in [18] Definition 6.1. (Lifted Hamiltonian for viability) We define the lifted Hamiltonian in (6.2) where in the last equality we used Theorem 8.2.11 in [4] (or Theorem 6.31 in [14]).

Definition 6.2. (Lifted Hamiltonian for invariance)
Related with the invariance problem and associated with H inv F , we define the following lifted Hamiltonian in L 2 P ( ) for all X, Q ∈ L 2 P ( since the assertion for H inv F can be proved in the same way. Fix any X, Y ∈ L 2 P , a, b 1 , b 2 > 0 and C 1 , C 2 ∈ L 2 P , and denote μ 1 := X P, μ 2 := Y P. We have where the first inequality comes from Lipschitz continuity of the set-valued map F. In particular, we can write z ε, p =ŵ ε, p + δ x,y w ε, p , withŵ ε, p ∈ F(μ 1 , x) and w ε, p ∈ B(0, 1), thus getting Hence, we have Thus, for any x, y, c 1 , c 2 ∈ R d and by choosing p = x − y, it holds where we used the Cauchy-Schwarz's inequality. Integrating with respect to the measure (X, Y, C 1 , C 2 ) P on the variables (x, y, c 1 , c 2 ) and by (3.1), we get We conclude from (6.3), thanks to the Lipschitz continuity of d K (·).
in the set of Borel selections of F(μ, ·). Indeed, let v(·) be a Borel selection of F(μ, ·). By Lusin's Theorem, for any ε > 0 there exists a compact K ε ⊆ R d and a continuous map w ε : Since |F(μ, x)| ≤ |F(δ 0 , 0)| + Lm and the right hand side tends to 0 as ε → 0 + . Now, we deduce that the value functions V viab and V inv satisfy the following Hamilton-Jacobi equations.

Proposition 6.5. Assume (F 1 ) − (F 2 ). Then,
where the equality U (s, Y ε s ) = U (s, X ) holds since Y ε s P = X P = μ and since U , as a lift, is law dependent. Therefore, there exists a continuous increasing function Dividing by t − s > 0, by Corollary A.3(3), we have By letting ε → 0 + , we obtain Recalling the boundedness of e t − e s t − s L 2 η coming from Proposition 3.4, by letting t → s + , we have Dφ(s, X )) ≥ 0, where, as already discussed, we have By Remark 6.4, we can suppose that v ε ∈ C 0 , and by By density, we can findv T ] a Borel map satisfying η ε = V ε P. Recalling Lemma A.2, since for all ε > 0 we have μ = μ ε s = e s η ε = (e s • V ε ) P = X P, we can find a sequence of measure-preserving Borel maps {r ε n (·)} n∈N such that Recalling the choice ofv ε , we have also where we used the Dominated Convergence Theorem to pass to the limit under the integral sign, exploiting the global boundedness ofv ε . From the Dynamic Programming Principle, for all t ∈ [s, T ] we have Therefore, there exists a continuous increasing function Dividing by t − s > 0, and recalling the choice of v ε , we have By letting h → +∞ and thanks to (6.7), we have By letting t → s + and recalling the boundedness of e t − e s t − s L 2 η ε coming from Finally, letting ε → 0 + yields i.e., in view of Definition 6.1, Dφ(s, X )) ≤ 0. The proof of item (2) is omitted since it is a straightforward adaption of the previous argument just provided for item (1). We specify that, in this case, the proofs of the assertions regarding subsolutions and supersolutions are reversed, minimum has to be replaced by maximum and vice versa, the inequality signs are reversed and the signs of the terms involving ρ and ε need to be changed accordingly.
We finish the section with our main results: a viscosity characterization of viability (Theorem 6.6) and invariance (Theorem 6.7).
is a viscosity supersolution of Proof. For any T > 0, consider the decreasing function α : [0, T ] → R defined as We denote by W (t, X ) := w(t, X P) the lift of w(·) according to Definition 5.1(1). Proof of (1 ⇒ 2). Let d K be a supersolution to (6.8) (cf. Remark 5.3). Fix t ∈ [0, T ), μ and X ∈ L 2 P ( ). Let : [0, T ] × L 2 P ( ) → R be a C 1 test function such that W − has a local minimum at (t, X ). We want to prove that is regular for any Y ∈ L 2 P ( ), then by the minimality we should have Hence, for all (s, Y ) ∈ [0, T ]× L 2 P ( ) in a small enough neighborhood I t,X of (t, X ), 12) and ϕ, g such that (6.13) by local minimality of (t, X ). By definition of W and (6.13), we get for any (s, Y ) ∈ I t,X . In particular, by choosing s = t, we obtain with equality holding when Y = X . Thus, denoting with t : L 2 P ( ) → R the function given by we notice that t ∈ C 1 (L 2 P ( )) and that the map Y → d K (Y P) − t (Y ) attains a local minimum in X . Thus, recalling also Remark 5.3, we can employ t as a test function for d K to get Notice that by (6.12), Recalling the definition of the lifted Hamiltonian H viab F , by (6.14) we obtain Multiplying by α(t), we finally get which concludes that w is a supersolution of (6.10).
Proof of (2 ⇒ 3). Let T > 0 and assume that w(t, μ) = α(t)d K (μ) is a viscosity supersolution of (6.10). We recall that H viab F , given in Definition 6.1, satisfies the assumptions of Theorem 5.4 as proved in Lemma 6.3. In particular, if we denote by U (t, X ) := V viab (t, X P) the lift of the value function of Definition 4.1, we have W (T, X ) = U (T, X ) = 0, for every X ∈ L 2 P ( ).
Therefore, since both w and V viab are uniformly continuous (see Proposition 4.6), by Theorem 5.4 and Proposition 6.5, we have U (t, X ) ≤ W (t, X ) for all (t, X ) ∈ [0, T ] × L 2 P ( ). Thus, for all μ ∈ K and all X ∈ L 2 P ( ) with X P = μ we obtain V viab (t, μ) = U (t, X ) = W (t, X ) = 0 for all t ∈ [0, T ]. By Proposition 4.3, we conclude that there exists an admissible trajectory starting from μ and defined on [0, T ], which is entirely contained in K . So K is viable.
Let φ ∈ C 1 (L 2 P ( )) and X ∈ L 2 P ( ) be such thatd K − φ has a local minimum at X , and set μ = X P ∈ P 2 (R d ).
For any ε > 0 and T > 0, there existμ ε ∈ K , andμ ε ∈ A [0,T ] (μ ε ) satisfying According to Corollary A.3 applied to μ ε , set for any p ∈ L 2 P ( ) (recall that μ = μ 0 = X P = Y ε 0 P). According to the choice of X , we have We estimate the first term as follows Concerning the right hand side of (6.16), we have that there exists a continuous increasing map : [0, +∞) → [0, +∞) with (r )/r → 0 as r → 0 + such that where in the third inequality we employed the definition of Y ε t provided in the proof of Recalling now the uniform boundedness in ε of e t −e 0 t L 2 η ε coming from Proposition 3.4(3), by letting ε → 0 + and t → 0 + , and by setting This leads to (L +2)d K (X P)+H viab F (X, Dφ(X )) ≥ 0, i.e., d K (μ) is a supersolution of (6.8).
Proof of (1 ⇒ 2). This part of the proof is the same as the one developed in Theorem 6.6 with H inv F in place of H viab F . Proof of (2 ⇒ 3). Same as in Theorem 6.6, with V viab replaced by V inv .
Let φ ∈ C 1 (L 2 P ( )) and X ∈ L 2 P ( ) be such thatd K − φ has a local minimum at X , and set μ = X P ∈ P 2 (R d ).
Fix ε > 0, and let v ε ∈ L 2 By Remark 6.4, we can suppose that v ε ∈ C 0 , and by Lemma A.4 there exists an admissible trajectory By density, we can findv T ] a Borel map satisfying η ε = V ε P. Recalling Lemma A.2, since for all ε > 0 we have μ = μ ε 0 = e 0 η ε = (e 0 • V ε ) P = X P, we can find a sequence of measure-preserving Borel maps {r ε n (·)} n∈N such that Recalling the choice ofv ε , we have also Since, by Lemma A.2, Y ε,n 0 − X L 2 P ≤ 1 n , we can find a subsequence {Y ε,n h 0 } h∈N such that for P-a.e. ω ∈ it holds lim h→+∞ Y ε,n h 0 (ω) = X (ω). Therefore, Concerning the right hand side of (6.20), we have that there exists a continuous increasing map : [0, +∞) → [0, +∞) with (r )/r → 0 as r → 0 + such that Recalling the choice of v ε , we have Recalling now the uniform boundedness in ε of e t −e 0 t L 2 η ε coming from Proposition 3.4(3), by letting h → +∞, t → 0 + and ε → 0 + , and by setting we have, thanks also to (6.19), Thus, by passing to the limit also in (6.21) and combining that estimate with (6.22), we get is a supersolution of (6.17) (cf. Remark 5.3).
• Choose a = 1. Then for all b > 0, we have ≥λ, and by passing to the limit as b → 0 + we have 0 ≥λ. For all b < 0, we have and by passing to the limit as b → 0 − we have 0 ≤λ. Therefore,λ = 0.
We prove now that K is invariant for the dynamics F. Thanks to Theorem 6.7, we have to prove that for every ψ ∈ C 1 (L 2 P ) such thatÛ − ψ attains a local minimum at X ∈ L 2 P it holds We distinguish two cases • when X L 2 P < 1, we have d K (X P) = 0 and Dψ(X ) = 0, which implies H inv F (X, Dψ(X )) = 0, so the equation is trivially satisfied.
So, also in this case, we have from which we get the invariance, and thus the viability, of the set K for the dynamics F. Since all the admissible trajectories for F are also admissible for G, we have that K is viable for G. We prove now that K is not invariant for G. Indeed, take X ∈ L 2 P ( ) with X L 2 P = 1. Then, we can consider ψ ∈ C 1 (L 2 soÛ − ψ attains in V a minimum at X , and Dψ(X ) = X . Set we obtain (recalling that X L 2 Thus, and thereforeÛ (·) is not a supersolution of the invariance equation.
On the other hand, set (see Definition 6.1) and by taking the supremum in the right-hand side over the set and therefore for every ψ ∈ C 1 (L 2 P ) such thatÛ − ψ attains a local minimum at X ∈ L 2 P it holds Thus, K is viable for G, as already noticed.
Therefore, e t − e s t − s (x, γ ) ∈ F(μ s , γ (s)) By Filippov's theorem (Theorem 8.2.10 in [4]), there exists a Borel map w : Thus, Observe that, by continuity of e t and uniqueness of the narrow limit, we have that μ (n) t = e t η (n) narrowly converges to μ t = e t η for any t ∈ [a, b], up to subsequences (see Lemma 5.2.1 in [2]). The rest of the proof is an adaptation of the proof of Theorem 1 in [13]. In order to conclude the admissibility of μ, we notice that t → μ t is a Lipschitz continuous map, indeed by Lipschitz continuity of γ in the support of η. According to Theorem 3.5 in [3], the map t → μ t is differentiable almost everywhere in [a, b], and for all ϕ ∈ C 1 for all t, s ∈ [a, b], with s < t.
In particular, for every p(·) ∈ L 2 P ( ) we have  [11], there exists a Borel map V : → R d × [a,b] such that η = V P, and thus μ t = X t P for all t ∈ [a, b], where X t = e t • V . Evaluating the estimates obtained in Proposition 3.4 for (x, γ ) = V (ω), and recalling that X t = e t • V , X s = e s • V , we obtain Thus, for every p(·) ∈ L 2 P ( ), we have By taking the liminf as t → s + , and using the estimate on X τ − X s L 2 P , we obtain lim inf In the same way, we prove the inequality for the limsup.
We recall the following well-known result, used to prove Corollary A.3.
Lemma A.2. (Lemma 5.23 p. 379 in [11]) Let P be an atomless Borel probability measure on , X, Y ∈ L 2 P ( ; R d ) two random variables with the same law, i.e., X P = Y P. Then for any ε > 0, there exist two Borel measurable maps r, r −1 : → such that • r and r −1 are measure-preserving, i.e., r P = r −1 P = P; In particular, we have X − Y • r L 2 P ≤ ε. [a,b] be an admissible trajectory, and X ∈ L 2 P ( ) such that X P = μ a . Let η ∈ P(R d × [a,b] ) such that μ t = e t η for any t ∈ [a, b]. Then, for every ε > 0 there exists a family of random variables (3) for every t ∈ [a, b] and for every p(·) ∈ L 2 Since P is an atomless Borel probability measure on a Polish space, as already noticed, there exists a Borel map V : Notice that for every measure-preserving map r : Evaluating at (x, γ ) = V • r (ω), and recalling that X t = e t • V , we obtain Since X P = X a P = μ a , by Lemma A.2 for any ε > 0 we can choose a measurepreserving map r = r ε such that |X (ω) − X a • r (ω)| ≤ ε for P-a.e. ω ∈ . So we have Then, as seen in the proof of Corollary A.1, we have for every p ∈ L 2 P ( ). Notice that (1) Y t P = X t • r ε P = X t P = μ t since r ε P = P; (2) we have From here follows the conclusion. c. e t − e a t − a → v • e a in L 2 η as t → a + .
Since we have the same estimate as in (A.3), then there exists η ∈ P(R d × T ) and a subsequence η (n k ) such that η (n k ) narrowly converges toward η. As already observed, we also have that θ (n k ) is a family of uniformly bounded and continuous curves, with uniformly bounded Lipschitz constants. Thus, it has a subsequence which is uniformly convergent to a Lipschitz curve θ = {θ t } t∈[0,T ] . We now follow the same reasoning as in the last part of the proof of Proposition 3.5 with μ and μ (n) replaced, respectively, by θ and θ (n k ) . For η-a.e. (x, γ ), we get thatγ (t) ∈ F(θ t , γ (t)) for a.e. t ∈ [0, T ], γ (0) = x, γ ∈ C 1 ([0, T ]) andγ (0) = v(x). Thus, θ is an admissible trajectory and e t − e 0 t (x, γ ) → v(x), as t → 0 + , for η-a.e. (x, γ ) ∈ R d × T . We also notice that v(x) = v •e 0 (x, γ ) for η-a.e. (x, γ ) ∈ R d × T . Finally, recalling the estimates on the admissible trajectories provided in Proposition 3.4, by the Dominated Convergence Theorem we have that the convergence is actually in L 2 η .