Swann Marx

Edouard Pauwels

Path differentiability of ODE flows

We consider flows of ordinary differential equations (ODEs) driven by path differentiable vector fields. Path differentiable functions constitute a proper subclass of Lipschitz functions which admit conservative gradients, a notion of generalized derivative compatible with basic calculus rules. Our main result states that such flows inherit the path differentiability property of the driving vector field. We show indeed that forward propagation of derivatives given by the sensitivity differential inclusions provide a conservative Jacobian for the flow. This allows to propose a nonsmooth version of the adjoint method, which can be applied to integral costs under an ODE constraint. This result constitutes a theoretical ground to the application of small step first order methods to solve a broad class of nonsmooth optimization problems with parametrized ODE constraints. This is illustrated with the convergence of small step first order methods based on the proposed nonsmooth adjoint.

Introduction 1.General context

We consider the ordinary differential equation (ODE for short), for some T > 0

Ẋ(t) = F (X(t)), ∀t ∈ [0, T ] (1) X(0) = x,
where F : R p → R p is a Lipschitz function and x ∈ R p . We denote by φ : R p × [0, T ] → R p the corresponding flow which associates to (x, t) ∈ R p × [0, T ] the value X(t) where X : R → R p is the solution to [START_REF] Acary | Numerical methods for nonsmooth dynamical systems: applications in mechanics and electronics[END_REF] with X(0) = x. The flow φ typically inherits the regularity of F . For example if F is C 1 , then φ is also C 1 (see e.g. [START_REF] Hirsch | Differential equations, dynamical systems, and an introduction to chaos[END_REF]Section 17.6]).

In our setting, the flow φ is Lipschitz (see e.g., [START_REF] Hirsch | Differential equations, dynamical systems, and an introduction to chaos[END_REF]Section 17.4]). A notion of generalized derivative adapted to Lipschitz function is due to Clarke. The Clarke Jacobian takes values in subsets of R p×p . We denote by J F : R p ⇒ R p×p the Clarke Jacobian of F [18, Section 2.6]. For x ∈ R p , it is defined as follows

J c F (x) = conv v ∈ R p×p , {x k } k∈N ⊂ R, x k → x, Jac F (x k ) → v, k → ∞ ,
where R is any full measure set where F is differentiable and Jac F is the usual Jacobian of F . Our main question of interest is to obtain generalized derivatives of φ from the knowledge of Clarke Jacobian of F . This question requires to take a more detailed look at the regularity of F .

Path differentiability of the flow

The class of Lipschitz functions F is too large for our purpose. Indeed, for generic Lipschitz F the Clarke Jacobian, ∂ c F carries no information about the function itself [START_REF] Wang | Pathological Lipschitz functions in R n[END_REF][START_REF] Borwein | Generalized subdifferentials: a Baire categorical approach[END_REF][START_REF] Borwein | Generalisations, Examples, and Counter-examples in Analysis and Optimisation[END_REF].

In particular, it is proved in [START_REF] Borwein | Generalized subdifferentials: a Baire categorical approach[END_REF] that generic 1-Lipschitz functions have the same constant subgradient.

Therefore, to obtain meaningful calculus rules, we need to restrict F to be in a well behaved subclass. We choose the class of path differentiable functions, which was identified by several authors to be well behaved from a nonsmooth analysis perspective [START_REF] Valadier | Entraînement unilatéral, lignes de descente, fonctions lipschitziennes non pathologiques[END_REF][START_REF] Borwein | A chain rule for essentially smooth Lipschitz functions[END_REF][START_REF] Bolte | Conservative set valued fields, automatic differentiation, stochastic gradient methods and deep learning[END_REF].

Let us emphasize that, although this is a negligible subclass of Lischitz functions, it is ubiquitous in potential applications as all semi-algebraic functions (more generally definable functions) are path differentiable [START_REF] Bolte | Conservative set valued fields, automatic differentiation, stochastic gradient methods and deep learning[END_REF]. This encompasses virtually any function Lipschitz F which can be written using an elementary logical formula involving elementary real operations including powers, exponential, logarithms, quotients, including large classes of numerical programs [START_REF] Bolte | A mathematical model for automatic differentiation in machine learning[END_REF].

Following [START_REF] Bolte | Conservative set valued fields, automatic differentiation, stochastic gradient methods and deep learning[END_REF], F is called path differentiable, if it satisfies a chain rule along absolutely continuous curves: for any absolutely continuous γ : [0, 1] → R p , we have for almost all t ∈ [0, 1],

d dt F (γ(t)) = D γ(t), ∀D ∈ J c F (γ(t)) ⊂ R p×p .
In a first step, we will be interested in the following question regarding regularity of φ Does path differentiability of F imply path differentiability of φ?

We provide a positive answer to this question. The result is stated in Corollary 1. The proof is based on a differential inclusion which generalizes the variational equation for smooth ODEs (see for example [START_REF] Hirsch | Differential equations, dynamical systems, and an introduction to chaos[END_REF]Section 17.6]) to the Lipschitz vector field F . This variational inclusion is described in [START_REF] Clarke | Optimization and nonsmooth analysis[END_REF]Section 7.4]. For any x ∈ R p , the latter is defined by the differential inclusion V (t) ∈ J c F (φ(x, t))V (t), for almost all t ∈ [0, T ] V (0) = I ∈ R p×p .

(

) 2
where V is to be found among absolutely continuous functions from [0, T ] to R p×p . Equation (2) can be seen as a formal differentiation of equation [START_REF] Acary | Numerical methods for nonsmooth dynamical systems: applications in mechanics and electronics[END_REF]. As proved in [START_REF] Clarke | Optimization and nonsmooth analysis[END_REF]Theorem 7.4.1], the Clarke Jacobian of the flow J c φ is to be found among the solutions of [START_REF] Aliprantis | Infinite Dimensional Analysis[END_REF]. More precisely, denoting by ψ the function x → φ(x, T ), we have J c ψ (x) ⊂ U (x) := {V (T ), V solution of (2) } for all x ∈ R p . However, as shown in [START_REF] Barton | Computationnally relevant generalized derivatives: theory, evaluation and applications[END_REF]Example 3.8], this inclusion can be strict even for a relatively simple F in R 2 (see Section 2.1). Following [START_REF] Bolte | Conservative set valued fields, automatic differentiation, stochastic gradient methods and deep learning[END_REF], path differentiability of the flow is characterized by existence of a conservative Jacobian for ψ. More precisely, we show that the set valued map U , despite not being necessarily equal to the Clarke Jacobian of ψ, still satisfies the chain rule: for any absolutely continuous γ : [0, 1] → R p , we have for almost all t ∈ [0, 1],

d dt ψ(γ(t)) = D γ(t), ∀D ∈ U (γ(t)) ⊂ R p×p .
This is the result given in Theorem 1. Thanks to this chain rule property, U is a conservative Jacobian of ψ, characterized as the set of solutions to a sensitivity differential inclusion. The existence of such a conservative Jacobian implies that ψ inherits the pathdifferentiable regularity of F .

The mapping U being a conservative Jacobian of ψ has several consequences for the flow. For example, as given in [7, Corollary 5], we have for Lebesgue almost all x ∈ R p U (x) = {Jac ψ(x)}, which means that the differential inclusion (2) provides a unique matrix that is the (classical) Jacobian of ψ. This allows to draw a connection with more classical notions of generalized derivatives. For example, using [START_REF] Evans | Measure theory and fine properties of functions[END_REF]Theorem 6.5], the mapping U (restricted to the set where it is a singleton) can be interpreted as a weak derivative of the flow ψ in the sense of Sobolev spaces.

Optimizing integral costs under ODE constraints

First motivations to address path differentiability of the flow relates to optimization problems of the form min

θ∈R m L(θ) := t=T t=0 (Z(t))dt + T (Z(T )), (3)
where

Z(0) = z Ż(t) = H(Z(t), θ), ∀t ∈ [0, T ]
where : R p → R, T : R p → R and H : R p × R m → R p are Lipschitz, path differentiable functions and z ∈ R p is fixed. Note moreover that the flow depends on a given parameter θ ∈ R m . The decision variable in problem (3) is a parameter vector θ. Such an optimization problem appears in many applications such as machine learning [START_REF] Chen | Neural ordinary differential equations[END_REF], data assimilation [START_REF] Lewis | Dynamic data assimilation: a least squares approach[END_REF] or geophysics [START_REF] Plessix | A review of the adjoint-state method for computing the gradient of a functional with geophysical applications[END_REF].

We will consider first order methods of gradient type to tackle problem (3) algorithmically. These methods generate sequences by recursively following negative gradient directions. The function L is Lipschitz and possibly nonsmooth so we need to use a generalized notion of gradient. The integral part of the loss L consists in a composition of the flow and a Lipschitz integral cost. However, Clarke Jacobian of the flow may be strictly contained in solutions of the variational inclusion [START_REF] Aliprantis | Infinite Dimensional Analysis[END_REF], see [START_REF] Barton | Computationnally relevant generalized derivatives: theory, evaluation and applications[END_REF]Example 3.8]. Fortunately, conservative gradients can be used in place of usual gradients in a nonsmooth optimization context, provided that the objective function is path differentiable [START_REF] Bolte | Conservative set valued fields, automatic differentiation, stochastic gradient methods and deep learning[END_REF][START_REF] Bolte | Long term dynamics of the subgradient method for Lipschitz path differentiable functions[END_REF]. Therefore, the main questions we need to adress are the following: Is the loss L path differentiable? How to obtain a conservative gradient for L?

We leverage our main result on path differentiability of the flow, and the compatibility of conservative Jacobian with calculus rules to show that L is indeed path differentiable. More precisely, we show that a formal differentiation of L (application of integral differentiation rules which hold in the smooth case) using solutions of the variational inclusion (2) provides a conservative gradient for L, this is described in Corollary 5.

