Proof. We consider only $x = O$ because the other cases are similar or simpler. Let us introduce a continuous and piecewise linear function $\phi_{\epsilon}$ on $\mathcal{G}$ such that $\phi_{\epsilon}(O) = 1$ and $\phi_{\epsilon}(x) = 0$ for any $x \in \mathcal{G}$ with $d(x, O) \ge \epsilon$. Clearly, $\{\phi_{\epsilon}\}_{\epsilon}$ is a monotone sequence of Lipschitz continuous functions with

$$ \lim_{\epsilon \to 0} \phi_{\epsilon}(x) = \begin{cases} 1 & \text{if } x = O \\ 0 & \text{if } x \neq O. \end{cases} $$

Monotone convergence theorem ensures: $m(t)(\{O\}) = \lim_{\epsilon \to 0} \int_{\mathcal{G}} \phi_{\epsilon}(x)m(t)(dx)$ for each $t \in [0, T]$. On the other hand, by the definition of $\mathcal{P}_{m_0}(\Gamma_{C,V}^{\text{Lip}})$, for each $\epsilon > 0$, the map $t \mapsto \int_{\mathcal{G}} \phi_{\epsilon}(x)m(t)(dx)$ is Lipschitz continuous. Hence, $t \mapsto m(t)(\{O\})$ is a measurable function because it is the pointwise limit of a sequence of (Lipschitz) continuous functions. In particular, $\{t \in [0, T] : m(t)(\{O\}) > 0\}$ is measurable. $\square$

**Lemma 3.26.** Consider $\phi$ as in Theorem 3.22. Then, for any $i \in \{1, \dots, N\}$, the function

$$ \mathcal{F}_{\phi,i}(t) = \int_{\Gamma} \phi(\gamma(t), t) \mathbf{1}_{\gamma(t) \in J_i \setminus \{O\}} \mu(d\gamma) $$

is a bounded measurable function on $(0, T)$. In particular, $\mathcal{F}_{\phi,i}$ admits a derivative in $\mathcal{D}'(0, T)$.

*Proof.* Fix $\phi$ and $i$ as in the statement. Consider a family of functions $\{\psi_{\epsilon}\}$ such that: $\psi_{\epsilon}(x) \in [0, 1]$, $\psi_{\epsilon} \in C^{\infty}(\mathcal{G})$, $\text{supp}(\psi_{\epsilon}) \subset J_i \setminus \{O\}$ and $\psi_{\epsilon}(x) = 1$ for $d(x, O) \ge \epsilon$. Clearly, $\lim_{\epsilon \to 0} \psi_{\epsilon}(x) = \mathbf{1}_{J_i \setminus \{O\}}(x)$ for any $x \in \mathcal{G}$. The functions

$$ t \mapsto \int_{\Gamma} \phi(\gamma(t), t) \psi_{\epsilon}(\gamma(t)) \mu(d\gamma) $$

are (Lipschitz) continuous. On the other hand, from the dominated convergence theorem,

$$ \lim_{\epsilon \to 0} \int_{\Gamma} \phi(\gamma(t), t) \psi_{\epsilon}(\gamma(t)) \mu(d\gamma) = \mathcal{F}_{\phi,i}(t). $$

Being the pointwise limit of bounded continuous functions, the function $\mathcal{F}_{\phi,i}$ is measurable and bounded. $\square$

*Proof of Theorem 3.22.* Fix $\phi$ as in the statement. By the regularity of $\phi$ and of $m$ with respect to $t$, the function

$$ \zeta(t) = \int_{\mathcal{G}} \phi(x, t) m(t)(dx) $$

is Lipschitz continuous on $(0, T)$; in particular, $\partial_t \zeta \in L^{\infty}(0, T)$. There holds