Numerical computation of a solution of the variational inclusion (2), for example using Euler discretization [START_REF] Dontchev | Difference methods for differential inclusions: A survey[END_REF], requires to solve a differential inclusion of size p×p. In the context of smooth ODEs, it is known that the size of the system to be solved can be reduced to p by using the adjoint method (see e.g., [START_REF] Cao | Adjoint sensitivity analysis for differential-algebraic equations: The adjoint DAE system and its numerical solution[END_REF]) at the cost of solving an ODE backward in time. We derive a nonsmooth counterpart of the adjoint system using the conservative Jacobian framework and show that solutions to the adjoint system are elements of the conservative gradient for the loss L given in Corollary 5. This is described in Corollary 6.

Application of known results in nonsmooth optimization [START_REF] Bolte | Long term dynamics of the subgradient method for Lipschitz path differentiable functions[END_REF] show that using the prosposed conservative gradient in place of a gradient in a small step first order method context induces a minimizing behavior and generates sequences attracted by sets defined by an optimality condition. In other word, the output given by the proposed adjoint methods may be used as a first order optimization oracle to implement gradient type methods for the problem (3). This result is formally described in Corollary 7.

Related work

Combination of adjoint differentiation and small step methods of gradient type is at the heart of numerical methods for training neural ordinary differential equations models [START_REF] Chen | Neural ordinary differential equations[END_REF][START_REF] Dupont | Augmented neural ODEs[END_REF]. Our results provide a theoretical ground for these approaches for which dedicated numerical librairies exist and are broadly used, such as torchdiffeq in python. These constitute one of the motivations for our investigation.

The use of Clarke's generalized derivatives in a dynamical systems context has been at the heart of nonsmooth analysis developments [START_REF] Clarke | Optimization and nonsmooth analysis[END_REF], in variational analysis [START_REF] Clarke | The Euler-Lagrange differential inclusion[END_REF] and stability analysis [START_REF] Clarke | Asymptotic stability and smooth Lyapunov functions[END_REF][START_REF] Acary | Numerical methods for nonsmooth dynamical systems: applications in mechanics and electronics[END_REF]. More recent contributions include existence and Lipschitz regularity of nonsmooth differential algebraic equations [START_REF] Stechlinski | Dependence of solutions of nonsmooth differential-algebraic equations on parameters[END_REF] and generalizations in Wasserstein space [START_REF] Bonnet | Differential inclusions in wasserstein spaces: The cauchy-lipschitz framework[END_REF].

The variational inclusion dates back to the work of Clarke [START_REF] Clarke | Optimization and nonsmooth analysis[END_REF]. Providing meaning to this equation has been an active topic of research. Let us mention the work of [START_REF] Pang | Solution dependence on initial conditions in differential variational inequalities[END_REF] which prove semismoothness of the flow induced by semismooth gradient fields. In this case the variational inclusion becomes an equation and allows to obtain directional derivatives. This result was extended by [START_REF] Khan | Generalized derivatives for solutions of parametric ordinary differential equations with non-differentiable right-hand sides[END_REF] to handle possibly discontinuous time dependency and lexicographic derivatives [START_REF] Nesterov | Lexicographic differentiation of nonsmooth functions[END_REF]. Deducing lexicographic derivatives from variational equation was extended to differential algebraic equations in [START_REF] Stechlinski | Generalized derivatives of differentialalgebraic equations[END_REF]. All these works are centered around notions of directional derivatives and forward derivative propagation. We are not aware of further interpretations of the variational inclusion (2) beyond directional derivatives and forward propagation. In an optimization context, directional derivatives are not sufficient as one needs to find candidate descent directions. This constitutes another motivation for the proposed developments.

Organization

The paper is organized as follows. Section 2 provides notations, definitions and details about the example of Clarke Jacobian forward propagation failure in [START_REF] Barton | Computationnally relevant generalized derivatives: theory, evaluation and applications[END_REF]Example 3.8]. Section 3 contains preliminary results with their proofs. Section 4 is devoted to the first main result, the flow of (1) inherits path differentiability of F . Section 5 shows that integral costs in optimization with ODE constraints are path differentiable as soon as the the loss function is path differentiable. It is also proved that the adjoint method can be applied in this context to estimate elements of the corresponding conservative gradient. Section 6 is devoted to an extension of these results, from initial conditions dependency to the more general parametric case described in [START_REF] Aubin | Differential inclusions: set-valued maps and viability theory[END_REF]. The latter includes also convergence guaranties for the small step gradient like method. Some concluding remarks are collected in Section 7 together with further research lines. Finally, Appendix A gathers technical results used throughout the paper.

Notation and definitions

Notation. Set R + = [0, ∞). Given p ∈ N, we will denote • the norm and •, • the scalar product in R p . We will denote by • op the operator norm for matrices, i.e. if A ∈ R p×p , then A op := sup v ≤1 Av . The Frobenius norm is defined and denoted by A F := Tr(A A), where A ∈ R p×p , Tr is the trace operator and A is the transpose of A. The supremum norm is denoted by • ∞ .

We recall that, due to Rademacher theorem [START_REF] Evans | Measure theory and fine properties of functions[END_REF]Theorem 3.1], any locally Lipschitz function is almost everywhere differentiable. Absolutely continuous curves γ : R → R p are functions admitting a Lebesgue integrable derivative (defined for almost all t ∈ R), such that for any t ≥ 0:

γ(t) -γ(0) = t 0 γ(s)ds.
Given three metric spaces H, S and Y , a Carathédory function f : (x, t) ∈ H × S → f (x, t) ∈ Y is a function such that x → f (x, t) is Borel measurable for each t ∈ S and such that t → f (x, t) is continuous for each x ∈ H. We say that a function f : R p → R is lower semi-continuous, if for every every sequence (x k ) k∈N ⊂ R p such that lim k→∞ x k = x, one has f (x) ≤ lim inf k→+∞ f (x k ).

A set valued map D : R p ⇒ R q is a function from R p to a subset of R q . We say that D has a closed graph if, for any convergent sequences (x k ) k∈N ⊂ R p and (v k ) k∈N ⊂ R q , with v k ∈ D(x k ), one has lim k→∞ v k ∈ D(lim k→+∞ x k ).

Path differentiablity and conservative Jacobians. The notion of path differentiable functions has been introduced in [START_REF] Bolte | Conservative set valued fields, automatic differentiation, stochastic gradient methods and deep learning[END_REF], this class of regularity allows to apply basic differential calculus rules such as the chain rule. As explained in [START_REF] Bolte | Conservative set valued fields, automatic differentiation, stochastic gradient methods and deep learning[END_REF], the notion of conservativity, defined just below, is crucial to define path differentiable functions.

Definition 1 (Conservative Jacobian) Let D : R p ⇒ R n×p be a locally bounded, graph closed, nonempty valued map and f : R p → R n be a locally Lipschitz continuous function. Then, D is said to be a conservative Jacobian of f if and only if, for any absolutely continuous curve γ : [0, 1] → R p , the function t → f (γ(t)) satisfies, for almost all t ∈ [0, 1]

d dt f (γ(t)) = V γ(t), ∀V ∈ D(γ(t)).
Equivalently, D is a conservative Jacobian of f if and only if, for any measurable selection V (t) ∈ D(γ(t)) for all t ∈ [0, 1],:

f (γ(1)) -f (γ(0)) = 1 0 V (t) γ(t)dt.
When n = 1, we say that D is a conservative gradient.

Conservatives gradients are defined in the same way for real valued functions (see [START_REF] Bolte | Conservative set valued fields, automatic differentiation, stochastic gradient methods and deep learning[END_REF]).

Throughout the paper, we require conservative gradients and Jacobians to be convex. This is not too restrictive due to the following remark.

Remark 1 It follows from the definition that if D is conservative, then its pointwise convex hull x ⇒ conv{D(x)} is also conservative [START_REF] Bolte | Conservative set valued fields, automatic differentiation, stochastic gradient methods and deep learning[END_REF].

Conservativity leads to the notion of path differentiability:

Definition 2 (Path differentiable function) We say that f : R p → R n is path differentiable if there exists a set valued map D such that D is a conservative Jacobian for f .

Remark 2 If J f is a conservative Jacobian for f , then we have J c f (x) ⊂ conv{J f (x)} for all x [START_REF] Bolte | Conservative set valued fields, automatic differentiation, stochastic gradient methods and deep learning[END_REF], in particular J c f is conservative. Hence J c f being conservative is a characterization of path differentiability of f as stated in the intoduction. Dynamical systems. Consider F : R p → R p the Lipschitz function given in (1) that is assumed path differentiable. We denote by J F : R p ⇒ R p a bounded convex valued conservative Jacobian for the vector field F which appears in [START_REF] Aliprantis | Infinite Dimensional Analysis[END_REF]. Throughout the paper, we denote by K > 0 a bound on the operator norm of J F , that is, sup

x∈R p ,J∈J F (x) J op ≤ K. (4)
We introduce the following map

U : R p × [0, T ] → R p×p (x, t) ⇒ V (t) V solution to (2), (5)
which is a candidate for being a conservative Jacobian for the flow φ of (1). The main result of this paper is to show that (x, t) ⇒ (U (x, t), F (φ(x, t)) is a conservative Jacobian for the flow φ, where we have used matrix concatenation.

Since F is assumed to be Lipschitz, the set of solutions to (2) is composed by Lipschitz functions, as stated in the following lemma.

Lemma 1 For any x ∈ R p , T > 0, the set of solutions to (2) is non empty and only contains L-Lipschitz functions with L = K √ p exp(KT ).

Proof : By hypotheses on J F , the solution set of ( 2) is nonempty and defined on maximal intervals invoking [3, Theorem 4, p. 101].

It remains to show that solutions to (2) are bounded. Indeed, once one has a bound on V , one deduces a bound on V through the following inequality, which holds for a.e. t ∈ [0, T ] and is sufficient to ensure Lipschicity,

V (t) F ≤ K V (t) F . (6)
Using ( 2), ( 4) and ( 6), for a.e. t ∈ [0, T ], one has:

d dt V (t) 2 F = 2Tr(V (t) V (t)) ≤ 2K V (t) 2 F .
Thanks to Lemma 6, and using the fact that V (0) = I (see ( 2)), one deduces that, for all t ∈ [0, T ]:

V (t) 2 F ≤ V (0) 2 F exp(2KT ) = p exp(2KT )
This latter equation together with [START_REF] Brezis | Functional analysis, Sobolev spaces and partial differential equations[END_REF] shows that the solutions V to (2) are L-Lipschitz with L = K √ p exp(KT ). This concludes the proof of the Lemma.

Remark 3 (On the Lipschitz assumption) The vector field F has been supposed to be Lipschitz with a uniform bound on a conservative Jacobian in (4), which is a stronger assumption than the (classical) local Lipschitz assumption. Under local Lipschicity, solutions only exist in a time interval which could be bounded with endpoint depending on initial condition. The global Lispchicity assumption allows to avoid such discussions, but there exist possible extensions which would allow to relax it:

1. If we suppose the trajectories (and the initial condition) to belong to some compact set, then local and global Lipschicity will be essentially equivalent for our purpose. For example if F maximal monotone [START_REF] Brezis | Functional analysis, Sobolev spaces and partial differential equations[END_REF]Chapter 7], one can show that the trajectories of (1) are bounded, independently of the initial condition.

2. A different possibility is to assume that all solutions to (1) are well defined on [0, T ] for any initial condition. One can see our global Lipschicity assumption as a sufficient condition.

Remark 4 It is worth mentioning that the unknown of (2) is a matrix, and not a vector as it is commonly defined in textbooks such as [START_REF] Aubin | Differential inclusions: set-valued maps and viability theory[END_REF][START_REF] Filippov | Differential equations with discontinuous righthand sides: control systems[END_REF]. It is always possible to identify a p × p matrix with a vector of dimension p × p, and the meaning of matrix differential inclusion follows by using this identification.

Failure of formal differentiation with Clarke Jacobian

Following [START_REF] Barton | Computationnally relevant generalized derivatives: theory, evaluation and applications[END_REF]Example 3.8], consider an instance of (1) as follows

Ẋ1 Ẋ2 = (1 -X 2 )|X 1 | 1 ,
it can be proved that for any initilization X 1 (0) and X 2 (0) = 0, we have X 1 (2) = X 1 (0) and X 2 (2) = X 2 (0)+2, therefore, the flow is differentiable at T = 2 and its Jacobian is the identity matrix. Furthermore, if X 1 (0) = 0, then we actually have X 1 (t) = 0 for all t ∈ R. However the variational inclusion (2) for the particular initialization

X 1 (0) = X 2 (0) = 0 reads Ṁ ∈ [-|1 -t|, |1 -t|] 0 0 0 M
with M (0) = I where we chose the conservative derivative of absolute value to be the usual derivative everywhere except at 0 where it is the segment [-1, 1]. All entries of M remain constant in time, except for the first one which we denote by m. The two extreme solutions for m are given by ṁ = |1 -t|m and ṁ = -|1 -t|m which leads to m(2) ∈ [1/e, e]. Therefore the variational inclusion fails to provide the correct subgradient for X 1 (2) with respect to the initial condition X 1 (0) (this should be 1). This example highlights the fact that it is not possible to prove that the sensitivity analysis differential inclusion (2) provides subgradients in general. In this example, the discrepancy occurs at the origin only, and, as described in the forthcoming results, the solutions to (2) actually provide a conservative Jacobian for the flow.

Preliminary results

Fix any T > 0, we define the following mapping:

U : R p ⇒ C([0, T ], R p×p ) x ⇒ {t → V (t), V solution to (2) } .
We call the mapping U the solution mapping of the differential inclusion (2) whose values are Lipschitz functions from [0, T ] to R p×p (see Lemma 1). Note that, for all t ∈ [0, T ],

U (x, t) = {V (t), V ∈ U(x)},
where U is defined in [START_REF] Benaïm | Stochastic approximations and differential inclusions[END_REF]. We introduce a Castaing representation for functions with values in Lipschitz subsets of C([0, T ]) which will allow to specify some technical measurability issues for U.

Proposition 1 (Castaing representation of solution mappings) Given T > 0, L > 0, denote by L the space of L-Lipschitz functions from [0, T ] to R q , endowed with the supremum norm. Consider a set-valued map V : R m ⇒ L with closed graph and non empty values. Then V admits a Castaing representation, that is, a sequence of Borel measurable functions from

R m to L, (M n ) n∈N , such that V = {M 1 (x), M 2 (x), . . .}, for each x ∈ R m ,
where the closure and Borel measurability are induced by L ∞ norm over continuous functions. Furthermore, for all i ∈ N, M i can be seen as a function R m × [0, T ] → R q and we have that (x, t) → M i (x, t) is a Carathéodory function, L Lipschitz in t for fixed x and Borel measurable in x for fixed t.

Proof : Recall that σ-compact sets are sets defined as the union of countably many compact subspaces. Since the domain of the V is obviously σ-compact and takes values in the space L which is, by Lemma 10, also σ-compact, then on can invoke [START_REF] Aliprantis | Infinite Dimensional Analysis[END_REF]Theorem 18.20] to deduce that V is Borel measurable. Finally, using [2, Corollary 18.14], there exists a Castaing representation for V. Moreover, by [2, Theorem 4.55], this representation is actually a sequence of Carathéodory functions, which is our desired result.

We are now in position to state a technical representation result for the set of solutions of (2). Fix any T > 0 and any absolutely continuous function γ : [0, 1] → R p . We define the following mapping:

U γ : [0, 1] ⇒ C([0, T ], R p×p ) r ⇒ V ∈ U(γ(r)),
which corresponds to the set of solutions to (2) with the initial condition given by x = γ(r) in (1).

f : R p×p × E → R + (S, r, t) → ∂ ∂t M (r, t) -SM (r, t) 2 ,
which is jointly Lebesgue measurable in (r, t) for a fixed S ∈ R p×p since the sum of the Lebesgue measurable functions ∂ ∂t M and -SM (r, t) is Lebesgue measurable, and because the composition of this sum with the norm function (which is continuous) is also Lebesgue measurable. This function is also continuous in S for fixed (r, t) ∈ [0, 1] × [0, T ], implying then that f is a Carathédory function. Consider K > 0 the global upper bound on J F op as in [START_REF] Barton | Computationnally relevant generalized derivatives: theory, evaluation and applications[END_REF]. By [2, Corollary 18.8], the set valued map

S 1 : E ⇒ R p×p (r, t) ⇒ S ∈ R p×p , S ≤ K, f (S, r, t) = 0 is measurable since S belongs to a compact set. We extend S 1 to [0, 1] × [0, T ] by setting S 1 (r, t) = ∅ if (r, t) ∈ E. Measurability of S 1 is preserved applying [2, Definition 18.1]. Now consider the set valued function S 2 : [0, 1] × [0, T ] ⇒ R p (r, t) ⇒ J F (φ(γ(r), t)).
Since the graph of J F is closed, and using moreover the continuity of the functions φ and γ, the function S → dist(S, J F (φ(γ(r), t))) is lower semicontinuous, hence Borel measurable by Lemma 4. It implies that it is a Carathéodory function, proving that S 2 is Borel measurable [2, Theorem 18.5]. Now consider the intersection set valued map:

S : [0, 1] × [0, T ] ⇒ R p (r, t) → S 1 (r, t) ∩ S 2 (r, t).
It is measurable [2, Lemma 18.4, Item 3] and compact valued. Consider the set Ẽ = {(r, t) ∈ [0, 1] × [0, T ], S(x, t) = ∅}, which is measurable (see discussion after Definition 18.1 in [START_REF] Aliprantis | Infinite Dimensional Analysis[END_REF]). We have that Ẽ ⊂ E because S is empty valued outside of E and Ẽ = {(r, t) ∈ E, d dt M (r, t) ∈ J F (φ(γ(r), t))M (r, t)} by construction. Since for any r ∈ [0, 1], M (r) ∈ U γ (r), it holds for almost all t ∈ [0, T ] that d dt M (r, t) ∈ J F (φ(γ(r), t))M (r, t). In other words, for all r ∈ [0, 1], {t ∈ [0, T ], (r, t) ∈ Ẽ} has full measure. This is by definition of U γ . Therefore, by Fubini's Theorem [START_REF] Royden | Real Analysis Prentice Hall[END_REF]Theorem 16 Section 20.2], Ẽ has full measure.

Set for all (r, t)

∈ [0, 1] × [0, T ], S(r, t) = S(r, t) if S(r, t) = ∅ (that is (r, t) ∈ Ẽ), and J F (φ(γ(r)), t) otherwise, it satisfies S(r, t) ⊂ J F (φ(γ(r), t)) for all (r, t) ∈ [0, 1] × [0, T ]
and has nonempty values. The mapping S is measurable and has non empty closed values [START_REF] Aliprantis | Infinite Dimensional Analysis[END_REF]Theorem 18.13]. Therefore it admits a measurable selection S : [0, 1] × [0, T ] → R p×p , which is the desired function. This achieves the proof.

Remark 5 Given M and S as in Lemma 2, we have by [24, Theorem 2, §1, Chapter1] that, for all r ∈ [0, 1], t → M (r, t) is the unique absolutely continuous solution to

∂ ∂t M (r, t) = S(r, t)M (r, t).
Remark 6 Note that, using the same arguments, the solution mapping U defined at the beginning of the section is also locally bounded and has a closed graph. Indeed, since J F is bounded and φ is Lipschitz, it is clear that U is locally bounded. Then using [24, Corally 1 and Theorem 3, §7,Chapter 2], one deduces that U has a closed graph.

Path differentiability of the flow

This section is devoted to the proof of our main result, conservativity of the mapping defined in (2) for the flow of (1). We first prove that, for any T ≥ 0, the mapping U evaluated at t = T is conservative for the flow evaluated at t = T .