$$ \begin{aligned} \zeta(t) &= \phi(O, t)m(t)(\{O\}) + \sum_{i=1}^{N} \int_{\mathcal{G}} \phi(x, t) \mathbf{1}_{x \in J_i \setminus \{O\}} m(t)(dx) \\ &= \phi(O, t)m(t)(\{O\}) + \sum_{i=1}^{N} \int_{\Gamma} \phi(\gamma(t), t) \mathbf{1}_{\gamma(t) \in J_i \setminus \{O\}} \mu(d\gamma). \end{aligned} $$

Note that Lemma 3.25 and Lemma 3.26 ensure that each contribution in the right hand side of the latter identity has a derivative in $\mathcal{D}'(0, T)$. We may therefore calculate the distributional derivative of $\zeta$. From now on, the notation $\langle \cdot, \cdot \rangle$ stands for the duality
between $\mathcal{D}'(0, T)$ and $C_0^\infty(0, T)$. We claim that, for distributions $q_i \in \mathcal{D}'(0, T)$, $i = 1, \dots, N$, that will be characterized later, there holds

$$ (3.24) \quad \frac{d\zeta}{dt} = \frac{d}{dt}[\phi(O, \cdot)m(\cdot)(\{O\})] + \sum_{i=1}^{N} \phi(O, \cdot)q_i \\ + \sum_{i=1}^{N} \int_{\mathcal{G}} [\partial_t\phi(x, \cdot) - D\phi(x, \cdot)Du(x, \cdot)] \mathbb{1}_{x \in J_i \setminus \{O\}}m(\cdot)(dx) $$

in the sense of $\mathcal{D}'(0, T)$. Indeed, for every test function $\chi \in C_0^\infty(0, T)$,

$$ (3.25) \quad \left\langle \frac{d\zeta}{dt}, \chi \right\rangle - \left\langle \frac{d}{dt}[\phi(O, \cdot)m(\cdot)(\{O\})], \chi \right\rangle = \sum_{i=1}^{N} I_i $$

with

$$ (3.26) \quad I_i = - \int_0^T \chi'(t) \left[ \int_{\Gamma} \phi(\gamma(t), t) \mathbb{1}_{\gamma(t) \in J_i \setminus \{O\}} \mu(d\gamma) \right] dt. $$

Consider a function $\psi \in C^\infty(\mathcal{G})$, $\text{supp}(\psi) \subset J_i \setminus \{O\}$, $\psi(x) = 1$ for all $x \in J_i$ such that $d(x, O) \ge 1$ and $\psi|_{J_i}$ is increasing with respect to $d(x, O)$. Setting $\psi_\epsilon(x) = \psi(\frac{x}{\epsilon})$, we observe that $\psi_\epsilon$ converges pointwise to $\mathbb{1}_{J_i \setminus \{O\}}$ has $\epsilon \to 0$. Hence,

$$ I_i = - \lim_{\epsilon \to 0} \int_0^T \chi'(t) \left[ \int_{\Gamma} \phi(\gamma(t), t) \psi_\epsilon(\gamma(t)) \mu(d\gamma) \right] dt. $$

From Remark 3.17 and the definition of $\psi_\epsilon$, for all $t \in (0, T]$, for $\mu$-a.a. $\gamma$,

$$ \mathbb{1}_{\gamma(t) \in J_i \setminus \{O\}} = \mathbb{1}_{\gamma(t) \in J_i \setminus \{O\}} \mathbb{1}_{(\gamma(t), t) \in Q_m}, \\ \psi_\epsilon(\gamma(t)) = \psi_\epsilon(\gamma(t)) \mathbb{1}_{(\gamma(t), t) \in Q_m}. $$

Therefore, Proposition 3.18-(b) and Lemma 3.16-(b) (in particular the validity of Lemma 2.33-(ii)) guarantee that

$$ (3.27) \quad \mathbb{1}_{\gamma(t) \neq O} \gamma'(t) = - \mathbb{1}_{\gamma(t) \neq O} Du(\gamma(t), t) \quad \text{for } \mu\text{-a.e. } \gamma. $$