Theorem 1 For all T ≥ 0, the mapping x ⇒ U (x, T ) is conservative for x → φ(x, T ).

Proof : If T = 0, then the statement is obvious. Then, we restrict our analysis to the case where T > 0.

Consider an absolutely continuous path γ :

[0, 1] → R p . Let M : [0, 1] × [0, T ] → R p×p
be a Carathéodory function as in Proposition 1 such that, for all (r, t) ∈ [0, 1] × [0, T ], M (r, t) ∈ U (γ(r), t). Consider the Lebesgue measurable selection S(r, t) ∈ J F (φ(γ(r), t)) for all (r, t) ∈ [0, 1] × [0, T ] as given by Lemma 2, such that, for all r ∈ [0, 1] and almost all t ∈ [0, T ]

∂ ∂t M (r, t) = S(r, t)M (r, t). (7)
In addition, we have, for all r ∈ [0, 1] and all t ∈ [0, T ],

φ(γ(r), t) -γ(r) = s=t s=0 F (φ(γ(r), s))ds, (8)
since φ(γ(r), 0) = γ(r).

Since φ is Lipschitz, for each s ∈ [0, T ], r → φ(γ(r), s) is an absolutely continuous loop. Therefore, it is differentiable at almost all r ∈ [0, 1]. Applying Lemma 3 shows that the function

g : (r, s) → d dr φ(γ(r), s),
is well defined for all s ∈ [0, t] and almost all r ∈ [0, 1], and Lebesgue measurable in (r, s).

Therefore, for all t ∈ [0, T ], for almost all r ∈ [0, 1], it follows from (8) that

g(r, t) -γ(r) = d dr s=t s=0 F (φ(γ(r), s))ds.
The integrand is jointly integrable in (r, s), and absolutely continuous in r for each s. It follows by Lemma 5 that, for all t ≥ 0 and for almost all r ∈ [0, 1]

g(r, t) -γ(r) = s=t s=0 ∂ ∂r F (φ(γ(r), s))ds.
Since F is path differentiable, we have, for all s ∈ [0, t], for almost all r ∈ [0, 1]

∂ ∂r F (φ(γ(r), s)) = J × g(r, s) ∀J ∈ J F (φ(γ(r), s)) = S(r, s)g(r, s),
where S is the Lebesgue measurable selection defined in [START_REF] Bolte | Conservative set valued fields, automatic differentiation, stochastic gradient methods and deep learning[END_REF]. Therefore, by integration, we have, for all t ∈ [0, T ], for almost all r ∈ [0, 1]

g(r, t) -γ(r) = s=t s=0 S(r, s)g(r, s)ds, (9)
Now, we rewrite (7) by integration, for all (r, t)

∈ [0, 1] × [0, T ], using M (r, 0) = I M (r, t) -I = s=t s=0
S(r, s)M (r, s)ds.

Multiplying both sides of the latter equation by γ(r), that is defined for almost all r ∈ [0, 1], one has, for all t ≥ 0, for almost all r ∈ [0, 1]

M (r, t) γ(r) -γ(r) = s=t s=0 S(r, s)M (r, t) γ(r)ds. ( 10
)
Combining both ( 9) and ( 10), we have, for all t ≥ 0, for almost all r ∈ [0, 1]

M (r, t) γ(r) -g(r, t) = s=t s=0 S(r, s)(M (r, s) γ(r) -g(r, s))ds ≤ s=t s=0 S(r, s)(M (r, s) γ(r) -g(r, s)) ds ≤ K s=t s=0 (M (r, s) γ(r) -g(r, s)) ds
where K is a bound on J F given in (4). Integrating with respect to r and using Fubini's theorem, we have, for all t ∈ [0, T ]

r=1 r=0 M (r, t) γ(r) -g(r, t) dr ≤ K s=t s=0 r=1 r=0 (M (r, s) γ(r) -g(r, s)) drds
By Lemma 7, one obtains that, for all t ≥ 0 r=1 r=0 M (r, t) γ(r) -g(r, t) dr = 0.

Therefore, we have, for all t ≥ 0 and all r ∈ [0, 1]

φ(γ(r), t) -φ(γ(0), t) = u=r u=0 g(u, t)du = u=r u=0 M (u, t) γ(u)du.
Since M was an arbitrary Carathéodory function in a countable dense subset of such selections, one can apply Lemma 8. This shows that x ⇒ U (x, t) is conservative for x → φ(x, t). This concludes the proof.

From the latter result, one can deduce that the flow φ is path differentiable for all t ≥ 0. It is stated in the following corollary.

Corollary 1 The mapping (x, t) ⇒ (U (x, t), F (φ(x, t))) is conservative for φ and in particular, φ is path differentiable.

Proof : Consider the following dynamical system on R p+1

Ẏ (s) = α(s)F (Y (s)) (11) α(s) = 0
Consider F : R p+1 → R p+1 the vector field associated to the ODE in [START_REF] Bottou | Optimization methods for large-scale machine learning[END_REF] with the state (Y, α). It is given by

F (Y (s), α) = αF (Y (s)) 0
We can compute a conservative Jacobian for F using the product rule of differential calculus and component-wise aggregation, both valid for conservative Jacobians [7, Lemmas 3 and 5]. We obtain a conservative Jacobian for F as follows:

(x, α) ⇒ αJ F (x) F (x) 0 0 (12)
Denote by φ : R p+1 → R p+1 the flow associated to [START_REF] Bottou | Optimization methods for large-scale machine learning[END_REF], and recall that φ is the flow of the system (1). We have, by a simple rescaling of time, for any x ∈ R p , α ∈ R and any

s ∈ [0, 1] φ(x, αs) = φ(x, α, s). (13)
Setting α = t and s = 1, by Theorem 1, the mapping (x, t) → φ(x, t, 1) = φ(x, t) is path differentiable jointly in (x, t). Let us compute a conservative Jacobian from Theorem 1. The differential inclusion in (2) can be expressed blockwise. Fix x 0 ∈ R p and α 0 ∈ R initial conditions for [START_REF] Bottou | Optimization methods for large-scale machine learning[END_REF] and denote by Y : [0, 1] → R p the solution to [START_REF] Bottou | Optimization methods for large-scale machine learning[END_REF], note that α(t) = α 0 for all t ∈ [0, 1]. Then, one has, for all t ∈ [0, 1], Y (s) = X(α 0 s) where X is the solution to (1) starting at x 0 . Moreover, one has

V1 (s) V2 (s) V3 (s) V4 (s) ∈ α 0 J F (Y (s))V 1 (s) + F (Y (s))V 3 (s) α 0 J F (Y (s))V 2 (s) + F (Y (s))V 4 (s) 0 0 , (14)
where

V 1 ∈ R p×p and V 1 (0) is the identity, V 2 ∈ R p×1 and V 2 (0) = 0, V 3 ∈ R 1×p and V 3 (0) = 0, V 4 ∈ R and V 4 (0) = 1.
It follows that V 3 = 0 and V 4 = 1 for all t and

V1 (s) ∈ α 0 J F (Y (s))V 1 (s) = α 0 J F (X(α 0 s))V 1 (s) V2 (s) ∈ α 0 J F (Y (s))V 2 (s) + F (Y (s)). ( 15
)
The two dynamics are independant. Furthermore, solutions of the first line are also solutions of (2) modulo a simple time rescaling by a factor α 0 . This is more explicitly written V 1 (s) ∈ U (x 0 , αs) for all s ∈ [0, 1], where U is given in [START_REF] Benaïm | Stochastic approximations and differential inclusions[END_REF]. Conversely, any V ∈ U (x 0 , αs) is related to a solution of the first line of [START_REF] Cao | Adjoint sensitivity analysis for differential-algebraic equations: The adjoint DAE system and its numerical solution[END_REF]. Let us show that V 2 : t → sF (X(α 0 s)) is the unique solution to the second line. By path differentiability of F , the function s → F (X(α 0 s)) is differentiable for almost all t, such that

d ds F (X(α 0 s)) = J(X(α 0 s)) d ds X(α 0 s)) ∀J ∈ J F (X(α 0 s)) = α 0 J(X(α 0 s))F (X(α 0 s)) ∀J ∈ J F (X(α 0 s))
The function s → sF (X(α 0 s)) is absolutely continuous and multiplication by s is a differentiable operation. Then, for almost all s ∈ [0, 1], substituting Y for

X d ds [sF (Y (s))] = α 0 J(Y (s)) [sF (Y (s))] + F (Y (s)) ∀J ∈ J F (Y (s)) (16)
Now, given a measurable selection in s → S(s) ∈ J F (Y (s)), the function (s, V 2 ) → S(s)V 2 is Lipschitz in its second argument, so that the corresponding solution V 2 in ( 15) is unique [24, Theorem 2, §1, Chapter 1]. Moreover, by [START_REF] Chen | Neural ordinary differential equations[END_REF], since 0F (Y (0)) = 0, we have

V 2 (s) = sF (Y (s)) for all s ∈ [0, 1]
. This shows that any solution to ( 14) is given by V 3 = 0, V 4 = 1, and for all s ∈ [0, 1],

V 1 (s) ∈ U (x 0 , α 0 s) V 2 (s) = sF (X(α 0 s)).
Thanks to Theorem 1, we have

(x, α) ⇒ (U (x, α), F (φ(x, α))),
is conservative for the mapping (x, α) → φ(x, α, 1). Using the fact that φ(x, α) = φ(x, α, 1) for all x ∈ R p , α ∈ R, this proves the desired result using α = t.

Consequences: backward and forward derivatives

In this section, we focus on an optimization of integral costs under ODE constraint and prove that, as soon as the ODE vector field and the integrand are path differentiable, then the integral cost is itself path differentiable. One should see these results as consecutive results of Sections 3 and 4. We provide further results about forward and backward derivatives propagation with a nonsmooth adjoint system.

Differentiation of a terminal cost

The following result is a direct consequence of Theorem 1 and the fact that product of conservative Jacobian is a also conservative Jacobian, as stated in [7, Lemma 5].

Corollary 2 Let δ T : R p → R be locally Lipschitz and path differentiable. Let D δ T : R p ⇒ R p be conservative gradient for δ T . Then the following set

D T : x ⇒ V u, V ∈ U (x, T ), u ∈ D δ T (φ(x, T )) (17)
is a conservative gradient for x → δ T (φ(x, T )).

Forward propagation of derivatives of integral costs

In this subsection, we show how our framework allows to compute forward derivatives of integral costs. Such results already exist in a nonsmooth context with other classes of functions such as the functions admitting lexicographic derivatives (see e.g., [START_REF] Barton | Computationnally relevant generalized derivatives: theory, evaluation and applications[END_REF]). Note that this result will be instrumental in deriving a backward derivative propagation in the form of an adjoint system.

Theorem 2 Let δ : R p → R be locally Lipschitz and path differentiable. Let D δ : R p ⇒ R p be a conservative Jacobian for δ, with convex values. For T > 0, set

∆(x) = t=T t=0 δ(φ(x, t))dt. ( 18
)
Then the following set valued field is a conservative gradient for ∆,

D ∆ : x ⇒ t=T t=0 V (t) w(t)dt, V ∈ U(x), w ∈ W(x) (19)
where W(x) is the set of measurable selections w(t) ∈ D δ (φ(x, t)) for all t ∈ [0, T ] and x ∈ R p . In particular V could be any solution of (2).

Proof

d k = t=T t=0 V k (t) w k (t)dt, V k ∈ U(x k ), w k ∈ W(x k ) .
The sequence (V k ) k∈N is bounded and Lipschitz (as proven in Lemma 1) uniformly in k, therefore we can use the Arzelá-Ascoli's Theorem [6, Theorem 4.25]: up to a subsequence, V k converges to a given V uniformly on [0, T ]. As detailed in Remark 6, it holds that V ∈ U(x). The sequence (w k ) k∈N is bounded in L 2 ([0, T ]) (and in L ∞ ([0, T ])) so it has a weakly convergent subsequence by [34, Theorem 17, Section 14] whose limit will be denoted by w : [0, T ] → R p . Up to a convex combination, the convergence occurs strongly and therefore pointwise almost everywhere by invoking Mazur's Lemma [START_REF] Brezis | Functional analysis, Sobolev spaces and partial differential equations[END_REF]Corollary 3.8].

We deduce that w(t) ∈ D δ (φ(x, t)) for almost all t ∈ [0, T ] using the fact that D δ has convex values. Combining uniform convergence of V k to V ∈ U(x) and weak convergence of w k to w, we have that d k → t=T t=0 V (t) w(t)dt ∈ D ∆ (x) and d ∈ D ∆ (x) by uniqueness of the limit.

From now on, we fix a Borel measurable selection d ∆ such that d ∆ (x) ∈ D ∆ (x) for all x ∈ R p . This means that, for all x ∈ R p , there is a continuous function V x ∈ U(x) and a measurable function

w x ∈ W(x) such that d ∆ (x) = t=T t=0 V x (t) w x (t)dt.
∂ ∂r δ(φ(γ(r), t)) = γ(r) M v, ∀v ∈ D δ (φ(γ(r), t)), ∀M ∈ U (φ(γ(r), t)). ( 20
)
Denote by E ⊂ [0, 1]×[0, T ] the set where [START_REF] Dafermos | Hyperbolic conservation laws in continuum physics[END_REF] holds. Let us show that this set is Lebesgue measurable.

Consider the function

f : (M, v, r, t) → ∂ ∂r δ(φ(γ(r), t)) -γ(r) T M T v 2 if ∂ ∂r δ
(φ(γ(r), t)) and γ(r) are well defined, and 1 otherwise. The function f is jointly Lebesgue measurable in (r, t) for fixed M and v and jointly continuous in (M, v) for fixed (r, t) ∈ [0, 1] × R + . Then, it is a Carathéodory function. Therefore, the function

f : (r, t) → max ∂ ∂r δ(φ(γ(r), t)) -γ(r) T M T v 2 s.t. v ∈ D δ (φ(γ(t), t)) M ∈ U (φ(γ(r), t))
is Lebesgue measurable thanks to [START_REF] Aliprantis | Infinite Dimensional Analysis[END_REF]Theorem 18.19]. The set {(r, t) ∈ [0, 1]×R + , f (r, t) = 0} is Lebesgue measurable and corresponds to the set where (20) holds. Therefore, [START_REF] Dafermos | Hyperbolic conservation laws in continuum physics[END_REF] holds on a jointly measurable set. Furthermore, since [START_REF] Dafermos | Hyperbolic conservation laws in continuum physics[END_REF] holds for all t ∈ [0, T ] for almost all r ∈ [0, 1], E has actually full measure.

Now consider the set

S = (r, t) ∈ [0, 1] × [0, T ], ∂ ∂r δ(φ(γ(r), t)) = γ(r) V γ(r) (t) w γ(r) (t) .
Clearly, E ⊂ S so that S c ⊂ E c . Moreover, since E c has zero measure we deduce that S c has zero (Lebesgue) measure. Therefore S is measurable jointly in (r, t) and the function (r, t) → γ(r)V γ(r) (t)w γ(r) (t) is also (Lebesgue) measurable [34, Proposition 3, Section 18.1]. From Lemma 5, we have that r → ∆(γ(r)) is absolutely continuous and for almost all r ∈ [0, 1],

d dr ∆(γ(r)) = t=T t=0 ∂ ∂r δ(φ(γ(r), t))dt = t=T t=0 γ(r) V γ(r) (t) w γ(r) (t)dt = γ(r) t=T t=0 V γ(r) (t) w γ(r) (t)dt = γ(r) d ∆ (r).
Note that d ∆ was an arbitrary measurable selection in D ∆ . Since D ∆ has a closed graph, it admits a countable Castaing representation ([2, Corollary 18.14] and [START_REF] Aliprantis | Infinite Dimensional Analysis[END_REF]Theorem 18.20]). Then Lemma 8 applies and conservativity is proved, which leads to the desired result.

Path differentiable adjoint method for integral costs

We describe a path differentiable version of the adjoint method for integral costs under ODE constraints.

Corollary 3 Let δ, δ T : R p → R be locally Lipschitz and path differentiable functions. Let D δ : R p ⇒ R p and D δ T : R p ⇒ R p be conservative Jacobians for δ and δ T , respectively where D δ has convex values.

For any x ∈ R p , any w : [0, T ] → R p measurable such that w(t) ∈ D δ (φ(x, t)) for all t ∈ [0, T ], any J : [0, T ] → R p×p measurable such that J(t) ∈ J F (φ(x, t)) for all t ∈ [0, T ] and any u ∈ D δ T (φ(x, T )), the unique absolutely continuous solution λ : [0, T ] → R p to the system For any absolutely continuous function λ : [0, T ] → R p , we have