Since the right hand side of (3.27) is the limit as $h \to 0$ of $-\mathbb{1}_{\gamma(t) \neq O}(u(\gamma(t)+h) - u(\gamma(t))/h$ as $h \to 0$, it is measurable and essentially bounded w.r.t. $\mu$, and so is the function in the left hand side of (3.27). Hence, observing also that $0 \notin \text{supp}(\psi_\epsilon)$, differentiation under the integral sign is permitted for $t \mapsto \int_{\Gamma} \phi(\gamma(t), t) \psi_\epsilon(\gamma(t)) \mu(d\gamma)$. We get

$$ I_i = \lim_{\epsilon \to 0} \int_0^T \chi(t) \int_{\Gamma} \left[ \begin{array}{l} (\partial_t \phi(\gamma(t), t) - D\phi(\gamma(t), t) \cdot Du(\gamma(t), t)) \psi_\epsilon(\gamma(t)) \\ -\phi(\gamma(t), t) D\psi_\epsilon(\gamma(t)) \cdot Du(\gamma(t), t) \end{array} \right] \mu(d\gamma) dt. $$

Hence,

$$ I_i = \lim_{\epsilon \to 0} (I_{i1} + I_{i2}) $$

where

$$ I_{i1} = \int_{0}^{T} \chi(t) \int_{\Gamma} (\partial_{t} \phi(\gamma(t), t) - D\phi(\gamma(t), t) Du(\gamma(t), t)) \psi_{\epsilon}(\gamma(t)) \mu(d\gamma) dt $$

$$ I_{i2} = - \int_{0}^{T} \chi(t) \int_{\Gamma} \phi(\gamma(t), t) D\psi_{\epsilon}(\gamma(t)) Du(\gamma(t), t) \mu(d\gamma) dt. $$
Dominated convergence theorem yields

$$
\begin{align}
\lim_{\epsilon \to 0} I_{i1} &= \int_0^T \chi(t) \int_{\Gamma} [\partial_t \phi(\gamma(t), t) - D\phi(\gamma(t), t) Du(\gamma(t), t)] \mathbb{1}_{\gamma(t) \in J_i \setminus \{O\}} \mu(d\gamma) dt \nonumber \\
(3.28) \qquad &= \int_0^T \chi(t) \left[ \int_G [\partial_t \phi(x, t) - D\phi(x, t) Du(x, t)] \mathbb{1}_{x \in J_i \setminus \{O\}} m(t)(dx) \right] dt. \nonumber
\end{align}
$$

On the other hand, there holds

$$
\begin{align*}
I_{i2} &= - \int_0^T \chi(t) \left[ \int_\Gamma [\phi(\gamma(t),t) - \phi(O,t)] D\psi_\epsilon(\gamma(t)) Du(\gamma(t),t) \mu(d\gamma) \right] dt \\
&\quad - \int_0^T \chi(t) \phi(O,t) \int_\Gamma D\psi_\epsilon(\gamma(t)) Du(\gamma(t)) \mu(d\gamma) dt \\
&:= I_{i3} + I_{i4}.
\end{align*}
$$

We now deal with $I_{i3}$ and $I_{i4}$ separately. First, from the regularity of $\phi$,

$$
\begin{align*}
I_{i3} &= - \int_0^T \chi(t) \int_{\Gamma} [D\phi(O,t)\bar{\gamma}(t) + \epsilon o(1)] D\psi_{\epsilon}(\gamma(t)) Du(\gamma(t),t) \mu(d\gamma) dt \\
&= - \int_0^T \chi(t) \left[ \int_{\Gamma} D\phi(O,t) D\beta_{\epsilon}(\bar{\gamma}(t)) Du(\gamma(t),t) \mu(d\gamma) \right] dt + o(1)
\end{align*}
$$

where $\gamma(t) = \bar{\gamma}(t)e_i$, $\beta_\epsilon$ is defined by

$$
\beta_{\epsilon}(\bar{x}) = \int_{0}^{\bar{x}} \xi D\psi_{\epsilon}(\xi e_{i}) d\xi \quad \forall \bar{x} \in [0, \infty).
$$

and $o(1)$ stands for a function of $\epsilon$ such that $\lim_{\epsilon\to 0} o(1) = 0$. Note that $\beta_\epsilon$ is an increasing regular function and fulfills: $\beta_\epsilon(0) = 0$, $\beta_\epsilon(\bar{x})$ is a constant for $\bar{x} \ge \epsilon$ with $\beta_\epsilon(\epsilon) = O(\epsilon)$. Therefore, taking into account the regularity of $\phi$ and of $\chi$ and arguing as above, we get

$$
\begin{align*}
I_{i3} &= - \int_0^T \chi(t) \int_{\Gamma} D\phi(O,t) D\beta_{\epsilon}(\bar{\gamma}(t)) Du(\gamma(t),t) + \partial_t D\phi(O,t) \beta_{\epsilon}(\bar{\gamma}(t)) \mu(d\gamma) dt + o(1) \\
&= - \int_0^T \chi(t) \int_{\Gamma} \partial_t (D\phi(O,\cdot) \beta_{\epsilon}(\bar{\gamma}(\cdot))) \mu(d\gamma) dt + o(1) \\
&= \int_0^T \chi'(t) \int_{\Gamma} D\phi(O,\cdot) \beta_{\epsilon}(\bar{\gamma}(\cdot)) \mu(d\gamma) dt + o(1) \\
(3.29)\qquad &= o(1)
\end{align*}
$$

where the last line is due to the properties of $\beta_\epsilon$.

From (3.29) and (3.28), we deduce that $\lim_{\epsilon \to 0} I_{i4} = I_i - \lim_{\epsilon \to 0} I_{i1}$.

Because we can choose $\phi(O, \cdot) = 1$ on $\text{supp}(\chi)$, this in particular implies that

$$
t \mapsto - \int_{\Gamma} D\psi_{\epsilon}(\gamma(t)) Du(\gamma(t),t) \mu(d\gamma)
$$

tends to some $q_i$ in $D'(0, T)$ as $\epsilon \to 0$. Hence,

$$
(3.30) \qquad t \mapsto -\phi(O,t) \int_{\Gamma} D\psi_{\epsilon}(\gamma(t)) Du(\gamma(t),t) \mu(d\gamma)
$$

tends to $\phi(O, \cdot)q_i$ in $D'(0, T)$ as $\epsilon \to 0$. We have obtained (3.23). Injecting (3.23) into (3.25) yields (3.24).
In order to complete the proof, there remains to check (3.22) and (3.21). Clearly, there holds: $\frac{d}{dt}(m(\cdot)(\{O\})+\sum_i m(\cdot)(J_i \setminus \{O\})) = 0$. Hence, (3.22) will follow from (3.21).

From the definition of $q_i$ as the limit of $-\int_{\Gamma} D\psi_{\epsilon}(\gamma(\cdot))Du(\gamma(\cdot), \cdot)\mu(d\gamma)$ as $\epsilon$ tends to 0 and from (3.27), there holds

$$ \begin{aligned} \langle q_i, \chi \rangle &= -\lim_{\epsilon \to 0} \int_0^T \left[ \int_{\Gamma} D\psi_{\epsilon}(\gamma(t))Du(\gamma(t),t)\mu(d\gamma) \right] \chi(t)dt \\ &= \lim_{\epsilon \to 0} \int_0^T \left[ \int_{\Gamma} \partial_t \psi_{\epsilon}(\gamma(t))\mu(d\gamma) \right] \chi(t)dt \\ &= -\lim_{\epsilon \to 0} \int_0^T \left[ \int_{\Gamma} \psi_{\epsilon}(\gamma(t))\mu(d\gamma) \right] \chi'(t)dt \\ &= -\int_0^T \left( \int_{\Gamma} \mathbb{1}_{\gamma(t) \in J_i \setminus \{O\}} \mu(d\gamma) \right) \chi'(t)dt \end{aligned} $$

for every test function $\chi \in C_0^{\infty}(0,T)$, where the last equality is due to the dominated convergence theorem. The proof of (3.22) with (3.21) is achieved. $\square$

**Acknowledgements.** The first author is partially on academic leave at Inria for the years 2021-22 and 2022-23 and acknowledges the hospitality of this institution during this period. The first author is partially supported by the chair Finance and Sustainable Development and FiME Lab (Institut Europlace de Finance). The first and fourth authors are partially supported by ANR (Agence Nationale de la Recherche) through project COSS, ANR-22-CE40-0010-01. The second and the third authors are partially supported by INDAM-GNAMPA. The fourth author benefits from the support of the French government “Investissements d’Avenir” program integrated to France 2030, bearing the following reference ANR-11-LABX-0020-01 and acknowledges INDAM-GNAMPA for the visiting professor position at the University of Padova.

## References

[1] Y. ACHDOU, J. HAN, J.M. LASRY, P.L. LIONS, B. MOLL *Income and wealth distribution in macroeconomics: a continuous-time approach*, Rev. Econ. Stud. 89 (2022), no. 1, 45-86.

[2] Y. Achdou, M-K. Dao, O. Ley, N. Tchou, *Finite Horizon Mean Field Games on Networks*, Calculus of Variations and P.D.E. 59 (2020), no 5,

[3] Y. Achdou, M-K. Dao, O. Ley, N. Tchou, A class of infinite horizon mean field games on networks. *Netw. Heterog. Media* 14 (2019), no. 3, 537-566.

[4] Y. ACHDOU, F. CAMILLI, A. CUTRÌ, N. TCHOU, *Hamilton-Jacobi equations constrained on networks*, NoDEA Nonlinear Differential Equations Appl. 20 (2013), 413-445.

[5] Y. ACHDOU, P. MANNUCCI, C. MARCHI, N. TCHOU, *Deterministic mean field games with control on the acceleration and state constraints*, SIAM J. Math. Anal. 54 (2022), no. 3, 3757-3788.

[6] Y. ACHDOU, S. OUDET, N. TCHOU, *Hamilton-Jacobi equations for optimal control on junctions and networks*, ESAIM Control Optim. Calc. Var. 21 (2015), no. 3, 876-899.

[7] F. AL SALEH, T. BAKARYAN, D.A. GOMES, R. RIBEIRO First-order mean-field games on networks and Wardrop equilibrium, available at https://arxiv.org/abs/2207.01397.

[8] J.P. AUBIN, H. FRANKOWSKA *Set-Valued analysis*, Systems & Control: Foundations & Applications 2, Birkhauser Boston, Boston, MA, 1990.
[9] L. AMBROSIO, N. GIGLI, G. SAVARÉ, Gradient flows in metric spaces and in the space of probability measures, Lectures in Mathematics ETH Zürich. Birkhäuser Verlag, Basel 2005.

[10] M. BARDI, I. CAPUZZO DOLCETTA, Optimal control and viscosity solutions of Hamilton-Jacobi Bellman equations, Systems and Control: Foundations and Applications. Birkhäuser, Boston 1997.

[11] G. BARLES, E. CHASSEIGNE, An Illustrated Guide of the Modern Approaches of Hamilton-Jacobi Equations and Control Problems with Discontinuities, arXiv 1812.09197 (2023).

[12] G. BARLES, A. BRIANI, E. CHASSEIGNE, A Bellman approach for regional optimal control problems in $R^N$, SIAM J. Control Optim. 52 (2014), no. 3, 1712–1744.

[13] J.-D. BENAMOU, Y. BRENIER A computational fluid mechanics solution to the Monge-Kantorovich mass transfer problem, Numerische Mathematik, 84(3):375–393, 2000.

[14] J.-D. BENAMOU, G. CARLIER Augmented Lagrangian methods for transport optimization, mean field games and degenerate elliptic equations, Journal of Optimization Theory and Applications, 167(1):1–26, 2015.

[15] F. CAMILLI, C. MARCHI, Stationary mean field games systems defined on networks. SIAM J. Control Optim., 54(2):1085–1103, 2016.

[16] P. CANNARSA, R. CAPUANI, Existence and uniqueness for Mean Field Games with state constraints, PDE models for multi-agent phenomena, 49–71, Springer INdAM Ser., 28, Springer, Cham, 2018.

[17] P. CANNARSA, R. CAPUANI, P. CARDALIAGUET $C^{1,1}$-smoothness of constrained solutions in the calculus of variations with application to mean field games, Math. Eng. 1 (2019), no. 1, 174–203.

[18] P. CANNARSA, R. CAPUANI, P. CARDALIAGUET Mean field games with state constraints: from mild to pointwise solutions of the PDE system, Calc. Var. Partial Differential Equations 60 (2021), no. 3, Paper No. 108.

[19] P. CANNARSA, C. SINESTRARI, Semiconcave Functions, Hamilton-Jacobi Equations, and Optimal Control, Progress in Nonlinear Differential Equations and Their Applications, 48, Birkhäuser, Boston 2004.

[20] P. CARDALIAGUET, Notes on Mean Field Games, from P.L. Lions lectures at College de France (2012), available at https://www.ceremade.dauphine.fr/cardalia/MFG20130420.pdf.

[21] P. CARDALIAGUET, A. R. MÉSZÁROS, F. SANTAMBROGIO First order mean field games with density constraints: pressure equals price SIAM J. Control Optim., 54(5):2672–2709, 2016.

[22] S. DWEIK, G. MAZANTI Sharp semi-concavity in a non-autonomous control problem and $L^p$ estimates in an optimal-exit MFG, NoDEA Nonlinear Differential Equations Appl. 27 (2020), no. 2, Paper No. 11.

[23] C. IMBERT, R. MONNEAU, Flux-limited solutions for quasi-convex Hamilton-Jacobi equations on networks, Ann. Sci. Éc. Norm. Supér. (4) 50 (2017), no. 2, 357–448.

[24] C. IMBERT, R. MONNEAU, H. ZIDANI, A Hamilton-Jacobi approach to junction problems and application to traffic flows, ESAIM Control Optim. Calc. Var. 19 (2013), no. 1, 129–166.

[25] J.-M. LASRY, P.-L. LIONS, Jeux à champ moyen. I. Le cas stationnaire, C. R. Math. Acad. Sci. Paris 343 (2006), 619–625.

[26] J.-M. LASRY, P.-L. LIONS, Jeux à champ moyen. II. Horizon fini et contrôle optimal, C. R. Math. Acad. Sci. Paris 343 (2006), 679–684.

[27] J.-M. LASRY, P.-L. LIONS, Mean field games, Japan. J. Math. (N.S.) 2 (2007), 229–260.

[28] P.-L. LIONS, P. SOUGANIDIS, Viscosity solutions for junctions: well posedness and stability, Atti Accad. Naz. Lincei Rend. Lincei Mat. Appl. 27 (2016), no. 4, 535–545.
[29] P.-L. LIONS, P. SOUGANIDIS, *Well-posedness for multi-dimensional junction problems with Kirchoff-type conditions*, Atti Accad. Naz. Lincei Rend. Lincei Mat. Appl. 28 (2017), no. 4, 807-816.

[30] G. MAZANTI, F. SANTAMBROGIO *Minimal-time mean field games*, Math. Models Methods Appl. Sci., 29 (2019), no. 8, 1413-1464.

[31] E.J. MCSHANE, R.B. WARFIELD JR, *On Filippov's implicit functions lemma*, Proc. Amer. Math. Soc. 18 (1967), 41-47.

[32] P.S. MORFE, *Convergence & rates for Hamilton-Jacobi equations with Kirchoff junction conditions*, NoDEA Nonlinear Differential Equations Appl. 27 (2020), no. 1, Paper No. 10.