λ(t) = -w(t) -J(t) λ(t), λ(T ) = u (
t=T t=0 M (t) w(t)dt = t=T t=0 M (t) w(t) + (J(t)M (t) -J(t)M (t)) λ(t)dt
Using Lemma 9, we have t=T t=0

(J(t)M (t)) λ(t)dt = t=T t=0 Ṁ (t) λ(t)dt = -λ(0) + M (T ) λ(T ) - 0 M (t) λ(t)dt.
Hence, we have for any u ∈ D T (φ(x, T )),

M (T ) u + t=T t=0 M (t) w(t)dt = t=T t=0 M (t) w(t) + J(t) λ(t) + λ(t) dt + M (0)λ(0) + M (T ) (u -λ(T ))
The latter holds for any absolutely continuous function λ, and in particular, using [24, Theorem 2, §1, Chapter 1], one can choose λ as the unique absolutely continuous solution to

λ(t) = -w(t) -J(t) λ(t) (22) λ(T ) = u. ( 23
)
Using the fact that M (0) is the identity, one has finally

M (T ) u + t=T t=0 M (t) w(t)dt =M (0)λ(0) = λ(0).
The term λ(0) being defined as the sum of two specific elements in D ∆ and D T (see Corollary 2 and Lemma 2), this means that λ(0) ∈ D ∆ (x) + D T (x), which concludes the proof.

Remark 7

The system (21) is typically solved backward in time. Setting g : s → λ(T -s), we have, for all s ∈ [0, T ],

g(0) = u ġ(s) = -λ(T -s) = w(T -s) + J(T -s)λ(T -s),
which is the backpropagation equation.

Minimization of integral costs with parameterized ODEs constraints

This section is centered around problem (3). The results combine conservative calculus rules with the elements developed in Section 5.

Problem setting

We consider the optimization problem described in (3) and introduce further notations. First the constraints in (3) relate to the following parametrized ODE, given T > 0, for all

t ∈ [0, T ] Ż(t) := H(Z(t), θ), Z(0) = z, (24)
where θ ∈ R m denotes a vector of parameters and H : R p+m → R p is a Lipschitz path differentiable function. We assume that J H : R p+m ⇒ R p is a conservative Jacobian for H and that it is bounded. We denote ψ(z, θ, t) ∈ R p the flow associated to the ODE [START_REF] Filippov | Differential equations with discontinuous righthand sides: control systems[END_REF]. Throughout this section, z will be a fixed initial condition in R p .

We denote by L I : R m → R the integral part of the loss in (3),

L I : θ → T 0 (ψ(z, θ, t))dt.
Recall that : R p → R is a locally Lipschitz, path differentiable functions from R p to R, we further assume that it admits a conservative gradients, D : R p ⇒ R p with convex values.

Furthermore, we denote by L T : R m → R the integral part of the loss in (3),

L T : θ → T (ψ(z, θ, T )).
Recall again that T : R p → R a locally Lipschitz, path differentiable function and assume that it admits a conservative gradients D T : R p ⇒ R p .

With a slight abuse of notations, problem (3) can be reformulated equivalently as an unconstrained minimization problem with cost L := L I + L T with respect to variable θ, that is,

inf θ∈R m L(θ) = inf θ∈R m T 0 (ψ(z, θ, t))dt + T (ψ(z, θ, T )). (25)
The purpose of this section is to specify the results presented in Section 5 to the parametrized ODE [START_REF] Filippov | Differential equations with discontinuous righthand sides: control systems[END_REF] and cost [START_REF] Hirsch | Differential equations, dynamical systems, and an introduction to chaos[END_REF] in order to address problem (3). This will result in expressions for conservative gradients, D I for L I and D T for L T . Setting D L = D I + D T , the sum of these conservative gradients, we obtain a conservative gradient for L [7, Corollary 4]. To this end, we see the parametrized flow of ( 24) as an unparametrized flow in a lifted space and justify formal differentiation operations using conservative calculus rules [START_REF] Bolte | Conservative set valued fields, automatic differentiation, stochastic gradient methods and deep learning[END_REF] to make connections with results presented in Section 5. This results in an adjoint method which can in turn be used as an oracle for D L . This allows to provide a convergence result for the corresponding small step first order optimization method to seek solutions of problem (25).

Conservative Jacobian of the flow

The following corollary reformulates Theorem 1 in the context of system [START_REF] Filippov | Differential equations with discontinuous righthand sides: control systems[END_REF].

Corollary 4 Let ψ be defined as in equation [START_REF] Filippov | Differential equations with discontinuous righthand sides: control systems[END_REF] with H : R p+m → R p a Lipschitz pathdifferentiable function and J H : R p+m ⇒ R p a bounded conservative Jacobian. Consider the matrix differential inclusion with unknown M ∈ R p×m , for almost all t ∈ [0, T ]

Ṁ (t) = J z (t)M (t) + J θ (t) (26)
J z (t) J θ (t) ∈ J H (ψ(z, θ, t), θ),
with initial condition M (0) = 0 pm ∈ R p×m , where we used block matrix notations in the second line. Then the set {M (T ), M solution to (26)} forms a conservative Jacobian for θ → ψ(z, θ, T ).

In particular, for any T : R p → R, path differentiable with conservative gradient D T and for any z ∈ R p , the following set valued map

D T : (z, θ) ⇒ M (T ) T u, M solution to (26), u ∈ D T (ψ(z, θ, T ))
is a conservative gradient for the function L T : θ → T (ψ(z, θ, T )).

Proof : We first introduce notations allowing to interpret the system (24) as a system of the form (1) on an extended state space R p+m . We rewrite [START_REF] Filippov | Differential equations with discontinuous righthand sides: control systems[END_REF] as follows, for all t ∈ [0, T ]:

Ż(t) = H(Z(t), θ(t)), θ(t) = 0, (27)
Z(0) = z, θ(0) = θ, (28)
We consider X = Z θ ∈ R p+m , the concatenation of the two variables Z ∈ R p and θ ∈ R m . We set, for all such X,

F (X) = H(Z, θ) 0 ∈ R p+m .
With these notations, ( 27) is equivalently rewritten as follows, for all t ∈ [0, T ] Ẋ(t) := F (X(t)),

In this case, ( 27) is in the same form than the one given in (1), and the parameter θ is now seen as an initial condition. Setting

J F (z, θ) : (z, θ) ⇒ J H (z, θ) 0 ,
we have that J F is a conservative Jacobian for F since J H is a conservative Jacobian for H. The variational inclusion (2) for ( 24) can be written as follows, for a.e.

t ∈ [0, T ] Ṁ = Ṁ1 Ṁ2 Ṁ3 Ṁ4 ∈ J H (ψ(z, θ, t), θ)M 0 ( 29
)
where

M 1 (0) = I p ∈ R p×p , M 2 (0) = 0 pm ∈ R p×m , M 3 (0) = 0 mp ∈ R m×p and M 4 (0) = I m ∈ R m×m .
From this equation, M 3 and M 4 remain constant. From [7, Lemma 4] and Theorem 1, the concatenation M 1 M 2 for all solutions to (29) forms a conservative Jacobian for (z, θ) → ψ(z, θ, T ). Let us express this equation in a simpler form.

For any t ∈ [0, T ], and any J ∈ J H (ψ(z, θ, t), θ), writing J = J z J θ where J z ∈ R p×p and J θ ∈ R p×m , with M 3 = 0 mp ∈ R m×p and M 4 = I m ∈ R m×m , we have

JM = J z J θ M 1 M 2 M 3 M 4 = J z M 1 J z M 2 + J θ .
Equation ( 29) is equivalently rewritten, for a.e.

t ∈ [0, T ] Ṁ1 (t) = J z (t)M 1 (t) (30) Ṁ2 (t) = J z (t)M 2 (t) + J θ (t) J z (t) J θ (t) ∈ J H (ψ(z, θ, t), θ), with M 1 (0) = I p ∈ R p×p and M 2 (0) = 0 pm ∈ R p×m .
Using Theorem 1, we have proved that concatenations of the form M 1 (T ) M 2 (T ) where M 1 and M 2 are solutions of (30) form a conservative Jacobian for (z, θ) → ψ(z, θ, T ). Focusing on the dependency in θ for fixed z, and invoking Lemma 11, component M 2 form a conservative field for θ → ψ(z, θ, T ). This proves the corollary.

Remark 8 Using the latter argument, one can also include a dependency of the initial condition in θ, that is Z(0) = z 0 (θ). It suffices to notice that this is a composition of the function (z, θ) → ψ(z, θ, T ) for which we have a conservative Jacobian from [START_REF] Nesterov | Lexicographic differentiation of nonsmooth functions[END_REF] and the function θ → (z 0 (θ), θ) for which we have a conservative Jacobian as long as we know a conservative Jacobian for θ → z 0 (θ). We may then apply the composition rule [7, Lemma 5]. It is also possible to include further dependency in θ for and T with similar lifting techniques.

Differentiation of integral costs and adjoint method

The following corollary is a reformulation of Theorem 2 in the context of [START_REF] Filippov | Differential equations with discontinuous righthand sides: control systems[END_REF], based on Corollary 4.

Corollary 5 Let ψ be defined as in equation [START_REF] Filippov | Differential equations with discontinuous righthand sides: control systems[END_REF] with H : R p+m → R p a Lipschitz pathdifferentiable function and J H : R p+m ⇒ R p a bounded conservative Jacobian. Let : R p → R be a locally Lipschitz, path differentiable functions with conservative gradients D with convex values. For any z ∈ R p , consider the function L I : θ ∈ R m → T 0 (ψ(z, θ, t)dt and the set valued field:

D I : (z, θ) ⇒ t=T t=0 M (t) w(t)dt, M ∈ U(z, θ), w ∈ W(z, θ)
where U(z, θ) is the set of solutions to [START_REF] Kechris | Classical descriptive set theory Springer Science & Business Media[END_REF] and W(z, θ) is the set of measurable functions w : [0, T ] → R p such that w(t) ∈ D (ψ(z, θ, t)) for all t ∈ [0, T ]. For any z ∈ R p , θ ⇒ D I (z, θ) is a conservative gradient for L.

Proof : Using Theorem 2 and the expressions given in [START_REF] Liberzon | Switching in systems and control[END_REF], one knows that the set valued map:

(z, θ) ⇒ t=T t=0 M 1 (t) 0 M 2 (t) I p w(t) 0 dt, M 1 and M 2 solutions to (30), w ∈ D (ψ(z, θ, t))
is a conservative field for the function (z, θ) → T 0 (ψ(z, θ, t))dt. Using Lemma 11, one can deduce that, for every z ∈ R p , the set valued field θ ⇒ D I (z, θ) is a conservative gradient for L I , which concludes the proof.

We have the following adaptation of the adjoint of Corollary 3.

Corollary 6 Let ψ be defined as in equation [START_REF] Filippov | Differential equations with discontinuous righthand sides: control systems[END_REF] with H : R p+m → R p a Lipschitz pathdifferentiable function and J H : R p+m ⇒ R p a bounded conservative Jacobian. Let : R p → R and T : R p → R be locally Lipschitz, path differentiable functions from R p to R with respective conservative gradients D and D T .

For any z ∈ R p , θ ∈ R m , any w : [0, T ] → R p measurable such that w(t) ∈ D (ψ(z, θ, t)) for all t ∈ [0, T ], any J z : [0, T ] → R p×p and J θ : [0, T ] → R p×m , measurable such that J z (t) J θ (t) ∈ J H (ψ(z, θ, t), θ) for all t ∈ [0, T ] and any u ∈ D T (ψ(z, θ, T )), the unique absolutely continuous solution λ : [0, T ] → R p to the system

λ(t) = -w(t) -J z (t) λ(t), λ(T ) = u (31) satisfies T 0 J θ (t) λ(t)dt ∈ D I (z, θ) + D T (z, θ)
which is an element of a conservative gradient for the loss function L in [START_REF] Hirsch | Differential equations, dynamical systems, and an introduction to chaos[END_REF].

Proof : Fix z ∈ R p and θ ∈ R m . Fix w and J z as in the statement of the theorem. This defines a unique M ∈ U(z, θ) by solving (31) Ṁ (t) = J z (t)M (t) + J θ (t) [

(J z (t)M (t) + J θ (t)) λ(t)dt = t=T t=0 Ṁ (t) λ(t)dt = -M (0) λ(0) + M (T ) λ(T ) - 0 M (t) λ(t)dt.
Hence, since M (0) = 0, we have, for any u ∈ D T (ψ(z, θ, T )),

M (T ) u + t=T t=0 M (t) w(t)dt = t=T t=0 M (t) w(t) + J z (t) λ(t) + λ(t) dt + t=T t=0 J θ (t) λ(t)dt + M (T ) (u -λ(T ))
The latter holds for any absolutely continuous function λ, and in particular, using [24, Theorem 2, §1, Chapter 1], one can choose λ as the unique absolutely continuous solution to

λ(t) = -w(t) -J z (t) λ(t), (32) λ
(T ) = u. ( 33
)
One has finally

M (T ) u + t=T t=0 M (t) w(t)dt = t=T t=0 J θ (t) λ(t)dt.
The term t=T t=0 J θ (t) λ(t)dt being defined as the sum of two specific elements in D L and D T (see Corollary 2 and Lemma 2), this means that t=T t=0 J θ (t) λ(t)dt ∈ D L (z, θ) + D T (z, θ), which concludes the proof.

Small step method for optimization

Recall that we are interested in the following problem, for a fixed z ∈ R p and T > 0 inf This constitutes relevant first order information. Indeed, for example the results borrowed from [7, Theorem 1, Corollary 1] ensure the following properties

∂ c L(θ) ⊂ conv{D L (θ)}, for all θ ∈ R m , D L (θ) = {∇L(θ)}, for
θ k+1 = θ k -α k g k (34) g k ∈ D L (θ k ). ( 35
)
We insist on the fact that g k can be obtained for example using Corollary 6. Recall that the set of accumulation points of the sequence (θ k ) k∈N is the set of θ such that, for all r > 0, the set {i ∈ N , θ i -θ < r} is infinite. The following result is a consequence of [9, Theorem 6] about bounded sequences of the form [START_REF] Royden | Real Analysis Prentice Hall[END_REF]. This uses a weaker notion of accumulation point to characterize the fact that the sequence is essentially attracted by critical points, that is points which comply with the necessary optimality condition 0 ∈ conv{D L (θ)}.

Corollary 7 Assume that α k → 0 and k i=0 α i → +∞ as k → +∞. Assume furthermore that the sequence (θ k ) k∈N given by (34) remains bounded. Then the set

Ω = θ ∈ R m , ∀r > 0, lim sup N →∞ 0≤i≤N, θ i -θ <r α i 0≤i≤N α i > 0
is non empty and satisfies Ω ⊂ crit L , where crit L is the set of θ ∈ R m complying with the optimality condition 0 ∈ conv{D L (θ)}.

In the latter corollary, Ω is termed the "essential accumulation set" of the sequence [START_REF] Bolte | Long term dynamics of the subgradient method for Lipschitz path differentiable functions[END_REF]. This is a subset of the set of usual accumulation points of the sequence, corresponding to those accumulation points for which the sequence spends a significant amount of time, as measured with respect to the sum of neighboring step sizes. This result illustrates the minimizing behavior of the sequence [START_REF] Royden | Real Analysis Prentice Hall[END_REF]. The result is quite weak, but provides a solid ground regarding the use of the proposed conservative adjoint method for finite dimensional optimization under ODE constraints. At this level of generality, stronger assumptions, such as Sard type conditions related to the loss L, would be required to obtain stronger statements [START_REF] Rios-Zertuche | Examples of pathological dynamics of the subgradient method for Lipschitz path-differentiable functions[END_REF]. This will be a topic of future research.

Conclusion

In this article, we have proved that flows of ODEs expressed with vector fields that are path differentiable are also path differentiable. The proof of this results stands on the fact that the set valued mapping obtained from the variational inclusion is a conservative Jacobian. This allows to develop a conservative calculus for integral costs, similar as one would have in the smooth case. This culminates with a conservative version of the adjoint method to propagate derivatives backward and obtain gradients of integral costs, with a considerable reduction of the size of the differential inclusion to be solved. A consequence of these results is the fact small step methods of gradient type for minimizing integral costs are attracted by solutions of a certain optimality condition for such problems with path differentiable data.

The developments provided in this work could be extended to parametric partial differential equations (PDEs), this was actually one of the original motivations for the proposed developments. The question of path differentiability of PDEs could be considered under regularity assumption by exhibiting a conservative Jacobian in a way similar to what is proposed for ODE flows. One should probably start with specific sub-classes of PDEs, for instance hyperbolic ones [START_REF] Dafermos | Hyperbolic conservation laws in continuum physics[END_REF].

The following result concerns derivatives of integrals. More precisely, it states and proves that the operators derivatives and integrals can be permutated. This result is closely related to the well-known Leibniz rule, but it concerns in our case absolutely continuous functions. It can be seen then as a general Leibniz rule.

Lemma 5 (General Leibniz rule) Consider a Lipschitz function F : R p × X → R p where X is a bounded interval of R. Consider furthermore an absolutely continuous function γ : [0, 1] → R p . Then, r → X F (γ(r), s)ds is absolutely continuous and for a.e r ∈ [0, 1] :

d dr X F (γ(r), s)ds = X ∂ ∂r F (γ(r), s)ds. (39)
Proof : Since F is Lipchitz continuous and γ is absolutely continuous, then, for all s ∈ X, the function r → F (γ(r), s) is absolutely continuous as the composition of a Lipschitz function with an absolutely continuous function. In particular, it is differentiable for a.e. r ∈ [0, 1].

Furthermore, since the function (r, s) → F (γ(r), s) is continuous, one can prove that, due to Lemma 3, the function:

(r, s) → ∂ ∂r F (γ(r), s) (40)
is well defined for all s ∈ X and for a. Then, using again the fact that, for all s ∈ X, r → F (γ(r), s) is absolutely continuous, then one has, for all s ∈ X and r ∈ [0, 1],

F (γ(r), s) -F (γ(0), s) = This proves the desired result because (39) is a consequence of Lebesgue differentiation theorem [34, Section 6.5], for all q, X ∂ ∂q F (γ(q), s)ds ≤ L γ(q) × X ds where right hand side is integrable because X is a bounded interval and γ is absolutely continuous (its derivative is integrable). This concludes the proof.

Next, we provide a generalization of the Grönwall's inequality for absolutely continuous functions. The proof is inspired by the proof of [START_REF] Filippov | Differential equations with discontinuous righthand sides: control systems[END_REF]Theorem 2].

Lemma 6 (Grönwall's Lemma for absolutely continuous functions) Let K be a constant and f : R + → R + be absolutely continuous on [0, T ] such that, for a.e. t ∈ [0, T ]:

d dt f (t) ≤ Kf (t). ( 43
)
Then, f (t) ≤ exp(Kt)f (0) for all t ∈ [0, T ].

Proof : From the inequality, one has, for a.e. t ∈ [0, T ],

d dt f (t) -Kf (t) exp(-Kt) = d dt (f (t) exp(-Kt)) ≤ 0.
The function t → f (t) exp(-Kt) is absolutely continuous as a product of absolutely continuous functions with bounded domain. One deduces therefore that, for all t ∈ [0, T ], f (t) exp(-Kt)f (t) -f (0) ≤ 0. Then, for all t ∈ [0, T ], f (t) ≤ f (0) exp(Kt), which concludes the proof of the lemma.

Associated to this inequality, one may deduce a Grönwall inequality for integrable functions, as stated in the following lemma.

Lemma 7 (Grönwall's inequality for integrable functions) Let K be a positive constant and f : R + → R + be integrable on [0, T ], such that for all t ∈ [0, T ]

f (t) ≤ K t 0 f (s)ds.
Then f (t) = 0 for all t ∈ [0, T ].

Proof : Let G : t → t 0 f (s)ds. This function is absolutely continuous, nonnegative (since f is nonnegative), and for almost all t ∈ [0, T ], one has d dt G(t) ≤ KG(t). Then, one can apply Lemma 6 and deduce that, for all t ∈ [0, T ], G(t) ≤ exp(Kt)G(0). Therefore, since G(0) = 0 one has G(t) = 0 for all t ≥ 0, which implies that f (t) = 0 since 0 ≤ f (t) ≤ KG(t). This concludes the proof of the lemma.

Finally, we provide a density result showing that for a set valued map D to be conservative for a given function f , it is sufficient to prove a conservativity relation for each element of a Castaing representation of D. The set E i has full measure for each i ∈ N. Then, we define E := ∩ i∈N E i . Since E is a countable intersection of full measure sets, its complement E c has a Lebesgue measure zero.

Therefore, for all t ∈ E, (45) holds for any i ∈ N. Since

for all t ∈ E. Since E has full measure and γ is an arbitrary absolutely continuous path, this shows that D is a conservative Jacobian for f and then concludes the proof of the Lemma.

Another important result is the integration by parts formula for absolutely continuous functions, that is stated as follows. Noticing that, for a.e. t ∈ [0, T ], d dt (f g)(t) = ḟ (t)g(t) + f (t) ġ(t), one obtains the desired result.

We also state and prove a result stating that the space of Lipschitz functions whose domain is a given bounded interval is σ-compact.

  Now, fix an absolutely continuous path γ : [0, 1] → R p . Since δ and φ are Lipschitz functions, and since γ is absolutely continuous, we have that r → ∆(γ(r)) := t=T t=0 δ(φ(γ(r), t))dt, is absolutely continuous. By Corollary 2, for all t ∈ [0, T ], for a.e. r ∈ [0, 1],

21 )

 21 satisfies λ(0) ∈ D ∆ (x)+D T (x) where D ∆ and D T are defined in Corollary 2 and Theorem 2.Proof : Fix x ∈ R p . Fix w and J as in the statement of the corollary. This defines a unique M ∈ U(x) by solving (2) Ṁ (t) = J(t)M (t) with M (0) = I [24, Theorem 2, §1, Chapter 1].

  z, θ, t))dt + T (ψ(z, θ, T )),where the integral cost is L I and the terminal cost is L T and their sum is denoted by L. Given θ ∈ R m , Corollary 6 allows to obtain an element of D L (θ) = D I (θ) + D T (θ).

  Lebesgue almost all θ ∈ R m , where ∂ c denotes the Clarke subgradient [18, Chapter 2]. As detailed in [7, Section 6], elements of D L can be used in place of gradients in an optimization context. Given a sequence of positive step sizes (α k ) k∈N and θ 0 ∈ R m , one can iterate the following recursion

  e. r ∈ [0, 1]. It is also jointly measurable in (r, s) (up to arbitrary values outside of its full measure domain of definition). Denoting by L a Lipschitz constant of F , we have we have for all s and almost all r ∂ ∂r F (γ(r), s) ≤ L γ(r) (41) by definition of the derivative.

  (q), s)dq. (42)Integrating the previous equation over the domain X leads toX [F (γ(r), s) -F (γ(0), s)]ds = q), s)dqds.Since the function given by (40) is jointly measurable, Fubini's theorem[START_REF] Aliprantis | Infinite Dimensional Analysis[END_REF] Theorem 11.27] applies and one has for all r ∈ [0, 1] X [F (γ(r), s) -F (γ(0), s)]ds =

Lemma 8 ( 0 M

 80 Measurable selections and density) Consider a set-valued map D : x ∈ R p ⇒ D(x) ∈ R p that is locally bounded and has non empty values and a closed graph. Consider a sequence of measurable selections in D, denoted by {M i } i∈N , such that, for allx D(x) = {M i (x)} i∈N .Then, for a given function f ; R p → R, if, for all i ∈ N and for all absolutely continuous path γ : [0, 1] → R p , one has, for all t ∈ [0, 1]f (γ(t)) -f (γ(0)) = t i (γ(s)) γ(s)ds, (44)then D is a conservative Jacobian for f .Proof : Fix an absolutely continuous path γ. By assumption, since D is locally bounded, we have that f is locally Lipschitz and therefore f • γ is absolutely continous.For each i ∈ N, by Lebesgue integration theorem,d dt f (γ(t)) = M i (γ(t)) γ(t), for a.e. t ∈ [0, 1]. (45)For i ∈ N, consider the set defined by E i := {t ∈ [0, 1] such that (45) holds} ⊂ [0, 1].

  {M i (γ(t))} i∈N = D(γ(t)), we have d dt f (γ(t)) = W γ(t), ∀W ∈ D(γ(t)),

Lemma 9 ( 0 f

 90 Integration by parts) Consider two absolutely continuous functions f, g : [0, T ] → R p . Then, the following integration by parts formula holdsT (t) ġ(t)dt = f (T )g(T ) -f (0)g(0)-Since f and g are absolutely continuous with bounded domains, then the product f g is absolutely continuous. By definition of absolutely continuous functions, one has T 0 d dt (f g)(t)dt = f (T )g(T ) -f (0)g(0).

  Using Proposition 1, U γ admits a Castaing representation as the closure of a countable dense set of Carathéodory selections. It remains to show that the functions composing this representation satisfy the claimed differential equation and to construct the proposed S.Fix M an element of this Castaing representation. With a slight abuse of notation, for the rest of this proof, we will see M as a function of (r, t) by identifying M with (r, t) → M (r, t). As a Carathéodory function, M is jointly Borel measurable in r and t as stated in[2, Lemma 4.51]. Denote by ∂ ∂t M the partial derivative of M with respect to t when it exists. Since M is Lipschitz (hence absolutely continuous) with respect to t, for any r ∈ [0, 1], ∂ ∂t M (r, t) is defined for almost all t ∈ [0, T ]. Consider the set E ⊂ [0, 1] × [0, T ] the set where ∂ ∂t M (r, t) exists. By Lemma 3, E has full Lebesgue measure and (r, t) → ∂ ∂t M (r, t) is Lebesgue measurable. Furthermore, for all r ∈ [0, 1], {t ∈ [0, T ], (r, t) ∈ E} has full measure by Lipschicity of M in the variable t for fixed r. The set E is a measure space with the induced subspace measure.

	Consider the function

Lemma 2

The map U γ is locally bounded, has a closed graph, is Borel measurable and admits a countable collection of dense Carathéodory selections M : [0, 1] × [0, T ] → R p×p which are absolutely continuous in time and Borel measurable in r. For each such M , there is a Lebesgue measurable selection S(r, t) ∈ J F (φ(γ(r), t) for all (r, t) ∈ [0, 1] × R, such that, for all r ∈ [0, 1] and for almost all t ∈ [0, T ], ∂ ∂t M (r, t) = S(r, t)M (r, t).

Proof : Since J F is bounded, φ is Lipschitz and γ is absolutely continuous, one can deduce that U γ is locally bounded. Using the fact that γ is absolutely continuous (and therefore has a closed graph) and invoking [24, Corollary 1 and Theorem 3, §7, Chapter 2], one can deduce that U γ has a closed graph.

:

  We prove first that D ∆ has a closed graph, nonempty values and is locally bounded. Both U(x) and W(x) are nonempty valued and locally bounded thanks to the local boundedness of D δ , φ and U proved in Lemma 1. Therefore D ∆ is locally bounded and nonempty valued. Second, we sketch the proof of graph closedness. Consider a sequence (x k ) k∈N converging to x, and (d k ) k∈N converging to d, such that, for each k ∈ N, the sequence (d k ) k∈N is defined by

  24, Theorem 2, §1, Chapter 1].For any absolutely continuous function λ : [0, T ] → R p , we have

	t=T
	M (t) w(t)dt =
	t=0
	t=T
	M (t) w(t) + (J z (t)M (t) + J θ (t) -J z (t)M (t) -J θ (t)) λ(t)dt
	t=0
	Using Lemma 9, we have
	t=T
	t=0

Acknowledgements

Edouard Pauwels acknowledges the support of AI Interdisciplinary Institute ANITI funding, through the French "Investing for the Future -PIA3" program under the Grant agreement ANR-19-PI3A0004, Air Force Office of Scientific Research, Air Force Material Command, USAF, under grant numbers FA9550-19-1-7026, FA9550-18-1-0226, and ANR MaSDOL 19-CE23-0017-01.

A Technical results

This appendix is devoted to the statement and the proof of some crucial results for our analysis.

The following result is about the Borel measurability of partial derivatives. Its proof is inspired by [START_REF] Evans | Measure theory and fine properties of functions[END_REF]Theorem 3.2].

Lemma 3 (Measurability of partial derivatives) Consider a function G : (x, y) ∈ R n × R → G(x, y) ∈ R m . Suppose that, for all x ∈ R n , y → G(x, y) is absolutely continuous, and for all y, x → G(x, y) is Borel measurable. Then, the function (x, y) → ∂ ∂y G(x, y) defined on a set of full Lebesgue measure and is measurable. Futhermore, for all x, the function y → ∂ ∂y G(x, y) exists for almost all t.

Proof :

As a Carathéodory function, G is jointly Borel measurable [2, Lemma 4.51] and therefore it is Lebesgue measurable. Consider the functions:

and

with h ∈ R.

Using the continuity of G in its second argument, one has the equivalent definition [START_REF] Stechlinski | Generalized derivatives of differentialalgebraic equations[END_REF] by

For all k ≥ 1, the set {h ∈ Q | 0 < |h| < 1 k } is countable and therefore, using Lemma [34, Corollary 7, Section 18.1], the supremum in [START_REF] Valadier | Entraînement unilatéral, lignes de descente, fonctions lipschitziennes non pathologiques[END_REF] is Lebesgue measurable as the countable supremum of measurable functions. This implies that the sequence sup

k∈N is a bounded, decreasing sequence of measurable functions and it has therefore a pointwise limit everywhere. Using [34, Chapter 18, Corollary 7], the pointwise limit of measurable functions is a measurable function. This implies that G u y defined in [START_REF] Valadier | Entraînement unilatéral, lignes de descente, fonctions lipschitziennes non pathologiques[END_REF] or equivalently in [START_REF] Stechlinski | Generalized derivatives of differentialalgebraic equations[END_REF] is Lebesgue measurable. By a similar argument, one can show that (37) is also measurable.

It remains to prove that the function (x, y) → ∂ ∂y G(x, y) exists Lebesgue almost everywhere. To do so, consider the Lebesgue measurable set where I A is the function such that I A (x, y) = 1 if (x, y) ∈ A and 0 otherwise. By Lebesgue integration theorem [34, Theorem 10, Section 6.5], the inner integral is zero because of the absolute continuity in y for fixed x. This shows that the function (x, y) → ∂ ∂y G(x, y) exists for Lebesgue almost all (x, y) ∈ R n+1 . Furthermore, up to an arbitrary measurable choice outside of its domain of definition, it is a Lebesgue measurable function. This concludes the proof of Lemma 3.

We also state a useful result which states that every lower semicontinuous functions are Borel measurable.

Lemma 4 Given X a metric space, let f : X → R be a lower semicontinuous real function. Then, it is Borel measurable.

Proof : The function f being lower semicontinuous, the set

It is in particular a Borel set, which implies that f is Borel measurable. This concludes the proof.

Lemma 10

The space L of L Lipschitz functions from [0, T ] to R q , equipped with the suppremum norm • ∞ , is σ-compact and Hausdorff.

Proof : For any ū ∈ L and v ∈ L, with ū = v we have ū -v ∞ > 0 and therefore

form two disjoint neighborhoods of ū and v and we have Hausdorff separation condition. Furthermore, denoting by B ∞ (s) the ball centered at 0 of radius s > 0 in L, we have L = ∪ i∈N L ∩ B ∞ (i). Since all the functions of this set are L-Lipschitz and bounded, each element of the union is sequentially compact using Arzelà-Ascoli Theorem [START_REF] Brezis | Functional analysis, Sobolev spaces and partial differential equations[END_REF]Theorem 4.25]. Thus L is a countable union of compact subspaces, meaning that the space L is σ-compact.

We now state and prove a result dealing with the projection of conservative Jacobians.

Lemma 11 Let G(x, y) : R p+m → R n be a path-differentiable function whose conservative Jacobian is denoted by J G : R p+m ⇒ R n×(p+m) . Consider

Then, for all x ∈ R p , Π y J G (x, y) is conservative for the function y → F (x, y). is also an absolute continuous function. Then, for every x ∈ R p , it is clear that J F (γ(t)) γ(t) = Π y J F (x, γ(t)) γ(t).

From this identity, and by definition of the conservativity, one can show that, for every x ∈ R p , Π y J F (x, γ(t)) is conservative for y → G(x, y), which concludes the proof.