Romuald Elie
email: romuald.elie@univ-mlv.fr.

Thibaut Mastrolia
email: thibaut.mastrolia@polytechnique.edu

Dylan Possamaï
email: possamai@cere-made.dauphine.fr.

A tale of a Principal and many many Agents *

Keywords: Moral hazard, mean field games, McKean-Vlasov SDEs, mean field FBSDEs, infinite dimensional HJB equations AMS 2000 subject classifications: Primary: 91A13. Secondary: 93E20, 60H30. JEL subject classifications: C61, C73, D82, D86, J33

.

Introduction

To quote Mary Kom 1 before the 2012 summer olympic games, "the incentive of a medal at the biggest sporting arena in the world is what drives me. Before I hang my gloves, I want to win the Olympic medal, and my performance at London will decide my future in the sport." When it comes to make an effort in order to achieve a financial, economical, political or personal project, the notion of incentives becomes fundamental and strongly determines the dynamic of the associated project. Many crucial questions in finance and economics are, at their heart, a matter of incentives. How can the government motivate banks and key players in the financial sector to act for the global interest? How can a firm encourage customers to consume (if possible responsibly and economically)? How can an employer motivate her employees to produce more efficiently?

As the above examples make it clear, these questions naturally lead to distinguish between two entities: a Principal, who is the one proposing to the second entity, the Agent, a contract. The Agent can accept or reject the proposed contract, for instance if he has outside opportunities, but is then committed to it. Of course such a contract will in general involve some kind of effort from the Agent, in exchange of which he receives some sort of compensation, paid by the Principal. The main issue for the Principal is then that, most of the time, he is has only partial information about the actions of the Agent, and does not necessarily observe them. This kind of asymmetry of information leads to a situation which is classically called in the literature "moral hazard". The problem of the Principal is then to design a contract for the Agent, which maximises his own utility, and which of course is accepted by the Agent. This situation is then reduced to finding a Stackelberg equilibrium between the Principal and the Agent. More precisely, one can proceed in two steps to solve these type of problems:

• given a fixed contract, the Principal computes the best reaction effort of the Agent.

• Then, the Principal solves his problem by taking into account the best reaction effort of the Agent and computes the associated optimal contract. This so-called contract theory has known a renewed interest since the seminal paper of Holmström and Milgrom [START_REF] Holmström | Aggregation and linearity in the provision of intertemporal incentives[END_REF], which introduced a convenient method to treat them in a continuous time setting 2 . It was then extended by Schättler and Sung [START_REF] Schättler | The first-order approach to the continuous-time principal-agent problem with exponential utility[END_REF][START_REF] Schättler | On optimal sharing rules in discrete-and continuous-time principal-agent problems with exponential utility[END_REF], Sung [START_REF] Sung | Linearity with project selection and controllable diffusion rate in continuous-time principal-agent problems[END_REF], Müller [START_REF] Müller | The first-best sharing rule in the continuous-time principal-agent problem with exponential utility[END_REF][START_REF] Müller | Asymptotic efficiency in dynamic principal-agent problems[END_REF], Hellwig and Schmidt [START_REF] Hellwig | Discrete-time approximations of the Holmström-Milgrom Brownian-motion model of intertemporal incentive provision[END_REF], and of course the well-known papers of Sannikov [START_REF] Sannikov | A continuous-time version of the principal-agent problem[END_REF][START_REF] Sannikov | Contracts: the theory of dynamic principal-agent relationships and the continuous-time approach[END_REF], using an approach based on the dynamic programming and martingale optimality principles, two well-known tools for anyone familiar with stochastic control theory 3 . More recently, this approach has been revisited by Cvitanić, Possamaï and Touzi in [START_REF] Cvitanić | Moral hazard in dynamic risk management[END_REF][START_REF] Cvitanić | Dynamic programming approach to principal-agent problems[END_REF],

where the authors propose a very general approach which not only encompasses, but goes further than the previous literature. They showed that, under an appropriate formulation of the problem,

• given a fixed contract, the problem of the Agent can always be interpreted in terms of a so-called second order BSDE (see Cheridito, Soner, Touzi and Victoir [START_REF] Cheridito | Second-order backward stochastic differential equations and fully nonlinear parabolic pdes[END_REF], Soner, Touzi and Zhang [START_REF] Soner | Wellposedness of second order backward SDEs[END_REF] and Possamaï, Tan and Zhou [START_REF] Possamaï | Stochastic control for a class of nonlinear kernels and applications[END_REF]), and,

• the Principal's problem can be rewritten as a standard stochastic control problem with in general two state variables, namely the output controlled by the Agent, and his continuation utility.

One arguably non-realistic aspect of the above literature is that in practice, one would expect that the Principal will have to enter in contracts with several Agents, who may have the possibility of interacting with, or impacting each other. This situation is known in the literature as multi-Agents model. In a one-period framework, this problem was studied by Holmström [START_REF] Holmström | Moral hazard in teams[END_REF], Mookherjee [START_REF] Mookherjee | Optimal incentive schemes with many agents[END_REF], Green and Stokey [START_REF] Green | A comparison of tournaments and contracts[END_REF], Harris, Kriebel and Raviv [START_REF] Harris | Asymmetric information, incentives and intrafirm resource allocation[END_REF], Nalebuff and Stiglitz [START_REF] Nalebuff | Prizes and incentives: towards a general theory of compensation and competition[END_REF] or Demski and Sappington [START_REF] Demski | Optimal incentive contracts with multiple agents[END_REF] among others. Extensions to continuous-time models were investigated by Koo, Shim and Sung [START_REF] Koo | Optimal multi-agent performance measures for team contracts[END_REF] and very recently by Élie and Possamaï [START_REF] Élie | Contracting theory with competitive interacting agents[END_REF]. In a model with competitiveness amongst the Agents, assumed to work for a given firm controlled by the Principal, [START_REF] Élie | Contracting theory with competitive interacting agents[END_REF] shows that the general approach initiated by [START_REF] Cvitanić | Dynamic programming approach to principal-agent problems[END_REF] has a counterpart in the N -Agents case as follows

• given fixed contracts for all the Agents, finding a Nash equilibria between them can be reduced to finding a solution to a multidimensional BSDE with quadratic growth in general, and,

• the Principal's problem can once more be rewritten as a standard stochastic control problem with in general 2N state variables, namely the outputs controlled by the Agents, and their continuation utilities.

The main issue here is that unlike with one-dimensional BSDEs or 2BSDEs, for which there are well established wellposedness theories, multi-dimensional systems are inherently harder. Hence, existence and uniqueness of solutions to systems of quadratic BSDEs have been shown to not always hold by Frei and dos Reis, and and have been subject to in-depth investigations, see for instance the very recent works of Xing and Žitković [START_REF] Xing | A class of globally solvable Markovian quadratic BSDE systems and applications[END_REF], or Harter and Richou [START_REF] Harter | A stability approach for solving multidimensional quadratic BSDEs[END_REF], as well as the references therein. [START_REF] Élie | Contracting theory with competitive interacting agents[END_REF] circumvents this problem by imposing wellposedness as a requirement for the admissibility of the contracts proposed by the Principal. Such a restriction would seem, a priori, to narrow down the scope of the approach, but the authors show that in general situations, the optimal contracts obtained are indeed admissible in the above sense.

The current paper can be understood as a continuation of [START_REF] Élie | Contracting theory with competitive interacting agents[END_REF], and considers the situation where one lets the number of Agents contracting with the Principal become very large. Let us explain why, from our point of view, such a regime is nowadays becoming more and more relevant. One key point is that the growth of our population keeps on increasing, and naturally leads to more and more situations where one has to understand the behaviour of an extremely large set of interacting Agents. One could for instance think about how a firm should provide electricity to a large population, how a government should encourage firms or people to invest in renewable energy by giving fiscal incentives, how city planners should regulate a heavy traffic or a crowd of people... The study of a large number of interacting players is also relevant for the so-called systemic risk theory, which consists in studying financial entities deeply interconnected and strongly subjected to the states of the others. One can for instance consider a large number of banks reaching a default before a given horizon, and study the underlying contagion phenomenon. We refer to the works of Carmona, Fouque and Sun [START_REF] Carmona | Mean field games and systemic risk[END_REF], Garnier, Papanicolaou and Yang [START_REF] Garnier | Diversification in financial networks may increase systemic risk[END_REF][START_REF] Garnier | Large deviations for a mean field model of systemic risk[END_REF], and more generally to the book of Fouque and Langsam [START_REF] Fouque | Handbook on systemic risk[END_REF] for more details. Contagion effects have also been studied by Carmona and Lacker [START_REF] Carmona | Mean field games of timing and models for bank runs[END_REF] or Nutz [START_REF] Nutz | A mean field game of optimal stopping[END_REF], in the context of models for bankruns. All these questions rely on the celebrated mean field game theory introduced by Lasry and Lions [START_REF] Lasry | Jeux à champ moyen. i-le cas stationnaire[END_REF][START_REF] Lasry | Jeux à champ moyen. ii-horizon fini et contrôle optimal[END_REF][START_REF] Lasry | Mean field games[END_REF] and independently by Huang, Caines and Malhamé [START_REF] Huang | An invariance principle in large population stochastic dynamic games[END_REF][START_REF] Huang | Large-population cost-coupled LQG problems with nonuniform agents: Individual-mass behavior and decentralized ε-Nash equilibria[END_REF][START_REF] Huang | The Nash certainty equivalence principle and McKean-Vlasov systems: an invariance principle and entry adaptation[END_REF][START_REF] Huang | Large population stochastic dynamic games: closed-loop McKean-Vlasov systems and the Nash certainty equivalence principle[END_REF]. Mean field games theory (MFG for short) consists in the modelling of a large set of identical players who have the same objectives and the same state dynamics. Each of them has very little influence on the overall system and has to take a decision given a mean field term driven by the others. The problem is then to find an equilibrium for the studied system. We refer to the notes of Cardaliaguet [START_REF] Cardaliaguet | Notes on mean field games (from P.-L. Lions' lectures at Collège de France)[END_REF] and to the book of Bensoussan, Frehse and Yam [START_REF] Bensoussan | Mean field games and mean field type control theory[END_REF] for nice overviews of this theory. A relevant question to deal with this kind of problems is to understand how the Nash equilibrium associated with the N -players model evolves and its link with the MFG equilibrium, or the behaviour of the players in the equilibrium itself. Several papers have investigated it using different approaches for different models, see among others Lacker [START_REF] Lacker | A general characterization of the mean field limit for stochastic differential games[END_REF] who gives a weak formulation of the convergence of the Nash equilibrium, Carmona and Lacker in [START_REF] Carmona | A probabilistic weak formulation of mean field games and applications[END_REF] who gives a probabilistic weak formulation of the problem, Cardaliaguet [START_REF] Cardaliaguet | Long time average of first order mean field games and weak KAM theory[END_REF] and Cardaliaguet, Lasry, Lions and Porretta [START_REF] Cardaliaguet | Long time average of mean field games[END_REF][START_REF] Cardaliaguet | Long time average of mean field games with a nonlocal coupling[END_REF] for the asymptotic behaviour of the equilibrium as the horizon goes to +∞.

An interesting extension to this theory has been proposed by Huang in [START_REF] Huang | Large-population LQG games involving a major player: the Nash certainty equivalence principle[END_REF], where he studies a situation where a major player (also called dominating player) interacts with a large number of individually insignificant minor players. More precisely, the major player has a big impact on every minor players through their cost functionals, whereas the actions of each minor player only contribute to the mean field terms in the individual dynamics and costs. Obviously, such a problem is reminiscent of the situation we are considering, since the major player could be considered as the Principal. However, the Principal-Agent problem considers a Stackelberg equilibrium between one Principal and the mean field equilibrium between the Agents, which is fundamentally different from the Nash equilibrium situation of a simple MFG. This model has been investigated later by Bensoussan, Chau and Yam [START_REF] Bensoussan | Mean field games with a dominating player[END_REF][START_REF] Bensoussan | Mean field Stackelberg games: aggregation of delayed instructions[END_REF] using a stochastic Hamilton-Jacobi-Bellman approach, and Carmona and Zhu in [START_REF] Carmona | A probabilistic approach to mean field games with major and minor players[END_REF] using a purely probabilistic approach linked to a type of SDE depending on mean field term, known as McKean-Vlasov SDEs. Such SDEs have a long history which can traced back to propagation of chaos problems, see for instance the famous course of Sznitman [START_REF] Sznitman | Topics in propagation of chaos[END_REF]. However, the associated optimal control problems, also coined mean-field type control problems and which, as will be seen below, lie at the very heart of our approach, are a lot more difficult, and have only been approached recently in the literature, using the stochastic maximum principle on the one hand, see among others Andersson and Djehiche [START_REF] Andersson | A maximum principle for SDEs of mean-field type[END_REF], Meyer-Brandis, Øksendal, Zhou [START_REF] Meyer-Brandis | A mean-field stochastic maximum principle via malliavin calculus[END_REF], Carmona, Delarue and Lachapelle [START_REF] Carmona | Control of McKean-Vlasov dynamics versus mean field games[END_REF], Carmona and Delarue [START_REF] Carmona | Forward-backward stochastic differential equations and controlled McKean-Vlasov dynamics[END_REF], or the dynamic programming principle, see Laurière and Pironneau [START_REF] Lauriére | Dynamic programming for mean-field type control[END_REF], or Pham and Wei [START_REF] Pham | Bellman equation and viscosity solutions for mean-field stochastic control problem[END_REF][START_REF] Pham | Discrete time McKean-Vlasov control problem: a dynamic programming approach[END_REF][START_REF] Pham | Dynamic programming for optimal control of stochastic McKean-Vlasov dynamics[END_REF].

Let us now describe in further details our problem. We focus our attention on the situation where the Principal has to hire infinitely many Agents who are supposed to be identical, and who can control the drift of an output process, representing the project that the Agent has to manage on behalf of the Principal. The value of this project is affected through his drift by both its law, and the law of the control, representing both the aggregated impact of the other Agents. After presenting the N -players model and introducing notations, we provide a weak formulation of the mean-field version of this model, inspired by [START_REF] Carmona | A probabilistic weak formulation of mean field games and applications[END_REF]. We then proceed to show that solving the mean field system associated with the Agent's problem is equivalent to solving a kind of mean field BSDE 4 . Even though such objects are actually easier to investigate than the aforementioned systems of quadratic BSDEs, it remains that their wellposedness requires in general very strong assumptions, see [START_REF] Carmona | A probabilistic weak formulation of mean field games and applications[END_REF]. Following in the footsteps of [START_REF] Élie | Contracting theory with competitive interacting agents[END_REF], we therefore embed wellposedness into the definition of an admissible contract. All of this is proved in Section 4.

Once this is done, we are on the right track traced by [START_REF] Cvitanić | Dynamic programming approach to principal-agent problems[END_REF], and turn to the Principal's problem in Section 5. The latter can then be shown to be equivalent to solving a (difficult) mean-field type control problem with the expected two states variables. We believe this result to be our main technical and practical contribution, since this paper is the first, to the best of our knowledge, in the literature to solve general mean-field Principal-Agent problems 5 . This opens up the way to considering extremely rich situations of interactions between many Agents, with subtle ripple effects.

We next apply in Section 6 our general results to specific examples. More precisely, we consider an extension of Holmström and Milgrom [START_REF] Holmström | Aggregation and linearity in the provision of intertemporal incentives[END_REF] to the mean-field case, where the drift of the output process is a linear function of the effort of the Agent, the output itself, its mean, its variance and the mean of the effort of the Agent. In particular, we show that the optimal effort is deterministic, by providing a smooth solution to the HJB equation associated with the Principal's problem. We then extend this example to the case where the Principal is no longer risk-neutral, and adopts a mean-variance attitude, in the sense that his criterion is impacted by both the variance of the output (he does not want projects with volatile values) and the variance of the salary given to the Agent (he does not want to create discrimination inside the firm, and looks for homogeneity). Our final point concerns the rigorous links between the N -players' model and the mean-field limit. Proving the convergence in a general setting is an extremely hard problem, see for instance the recent article of Cardaliaguet, Delarue, Lasry and Lions [START_REF] Cardaliaguet | The master equation and the convergence problem in mean field games[END_REF], which shows some results that could not be applied to our case in more than a 100 pages manuscript. Therefore, we have concentrated our attention to the above examples, and showed in this context that the optimal contract in the N -Agents' model, as well as their optimal actions, indeed converged to the mean-field solution.

General notations: Let R be the real line, R + the non-negative real line and R ⋆ + the positive real line. Let m and n be two positive integers. We denote by M m,n (R) the set of matrices with m rows and n columns, and simplify the notations when m = n, by using M n (R) := M n,n (R). We denote by I n ∈ M n (R) the identity matrix of order n. For any M ∈ M m,n (R), we define M ⊤ ∈ M n,m as the usual transposition of the matrix M . For any x ∈ R n , we set diag(x) ∈ M n (R) such that (diag(M )) i,j = 1 i=j x i , 1 ≤ i, j ≤ n. We denote by 1 n,n the matrix with coefficients (1 n,n ) i,j = 1 for any 1 ≤ i, j ≤ N . We will always identify R n with M n,1 (R). Besides, for any X ∈ R n , we denote its coordinates by X 1 , . . . , X n . We denote by • n the Euclidian norm on R n , which we simplify to |•| when N = 1. The associated inner product between x ∈ R n and y ∈ R n is denoted by x • y. We also denote by 0 n and 1 n the n-dimensional vector (0, . . . , 0) ⊤ and (1, . . . , 1) ⊤ respectively and (e i ) 1≤i≤N the canonical basis of R N . Similarly, for any X ∈ R n , we define for any i = 1, . . . , n, X -i ∈ R n-1 as the vector X without its ith component, that is to say

X -i := (X 1 , . . . , X i-1 , X i+1 , . . . , X n ) ⊤ . For any X, Y in R N we will write X ≤ Y for the classical lexicographic order i.e. X ≤ Y if X i ≤ Y i , ∀1 ≤ i ≤ N . Finally, for any (a, ã) ∈ R × R n-1
, and any i = 1, . . . , n, we define the following n-dimensional vector a ⊗ i ã := (ã 1 , . . . , ãi-1 , a, ãi , . . . , ãn-1 ).

For any Banach space (E, • E ), let f be a map from E × R n into R. For any x ∈ E, we denote by ∇ a f (x, a) the gradient of a -→ f (x, a), and we denote by ∂ aa f (x, a) the Hessian matrix of a -→ f (x, a).

When n = 1, we write f a (x, a) for the derivative of f with respect to the variable a.

Finally, we denote by D the set of deterministic function from [0, T ] into R.

2 From the N -players game...

Stochastic basis and spaces

In this section we recall some notations used in [START_REF] Carmona | A probabilistic weak formulation of mean field games and applications[END_REF]. Fix a positive integer N and a positive real number T . In this paper, as soon as N = 1, we will simplify the notations by removing the indexation for any object defined with the index N . For any measurable space (S, F S ), we will denote by P(S) the set of probability measures on S. Let (E, • E ) be a Banach space. We will always refer to the Borel sets of E (associated to the topology induced by the norm • E ) by B(E). We will also endow this set with the topology induced by the weak convergence of probability measures, that is to say that a sequence (m n ) n in P(E) converges weakly to m ∈ P(E) if for any continuous map ϕ : E -→ E, we have

lim n→+∞ E ϕ(x)dm n (x) = E ϕ(x)dm(x).
This convergence is associated to the classical Wasserstein distance of order p ≥ 1, defined for any µ and ν in P(E) by

W E,p (µ, ν) = inf π∈Γ(µ,ν) E x -y p E π(dx, dy) 1 p
, where Γ(µ, ν) denotes the space of all joint distributions with marginal laws µ and ν. More precisely, convergence in the Wasserstein distance of order p is equivalent to weak convergence plus convergence of the first pth moments.

Let C N := C([0, T ]; R N ) be the space of continuous maps from [0, T ] into R N , endowed with the norm ω T,∞ , where for any t ∈ [0, T ], we have defined

ω t,∞ = sup s∈[0,t] ω s N .
We denote Ω N := R N × C N , and define the coordinate processes in the space Ω N by

ψ N (x, ω) := x, W N (x, ω) := ω, ∀(x, ω) ∈ Ω N .
We fix a probability measure λ N 0 in P(R N ), which will serve as our initial distribution for the state of the different Agents of the model. We will always assume that λ N 0 has exponential moments of any order, that is to say

R N exp(px)λ N 0 (dx) < ∞, for any p ≥ 0. (2.1)
We denote by P the product of λ N 0 with the Wiener measure defined on B(C N ). For any t ∈ [0, T ], we define F t as the P-augmentation of the σ-field σ((ψ N , W N s ) s∈[0,t] ), as well as the filtration F := (F t ) t∈[0,T ] . The filtered probability space we will be interested in is (Ω N , B(Ω N ), F, P). Expectations or conditional expectations under P will be denoted by

E[•] and E[•|•].
We also denote by T [0,T ] the set of F-stopping times which take value in [0, T ].

For any finite dimensional normed space (E, • E ), P(E) (resp. P r (E)) will denote the set of E-valued, F-adapted processes (resp. F-predictable processes) and for any p ≥ 1 and ℓ > 0

S p (E) := Y ∈ P(E), càdlàg, such that Y p S p (E) := E sup t∈[0,T ] Y t p E < +∞ , E(E) := {Y ∈ P(E), càdlàg and such that E [exp (p Y E )] < +∞, ∀p ≥ 1} , H p (E) := Z ∈ P r (E), Z p H p := E T 0 Z t 2 E dt p/2 < +∞ , H ℓ exp (E) := Z ∈ P r (E), E exp m T 0 Z t ℓ E dt < +∞, ∀m ≥ 1 .
A map X : [0, T ] × C N will be called F-progressive if for any (x, x ′ ) ∈ C N × C N such that for some t ∈ [0, T ], x •∧t = x ′ •∧t , we have X(s, x) = X(s, x ′ ), for any s ≤ t.

Fix some σ-algebra G on (Ω N , B(Ω N ). For any E-valued and G-measurable random variable F on Ω N , we denote by L(F ) := P • F -1 ∈ P(Ω N ) the law of F under P and for any p > 0, we set

L p (Ω N , G, E) := F : Ω N -→ E, G-measurable, s.t. E[ F p E ] < +∞ .

Controls, drift, volatility, cost and discount factor

The problems that we will consider necessitate to introduce a certain number of maps. We fix some closed set A ⊂ R, and say that a process is a control process, if it is F-adapted and A-valued. Similarly, we say that a process is a control process for all the Agents if it is F-adapted and A N -valued.

Next, our first object is the volatility function Σ : [0, T ] × C N -→ M N (R). We will assume that the following holds Assumption (Σ). The map Σ is bounded, F-progressive, measurable, and for every (t, x) ∈ [0, T ] × C N , Σ(t, x) is invertible with inverse bounded by some positive constant M . Moreover, Σ is actually a multiple of the identity matrix and such that the following stochastic differential equation admits a unique strong solution

X N t = ψ N + t 0 Σ s (X)dW N s , t ∈ [0, T ], P -a.s.
Remark 2.1. We assume that Σ has to be diagonal in order to have homogeneity between the Agents and then pass to the limit in the mean-field problem. The boundedness assumption is here for simplicity, while the invertibility is fundamental to define properly the weak formulation of the problem.

Our second object will be the so-called drift function, which drives the value of the output. It will be a map b from [0, T ] × C × P(C N ) × P(R N ) × R into R. For any (p, ℓ, η) ∈ [1, +∞) × (0, +∞) × (1, +∞), we will consider the following assumption on b Assumption (B p,ℓ,η ). (i) For any (µ, q, a) ∈ P(C N ) × P(R N ) × R, the map (t, x) -→ b(t, x, µ, q, a) is F-progressive and measurable.

(ii) For any (t, x, µ, q) ∈ [0, T ] × C × P(C N ) × P(R N ), the map a -→ b(t, x, µ, q, a) is continuously differentiable on R.

(iii) There is a positive constant C such that for any (t, x, µ, q, a)

∈ [0, T ] × C × P(C N ) × P(R N ) × R, we have |b(t, x, µ, q, a)| ≤ b 0 ( x t,∞ ) + C 1 + C N z p t,∞ µ(dz) 1 p + R N z p N q(dz) 1 p + |a| ℓ , |∂ a b(t, x, µ, q, a)| ≤ C 1 + b 1 ( x t,∞ ) + C N z p t,∞ µ(dz) 1 p + R N z p N q(dz) 1 p + |a| ℓ-1 , where b 0 , b 1 : R + -→ R + are such that E exp 3η 2 M 2 T 0 |b 0 ( X N t,∞ )| 2 dt + exp h T 0 |b 1 ( X N t,∞ )| h ′ dt < +∞, ∀h, h ′ > 1,
with M denoting the constant defined in Assumption (Σ).

Remark 2.2. Letting the drift b depend on the laws of the output and the control allows for instance to incorporate the following effects.

(i) The average value of the firm can have a positive or negative impact on its future evolution: when things are going well, they have a tendency to keep doing so, and conversely. We can also consider that large disparities in the distribution of X N can also negatively impact the future evolution of the outputs. This would then naturally make b depend on the variance ofX N .

(ii) Similarly, if all the other Agents in the firm are working on average very hard, this could have a ripple effect on the whole firm. Hence a dependence on the law of the control itself.

Furthermore, the growth assumptions made here are for tractability, and are mainly due to the fact that we are going at some point to work with quadratic BSDEs. They allow for instance for drifts which are linear in x, with a constant small enough. Indeed, in this case X N is basically like a Brownian motion (recall that Σ is bounded) so that its square will have exponential moments, provided that they are of a small order.

The third object will be a discount factor k, that is a map from [0, T ] × C × P(C N ) × P(R N ) to R, satisfying the following standing assumption Assumption (K). The map k is bounded, measurable, and such that for any (µ, q) ∈ P(C N ) × P(R N ), the map (t, x) -→ k(t, x, µ, q) is F-progressive.

Remark 2.3. The discount factor is here to model a possible impatience of the Agents, who would value more having utility now than later. Letting it depend on the law of X N and the law of the control played by the Agent is again for generality and possible ripple effects. Agents may for instance become more impatient if the firm is currently doing extremely well. We could have let k also depend on the control itself, but it would have further complicated our definition of admissible controls. We therefore decided to refrain from it, but it is not a limit of the theory, per se.

Finally, we will need to consider a cost function c

: [0, T ] × C × P(C N ) × P(R N ) × R N -→ R + satisfying, for some (p, ℓ, m, m) ∈ [1, +∞) × (0, +∞) × [ℓ, +∞) × (ℓ -1, +∞)
Assumption (C p,ℓ,m,m ). For any (µ, q, a) ∈ P(C N ) × P(R N ) × R, the map (t, x) -→ c(t, x, µ, q, a) is measurable and F-progressive. Moreover, the map a -→ c(t, x, µ, q, a) is increasing, strictly convex and continuously differentiable for any (t, x, µ, q) ∈ [0, T ] × C × P(C N ) × P(R N ). Finally, there exists C > 0 such that for any (t, x, µ, q, a)

∈ [0, T ] × C × P(C N ) × P(R N ) × R 0 ≤ c(s, x, µ, q, a) ≤ C 1 + x s,∞ + C N z p s,∞ µ(dz) 1 p + R N z p N q(dz) 1 p + |a| ℓ+m ,
|∂ a c(s, x, µ, q, a)| ≥ C|a| m , and lim |a|→∞ c(s, x, µ, q, a) |a| ℓ = +∞.

Remark 2.4. Once again, the cost faced by the Agents can be influenced by the past states of the firm and its law, as well as the law of the control played by the other Agents. It helps to model the fact that Agents may find it hard to work when everyone else is working (the classical free rider problem), or if the situation of the firm is on average extremely good. As for the growth conditions assumed, they are basically here to ensure that the Hamiltonian of the Agent, which will involve both b and c, has at least one maximiser in a, thanks to nice coercivity properties.

Output process and admissible controls

To justify the mean field model considered in this paper, we begin by setting the paradigm for N Agents hired by one Principal. A more general situation has been studied recently in [START_REF] Élie | Contracting theory with competitive interacting agents[END_REF]. Here, we consider N Agents managing a N -dimensional project whose value X N , usually called the output process in the Principal-Agent literature, is such that the ith Agent manages the ith component of X N . In this model, X N is given by (recall Assumption 2.2)

X N t = ψ N + t 0 Σ s (X N )dW N s , t ∈ [0, T ], P -a.s. (2.2)
Notice that since Σ is bounded and because of (2.1), it is a classical result that X N has exponential moments of any order under P. For any x ∈ C N , we let µ N (x) ∈ P(C N ) be the empirical distribution of x defined by

µ N (x)(dz 1 , . . . , dz N ) := 1 N N i=1 δ x i (dz i ), (2.3)
where for any y ∈ C, δ y (dz) ∈ P(C) denotes the Dirac mass at y. Similarly, for any a ∈ R N , we let q N (a) ∈ P(R N ) the empirical distribution of a defined by

q N (a)(dz 1 , . . . , dz N ) := 1 N N i=1 δ a i (dz i ),
where we abuse notations and still designate for any y ∈ R by δ y (dz) ∈ P(R) the Dirac mass at y.

We now consider a lifting of the map b defined in the previous section as follows. Let b N : [0, T ] × C N × P(C N ) × P(R N ) × A N -→ R N be defined, for i = 1, . . . , N , by b N,i (t, x, µ, q, a) := b(t, x i , µ, q, a i ), (t, x, µ, q, a)

∈ [0, T ] × C N × P(C N ) × P(R N ) × A N . (2.4)
Given all the above, we can finally define our set of admissible controls. A control process for all the Agents α will be said to be admissible, denoted by α ∈ A N , if it also belongs for some ε > 0 to the set A ε , where

A ε := α, E E T 0 (Σ -1 t (X N )) ⊤ b N t, X N , µ N (X N •∧t ), q N (α t ) • dW N t 1+ε < +∞ ,
and if for any p ≥ 0, and for the same ℓ and m appearing in Assumption (C p,ℓ,m,m )

E exp p T 0 α s ℓ+m N ds < +∞. (2.5)
We also define the set of admissible controls for the ith Agent, given some other controls played by the N -1 other Agents, α -i := (α 1 , . . . , α i-1 , α i+1 , . . . , α N )

A i (α -i ) := α, R-valued and F-adapted s.t. α ⊗ i α -i ∈ A N .
By definition, for any α ∈ A N we can define a probability measure P α N which is equivalent to P by

dP α N dP := E T 0 (Σ -1 t (X N )) ⊤ b N t, X N , µ N (X N •∧t ), q N (α t ) • dW N t .
By Girsanov theorem, we can define for any α ∈ A N an N -dimensional P α N -Brownian motion W N,α by

W N,α t := W N t - t 0 Σ -1 s (X N )b N s, X N , µ N (X N •∧s
), q N (α s ), α s ds, so that we can rewrite

X N t = ψ N + t 0 b N s, X N , µ N (X N •∧s ), q N (α s ), α s ds + t 0 Σ s (X N )dW N,α s , t ∈ [0, T ], P -a.s.
Notice that in our model, the dynamic of the ith project managed by the ith Agent is directly impacted by both the projects of other Agents and their efforts, through their empirical distribution.

The Agents' problems

In this paper, we will consider an homogeneous model, in the sense that the N Agents are supposed to be similar 6 . Hence, they have the same cost function c, as well as the same discount factor k. Moreover, they have the same tastes, in the sense that their utility functions U A : R -→ R and u A : [0, T ] × C × P(C N ) × P(R N ) × R + -→ R, are also identical. We will assume Assumption (U). The map U A is non-decreasing and concave, and for any (t, x, µ, q) ∈ [0, T ] × C × P(C N ) × P(R N ), the map χ -→ u A (t, x, µ, q, χ) is non-decreasing and concave. Furthermore, for any (µ, q, χ) ∈ P(C N ) × P(R N ) × R + , the map (t, x) -→ u A (t, x, µ, q, χ) is measurable and F-progressive, and there is a positive constant C and a concave map ũA : R + -→ R + such that for any (t, x, µ, q, χ) ∈

[0, T ] × C × P(C N ) × P(R N ) × R + , we have |u A (t, x, µ, q, χ)| ≤ C 1 + x t,∞ + C N z p t,∞ µ(dz) 1 p + R N z p N q(dz) 1 p + ũA (χ) .
The Agents are hired at time 0 by the Principal on a "take it or leave it" basis. The Principal proposes a contract to the Agents, which consists in two objects (i) A stream of payments χ, which is a (R ⋆ + ) N -valued and F-adapted process, such that, for i = 1, . . . , N , χ i t represents the instantaneous payments made to Agent i at time t.

(ii) A final payment ξ, which is a R N -valued and F T -measurable random variable, such that, for i = 1, . . . , N , ξ i represents the amount of money received by Agent i at time T .

A contract will always refer to the pair (χ, ξ), and the set of contracts will be denoted by C N . Hence, the problem faced by the ith Agent, given a contract (χ, ξ) ∈ C N as well as a given A N -1 -valued control α -i chosen by the N -1 other Agents, is the following

V A,i 0 (χ i , ξ i , α -i ) := sup α∈A i (α -i ) v A,i 0 (α, χ i , ξ i , α -i ), (2.6)
where for any α

∈ A i (α -i ) v A,i 0 (α, χ i , ξ i , α -i ) := E P α⊗ i α -i N T 0 K i,X N ,αs,α -i s 0,s u A s, X i,N , µ N (X N •∧s ), q N ((α ⊗ i α -i ) s ), χ i s ds -E P α⊗ i α -i N T 0 K i,X N ,αs,α -i s 0,s c s, X N , µ N (X N •∧s ), q N ((α ⊗ i α -i ) s ), α s ds + E P α⊗ i α -i N K i,X N ,αs,α -i s 0,T U A (ξ i ) ,
where we defined for any i = 1, . . . , N , and any (t, s, x, a, a

-i ) ∈ [0, T ] × [t, T ] × C N × R × R N -1 K i,x,a,a -i t,s := exp - T t k(s, x i , µ N (x), q N (a ⊗ i a -i ))ds .
We are looking for an equilibrium between the Agents, in the sense of a Nash equilibrium, for which we remind the definition.

Definition 2.1 (Nash equilibrium). Given a contract (χ, ξ) ∈ C N , a Nash equilibrium for the N Agents is an admissible control process α ⋆ (χ, ξ) ∈ A N satisfying for any

1 ≤ i ≤ N V A,i 0 (χ i , ξ i , α ⋆,-i (χ, ξ)) = v A,i 0 (α ⋆,i (χ, ξ), χ i , ξ i , α ⋆,-i (χ, ξ)).
For an given (χ, ξ) ∈ C N , we let NA(χ, ξ) denote the (possibly empty) set of Nash equilibria for the Agents' problem. Of course, in general, when a Nash equilibrium exists between the Agents, there is absolutely no reason for it to be unique, which means that NA(χ, ξ) is not a singleton in general. It is therefore necessary for us to have some kind of mechanism allowing the Agents to choose between different Nash equilibria. Several possibilities can be considered:

(i) The Principal could be risk-averse and behave as if the Agents were choosing the worst equilibrium from his point of view.

(ii) The Agents could also have a collective criterion allowing them to differentiate between possible equilibria, and, if this is not enough to have uniqueness, they would behave as in the standard contract theory literature and let the Principal choose among the equilibria maximising their criterion.

(iii) The Principal could also have a very strong bargaining power and impose one equilibrium to the Agents.

As in [START_REF] Élie | Contracting theory with competitive interacting agents[END_REF], we have decided to follow here the second approach. We thus assume that the Agents have agreed upon some order relationship N between Nash equilibria, and hence consider the set

NAI(χ, ξ) := {α ∈ NA(χ, ξ), α N α, for every α ∈ NA(χ, ξ)} .
Once more, for any (χ, ξ) ∈ C N , NAI(χ, ξ) may be empty or not a singleton. However, since now Agents are indifferent between any Nash equilibrium in NAI(χ, ξ), we follow, as stated above, the usual assumption in the Principal-Agent literature, and assume that they let the Principal chooses the equilibrium that suits him the most.

The Principal's problem

Before defining the problem of the Principal, we need to define the set of admissible contracts. The idea is to consider only contracts such that the Principal is able to compute the reaction of the Agents, that is to say the ones for which there is at least one Nash equilibrium. Although there could arguably be a discussion on the question of whether considering that the Agents are looking for a Nash equilibrium or not is the most pertinent one, we believe that once this choice has been made, our assumption makes sense from the practical point of view. Indeed, the Principal needs to be able to anticipate, one way or another, how the Agents are going to react to the contracts that he may offer, and will therefore not offer contracts for which Agents cannot agree on an equilibrium. Granted, one could also resort to approximate equilibria or other related notions, but this paper being the first one in the literature treating moral hazard problems with mean-field interactions, we have chosen to work in a setting which remains reasonable and tractable at the same time.

This being said, the contracts also have to take into account the fact that all the Agents have a reservation utility R 0 and will never accept a contract which does not guarantee them at least that amount of utility.

In the following we will denote by R N 0 the N -dimensional vector of coordinate (R N 0 ) i := R 0 . Finally, we need to add some integrability assumptions, which finally leads us to the set of admissible contracts Ξ N , consisting of pairs (χ, ξ) ∈ C N , such that NAI(χ, ξ) = ∅, and such that for any i = 1, . . . , N , and any

α ⋆ (χ, ξ) ∈ NAI(χ, ξ), we have V A,i 0 (χ i , ξ i , α ⋆,-i (χ, ξ)) ≥ R 0 and for any p ≥ 0 E exp p |U A (ξ i )| + T 0 ũA (χ i s )ds < +∞.
The Principal's problem is then

U P,N 0 := sup (χ,ξ)∈Ξ N sup α∈NAI(χ,ξ) E P α N -exp - R P N X T -ξ - T 0 χ s ds • 1 N . (2.7)
The idea behind the above criterion for the Principal, is that he has exponential utility with risk aversion R P /N , which means that the more Agents there are, the less risk averse the Principal becomes. We interpret this as a sort of diversification effect.

Solving the N-players' problem

We now follow [31, Section 4] and we solve the N -players' problem. Since our setting is extremely similar, we will omit the proofs. That being said, the results of [START_REF] Élie | Contracting theory with competitive interacting agents[END_REF] tell us that we should consider the following

N -dimensional BSDE, given a contract (χ, ξ) ∈ C N Y t = U A (ξ) + T t g ⋆ N (s, X N , Y s , Z s , χ s )ds - T t Z ⊤ s Σ s (X N )dW s , (2.8)
where

g ⋆ N : [0, T ] × C N × R N × M N (R) × R N -→ R N is defined by (g ⋆ N ) i (s, x, y, z, χ) = sup a∈A N j=1 b s, x i , µ N (x), q N (a ⊗ i (a ⋆ ) -i (s, x, z)), a Z j,i -c(s, x, µ N (x), q N (a ⊗ i (a ⋆ ) -i (s, x, z)), a) + u A s, x i , µ N (x), q N (a ⊗ i (a ⋆ ) -i (s, x, z)), χ i -k(s, x i , µ N (x), q N (a ⊗ i (a ⋆ ) -i (s, x, z))y,
where

a ⋆ : [0, T ] × R N × M N (R) -→ R N is defined for any 1 ≤ i ≤ N by (a ⋆ ) i (s, x, z) ∈ argmax a∈A N j=1 b s, x i , µ N (x), q N (a ⊗ i (a ⋆ ) -i (s, x, z)), a Z j,i -c(s, x, µ N (x), q N (a ⊗ i (a ⋆ ) -i (s, x, z)), a) . (2.9)
As in [START_REF] Élie | Contracting theory with competitive interacting agents[END_REF], the definition of a ⋆ might happen to be truly circular. We thus consider the following assumption, corresponding to [31, Assumption 4.1] (see the remark following their assumption for conditions ensuring that this indeed holds)

Assumption 2.1. For any (s, x, z) ∈ [0, T ] × R N × M N (R)
, there exists at least one N -dimensional vector a ⋆ (s, x, z) satisfying (2.9).

Exactly as will be proved in the mean-field case below (see Theorem 4.1), there is a one-to-one correspondence between a Nash equilibrium a ⋆ (χ, ξ) ∈ NAI(χ, ξ), with appropriate additional integrability properties, and a solution (Y, Z) to BSDE (2.8), in appropriate spaces. Furthermore, the corresponding Nash equilibria are any maximisers a ⋆ (•, X, Z • ) in (2.9).

We voluntarily remain rather vague in this statement, because it can be proved exactly as below or as in [START_REF] Élie | Contracting theory with competitive interacting agents[END_REF], and the N -players' situation is not at the heart of this paper. Our aim here is merely to explain how to solve the problem, and to have at hand the general HJB equation for the problem of the Principal, which will allow us to obtain explicit solutions in the examples considered in Section 6.

With such a representation for the problem of the Agents, we can then proceed and show that the problem of the Principal becomes equivalent to a classical stochastic control problem, with the following state variables

X N t = ψ N + t 0 b N s, X N , µ N (X N •∧s ), q N (α ⋆ s ), α ⋆ s ds + t 0 Σ s (X N )dW N,a ⋆ (•,X,Z•) s , Y N,Y N 0 ,Z t (χ) := Y N 0 + t 0 Z ⊤ s b N s, X N , µ N (X N •∧s ), q N (a ⋆ (s, X, Z s )), a ⋆ (s, X, Z s ) ds - t 0 g ⋆ N s, X, Y N,Y 0 ,Z s (χ), Z s , χ s ds + t 0 Z ⊤ s Σ s (X N )dW N,a ⋆ (•,X,Z•) s . (2.10)
If in addition all the considered functions are assumed to be Markovian (we abuse notations and still use the same letters to denote them), and if for simplicity we assume that there is a unique maximiser in (2.9)7 , we can write the associated HJB equation as follows

       -∂ t v(t, x, y) -G(t, x, y, ∂ x v, ∂ y v, ∂ xx v, ∂ yy v, ∂ xy v) = 0, (t, x, y) ∈ [0, T ) × R N × R N , v(T, x, y) = -exp - R P N x -U -1 A (y) • 1 N , (x, y) ∈ R N × R N , (2.11)
where

G : [0, T ] × R N × R N × R N × R N × M N (R) × M N (R) × M N (R) -→ R is defined for any (t, x, y, p x , p y , γ x , γ y , γ xy ) ∈ [0, T ] × (R N ) 2 × (R N ) 2 × (M N (R)) 3 G(t, x, y, p x , p y , γ x , γ y , γ xy ) = sup (χ,z)∈(R ⋆ + ) N ×M N (R) b N t, x, µ N (x), q N (a ⋆ (t, x, z)), a ⋆ (t, x, z) • p x + 1 2 Tr Σ t (x)Σ t (x) ⊤ γ x + z ⊤ b N t, x, µ N (x), q N (a ⋆ (t, x, z)), a ⋆ (t, x, z) -g ⋆ N (t, x, y, z, χ) • p y + 1 2 Tr z ⊤ Σ t (x)Σ t (x) ⊤ zγ y + Tr Σ t (x)Σ t (x) ⊤ zγ xy .
We have finally the following verification argument as an adaptation of [31, Proposition 4.1] or the step 2 of the proof of Theorem 6.1 in Section 6 below, which is very classic in the stochastic control theory. We refer for instance to the classical monograph of Fleming and Soner [START_REF] Fleming | Controlled Markov processes and viscosity solutions[END_REF] for more details.

Theorem 2.1. Assume that their exists a smooth function v : [0, T ] × R N × R N continuously differentiable with respect to time and twice differentiable with respect to its space variables solving the PDE (2.11), and such that the supremum in the definition of G is always attained for at least one (χ ⋆ , z ⋆ )(t, x, y, p x , p y , γ x , γ y , γ xy ), for any (t, x, y, p x , p y , γ x , γ y , γ

xy ) ∈ [0, T ]×(R N ) 2 ×(R N ) 2 ×(M N (R)) 3 .
Then, if the couple

(χ ⋆ , z ⋆ )(t, X ⋆ t , Y ⋆ t , ∂ x v(t, X ⋆ t , Y ⋆ t ), ∂ y v(t, X ⋆ t , Y ⋆ t ), ∂ xx v(t, X ⋆ t , Y ⋆ t ), ∂ yy v(t, X ⋆ t , Y ⋆ t ), ∂ xy v(t, X ⋆ t , Y ⋆ t )),
where (X ⋆ , Y ⋆ ) solves the system (2.10), is admissible8 , then we have

U P 0 = sup Y N 0 ∈[R 0 ,∞) N v(0, ψ, Y N 0 ).
In particular, if k = 0, clearly v is non-increasing with respect to all components of y, so that U P 0 = v(0, ψ, R N 0 ). Moreover, an optimal contract is then given by

ξ := U (-1) A R N 0 - T 0 g ⋆ N (s, X ⋆ s , Y ⋆ s , z ⋆ s , χ ⋆ s )ds + T 0 (z ⋆ s ) ⊤ dX N s ,
where the inverse of U A has to be taken component-wise.

... to the mean field problem

This section is dedicated to the description of the mean-field problem corresponding, at least formally, to the limit as N goes to ∞ of the model described in Section 2. The idea now is that there is only one Agent which is interacting with the theoretical distribution of the infinite number of other players. The natural consequence on our notations is that we will enforce N = 1 throughout this section.

The controlled output process

We now need to introduce a new volatility process σ : [0, T ] × C -→ R\{0}. It will be assumed to satisfy the following.

Assumption (σ). The map σ is bounded, measurable, and F-progressive, and for every (t, x) ∈ [0, T ]×C, σ(t, x) is invertible with inverse bounded by some positive constant M . Moreover, σ is such that the following stochastic differential equation admits a unique strong solution

X t = ψ + t 0 σ s (X)dW s , t ∈ [0, T ], P -a.s.
Let us define the following set

P(R) := {q : [0, T ] -→ P(R), measurable} ,
as well as A the set of R-valued and F-adapted processes α such that for some ε > 0, for every (h, µ, q) ∈ R + × P(C) × P(R) and for the same m and ℓ as the ones appearing in Assumption (C p,ℓ,m,m )

E E T 0 σ -1 t (X)b(t, X, µ, q t , α t )dW t 1+ε + E exp h T 0 |α t | ℓ+m dt < +∞. (3.1)
Then, for any (µ, q, α) ∈ P(C) × P(R) × A, we can define, thanks to Assumption 2.2, a probability P µ,q,α such that

dP µ,q,α dP = E T 0 σ -1 t (X)b(t, X, µ, q t , α t )dt . (3.2)
Hence, we can define a Brownian motion under P µ,q,α by

W µ,q,α t := W t - t 0 σ -1 s (X)b(s, X, µ, q s , α s )ds, t ∈ [0, T ], P -a.s.,
so that we can rewrite

X t = ψ + t 0 b(s, X, µ, q s , α s )ds + t 0 σ s (X)dW µ,q,α s , t ∈ [0, T ], P -a.s.

The Agent's problem: a classical mean-field game

Exactly as in the N -players' game, the Principal proposes a contract (χ, ξ) ∈ C to the Agent at time t = 0. For given (µ, q, α) ∈ P(C) × P(R) × A, representing respectively an arbitrary distribution of the output managed by the infinitely many other Agents, an arbitrary distribution of the actions chosen by these infinitely many Agents, and an action chosen by the representative Agent, his associated utility is given by

v A 0 (χ, ξ, µ, q, α) := E P µ,q,α K X,µ,q 0,T U A (ξ) + T 0 K X,µ,q,α 0,s u A (s, X, µ, q s , χ s ) -c(s, X, µ, q s , α s ) ds ,
where for any (x, µ, q, t, s)

∈ C × P(C) × P(R) × [0, T ] × [t, T ] K x,µ,q t,s := exp - s t k(u, x, µ, q s )du .
In another words, the Agent profits from the (discounted) utilities of his terminal payment, and his inter-temporal payments, net of his instantaneous cost of working. Overall, the problem of the Agent corresponds to the following maximisation

V A 0 (χ, ξ, µ, q) := sup α∈A v A 0 (χ, ξ, µ, q, α). (3.3)
As usual in mean-field games, it is immediate that the best reaction function of the Agent is a standard (albeit non-Markovian) stochastic control problem, where µ and q only play the role of parameters. As such, it is a well-known result that, since the Agents can only impact the drift of the output process, the study of the dynamic version of the Agent's value function requires to introduce first the following family of BSDEs, indexed by (µ, q, α)

∈ P(C) × P(R) × A Y µ,q,α t (χ, ξ) = U A (ξ) + T t g s, X, Y µ,q,α s (χ, ξ), Z µ,q,α s (χ, ξ), µ, q s , α s , χ s ds - T t Z µ,q,α s (χ, ξ)σ s (X)dW s , (3.4)
where for any (s, x, y, z, µ, q, a, χ)

∈ [0, T ] × C × R × R × P(C) × P(R) × R × R + we defined g(s, x, y, z, µ, q s , a, χ) := zb(s, x, µ, q s , a) + u A (s, x, µ, q s , χ) -k(s, x, µ, q s )y -c(s, x, µ, q s , a). (3.5)
We begin by defining a solution to BSDE (3.4).

Definition 3.1. We say that a pair of processes (Y µ,q,α (χ, ξ), Z µ,q,α (χ, ξ)) solves the BSDE (3.4) if Y µ,q,α (χ, ξ) ∈ E(R), Z µ,q,α (χ, ξ) ∈ H p (R) for any p ≥ 0 and (3.4) holds for any t ∈ [0, T ], Pa.s.

We now make the aforementioned link between v A 0 (χ, ξ, µ, q, α) and BSDE (3.4) clear.

Lemma 3.1. Let Assumptions (B p,ℓ,η ), (σ), (U), (K) and (C p,ℓ,m,m ) be true for some

(p, ℓ, m, m, η) ∈ [1, +∞) × (1, +∞) × [ℓ, +∞) × (ℓ -1, +∞) × (1, +∞).
For any (µ, q, α) ∈ P(C) × P(R) × A, there exists a solution (Y µ,q,α (χ, ξ), Z µ,q,α (χ, ξ)) to BSDE (3.4). Furthermore, we have

E [Y µ,q,α 0 (χ, ξ)] = v A 0 (χ, ξ, µ, q, α).
Now, we turn our attention to the equilibrium between the Agents, which consists in solving the problem (3.3) and finding an associated fixed point. For given (χ, ξ) ∈ C, we call this problem (MFG)(χ, ξ) and recall our readers the rigorous definition of a solution, taken from [START_REF] Carmona | A probabilistic weak formulation of mean field games and applications[END_REF].

Definition 3.2 (Solution of (MFG)(χ, ξ)). A triplet (µ, q, α) ∈ P(C) × P(R) × A is a solution to the system (MFG)(χ, ξ) if V A 0 (χ, ξ, µ, q) = v A 0 (χ, ξ, µ, q, α), P µ,q,α • (X) -1 = µ and P µ,q,α • (α t ) -1 = q t for Lebesgue almost every t ∈ [0, T ].
Recall from Lemma 3.1 that for any triplet (µ, q, α) ∈ P(C) × P(R) × A, there exists a solution to BSDE (3.4). The notion of admissibility for an effort given by (3.1) implies implicitly that we have to restrict a bit more the notion of a solution to (MFG)(χ, ξ), mainly in terms of the required integrability.

Let r > 1 be fixed throughout the rest of the paper. We denote by MF r (χ, ξ) the set of solutions (µ, q, α) to (MFG)(χ, ξ) such that the second component Z µ,q,α of the solution to BSDE (3.4) (associated to the solution of (MFG)(χ, ξ) by Lemma 3.1) is in the space H λr exp (R), with λ := (ℓ + m)/(m + 1ℓ) (recall that by definition, m + 1 > ℓ).

In general, the system (MFG)(χ, ξ) can admit several solutions, i.e. the set MF r (χ, ξ) is not necessarily reduced to a unique triplet (µ, q, α). As in the N -players's case, we give ourselves an exogenous criterion for the Agents. Notice that since all the Agents are identical, they actually all have the same utility, so that the choice between several solutions can indeed be made by a unique representative Agent. We therefore define

MFI r (χ, ξ) := {(µ, q, α) ∈ MF r (χ, ξ), (ν, p, β) (µ, q, α), ∀(ν, p, β) ∈ MF r (χ, ξ)} ,
where is the selection criterion of the Agent. We could for instance define by

• (ν, p, β) (µ, q, α) if v A 0 (χ, ξ, ν, p, β) ≤ v A 0 (χ, ξ, µ, q, α).
In this case, the Agents select the mean-field equilibria that maximise the expectation of their utility.

• (ν, p, β) (µ, q, α) if Var K X,ν,p 0,T U A (ξ) + T 0 K X,ν,p 0,s u A s, X, ν, p s , β s -c(s, X, ν, p s , β s ) ds ≥ Var K X,µ,q 0,T U A (ξ) + T 0 K X,µ,q 0,s u A s, X, µ, q s , α s -c(s, X, µ, q s , α s ) ds .
In this case, the representative Agent selects mean-field equilibria that minimise the variance of his utility.

Finally, since the representative Agent is indifferent between elements of MFI r (χ, ξ), we assume, like in the N -players' game, that he lets the Principal choose any (µ ⋆ , q ⋆ , α ⋆ ) ∈ MFI r (χ, ξ).

The Principal problem as a mean field version of (2.7)

Similarly to the definition of Ξ N for the N -players' model, we denote by Ξ the set of admissible contracts, that is to say the set of (χ, ξ) ∈ C such that

(i) MFI r (χ, ξ) = ∅. (ii) For any (µ ⋆ , q ⋆ , α ⋆ ) ∈ MFI r (χ, ξ) we have V A 0 (χ, ξ, µ ⋆ , q ⋆ ) ≥ R 0 .
(iii) For any p ≥ 0

E exp p |U A (ξ)| + T 0 ũA (χ s )ds < ∞. (3.6)
Formally, by taking the limit when N -→ ∞ in the Principal's problem (2.7), we expect the Principal to become risk-neutral. In other words, the mean-field version of (2.7) for the Principal is

U P 0 := sup (χ,ξ)∈Ξ sup (µ,q,α)∈MFI r (χ,ξ) E P µ,q,α X T -ξ - T 0 χ s ds . (3.7)
As far as we know, such a problem has never been considered so far in the literature. It basically boils down to finding a Stackelberg equilibrium between the Principal and infinitely many Agents in mean-field equilibrium. The main contribution of this paper is to show that we can actually reduce it to the study of a system of controlled McKean-Vlasov SDEs. We will describe in Section 5 two possible approaches to try and tackle the latter problem.

4 Solving the mean-field game: yet another BSDE story

Optimal effort

We first present a result ensuring the existence of a maximiser for g with respect to the effort of the Agent, as well as associated growth estimates.

Lemma 4.1. Let Assumptions (B p,ℓ,η ), (σ), (K) and (C p,ℓ,m,m ) hold true for some

(p, ℓ, m, m, η) ∈ [1, +∞) × (0, +∞) × [ℓ, +∞) × (ℓ -1, +∞) × (1, +∞).
Then, for any (s, x, µ, q, y, z, χ)

∈ [0, T ] × C × P(C) × P(R) × R × R × R + there exists a ⋆ (s, x, z, µ, q) ∈ R such that a ⋆ (s, x, z, µ, q) ∈ argmax a∈A g(s, x, y, z, µ, q s , a, χ), (4.1)
satisfying for some positive constant C

|a ⋆ (t, x, z, µ, q)| ≤ C 1 + |z| 1 m+1-ℓ 1 + |b 1 ( x t,∞ )| 1 m+1-ℓ + C w p t,∞ µ(dw) 1 p(m+1-ℓ) + R |w| p q(dw) 1 p(m+1-ℓ)
. Furthermore, we have |g(s, x, y, z, µ, q s , a ⋆ (s, x, z, µ, q), χ)|

≤ C 1 + x s,∞ + |y| + |z| (ℓ+m)∨(m+1) m+1-ℓ + C w p t,∞ µ(dw) 1 p + R |w| p q(dw) 1 p + ũA (χ) + C|z| b 0 ( x t,∞ ) + C w p t,∞ µ(dw) 1 p + R |w| p q(dw) 1 p + C|z| m+1 m+1-ℓ |b 1 ( x t,∞ )| 1 m+1-ℓ + C w p t,∞ µ(dw) 1 p(m+1-ℓ) + R |w| p q(dz) 1 p(m+1-ℓ)
.

We define now the following set for any (x, z, µ, q) ∈ C × R × P(C) × P(R) A x,z,µ,q := (α s ) s∈[0,T ] , α s ∈ argmax a∈A g(s, x, y, z, µ, q s , a, χ), for a.e. s ∈ [0, T ] , and also define for any (s, x, y, z, µ, q, χ) ∈ [0, T ]× C × R × R × P(C)× P(R)× R + and for any a ⋆ ∈ A x,z,µ,q , g ⋆ (s, x, y, z, µ, q s , χ) := g(s, x, y, z, µ, q s , a ⋆ , χ).

We next consider the following system, which is intimately related to mean-field FBSDE as introduced by [START_REF] Carmona | Mean field forward-backward stochastic differential equations[END_REF]

]              Y ⋆ t (χ, ξ) = U A (ξ) + T t g ⋆ (s, X, Y ⋆ s (χ, ξ), Z ⋆ s (χ, ξ), µ, q s , χ s )ds - T t Z ⋆ s (χ, ξ)σ s (X)dW s , P µ,q,a ⋆ (•,X,Z ⋆ • (χ,ξ),µ,q•) • (X) -1 = µ, P µ,q,a ⋆ (•,X,Z ⋆ • (χ,ξ),µ,q• • (a ⋆ (s, X, Z ⋆ s (χ, ξ), µ, q s )) -1 = q s , for a.e. s ∈ [0, T ]. (4.2)
This system will provide us the required probabilistic representation of the solution to the mean-field game of the Agent. Before presenting and proving this link, we start by defining a solution to (4.2). Once more, the constants ℓ, m and m are the ones appearing in Assumption (C p,ℓ,m,m ).

Definition 4.1. A solution to the mean-field BSDE (4.2) is a quadruplet (Y ⋆ , Z ⋆ , µ, q) ∈ E(R) × H λr exp (R) × P(C) × P(R), with λ = (ℓ + m)/(m + 1ℓ), satisfying the system (4.2) for any t ∈ [0, T ], Pa.s.

Inspired by [START_REF] Élie | Contracting theory with competitive interacting agents[END_REF], we aim at providing an equivalence result between a solution to (MFG)(χ, ξ) in the set MF r (χ, ξ) and a solution to BSDE (4.2) in the sense of Definition 4.1. We have the following theorem which provides such a result, together with a characterisation of an optimal effort for the Agent in terms of maximisers of g. Theorem 4.1. Let Assumptions (B p,ℓ,η ), (σ), (K) and (C p,ℓ,m,m ) hold true for some

(p, ℓ, m, m, η) ∈ [1, +∞) × (0, +∞) × [ℓ, +∞) × (ℓ -1, +∞) × [0, +∞) × (1, +∞). Fix (χ, ξ) ∈ C.
• Assume that (χ, ξ) ∈ Ξ, i.e., the system (MFG)(χ, ξ) admits a solution in MFI r (χ, ξ) denoted by (µ, q, α ⋆ ). Then there exists a solution (Y ⋆ , Z ⋆ , µ, q) to BSDE (4.2), and in addition α ⋆ ∈ A X,Z ⋆ ,µ,q . In particular, α ⋆ provides an optimal effort for the Agent. In this case, we have the following decomposition for U A (ξ)

U A (ξ) = Y ⋆ 0 - T 0 g ⋆ (t, X, Y ⋆ t , Z ⋆ t , µ, q t , χ t )dt + T 0 Z ⋆ t σ t (X)dW t . (4.3)
• Conversely, if there exists a solution to BSDE (4.2) denoted by (Y ⋆ (χ, ξ), Z ⋆ (χ, ξ), µ, q) ∈ E(R) × H λr exp (R) × P(C) × P(R), then the system (MFG)(χ, ξ) admits as a solution in MFI r (χ, ξ), given by the triplet (µ, q, a ⋆ (•, X, Z ⋆

• (χ, ξ), µ, q • )), where a ⋆ is any of the maximisers in (4.1).

A convenient characterisation of Ξ

In order to provide a relevant Hamilton-Jacobi-Bellman equation to solve the Principal's problem (3.7), and following the general approach to contracting problems initiated by Cvitanić, Possamaï and Touzi [START_REF] Cvitanić | Moral hazard in dynamic risk management[END_REF][START_REF] Cvitanić | Dynamic programming approach to principal-agent problems[END_REF], we need to have a convenient probabilistic representation of the value function of the Agent, for any contract (χ, ξ) ∈ Ξ. We will now show in this section that Theorem 4.1 is tailor-made for that purpose.

Let us start by introducing a convenient notation, and define the set X as the set of R + -valued F-predictable processes χ such that

E exp h T 0 ũA (χ s )ds < +∞, for any h ≥ 0.
Our first step is to introduce an appropriate system of coupled and controlled McKean-Vlasov type SDEs, which basically amounts to look at the BSDE (4.2) in a forward manner. For any (Y 0 , Z) ∈ R × H λr exp (R), with once more λ = (ℓ + m)/(m + 1ℓ), and any χ ∈ X , we introduce for a given maximiser We emphasise that the above does not depend on the choice of the maximiser a ⋆ , in the sense that the drift functions b actually cancels out with the Brownian motion W µ,q,a ⋆ (•,X,Z•,µ,q•) . A solution of this system will be required to satisfy the following properties. Definition 4.2. A solution of the system (4.4) is a quadruplet (X, Y Y 0 ,Z (χ), µ, q) satisfying (4.4) for any t ∈ [0, T ], Pa.s., such that in addition Y Y 0 ,Z (χ) ∈ E(R). We call Z(χ) the subset of H λr exp (R), with λ = (ℓ + m)/(m + 1ℓ), such that there is a solution to (4.4).

a ⋆ of g ⋆                              X t = ψ + t 0 b(s, X, µ, q s , a ⋆ (s, X, Z s , µ, q s ))ds + t 0 σ s (X)dW µ,q,a ⋆ (•,X,Z•,µ,q•) s , Y Y 0 ,Z t (χ) = Y 0 + t 0 b(s, X, µ, q s , a ⋆ (s, X, Z s , µ, q s ))Z s -g ⋆ (s, X, Y Y 0 ,Z s (χ), Z s , µ, q s , χ s ) ds + t 0 Z s σ s (X)dW µ,q,a ⋆ (•,X,Z•,µ,q•) s , µ = P µ,q,a ⋆ (•,X,Z•,µ,q•) • X -1 , q t = P µ,q,a ⋆ (•,X,Z•,µ,q•) • (a ⋆ (t, X, Z t , µ, q t )) -1 ,
We now define Ξ as follows

Ξ := χ, U (-1) A Y Y 0 ,Z T (χ) , χ ∈ X , Y 0 ≥ R 0 , Z ∈ Z(χ) .
We have the following characterisation of the set Ξ as an immediate consequence of Theorem 4.1.

Corollary 4.1. Let Assumptions (B p,ℓ,η ), (σ), (K) and (C p,ℓ,m,m ) hold true for some

(p, ℓ, m, m, η) ∈ [1, +∞) × (0, +∞) × [ℓ, +∞) × (ℓ -1, +∞) × (1, +∞). Then Ξ = Ξ.
5 The Principal's problem: optimal control of a McKean-Vlasov SDE

This section is devoted to the proof of our main result, that is to say that the problem of the Principal amounts to solving a so-called mean-field type control problem.

Rewriting the Principal's problem

Using the characterisation of Ξ provided by Corollary 4.1, we have immediately

U P 0 = sup (χ,ξ)∈Ξ sup (µ,q,α)∈MFI r (χ,ξ) E X T -ξ - T 0 χ s ds = sup Y 0 ≥R 0 U P 0 (Y 0 ),
where

U P 0 (Y 0 ) := sup (χ,Z)∈X ×Z(χ) sup (µ,q,α)∈MFI r χ,U (-1) A Y Y 0 ,Z T E P µ,q,α X T -U -1 A (Y Y 0 ,Z T ) - T 0 χ s ds .
Hence, for any Y 0 ≥ R 0 , we can identify U P 0 (Y 0 ) as the value function of a stochastic optimal control problem with a two-dimensional state variable M χ,Z := (X, Y Y 0 ,Z (χ)) ⊤ controlled by the processes (χ, Z) ∈ X × Z(χ). Introducing the two functions

• C : [0, T ] × C 2 × P(C 2 ) × P(R) × R × R + -→ R 2 defined for any (t, m, µ, q, z, χ) ∈ [0, T ] × C 2 × P(C 2 ) × P(R) × R × R + by C(t, m, µ, q, z, χ) := b(t, m 1 , µ 1 , q, a ⋆ (t, m 1 , z, µ 1 , q)) k(t, m 1 , µ 1 , q)m 2 (t) + c(t, m 1 , µ 1 , q, a ⋆ (t, m 1 , z, µ 1 , q)) -u A (t, m 1 , µ 1 , q, χ) . • S : [0, T ] × C 2 × R -→ M 2 (R) defined for any (t, m, z) ∈ [0, T ] × C 2 × R by S(t, m, z) := σ t (m 1 ) 0 σ t (m 1 )z 0 ,
the dynamics of M χ,Z is then given by9

             M χ,Z t = ψ Y 0 + t 0 C(s, M χ,Z , µ, q s , Z s , χ s )ds + t 0 S(s, M χ,Z , Z s )1 2 dW a ⋆ (M 1 ,Z,µ 1 ,q) s , µ = P a ⋆ (M 1 ,Z,µ 1 ,q) • M χ,Z -1 , q t = P a ⋆ (M 1 ,Z,µ 1 ,q) • a ⋆ (t, M 1 , Z t , µ 1 , q t ) -1
, for Lebesgue a.e. t ∈ [0, T ].

(5.1)

Introducing finally the map G : R 2 -→ R, such that for any m ∈ R 2 ,

G(m) := m 1 -U -1 A (m 2
), the problem of the Principal can finally be linked to

U P 0 (Y 0 ) = sup (χ,Z)∈X ×Z(χ) sup (µ,q,α)∈MFI r χ,U (-1) A Y Y 0 ,Z T E P µ,q,α G M χ,Z T - T 0 χ s ds , (5.2)
Remark 5.1. Notice that the dynamics of M does not depend on the law of its second coordinate. We nonetheless used this notation to stay within the framework of [START_REF] Pham | Bellman equation and viscosity solutions for mean-field stochastic control problem[END_REF] or [START_REF] Carmona | Forward-backward stochastic differential equations and controlled McKean-Vlasov dynamics[END_REF].

Solving such a problem in full generality goes far beyond the scope of the present paper, and this question is actually the subject of a great number of current studies. Once again, our main message here is that the a priori quite complicated problem faced by the Principal, consisting in finding a Stackelberg equilibrium between himself and a mean-field equilibrium of interacting Agents, is actually amenable to a dynamic programming approach, and leads to a simpler problem of mean-field type control.

In the subsequent sections, we will describe informally two possible approaches to solve the problem of the Principal that have been proposed in the literature, before providing several explicitly solvable examples in Section 6.

An approach using the dynamic programming principle in the Markovian case

The first approach that we present (but not the first chronologically) to solve (5.2) is mainly based on the recent papers [START_REF] Bayraktar | Randomized dynamic programming principle and Feynman-Kac representation for optimal control of McKean-Vlasov dynamics[END_REF][START_REF] Pham | Linear quadratic optimal control of conditional McKean-Vlasov equation with random coefficients and applications[END_REF][START_REF] Pham | Bellman equation and viscosity solutions for mean-field stochastic control problem[END_REF][START_REF] Pham | Discrete time McKean-Vlasov control problem: a dynamic programming approach[END_REF][START_REF] Pham | Dynamic programming for optimal control of stochastic McKean-Vlasov dynamics[END_REF] (see the references therein for earlier results) and consists in using the dynamic programming principle and solving the corresponding Hamilton-Jacobi-Bellman equation in an infinite dimensional space. Of course, this requires to work in a Markovian framework, namely that, abusing notations slightly, for any (t, x, µ, q, a)

∈ [0, T ] × C × P(C) × P(R) × R + b(t, x, µ, q, a) = b(t, x(t), µ t , q, a), c(t, x, µ, q, a) = c(t, x(t), µ t , q, a), k(t, x, µ, q) = k(t, x(t), µ t , q),
where for any (t, µ) ∈ [0, T ] × P(C), we define µ(t) ∈ P(R) by

µ t [A] := µ [{ω ∈ Ω, ω(t) ∈ A}] , for every A ∈ B(R).
In order to give a precise meaning to the notion of differentiability in this framework, we follow [67, Section 4.2], which is based on the original ideas of Lions [START_REF] Lions | Théorie des jeux de champ moyen et applications[END_REF] (see also the lecture notes of Cardaliaguet [START_REF] Cardaliaguet | Notes on mean field games (from P.-L. Lions' lectures at Collège de France)[END_REF]), and introduce the differentiability with respect to a probability measure, based on a lifting procedure.

Let n be a positive integer and let u :

P(R n ) -→ R. We define ũ : L 2 (Ω, F T , R n ) -→ R by ũ(η) := u(L(η)) for any η ∈ L 2 (Ω, F T , R n ).
We then say that u is differentiable on P(R n ) if ũ is Fréchet differentiable on L 2 (Ω, F T , R n ) and we denote by [Dũ](η) its Fréchet derivative in the direction of η, which can be identified as a linear operator from L 2 (Ω, F T , R n ) into R.

According to Riesz's Theorem, for any η ∈ L 2 (Ω,

F T , R n ) there exists Dũ(η) ∈ L 2 (Ω, F T , R n ) such that for any Y ∈ L 2 (Ω, F T , R n ) [Dũ](η)(Y ) = E[Dũ(η) • Y ].
We then introduce the notation ∂ ρ u(L(η)) : R n -→ R n as follows

Dũ(η) =: ∂ ρ u(L(η))(η),
and call the latter the derivative of u at ρ = L(η). We now say that u is partially twice differentiable on P(R n ) if u is differentiable in the above sense, and such that the mapping (ρ, x)

∈ P(R n ) × R n -→ ∂ ρ u(ρ)(x
) is continuous at any point (ρ, x), with x being in the support of ρ, and if for any

ρ ∈ P(R n ), the map x ∈ R n -→ ∂ ρ u(ρ)(x) is differentiable. We denote the gradient of ∂ ρ u(ρ)(x) by ∂ x ∂ ρ u(ρ)(x) ∈ R n × R n .
We also recall that a generalised Itō's formula has been proved by Chassagneux, Crisan and Delarue [START_REF] Chassagneux | A probabilistic approach to classical solutions of the master equation for large population equilibria[END_REF], for functions from P(R n ) into R.

We will need to distinguish between two cases, depending on whether C depends on the variable q or not.

No dependance on the law of the controls

In this section, we assume that the drift b, the cost function c and the discount factor k do not depend on the variable q, which means that the drift of the Agent's output is only impacted by the actions of the other players through their outputs, and not their actions. This is the situation considered in [START_REF] Pham | Dynamic programming for optimal control of stochastic McKean-Vlasov dynamics[END_REF], from which we deduce that the Hamilton-Jacobi-Bellman equation associated with the McKean-Vlasov optimal control problem (5.2) is

       -∂ t v(t, ρ) - sup (χ,Z)∈X ×Z(χ) R 2 L χ,Z v(t, ρ)(x)ρ(dx) = 0, (t, ρ) ∈ [0, T ) × P(R 2 ), v(T, ρ) = R 2 G(x)ρ(dx), ρ ∈ P(R 2 ), (5.3)
where for any ϕ : [0, T ] × P(R 2 )) -→ R, which is continuously differentiable in t and twice continuously differentiable in ρ, for any

(t, ρ) ∈ [0, T ] × P(R 2 ), (χ, Z) ∈ X × Z(χ), the map L χ,Z ϕ(t, ρ) is defined from R 2 into R by L χ,Z ϕ(t, ρ)(x) := ∂ ρ ϕ(t, ρ) • C(t, x, ρ, Z, χ) + 1 2 Tr ∂ x ∂ ρ ϕ(t, ρ)(x)SS ⊤ (t, x, Z) -χ, x ∈ R 2 .
In the example studied in Section 6, we will provide an intuitive optimal contract such that the corresponding value function of the Principal is smooth and solves directly PDE (5.3). Combined with a verification theorem (see for instance Theorem 4.2 in [START_REF] Pham | Bellman equation and viscosity solutions for mean-field stochastic control problem[END_REF]), this ensures that we have indeed solved the Principal's problem. Notice however that in general, one should not expect existence of classical solutions to the above PDE, and one would have to rely on an appropriately defined notion of viscosity solutions. We refer the reader to [START_REF] Pham | Dynamic programming for optimal control of stochastic McKean-Vlasov dynamics[END_REF] for one possible approach.

Dependance on the law of the controls

We now turn to the case where the dependance with respect to the law q impacts the drift b, the cost function c and the discount factor k. This situation was recently studied in [START_REF] Pham | Bellman equation and viscosity solutions for mean-field stochastic control problem[END_REF], and requires some modifications compared to the previous case.

Let p ≥ 1 and let Lip p ([0, T ] × R × P(R); R) be the set of deterministic measurable functions Z :

[0, T ] × R × P(R) -→ R, such that for any t ∈ [0, T ], the map (x, µ) -→ Z(t, x, µ) is such that there exists a constant C > 0 satisfying for any

(t, x, x ′ , µ, µ ′ ) ∈ [0, T ] × R 2 × R 2 × P(R 2 ) × P(R 2 ) | Z(t, x, µ) -Z(t, x ′ , µ ′ )| ≤ C x -x ′ + W R 2 ,p (µ, µ ′ ) ,
and

T 0 Z(t, 0 2 , δ 0 2 )dt < +∞.
We now restrict our attention to control processes (χ, Z) ∈ X × Z(χ) which are actually (partially) Markovian, in the sense that there is a map

Z : [0, T ] × R 2 × P(R 2 ) in Lip p ([0, T ] × R × P(R); A) for some p ≥ 1, such that Z t = Z(t, X t , L(X t )), t ∈ [0, T ].
We denote by Zp the set of such processes. The main difference with Section 5.2.1 lies in the HJB equation associated with the Principal's problem (5.2) which becomes

       -∂ t v(t, ρ) - sup (χ,Z)∈X × Zp R 2 L χ,Z v(t, ρ)ρ(dx) = 0, (t, ρ) ∈ [0, T ) × P(R 2 ), v(T, ρ) = R 2 G(x)ρ(dx), ρ ∈ P(R 2 ).
(5.4)

On the admissibility of the optimal contract.

This short section adresses the problem of admissibility of the optimal contracts derived from the dynamic programming approach we just described. Assume that the HJB equation (5.4) admits10 a solution, and denote by (χ ⋆ , Z ⋆ ) the optimisers of the Hamiltonian. Recall that a contract (χ, ξ) is admissible, i.e. (χ, ξ) ∈ Ξ if it is in C and if (MFG)(χ, ξ) has a solution in MFI r (χ, ξ). According to Corollary 4.1, the admissibility of ξ, and so the existence of a mean-field equilibrium, relies on the existence of a solution in the sense of Definition (4.2), of the system (4.4). As explained in [START_REF] Carmona | A probabilistic weak formulation of mean field games and applications[END_REF]Remark 7.3], the main difficulty is that the process Z ⋆ can depend on the law of X and the existence of a solution to the system (4.4) is not clear. However, if for instance the process Z ⋆ is deterministic and belongs to the space L λr ([0, T ]), then the system (4.4) admits a solution in the sense of Definition (4.2), and as a consequence of Corollary 4.1, the contract

ξ ⋆ = U (-1) A Y R 0 ,Z ⋆ T (χ ⋆
) is optimal. This will be exactly the situation encountered in our solvable examples, so that admissibility comes for free in these case.

FBSDEs and the maximum principle

In this second approach, we follow mainly [START_REF] Carmona | Forward-backward stochastic differential equations and controlled McKean-Vlasov dynamics[END_REF]. Their work is based on the Pontryagin stochastic maximum principle, and as such requires quite restrictive assumptions, which will be listed below. We emphasise nonetheless that they will hold in the examples studied in Section 6.

Assumptions and main result

Let (χ, ξ) ∈ Ξ and assume for the sake of simplicity that MFI r (χ, ξ) is reduced to a unique triplet, denoted by (µ, q, a ⋆ ), solving (MFG)(χ, ξ). We assume that the drift b, the discount factor k, the cost function c and the utility u A do not depends on the variable q, so that the law q of the effort a ⋆ does not impact the output X, nor the utility function of the Agent. By considering the Markovian version of the system (5.1) controlled by the processes (χ, Z) ∈ X × Z(χ), the dynamics of M χ,Z becomes

     M χ,Z t = ψ Y 0 + t 0 C(s, M χ,Z s , µ, Z s , χ)ds + t 0 Σ(s, M χ,Z s , Z s )1 2 dW a ⋆ (M 1 ,Z,µ 1 ) s , µ = P a ⋆ (M 1 ,Z,µ 1 ) • M χ,Z -1 , (5.5)
where we abused notations and suppressed the dependency with respect to q in C and a ⋆ .

We first introduce the Hamiltonian associated with (5.2), see [START_REF] Carmona | Forward-backward stochastic differential equations and controlled McKean-Vlasov dynamics[END_REF]Section 3.4],

H : [0, T ] × R 2 × P(C 2 ) × R 2 × M 2 (R) × R × R + -→ R (t, x, µ, p, p ′ , z, χ) -→ C(t, x, µ, z, χ) • p + Tr Σ ⊤ (t, x, z)p ′ 2 - T 0 χ s ds.
We denote by ∂ µ H(t, x, µ, p, p ′ , z, χ) : R 2 -→ R 2 the derivative of H with respect to the distribution µ, as defined in Section 5.2. Let (p, p ′ ) ∈ R 2 × M 2 (R), following [16, Section 3.2], we say that the map (x, µ, z, χ) -→ H(t, x, µ, p, p ′ , z, χ) is concave dt ⊗ dP a.e., if for every

(x, x ′ , µ, µ ′ , z, z ′ , χ, χ ′ ) ∈ R 2 × R 2 × P(C 2 ) × P(C 2 ) × R × R × R + × R + we have H(t, x ′ , µ ′ , p, p ′ , z ′ , χ ′ ) -H(t, x, µ, p, p ′ , z, χ) ≤ ∂ x H(t, x, µ, p, p ′ , z, χ) • (x ′ -x) + ∂ z H(t, x, µ, p, p ′ , z, χ)(z -z ′ ) + ∂ χ H(t, x, µ, p, p ′ , z, χ)(χ -χ ′ ) + E ∂ µ H(t, x, µ, p, p ′ , z, χ)( X ) • ( X′ -X) , dt ⊗ dP -a.e., (5.6)
whenever X and X′ are square integrable random variables with distributions µ and µ ′ respectively. H will be said to be convex if -H is concave.

Let M χ,Z be the solution to SDE (5.5) controlled by (χ, Z) ∈ X × Z(χ). Similarly to [16, Definition 3.5], we now introduce the adjoint process of M χ,Z as any pair (Y, Z) of processes in

H 2 (R 2 ) × H 2 (M 2 ) satisfying Y t = ∂ x G(M χ,Z T ) + E ⋆ ∂ µ G M χ,Z T M χ,Z T + T t ∂ x H(s, M χ,Z s , µ, Y s , Z s , Z s , χ s )ds - T t Z s 1 2 dW a ⋆ (M 1 ,Z,µ 1 ) s + T t E ⋆ ∂ µ H(s, M χ,Z s , µ, Y s , Z s , Z s , χ s )(M χ,Z s ) ds, (5.7)
where ( M χ,Z , Y, Z, Z, χ) is an independent copy of (M χ,Z , Y, Z, Z, χ) and E ⋆ denotes the expectation on a copy ( C, F, P ⋆ ) of (C, F, P a ⋆ (M 1 ,Z,µ 1 ) ). In order to ensure the existence of an optimal control in the Principal's problem (5.2), we need to consider the following assumption.

Assumption 5.1. FBSDE (5.7) admits a unique solution

(Y, Z) in H 2 (R 2 ) × H 2 (M 2 ).
Conditions ensuring that Assumption 5.1 holds are studied in [16, Section 5], we refer to Assumptions (B1) -(B4) and Theorem 5.1 in [START_REF] Carmona | Forward-backward stochastic differential equations and controlled McKean-Vlasov dynamics[END_REF]. We will consider the following assumption on the regularity of C and G corresponding to [16, Assumptions (A3)-(A4)] in our framework.

Assumption 5.2. (i)

The optimal reaction effort a ⋆ given by Lemma 4.1 is continuously differentiable with respect to (x, z, µ).

(ii) The drift b is continuously differentiable with respect to (x, µ, a).

(iii) The volatility σ is continuously differentiable with respect to x.

(iv) The discount factor k is continuously differentiable with respect to (x, µ).

(v) The cost function c is continuously differentiable with respect to (x, µ, a, χ).

(vi) The utility u A is continuously differentiable with respect to (x, µ, χ).

(vii) G is continuously differentiable.

(viii) b(t, 0 2 , δ 0 2 , a ⋆ (t, 0, 0, δ 0 2 )), c(t, 0 2 , δ 0 2 , a ⋆ (t, 0, 0, δ 0 , 0), 0), u A (t, 0 2 , δ 0 2 , 0) are uniformly bounded.

(ix) ∂ z a ⋆ , ∂ x a ⋆ , ∂ x b, ∂ a b, ∂ x σ, ∂ x c, ∂ a c, ∂ χ c, ∂ x k, ∂ x u A , ∂ χ u A are uniformly bounded. (x) the maps x ′ -→ ∂ µ (a ⋆ , b, k, c, u A )(•)(x ′
) are uniformly bounded with respect to (•).

Remark 5.2. Assumption 5.2 ensures that C is continuously differentiable with respect to (x, µ, z, χ), that C(t, 0 2 , δ 0 2 , 0, 0) is uniformly bounded, and that

∂ x C, ∂ z C, ∂ χ C and x ′ -→ ∂ µ C(t, x, µ, z, χ)(x ′
) are uniformly bounded. Thus, Assumption 5.2 coincides exactly with Assumptions (A3) and (A4) in [START_REF] Carmona | Forward-backward stochastic differential equations and controlled McKean-Vlasov dynamics[END_REF].

Theorem 5.1 (Theorem 4.6 of [START_REF] Carmona | Forward-backward stochastic differential equations and controlled McKean-Vlasov dynamics[END_REF]). Let Assumptions 5.1 and 5.2 hold, and let (χ, Z) ∈ X × Z(χ) be an admissible control and denote by M χ,Z corresponding controlled state process defined as the solution to SDE (5.1). We denote by (Y, Z) the pair of adjoint processes associated with X. Assume moreover that the map x -→ G(x) is concave and the map

(x, µ, z, χ) -→ H(t, x, µ, Y t , Z t , z, χ) is concave dt ⊗ dP almost everywhere. If there exists (χ ⋆ , Z ⋆ ) ∈ X × Z(χ) such that H(t, M χ,Z t , µ, Y t , Z t , Z ⋆ t , χ ⋆ t ) = sup (χ,Z)∈X ×Z(χ) H(t, M χ,Z t , µ, Y t , Z t , Z, χ), (5.8)
then (χ ⋆ , Z ⋆ ) is an optimal control for the problem (5.2).

Checking for concavity

In this section, we provide conditions under which the concavity assumptions in Theorem 5.1 hold. Let us start by proving that for some classical utility functions U A for the Agent, G is concave.

• Assume that the Agent is risk neutral, i.e. U A (x) = x, x ∈ R. Then, G is obviously concave.

• If now U A is an exponential utility function, we have

G(m) = m 1 -U -1 A (m 2 ), U A (x) = -e -x , m 2 ≤ 0. Then U -1 A (m 2 ) = -log(-m 2 ) and G(m) = m 1 + log(-m 2 )
, which is obviously concave. We now turn to the concavity of the map (x, µ, z, χ) -→ H(t, x, µ, Y t , Z t , z, χ), dt⊗dP almost everywhere in the sense of (5.6). Assume for instance that for any (s, x, µ, a)

∈ [0, T ] × R × P(C) × R + , b(s, x, µ, a) := a + B 1 (x) + B 2 (µ), σ t (x) = σ,
with σ > 0 and where B 1 : R -→ R and B 2 : P(R) -→ R are concave and chosen such that Assumptions 5.1 and 5.2 hold (see [START_REF] Carmona | Forward-backward stochastic differential equations and controlled McKean-Vlasov dynamics[END_REF]Section 5]). Assume also that c(a) = ca 2 /2, c > 0 and k = 0. Then a ⋆ (z) = z/c. Assume moreover that (x, µ, χ

) ∈ R × P(R) × R + -→ u A (t, x, µ, χ) is concave dt ⊗ dP -a.e. We denote by (Y, Z) = (Y 1 , Y 2 ) ⊤ , Z ∈ H 2 (R 2 ) × H 2 (M 2
) the adjoint process of M χ,Z . In this setting recall that

H(t, x, µ, Y t , Z t , z, χ) = b t, x, µ, z c Y 1 t + z 2 2c -u A (t, x, µ, χ) Y 2 t + 1 2 Tr Σ ⊤ (t, x, z)Z t .
We finally consider the following assumption Assumption 5.3. For any t ∈ [0, T ], we have Y 2 t ≤ 0, Pa.s. Remark 5.3. Assumption 5.3 seems to be restrictive but can be easily satisfied. For instance, if U A (x) = x, x ∈ R 2 , then ∂ x G(x) = (1, -1) ⊤ for any x ∈ R 2 . Thus, since k = 0 and from the definition of H together with (5.7), one proves that

Y 2 t = -1. Similarly, if U A (x) = -e -x , x ∈ R 2 , we get ∂ x G(x) = (-1, -1/|x 2 |) ⊤ , x ∈ R 2 and Y 2
t ≤ 0. Therefore, as soon as Assumption 5.3 holds, the map (x, µ, z, χ) -→ H(t, x, µ, Y t , Z t , z, χ) is concave dt ⊗ dP almost everywhere. If in addition the Agent is risk-neutral or has exponential utility (so that G is also concave), then Theorem 5.1 applies, any (χ ⋆ , Z ⋆ ) satisfying (5.8) is optimal for the Principal's problem (5.2).

Some explicitly solvable examples

In this section, we study an explicit model where the dynamic of the output process depends on its mean and its variance. We fix some p ≥ 1 associated to the definition of the space Zp .

Quadratic dynamics and power cost

Let α ∈ [0, 1 2 ) and β 1 , β 2 , γ ≥ 0. We define for any (s, x, µ, q, a)

∈ [0, T ] × R × P(C) × P(R) × R + , b(s, x, µ, q, a) := a + αx + β 1 R zdµ s (z) + β 2 R zdq s (z) -γV µ (s), with V µ (s) := R |z| 2 dµ s (z) + R zdµ s (z) 2
, and for fixed n > 1, c(s, x, µ, q, a) := c |a| n n , c > 0.

Recalling the definitions of ℓ, m, m, we check immediately that Assumptions (B p,ℓ,η ) and (C p,ℓ,m,m ) hold with ℓ = 1, m = m = n -1.

In this model, we have a ripple effect in the sense that both the value of the project managed by the representative, and the average values of the projects managed by the other, impact linearly through the parameter β 1 the drift of X. The better the situation is (that it the further away from 0 X and his mean are), the better it will be, and conversely if things start to go wrong. Similarly, we assume that large disparities between the values of the projects have a negative impact on the future evolution of the value of the firm, through the variance penalisation parameter β 2 . We interpret this as an indicator of possible frailness and potential instability of the firm, that should be avoided.

For the sake of simplicity, we assume in this applicative section that u A = 0 (the Agent only receives a terminal payment ξ), k = 0 (no discount factor), U A (x) = x, x ∈ R (the Agent is risk neutral). To alleviate notations, we omit the dependence with respect to χ in every objects previously defined and we denote κ := α + β 1 .

Notice that this example that we consider does not fall into the class of so-called linear-quadratic problems, which are, as far as we know, the only explicitly solved ones in the mean-field game literature. Indeed, the drift of the the diffusion X in our case is quadratic, due to the variance penalisation, while the cost of effort is a power function with any exponent n > 1.

Agent's optimal effort

Recall now the BSDE associated to the Agent value function U A t (ξ, µ, q) is given by

Y µ,q t (ξ) = ξ + T t g ⋆ s, X, Z µ,q s (ξ), µ, q s ds - T t Z µ,q s (ξ)σdW s ,
where in this context we can compute that

g ⋆ s, x, z, µ, q s = |z| n n-1 c 1 n-1 1 - 1 n + z αx + β 1 R zdµ s (z) + β 2 R zdq s (z) -γV µ (s) .
Let a ⋆ (Z µ,q ) be the corresponding optimiser, i.e.

a ⋆ s (Z µ,q ) := |Z µ,q s | c 1 n-1 .
Thus, according to Theorem 4.1, as soon as the corresponding system (4.2) has a solution denoted by (Y ⋆ , Z ⋆ , µ ⋆ , q ⋆ ), (µ ⋆ , q ⋆ , a ⋆ s ) is solution to (MFG)(ξ) and a ⋆ s := a ⋆ s (Z ⋆ ) is optimal for the Agent.

Principal's problem

Recall from Section 5.2.2 that the HJB equation associated with the Principal's problem is

       -∂ t v(t, ρ) - sup (χ,Z)∈X × Zp R 2 L χ,Z v(t, ρ)ρ(dx) = 0, (t, ρ) ∈ [0, T ) × P(R 2 ), v(T, ρ) = R 2 G(x)ρ(dx), ρ ∈ P(R 2 ). (6.1)
In our particular case, we can solve explicitly HJB equation (6.1) and using a verification result we can solve completely the problem of the Principal (5.2). All the details are postponed to the appendix ,and lead us to our main result Theorem 6.1. The optimal contract for the problem of the Principal is

ξ ⋆ := δ + β 1 (1 + β 2 ) T 0 e (α+β 1 )(T -t) X t dt + (1 + β 2 ) X T -e (α+β 1 )T X 0
for some constant δ explicitly given by (A.7) in the proof. Besides, the contract ξ * is a Normal random variable and

ξ * ∼ N R 0 + (1 + β 2 ) n n-1 nc e n n-1 (α+β 1 )(T ) -1 ; σ 2 (1 + β 2 ) 2 e 2(α+β 1 )T -1 .
The associated optimal effort of the Agent is deterministic and given by

a ⋆ u := (1 + β 2 ) 1 n-1 e (α+β 1 )(T -u) c 1 n-1 , u ∈ [0, T ].

Economic interpretations

We focus in this section on the impact of different parameters of the model on the designed contract, the optimal effort of the Agent and the value function of the Principal. Since the optimal effort is deterministic, X and ξ ⋆ are Gaussian, and we only need to study their expectation and variance. The salary ξ ⋆ always decomposes into a fixed part denoted δ and a (possibly negative) variable part, indexed on the output process X. The one by one sensitivities to the different parameters of the model are summed up in the next tabular. The sensitivities of the fixed salary part and the expected gain of the Principal with respect to a parameter, are computed when the other parameters are equal to 0. The last two columns of the tabular have to be understood as follows: the parameters α and β 1 are both playing the roles of boosters of the health of the project, and we present in the last column the impact of parameter β 1 whenever α + β 1 is constant. This boils down to understanding the effect of balancing the boosting effect in the dynamics between the value of the project X, and the average value of the projects of the company. Similarly, the last column studies the consequences of partly replacing the effect of effort a ⋆ by the average amount of effort E ⋆ [a ⋆ ] produced in the company.

c α β 1 β 2 γ β 1 α+β 1 β 2 1+β 2 Expectation of ξ * ց ր ր ր = = = Variance of ξ * = ր ր ր = = =
Let us now detail further the economic interpretation of the impact of these parameters, by focusing on the optimal effort of the Agent, the shape of the optimal contract, and the value of the game for the Principal.

Optimal effort of the Agent (i) Let us first notice that the parameters α and β 1 play exactly the same role for the optimal effort a ⋆ , since they intervene only through their sum α + β 1 . Moreover, we observe that a ⋆ is non-decreasing with respect to these two parameters. Therefore, the higher the value of the project of the Agent is, and the higher the average value of the projects of the other Agents are, the more the Agents work. This is mainly due to the fact that α and β 1 play the roles of the boosters of the health of the project.

(ii) Similarly, a ⋆ is increasing with respect to β 2 . This is more surprising, since β 2 somehow measures the gain, in terms of the associated increase of the drift of X, that the Agent gets from the efforts of the other Agents. Hence, one could expect that the Agent may decide to work less and let the other ones do all the work for him. Therefore, at the optimum, the Principal gives sufficiently good incentives to the Agents so that at the equilibrium they select, they do not adopt any free-rider type behaviour. Ex post, since the optimal efforts are deterministic, we observe that replacing the effects of one Agent effort by the average effect of all the others does not modify in any way the solution to the problem.

(iii) Notice that a ⋆ decreases with the time t (or equivalently increases with the time left until maturity (Tt), whenever α + β 1 > 0. This was to be expected. Indeed, the Agent starts by working a lot at the beginning of the project, so as to increase the probability that its value will remain positive. Then he takes advantage of the boosting effect (due to α and β 1 ) to work less and less.

(iv) As expected, a ⋆ decreases with the cost parameter c: the more costly it is for the Agent to work, the more difficult it is going to be for the Principal to give him incentives to work.

(v) Quite surprisingly, both the volatility of the project σ, as well as the volatility penalisation, through the parameter γ, have no impact on a ⋆ . This is of course an unrealistic conclusion of the model, which is, according to us, a simple artefact of the fact that both the Principal and the Agent are risk-neutral here. As can be inferred from the general PDEs derived in Section 5.2, this effect should generally disappear for more general situations.

Optimal contract ξ * (i) The optimal contract always divides into a fixed salary δ, and a random part indexed on the performances of the project X, corresponding to the difference between the value of the project at time T , and the capitalized initial value of the project with rate α + β 1 (which is the rate generated by the project itself). Whenever β 1 = 0 and β 2 = 0, the Principal always transfers the totality of the project to the Agent and he does not keep any risk. This feature is classical since the Agent is risk-neutral. Indeed the same conclusions hold in Holmström and Milgrom's model [START_REF] Holmström | Aggregation and linearity in the provision of intertemporal incentives[END_REF].

(ii) Whenever β 2 > 0 and β 1 = 0, the Principal transfers to the Agents a fraction of the company, which happens to be greater than 1, and hereby faces a random terminal gain. In order to provide proper incentives to the Agents, the Principal accepts to face a random terminal payment which surprisingly decreases with the value of the company, but that he can compensate via a reduction of the fixed salary part δ. This feature disappears in the more realistic case where the project is impacted by a convex combination of both the effort of the representative Agent and the average efforts of all the other ones.

(iii) If β 1 > 0, it is worth noticing that the optimal contract ξ ⋆ is not Markovian anymore. The contract is indexed on all the values of the project X over time, with a growing importance as time approaches maturity. This effect is due to the impact of the other Agents project on the dynamics of the representative one, and would not appear using the parameter α only.

(iv) The fixed salary δ is decreasing with respect to α, β 1 and β 2 . Recall that these parameters have to be seen as boosters for the project. This reduction is compensated by the more advantageous dynamics of the project X, so that the average of the terminal payment ξ ⋆ is in fact increasing with these parameters.

(v) On the other hand, the fixed part δ of the optimal contract, as well as the average of the terminal payment ξ ⋆ increase with the variance penalization γ. The Principal increases the fixed part of the salary in order to compensate the negative effect on the dynamics of the project of the dispersion of the results of all the projects of the company.

Value of the game for the Principal (i) As in the classical Principal-unique agent model, all the Agents always obtain here their reservation utility. In our model, the interaction between the Agents does not create a situation where the Principal should provide them with a higher utility.

(ii) Since the Principal is risk-neutral, the value of the game for him is the expectation of his terminal gain. It is increasing with respect to the boosters α, β 1 , β 2 of the project, and is decreasing with the variance penalization γ, which is of course quite natural.

(iii) From the viewpoint of the Principal, it is more interesting to have project dynamics, which are boosted through the average level of the projects, instead of the level of the project itself. The averaging effect over the level of the different projects provide a more secure dynamics for each project of the company. On the other hand, interchanging the boosting effect provided by the effort of the representative Agent, with the one provided by the average effort of all Agents does not provide any extra value for the Principal.

Extension to risk averse Principal

In all this section, we assume for the sake of simplicity that α > 0. We now investigate a model in which the payoff of the Principal is penalised by the covariance between the project and the salary given to any Agent. More precisely, the Principal has to solve for some positive constants λ X , λ ξ , λ Xξ

U P 0 (Y 0 ) = sup (χ,Z)∈X ×Z(χ) E P ⋆ X T -ξ -λ X Var P ⋆ (X T ) -λ ξ Var P ⋆ (ξ) -λ Xξ Var P ⋆ (X T -ξ), (6.2)
where Var P ⋆ and Cov P ⋆ denote respectively the variance and the covariance under P ⋆ . We thus have the following theorem, and we refer to the appendix for its proof, Theorem 6.2. Let z ⋆ ∈ D be the unique maximiser of

z ∈ R -→ h(u, z) := (1 + β 2 ) |z| c 1 n-1 e κ(T -u) - |z| n n-1 c 1 n-1 n -(λ ξ + λ Xξ )σ 2 |z| 2 + 2λ Xξ σ 2 ze α(T -u) ,
for any u ∈ [0, T ]. The optimal contract for the problem of the Principal is

ξ ⋆ := δ(z ⋆ ) -α T 0 z ⋆ t X t dt + T 0 z ⋆ t dX t .
for some explicit constant δ(z ⋆ ), depending on z ⋆ and the associated optimal effort of the Agent is

a ⋆ u := z ⋆ u c 1 n-1 , u ∈ [0, T ].
Except in very special cases, the maximiser of the map h above cannot be computed explicitly. The case n = 2 is an exception, on which we now concentrate. 2 , c > 0 for the Agent, one gets

Particular case of quadratic cost

a ⋆ t = 1 + β 2 c (1 + 2(λ ξ + λ Xξ )cσ 2 ) e (α+β 1 )(T -t) + 2λ Xξ σ 2 1 + 2(λ ξ + λ Xξ )cσ 2 e α(T -t)
with optimal contract

ξ ⋆ = C + β 1 1 + β 2 1 + 2(λ ξ + λ Xξ )cσ 2 T 0 e κ(T -t) X t dt + 1 + β 2 + 2cλ Xξ σ 2 1 + 2(λ ξ + λ Xξ )cσ 2 X T ,
where C is an explicit constant. Besides,

ξ * ∼ N R 0 + c 2 T 0 |a ⋆ t | 2 dt ; T 0 c 2 σ 2 |a ⋆ t | 2 dt .
The sensitivities to the parameters λ X , λ ξ , λ Xξ of the model are summed up in the next tabular.

λ X λ ξ λ Xξ Optimal effort of the Agent = ց ց Expectation of ξ * = ց ց Variance of ξ * = ց ց Economic interpretation (i)
The optimal effort of the agent is decreasing with the penalisation of both the variance of ξ and the one of X Tξ. Indeed, lowering the value of the projects allows to reduce the variance of the output. As a consequence, the optimal contract provides incentives for Agents to provide less efforts.

(ii) Focus now on the particular case where β 1 = β 2 = 0, corresponding to the situation where there are no interactions between the project dynamics. If the Principal criterion is only penalized by X Tξ, we retrieve a similar solution as the one obtained in the previous study. Indeed, when both Principal and Agents are risk neutral, the optimal solution without penalisation already exhibits no variance, since the Agent keeps all the risk. Hence, it is also optimal for a Principal with mean-variance criterion.

(iii) Since the contract and the output process are Gaussian processes, whenever the optimal effort is deterministic, considering a mean variance criterion boils down in fact to solving an exponential utility criterion problem. We indeed retrieve the corresponding solutions, also whenever the Agent is meanvariance risk adverse as discussed in Remark 6.1 below.

(iv) The penalisation with respect to the dispersion of the project values has absolutely no effect on the optimal effort or the optimal contract. This is due to the fact that the variance of the output is not impacted by a deterministic effort and hence by the optimal one. This feature should disappear in less linear models where the optimal effort is not deterministic.

Remark 6.1. One could similarly consider the case where the Agents also optimize a mean-variance criterion of the form

U A 0 (ξ) = sup a E P a,µ,q ξ - T 0 c(a t )dt -λ A Var P a,µ,q [ξ].
In such a case, for a given contract ξ, the resolution of the Agent problem is done similarly. Then, considering ξ ′ := ξλ A Var P a,µ,q [ξ] and observing that Var P a,µ,q (ξ ′ ) = Var P a,µ,q [ξ], the Principal's problem rewrites exactly as (6.2), replacing λ ξ by λ ξ + λ A . Hence the previous results directly apply to the case where the Agent is mean-variance risk adverse.

Links with the solution of the N-players' problem

In this section, we go back to the framework of Section 2, and through an example, we aim at studying the behaviour of the optimal contract when N goes to +∞. We assume that the drift b N in the dynamic of the output X N is Markovian and defined for any

(t, x, a) ∈ [0, T ] × R N × A N by b N t, x, µ N (x), a := a + αx + β 1 R N wµ N (dw),
which can be rewritten (see the definition of µ N ) b N (t, x, µ N (x), a) = a + B N x, with

B N := αI N + β 1 N 1 N,N .
We assume that the volatility of the output is given by the N × N -matrix Σ := σI N , σ > 0 and the components of the initial condition ψ N are independent and identically distributed such that ψ N,i = ψ in law for any i ∈ {1, . . . , N }. We consider that the Agent is risk neutral (U A (x) = x) and he is penalised through his effort by the quadratic cost function c defined for any a ∈ A by c(a) := ca 2 /2, c > 0. Finally, we consider only terminal payments and we assume that there is no discount factor (k = 0). Thus, according to the general results of Section 2, we deduce that in this framework, the optimal effort for the Agents is given by the N -dimensional vector a N,⋆ (z) defined for any 1 ≤ i ≤ N and z ∈ M N (R) by

(a N,⋆ (z)) i = z i,i c .
We now define the map g :

M N (R) -→ R N by g(z) := 1 2c z 1,
) ∈ [0, T ] × (R N ) 2 × (R N ) 2 × (M N (R)) 3 G(t, x, y, p x , p y , γ x , γ y , γ xy ) = sup z∈M N (R) a ⋆ (z) • p x + g(z) • p y + σ 2 2 Tr z ⊤ zγ y + σ 2 Tr [zγ xy ] + B N x • p x + σ 2 2 Tr [γ x ] .
Since in Section 3.3 we actually consider a risk-neutral Principal, we decided, for the sake of simplicity and tractability to assume in this example that, Assumption 6.1. For the N -players' model, the Principal is risk neutral, i.e. his payoff is 1

N (X T - ξ) • 1 N .
We search now for a smooth solution to HJB equation (2.11)

of the form v(t, x, y) = f (t, x) -1 N y • 1 N , with ∂ x i x j f = 0, i = j. Such a solution requires that f satisfies the following PDE        -∂ t f -B N x • ∂ x f - σ 2 2 Tr [∂ xx f ] -sup z∈M N (R) a ⋆ (z) • ∂ x f - 1 N g(z) • 1 N = 0, (t, x) ∈ [0, T ) × R N , f (T, x) = 1 N x • 1 N , x ∈ R N . (6.
3) The optimal z is given by z ⋆ N := N diag(∂ x f ) and the PDE (6.3) becomes

       -∂ t f -B N x • ∂ x f - σ 2 2 Tr [∂ xx f ] - N 2c ∂ x f 2 = 0, (t, x) ∈ [0, T ) × R N , f (T, x) = 1 N x • 1 N , x ∈ R N . (6.4)
Using the Cole-Hopf transformation g := e γ ⋆ N f , with γ ⋆ := 1 cσ 2 we deduce that g must solve the following linear PDE

     -∂ t g -B N x • ∂ x g - σ 2 2 Tr [∂ xx g] = 0, (t, x) ∈ [0, T ) × R N , g(T, x) = e γ ⋆ x•1 N , x ∈ R N . (6.5)
Using Feynman-Kac's formula, we get an explicit smooth solution to PDE (6.5) given by

g(t, x) = exp γ ⋆ e (α+β 1 )(T -t) 1 N N i=1 x i + |γ ⋆ | 2 N σ 2 4(α + β 1 ) e 2(α+β 1 )(T -t) -1 .
Thus,

f N (t, x) = e (α+β 1 )(T -t) 1 N N i=1 x i + γ ⋆ σ 2 4(α + β 1 ) e 2(α+β 1 )(T -t) -1 ,
is a smooth solution to the HJB equation (6.4). Recall now that the optimal z for the HJB equation ( 6.3) is given by z

N,⋆ t = N diag(∂ x f N )(t, x), (t, x) ∈ [0, T ] × R N . Hence, z N,⋆ t = exp((α + β 1 )(T -t))I N , (6.6)
and the value function V N of the Principal is

V N (t, x, y) = e (α+β 1 )(T -t) 1 N N i=1 x i + γ ⋆ σ 2 4(α + β 1 ) e 2(α+β 1 )(T -t) -1 - 1 N N i=1 y i . (6.7)
Remark 6.2. Notice that the component of (z N,⋆ t ) i,i are identical. Thus, the optimal effort does not depend on the Agent. This is relevant since any Agents are supposed to be identical.

We thus have from Theorem 2.1 together with Theorem 6.1 the following theorem, whose the proof is postponed to the appendix, Theorem 6.3. Assume that for any i = 1, . . . , N , (λ N 0 ) i = λ 0 We have the following two properties.

(i) The optimal effort a N,⋆ of Agents in the N -players' model is given by

a N,⋆ t = exp((α + β 1 )(T -t)) c 1 N ,
In particular, for any i ∈ {1, . . . , N } we have (a N,⋆ t ) i = a ⋆ t , i.e. the optimal effort of the ith Agent in the N players model coincides with the optimal effort of the Agent in the mean-field model.

(ii) The optimal contract ξ N,⋆ proposed by the Principal is

ξ N,⋆ := R N 0 - T 0 exp(2κ(T -t)) 2c 1 N dt - T 0 e κ(T -t) B N X N t dt + T 0 e κ(T -t) dX N t ,
and for any i ∈ {1, . . . , N } we have

P a N,⋆ N • (ξ N,⋆ ) i -1 weakly -→ N →∞ P a ⋆ • (ξ ⋆ ) -1 .

A Appendix

A.1 Technical proofs of Section 3

Proof of Lemma 3.1. Let (µ, q, α) ∈ P(C) × P(R) × A. We set v A t (χ, ξ, µ, q, α) := E P µ,q,α K X,µ,q t,T U A (ξ) + T t K X,µ,q t,s (u A (s, X, µ, q s , χ s )c(s, X, µ, q s , α s ))ds F t , and

E t,T := E T t σ -1 s (X)b(s, X, µ, q s , α s )ds .
First of all, by Hölder's inequality, the definition of Ξ, A (recall (3.1)) and Assumptions (C p,ℓ,m,m ), (K) and (U), we have that the process v A (χ, ξ, µ, q, α) belongs to E(R). Hence11 , the process (M t ) t∈[0,T ] defined for any t ∈ [0, T ] by M t := E 0,t K X,µ,q 0,t v A t (χ, ξ, µ, q, α) + t 0 K X,µ,q 0,s (u A (s, X, µ, q s , χ s )c(s, X, µ, q s , α s )) ds , is a (P, F)-martingale in E(R). We deduce that exists an F-predictable process Z ∈ H p (R), for any p ≥ 0, such that

M t = M T - T t Z s σ s (X)dW s .
Applying Itō's formula, we obtain

dE -1 t = -E -1 t b(t, X, µ, q t , α t )σ -1 t (X)dW t + E -1 t |b(t, X, µ, q t , α t )| 2 σ -2 t (X)dt. Thus, d(E -1 t M t ) = Z t σ t (X)dW µ,q,α, t , with
Z t := E -1 t -M t b(t, X, µ, q t , α t )σ -2 t (X) + Z t .
By Assumptions (B p,ℓ,η ) and (σ), the definition of A, Hölder's inequality and the fact that Z ∈ H p (R) for any p ≥ 1, we deduce that we also have Z ∈ H p (R) for any p ≥ 1.

Finally, applying Itō's formula again and setting Y µ,q,α t (χ, ξ) := v A t (χ, ξ, µ, q, α), Z µ,q,α t (χ, ξ) := exp t 0 k(s, X, µ, q s )ds Z t ,

we deduce that (Y µ,q,α t (χ, ξ), Z µ,q,α t (χ, ξ)) is a solution to BSDE (3.4). Moreover, recalling that since F 0 is not trivial, the Blumenthal 0 -1 law does not hold here, we cannot claim that Y µ,q,α 0 (χ, ξ) is a constant, and it a priori depends on the canonical process ψ. We therefore have

E[Y µ,q,α 0 (χ, ξ)] = R Y µ,q,α 0 (χ, ξ)(x)λ 0 (dx) = v A 0 (χ, ξ, µ, q, α).

A.2 Technical proofs of Section 4

Proof of Lemma 4.1. Under Assumptions (B p,ℓ,η ), (K) and (C p,ℓ,m,m ), for any fixed (s, x, µ, q, y, z, χ) ∈ [0, T ] × C × P(C) × P(R) × R × R × R + , we have that the map a -→ g(s, x, y, z, µ, q, a, χ) is continuous. Therefore, if A is bounded, it is a compact subset of R and the existence of a bounded maximiser is obvious.

Assume now that A is unbounded. Then, it is also clear that for any fixed (s, x, µ, q, y, z, χ) ∈ [0, T ] × C × P(C) × P(R) × R × R × R + the map a -→ g(s, x, y, z, µ, q, a, χ) is coercive, in the sense that it goes to -∞ as |a| goes to +∞. Therefore, the existence of a maximiser is obvious. Besides, since neither k nor u A depend on a, then any maximiser clearly does not depend on χ and y. Let now a ⋆ (s, x, z, µ, q) ∈ argmax a∈A g(s, x, y, z, µ, q, a, χ). If it happens to belong to the boundary of A, then it is automatically bounded. Otherwise, if this is an interior maximiser, it satisfies the first order conditions z∂ a b(s, x, µ, q s , a ⋆ (s, x, z, µ, q)) = ∂ a c(s, x, µ, q s , a ⋆ (s, x, z, µ, q)).

(A.1)

Thus, by our assumptions on the derivatives of c and b, there exists some positive constant κ such that |a ⋆ (s, x, z, µ, q)| m ≤ κ|∂ a c(s, x, µ, q s , a ⋆ (s, x, z, µ, q))|

= κ|z||∂ a b(s, x, µ, q s , a ⋆ (s, x, z, µ, q))|

≤ κ|z| 1 + b 1 ( x s,∞ ) + C w p s,∞ µ(dw) 1 p + R |w| p q(dw) 1 p + κ|z||a ⋆ (s, x, z, µ, q)| ℓ-1 .
Therefore, if a ⋆ is unbounded, there exists D > 0 such that

|a ⋆ (s, x, z, µ, q)| ≤ D|z| 1 m+1-ℓ 1 + |b 1 ( x s,∞ )| 1 m+1-ℓ + C w p s,∞ µ(dw) 1 p(m+1-ℓ) + R |w| p q(dw) 1 p(m+1-ℓ)
.

Hence the desired result for a ⋆ . The growth for g at a ⋆ (s, x, z, µ, q) is immediate from our assumptions.

Proof of Theorem 4.1. The proof of this theorem is similar to the proof of Theorem 4.1 in [START_REF] Élie | Contracting theory with competitive interacting agents[END_REF] and based on the so-called martingale optimality principle. We prove it in two steps.

Step 1: a solution to (MFG)(χ, ξ) provides a solution to BSDE (4.2). Let (µ, q, α ⋆ ) be a solution to (MFG)(χ, ξ). Let τ ∈ T [0,T ] , the set of F-stopping times valued in [0, T ]. We define the following family of random variables

V A τ (χ, ξ, µ, q) := ess sup α∈A v A τ (χ, ξ, µ, q, α),
where we recall that

v A τ (χ, ξ, µ, q, α) = E P µ,q,α K X,µ,q τ,T U A (ξ) + T τ K X,µ,q τ,s (u A (s, X, µ, q s , χ s ) -c(s, X, µ, q s , α s ))ds F τ .
From for instance Theorem 2.4 in [START_REF] Karoui | Capacities, measurable selection and dynamic programming part ii: application in stochastic control problems[END_REF] as well as the discussion in their Section 2.4.2, we recall that this family satisfies the following dynamic programming principle

V A τ (χ, ξ, µ, q)
= ess sup α∈A E P µ,q,α K X,µ,q τ,θ V θ (χ, ξ, µ, q) + θ τ K X,µ,q τ,s (u A (s, X, µ, q s , χ s )c(s, X, µ, q s , α s ))ds F τ , for any θ ∈ T [0,T ] with τ ≤ θ, Pa.s. We thus notice that for any α ∈ A, the family K X,µ,q 0,τ V A τ (χ, ξ, µ, q) + τ 0 K X,µ,q 0,s (u A (s, X, µ, q s , χ s )c(s, X, µ, q s , α s ))ds

τ ∈T [0,T ]
, is a P µ,q,α -super-martingale system which can be aggregated (see [START_REF] Dellacherie | Sur des problèmes de régularisation, de recollement et d'interpolation en théorie des martingales[END_REF]) by a unique F-optional process coinciding with

(M α t ) t∈[0,T ] := K X,µ,q 0,t V A t (χ, ξ, µ, q) + t 0 K X,µ,q 0,s (u A (s, X, µ, q s , χ s ) -c(s, X, µ, q s , α s )) ds t∈[0,T ] ,
which is therefore a P µ,q,α -super-martingale for any α ∈ A.

We now check that M α ⋆ is a P µ,q,α ⋆ -uniformly integrable martingale. Since (µ, q, α ⋆ ) is a solution to (MFG)(χ, ξ), we have

V A 0 (χ, ξ, µ, q) = v A 0 (χ, ξ, µ, q, α ⋆ ) = E P µ,q,α ⋆ K X,µ,q 0,T U A (ξ) + T 0 K X,µ,q 0,s (u A (s, X, µ, q s , χ s ) -c(s, X, µ, q s , α ⋆ s ))ds .
By the super-martingale property, we thus have

V A 0 (χ, ξ, µ, q) ≥ E P µ,q,α ⋆ M α ⋆ t ≥ E P µ,q,α ⋆ M α ⋆ T = V A 0 (χ, ξ, µ, q).
Hence, M α ⋆ t = E P µ,q,α ⋆ M α ⋆ T F t , which shows that M α ⋆ is a P µ,q,α ⋆ -martingale, which is uniformly integrable under Assumptions (B p,ℓ,η ), (σ), (K) and (C p,ℓ,m,m ). Furthermore, it is also clear thanks to Hölder's inequality that V A belongs to E(R), since α ⋆ ∈ A. By Lemma 3.1, we deduce that there exists some process Z µ,q,α ⋆ ∈ H λr exp (R) (recall that the solution of the mean-field game is assumed to be in MFI r (χ, ξ)) such that

V A t (χ, ξ, µ, q) = U A (ξ) + T t g s, X, V A s (χ, ξ, µ, q), Z µ,q,α ⋆ s (χ, ξ), µ, q s , α ⋆ s , χ s ds - T t Z µ,q,α ⋆ s (χ, ξ)σ s (X)dW s .
We thus deduce that for any α ∈ A, we have

M α t = K X,µ,q 0,T U A (ξ) + T t g s, X, V A s (χ, ξ, µ, q), Z µ,q,α ⋆ s (χ, ξ), µ, q s , α ⋆ s , χ s ds - T t Z µ,q,α ⋆ s (χ, ξ)σ s (X)dW µ,q,α s .
Since M α t has to be a P µ,q,α -super-martingale, we have necessarily for any α ∈ A g s, X, V A s (χ, ξ, µ, q), Z µ,q,α ⋆ s (χ, ξ), µ, q s , α ⋆ s , χ s ≥ g s, X, V A s (χ, ξ, µ, q), Z µ,q,α ⋆ s (χ, ξ), µ, q s , α s , χ s .

By setting Y ⋆ (χ, ξ) := V (χ, ξ, µ, q), Z ⋆ (χ, ξ) := Z µ,q,α ⋆ (χ, ξ), we have finally proved that the quadruple (Y ⋆ (χ, ξ), Z ⋆ (χ, ξ), µ, q) is a solution to BSDE (4.2) and α ⋆ ∈ A X,Z ⋆ ,µ,q .

Step 2: a solution to BSDE (4.2) provides a solution to (MFG)(χ, ξ).

Let now (Y ⋆ (χ, ξ), Z ⋆ (χ, ξ), µ, q) be a solution to BSDE (4.2). Recall from Lemma 4.1 together with a measurable selection argument that there exists a process a ⋆ (•, X, Z ⋆ (χ, ξ), µ, q • ) ∈ R such that

a ⋆ s := a ⋆ (s, X, Z ⋆ s (χ, ξ), µ, q s ) ∈ argmax a∈A g(s, X, Y ⋆ s (χ, ξ), Z ⋆ s (χ, ξ), µ, q s , a).
Following the computations of Step 1, we obtain that for any α ∈ A,

( M α t ) t∈[0,T ] := K X,µ,q 0,t Y ⋆ t (χ, ξ) + t 0 K X,µ,q 0,s (u A (s, X, µ, q s , χ s ) -c(s, X, µ, q s , α s ))ds t∈[0,T ]
, is a P µ,q,α -super-martingale and a P µ,q,a ⋆ -martingale, which is uniformly integrable since Y ⋆ (χ, ξ) ∈ E(R). Remember that by Lemma 3.1 we have

v A 0 (χ, ξ, µ, q, a ⋆ ) = E P [Y ⋆ 0 (χ, ξ)] = E P µ,q,a ⋆ [Y ⋆ 0 (χ, ξ)],
since the only randomness in Y ⋆ 0 (χ, ξ) comes from the canonical process ψ, so that it does not matter which probability measure you use in the expectation. We thus have for any α ∈ A, using Fubini's Theorem and the fact that M α 0 is actually independent of α by construction

v A 0 (χ, ξ, µ, q, a ⋆ ) = E P µ,q,a ⋆ [Y ⋆ 0 (χ, ξ)] = E P µ,q,a ⋆ M a ⋆ T = E P µ,q,a ⋆ M α 0 = E P µ,q,α M α 0 ≥ E P µ,q,α M α T = v A 0 (χ, ξ, µ, q, α).
It therefore means that we have V A 0 (χ, ξ, µ, q) = v A 0 (χ, ξ, µ, q, a ⋆ ). Furthermore, we have by definition that P µ,q,a ⋆ • (X) -1 = µ and P µ,q,a ⋆ • (a ⋆ t ) -1 = q t for Lebesgue almost every t ∈ [0, T ]. Hence, it simply remains to prove that a ⋆ is indeed in A to deduce that (µ, q, a ⋆ ) is a solution to (MFG)(χ, ξ). Recall that Z ⋆ ∈ H λr exp (R). We then obtain for any h ≥ 1 and for some constants κ, κ > 0 and by denoting r the conjugate of r

E exp h T 0 |a ⋆ t | ℓ+m dt ≤ κE exp hκ T 0 |Z ⋆ t | λ 1 + b 1 ( X t,+∞ ) λ dt ≤ κE    exp   hκ T 0 |Z ⋆ t | λr dt 1 r T 0 |b 1 ( X t,+∞ )| λr dt   1 r    ≤ κE exp hκ T 0 |Z ⋆ t | λr dt < +∞,
by using Lemma 4.1, Hölder's Inequality, Young's Inequality and the definition of Z ⋆ . Thus Condition (2.5) holds. We now show that a ⋆ ∈ A ε for some ε > 0. Recall that ℓ ≤ m. Then, there exists a positive constant κ > 0 which may vary from line to line such that for any h, k > 1 we have by Hölder's inequality

E exp k 2 T 0 |σ -1 t (X)b(t, X, µ, q t , a ⋆ t )| 2 dt ≤ κE exp 3M 2 k 2 T 0 C 2 |a ⋆ t | 2ℓ + |b 0 ( X t,∞ )| 2 dt ≤ κE exp 3M 2 C 2 kh 2(h -1) T 0 |a ⋆ t | 2ℓ dt 1-1 h E exp 3hkM 2 2 T 0 |b 0 ( X t,∞ )| 2 dt 1 h
, which is finite as soon as ph ≤ η.

Thus, since η > 1, we can choose k > 1, so that by Lépingle and Mémin [START_REF] Lépingle | Intégrabilité uniforme et dans l r des martingales exponentielles[END_REF][Théorème a)], we deduce that there exists ε > 0 such that

E E T 0 σ -1 t (X)b(t, X, µ, q t , a ⋆ t )dW t 1+ε < +∞.
Proof of Corollary 4.1. Let (χ, ξ) ∈ Ξ. From Theorem 4.1, there exists (Y ⋆ , Z ⋆ , µ, q) ∈ E(S) × H λr exp (R) × P(C) × P(R) such that (Y ⋆ , Z ⋆ , µ, q) is a solution to BSDE (4.2). Besides, the proof of the Step 1 of Theorem 4.1 shows that E[Y ⋆ 0 ] = V A 0 (χ, ξ, µ, q) ≥ R 0 . Thus, we deduce that the system (4.4) admits a solution with parameters Y

0 := E[Y ⋆ 0 ] and Z := Z ⋆ . Thus (χ, ξ) ∈ Ξ. Conversely, let (χ, ξ) ∈ Ξ with ξ = U (-1) A Y Y 0 ,Z T (χ)
where the quadruple (Y Y 0 ,Z (χ), Z, µ, q) is a solution to the system (4.4) with Y 0 ≥ R 0 and Z ∈ Z(χ). Then, according to Theorem 4.1, we deduce that (χ, ξ) ∈ Ξ.

A.3 Technical proofs of Section 6

Proof of Theorem 6.1. For the considered model, we will show that there exists a smooth solution to HJB equation (6.1) and that the optimal z is in D. This leads us to set the following ansatz Ansatz 1. The optimal z for the HJB equation (6.1) is in D.

Considering this ansatz, and by denoting U (t, ν) the correspond dynamic version of the problem of the Principal with Z restricted to D, we obtain for any (t, ν) ∈ [0, T ] × P(C 2 )

U P (t, ν) = sup z∈D T t H(u, z u )du + R xν 1 (dx)e κ(T -t) - R xν 2 (dx) -γ T t e κ(T -u) e 2α(u-t) V ν 1 (t) + σ 2 2α (e 2α(u-t) -1)1 α>0 + σ 2 (u -t)1 α=0 du, (A.2)
where -u) is optimal for this sub-optimal problem. As for the corresponding value, we need to distinguish several cases.

H(u, z) := (1 + β 2 ) |z| c 1 n-1 e κ(T -u) - |z| n n-1 c 1 n-1 n . Thus, z ⋆ u := (1 + β 2 )e κ(T
• If α = β 1 = 0, we get

U P (t, ν) = (T -t) (1 + β 2 ) n n-1 c 1 n-1 n -1 n + R xν 1 (dx) - R xν 2 (dx) -γ(T -t) R |x| 2 ν 1 (dx) - R xν 1 (dx) 2 -γσ 2 (T -t) 2 2 .
• If α = 0 and β 1 > 0, we get

U P (t, ν) = T t (1 + β 2 ) n n-1 e β 1 n n-1 (T -u) c 1 n-1 1 - 1 n du + R xν 1 (dx)e β 1 (T -t) - R xν 2 (dx) -γ e β 1 (T -t) -1 β 1 R |x| 2 ν 1 (dx) - R xν 1 (dx) 2 -γσ 2 T t e β 1 (T -u) (u -t)du.
• If α > 0 and α = β 1 , we get

U P (t, ν) = T t (1 + β 2 ) n n-1 e κ n n-1 (T -u) c 1 n-1 1 - 1 n du + R xν 1 (dx)e κ(T -t) - R xν 2 (dx) - γ 2α -κ (e 2α(T -t) -e κ(T -t) ) R |x| 2 ν(dx) - R xν(dx) 2 + σ 2 2α - γσ 2 2ακ
(1e κ(T -t) ).

(A.3)

• If α > 0 and α = β 1 we have

U P (t, ν) = T t (1 + β 2 ) n n-1 e κ n n-1 (T -u) c 1 n-1 1 - 1 n du + R xν 1 (dx)e κ(T -t) - R xν 2 (dx) -γe 2α(T -t) (T -t) R |x| 2 ν 1 (dx) - R xν 1 (dx) 2 + σ 2 2α - γσ 2 4α 2 κ (1 -e 2α(T -t) ).
We only prove the result when α = β 1 and α, β 1 > 0 since the other cases can be obtained similarly.

The proof is divided in three steps. In the first one, we show that U P (t, ν) is a smooth solution to the HJB equation (6.1). In the second step, we provide a verification theorem by adapting the proof of [67, Theorem 4.1], and in the last step we compute explicitly the optimal contract ξ ⋆ .

Step 1: a smooth solution to the HJB equation (6.1). Direct computations show that

∂ ν 2 U P (t, ν)(x 1 , x 2 ) = -1, ∂ ν 1 U P (t, ν)(x 1 , x 2 ) = e κ(T -t) - 2γ 2α -κ (e 2α(T -t) -e κ(T -t) ) x 1 - R xν 1 (dx) , ∂ x ∂ ν U P (t, ν)(x 1 , x 2 ) = -2 γ 2α-κ (e 2α(T -t) -e κ(T -t) ) 0 0 0 , and
-∂ t U P (t, ν)(x) = (1 + β 2 ) n n-1 e κ n n-1 (T -t) c 1 n-1 1 - 1 n + κ R xν 1 (dx)e κ(T -t) + γσ 2 2α e κ(T -t) - γ 2α -κ (2αe 2α(T -t) -κe κ(T -t) ) R |x| 2 ν 1 (dx) - R xν 1 (dx) 2 + σ 2 2α .
Then, we have for any

z ∈ Zp R L z t U P (t, ν)(x)ν(dx) = R |z(t, x, ν)| c 1 n-1 (1 + β 2 )e κ(T -t) - |z(t, x, ν)| n cn n-1 1 n-1 ν(dx) + κ R xν 1 (dx)e κ(T -t) -2 γα 2α -κ (e 2α(T -t) -e κ(T -t) ) + γe κ(T -t) R |x| 2 ν 1 (dx) - R xν 1 (dx) 2 - γσ 2 2α -κ (e 2α(T -t) -e κ(T -t) ).
Notice that for any (t, x, ν) ∈ [0, T ] × R 2 × P(C 2 ), the maximum of z ∈ Zp -→ |z(t, x, ν)| c Thus, the HJB Equation (6.1) is satisfied by U P .

Step 2: a verification result. Let (t, ν) ∈ [0, T ] × P(C 2 ) and let Z be some feedback control in Zp .

According to Itō's formula (see again [START_REF] Chassagneux | A probabilistic approach to classical solutions of the master equation for large population equilibria[END_REF]), we have classically U P (T, L(M Z T )) = U P 0 + T 0 ∂ t U P (s, L(M Z s )) + R L Z t U P (s, L(M Z s ))(x)ν(dx) ds.

Using the fact that U P solves (6.1), we thus get E ⋆ G(M Z T ) ≤ U P 0 , and since Z is arbitrary, U P 0 ≤ U P 0 . Notice now that z ⋆ t := (1 + β 2 )e κ(T -t) is a maximiser for the HJB equation (6.1) in D, then in Zp . Thus, we deduce that U P 0 = U P 0 with the optimal control z ⋆ t := (1 + β 2 )e κ(T -t) , t ∈ [0, T ].

Step 3: computation of the optimal contract and admissibility. Notice that the optimal effort of the Agent is a ⋆ u := a ⋆ u (z ⋆ ) = (1 + β 2 )

1 n-1 e (α+β 1 )(T -u) c

1 n-1 . Since z ⋆ is deterministic by remembering the discussion of Section 5.2.3, their exists a solution (X, Y R 0 ,z ⋆ , µ ⋆ , q ⋆ ) to the system 4.4 and according to Corollary 4.1, (µ ⋆ , q ⋆ , a ⋆ ) is a solution to (MFG)(ξ ⋆ ) in MF r (ξ ⋆ ) for any r > 1 with ξ ⋆ = Y R 0 ,z ⋆ T .

Denote now P ⋆ := P µ ⋆ ,q ⋆ ,a ⋆ and W ⋆ := W µ ⋆ ,q ⋆ ,a ⋆ . Let t ∈ [0, T ], we set Proof of Theorem 6.2. First notice that since h is clearly coercive in z, there exists at least z ⋆ ∈ D maximising h. After tedious but easy computations, we prove that the uniqueness of the maximizer in D of h holds. Following the proof of Theorem 6.1, the corresponding HJB equation is From now on, we will only consider the case α = β 1 but the proofs and computations for the other case are similar. We obtain directly Thus, HJB Equation (A.8) is satisfied by U P . By adapting the second step of the proof of Theorem 6.1, we deduce that U P is the value function of the Principal with the optimal control z ⋆ ∈ D maximising h.

f (t) := E ⋆ [X t ], g(t) := E ⋆ |X t | 2 , z n (t) := |z ⋆ t | c
                               -∂ t v(t, ν) -sup
Proof of Theorem 6.3. From (6.6), we deduce that (i) holds. We now turn to the proof of (ii). Then, since S N N is an Ornstein-Uhlenbeck process, we get

S N t N = 1 N N i=1
ψ N,i e (α+β 1 )t + ψ N,i e κt + β 1 2κc e κ(T +t)e κ(T -t) , and

σ N t = σ κ (1 -e -κ(s-t) ) 1 N N + σe i .
Therefore, X N,i is an Ornstein-Uhlenbeck process with parameters α, θ N t and volatility σ N t . By setting θ ⋆ := exp(κ(T -t)) c + f (t) where f (t) denotes the solution to ODE (A.6), we deduce that the following convergences hold

λ 0 • (θ N t ) -1 weakly -→ N →+∞ λ 0 • (θ ⋆ t ) -1 ,
and

P a N,⋆ N • • 0 σ N s • dW N,⋆ s -1 weakly -→ N →+∞ P a ⋆ • • 0 σdW ⋆ s -1
.

It is then clear that the required convergence for X N,i holds. The fact that ξ N,⋆ is optimal for the N -players' model is a direct consequence of Theorem 2. By the above computations, it is clear that for any t ∈ [0, T ], the law of N -1 S N t under P a N,⋆ N converges weakly to a Dirac mass at E ⋆ [X ⋆ t ]. Hence the desired result (ii).

  for Lebesgue a.e. t ∈ [0, T ].

Fixed salary part δ ց ց ց ց ր ց =

 ց Optimal effort of the Agent ց ր ր ր = = = Expected gain of the Principal ց ր ր ր ց ր = Variance of the terminal gain of the Principal = = ր ր = = =

  By considering the classical quadratic cost function c(a) := c |a| 2

1 n- 1 ( 1 +- 1 1 n- 1 is 2 |z 1 ( 1 +- 1 1 n- 1 ν

 111121111 β 2 )e κ(T -t) -|z(t, x, ν)| n cn nclearly z ⋆ t := (1 + β 2 )e κ(T-t) . Thus, we havesup z∈ Zp R β 2 )e κ(T -t) -|z(t, x, ν)| n cn n(dx) = (1 + β 2 ) n n-1 e κ n n-1 (T -t)

1 n- 1 ,- 1 -( 1 +γV λ 0 α -β 1 + 1 2 γσ 2 1 2 - 1 nc 1 n- 1 (α + β 1 )

 1112221111 for any t ∈ [0, T ], Z ∈ C. Thus, applying Itō's formula, we obtain the following system of ODEs for any0 ≤ t ≤ s ≤ T          f ′ (t) = (1 + β 2 )z n (t) + (α + β 1 )f (t)γg(t) + γ|f (t)| 2 , f (0) = R xλ 0 (dx), g ′ (t) = 2αg(t) + 2f (t)(f ′ (t)αf (t)) + σ 2 , g(0) = Rx 2 λ 0 (dx). .5) we haveg(t) = g(0)f 2 (0) e 2αt + f 2 (t) + σ 2 2α (e 2αt -1).The ODE (A.4) thus become for any0 ≤ t ≤ T f ′ (t) = κf (t) + H n (t), f (0) = R xλ 0 (dx), (A.6) with H n (t) := (1 + β 2 )z n (t)γ σ 2 2α (e 2αt -1)γ g(0)f 2 (0) e 2αt .Thus, the linear ODE (A.6) has a unique solution given byf (t) = R xλ 0 (dx)e κt + t 0 e κ(t-u) H n (u)du = λ 1 e κt + λ 2 e -κ n-1 t + λ 3 e 2αt + λ 4 ,withλ 1 := R xλ 0 (dx) + (1 + β 2 ) (1 + β 2 )e κT c 1 n-1 n -1 κn + γσ 2 κ(2ακ) + γ 2ακ g(0)f 2 (0) , λ 2 := -(1 + β 2 ) (1 + β 2 )e κT c 1 n-1 n -1 κn , λ 3 := -γσ 2 2α(2ακ) -γ g(0)f 2 (0) 2ακ , λ 4 := -γσ 2 2ακ .Thus, the optimal contract is given, after tedious but simple computationsξ ⋆ = δα(1 + β 2 ) T 0 e κ(T -t) X t dt + (1 + β 2 ) T 0 e κ(T -t) dX t , with δ := R 0 -1 + β 2 -1 n (1 + β 2 ) β 2 )e (α+β 1 )T T β 1 f (0) + γσ 2 (α + β 1 )(αβ 1 )+ e -(α+β 1 )T (α + β 1 )γα σ 2 2α + V λ 0 (αβ 1 ) 2 e (α-β 1 )T -1 + (1 + β 2 )(n -1)β

2 ( 2 xyν- 2 - 2 .(A. 8 ) 2 - 2 + 2λ Xξ R 2 • if α = β 1 Uxν 1 1 - 2 -•( 1 - 2 -

 22228222111212 xy)ν(dx, dy)+ 2λ Xξ R (λ X + λ Xξ ) R |x| 2 ν 1 (dx) -R xν 1 (dx) (λ ξ + λ Xξ ) R |y| 2 ν 2 (dy) -R yν 2 (dy)As previously, by considering the ansatz 1, and by denoting U (t, ν) the dynamic version of the problem the Principal restricted to deterministic Z, we have for any(t, ν) ∈ [0, T ] × P(C 2 ) U P (t, ν) = sup z∈D T t h(u, z u )du + R xν 1 (dx)e κ(T -t) -(u-t) -1) du -(λ X + λ Xξ )e 2α(T -t) R |x| 2 ν 1 (dx) -R xν 1 (dx) (λ X + λ Xξ ) σ 2 2α (e 2α(T -t) -1) -(λ ξ + λ Xξ ) R |x| 2 ν 2 (dx) -R xν 2 (dx) xyν(dx, dy) -R xν 1 (dx) R yν 2 (dy) .Thus we have,P (t, ν) = (dx)e κ(T -t) -R xν 2 (dx) -γ 2ακ (e 2α(T -t)e κ(T -t) ) e κ(T -t) ) -(λ X + λ Xξ )e 2α(T -t) R |x| 2 ν 1 (dx) -R xν 1 (dx) (λ X + λ Xξ ) σ 2 2α (e 2α(T -t) -1) -(λ ξ + λ Xξ ) R |x| 2 ν 2 (dx) -If α = β 1 U P (t, ν) = T t h(z ⋆ u )du + R xν 1 (dx)e κ(T -t) -R xν 2 (dx) γe 2α(T -t) (Tt) e 2α(T -t) ) -(λ X + λ Xξ )e 2α(T -t) R |x| 2 ν 1 (dx) -R xν 1 (dx) (λ X + λ Xξ ) σ 2 2α(e 2α(T -t) -1) -(λ ξ + λ Xξ ) R |x| 2 ν 2 (dx) -

∂ ν 1 U 2 , 1 ( 1 + 1 1 n- 1 - 2 - 2 -

 12111122 P (t, ν)(x 1 , x 2 ) = e κ(T -t) -2γ 2ακ (e 2α(T -t)e κ(T -t) ) x 1 -R xν 1 (dx) -2(λ X + λ Xξ )e 2α(T -t) x 1 -R xν 1 (dx) + 2λ Xξ x 2 -R xν 2 (dx) , ∂ ν 2 U P (t, ν)(x 1 , x 2 ) = -1 -2(λ ξ + λ Xξ ) x 2 -R xν 2 (dx) + 2λ Xξ x 1 -R xν 1 (dx) , ∂ x ∂ ν U P (t, ν)(x) = -2 γ 2α-κ (e 2α(T -t)e κ(T -t) ) -2(λ X + λ Xξ )e 2α(T -t) 2λ Xξ 2λ Xξ -2(λ ξ + λ Xξ ) ,and-∂ t U P (t, ν)(x) = h(Z ⋆ t ) + κ R xν 1 (dx)e κ(T -t) -(λ X + λ Xξ )σ 2 e 2α(T -t) -γ 2ακ (2αe 2α(T -t)κe κ(T -t) ) R |x| 2 ν 1 (dx) -T -t) -2α(λ X + λ Xξ )e 2α(T -t) R |x| 2 ν 1 (dx) -R xν 1 (dx)and for any z∈ Zp R L z t U P (t, ν)(x)ν(dx) = κ R xν 1 (dx)e κ(T -t) -γσ 2 2ακ (e 2α(T -t)e κ(T -t) β 2 )e κ(T -t) -|z(t, x, ν)| n cn n-(λ ξ + λ Xξ )σ 2 |z(t, x, ν)| 2 + 2λ Xξ σ 2 ze α(T -t) ν(dx) -2 γα 2ακ (e 2α(T -t)e κ(T -t) ) + γe κ(T -t) R |x| 2 ν 1 (dx) -R xν 1 (dx) 2α(λ X + λ Xξ )e 2α(T -t) R |x| 2 ν 1 (dx) -R xν 1 (dx) (λ X + λ Xξ )σ 2 e 2α(T -t) .

1 N

 1 First recall that dX N t = a N,⋆ t + B N X N t dt + σdW N,⋆ t , X N 0 = ψ N .Thus, by denoting S N t := N i=1 X N,i t for any t ∈ [0, T ] we have for any i ∈ {1, . . . , N } dX dW N,a N,⋆ t N .

t 0 e

 0 (α+β 1 )(T -2s+t) c ds + t 0 σe -(α+β 1 )(s-t) 1 N N • dW N,a N,⋆ s = 1 N N i=1 ψ N,i e κt + 1 2κc e κ(T +t)e κ(T -t) + t 0 σe -(α+β 1 )(s-t) 1 N N • dW N,a N,⋆ s .Hence, using the stochastic Fubini's theorem, we getX T +s)e κ(T -s) + s 0 σe -(α+β 1 )(u-s) 1 N N • dW N,a N,⋆

1 .

 1 Notice that for any i ∈ {1, . . . , N }(ξ N,⋆ ) i = R 0 -T -t) dX N,i t .

  In this case, the Hamiltonian G of the HJB equation associated with the problem of the Principal (see HJB Equation (2.11) and Theorem 2.1) is defined by for any (t, x, y, p x , p y , γ x , γ y , γ xy

	1 2 , . . . ,	1 2c	z N,N 2	⊤	.

There was before that an impressive literature on static or discrete-time models, which we will not detail here. The interested reader can check the references given in the classical books[START_REF] Bolton | Contract theory[END_REF][START_REF] Laffont | The theory of incentives: the principal-agent model[END_REF][START_REF] Salanié | The economics of contracts: a primer[END_REF]

There is an alternative approach using the Pontryagin stochastic maximum principle to characterise both the optimal action of the Agent and the optimal contract in terms of fully coupled systems of FBSDEs, initiated by Williams[START_REF] Williams | On dynamic principal-agent problems in continuous time[END_REF], see the recent monograph by Cvitanić and Zhang[START_REF] Cvitanić | Contract theory in continuous-time models[END_REF] for more details.

Several papers have investigated related but not exactly similar BSDEs, see among others[7, 9, 8, 15,

[START_REF] Li | Mean-field reflected backward stochastic differential equations[END_REF].[START_REF] Bensoussan | Mean field games and mean field type control theory[END_REF] Let us nonetheless mention the recent contribution of Djehiche and Hegelsson[START_REF] Djehiche | The principal-agent problem with time inconsistent utility functions[END_REF] which considers a related but different problem with only one Agent whose output solves a McKean-Vlasov SDE. Their approach is a stochastic maximum principle one.

There is actually room for a little heterogeneity between the Agents, which could be incorporated in the model through an enlargement of the space Ω N , see[START_REF] Carmona | A probabilistic weak formulation of mean field games and applications[END_REF] Remark 3.10].

If not, we just have to add a supremum in the Hamiltonian, over all the possible maximisers which in addition maximise the collective criterion of the Agents. In order to alleviate already heavy notations, we decided to not write the most general result. Furthermore, in the examples solved in Section 6, there will always be uniqueness.

Again the notion of admissibility would have to be clearly defined, but as will be seen below, this is purely a matter of integrability assumptions.

In full generality, we should have let the initial value of Y be a probability measure as well. However, since the law of Y never appears in the problem, we fixed it as a constant for simplicity. Notice that in the examples below, we will modify the criterion of the Principal and let the law of Y play a role. This would necessitate to rewrite the current section, which we refrain from doing for ease of notations.

We have to make clear the definition of a solution to an HJB equation. Most of the time, we have to deal with solutions in the sense of viscosity for PDEs on Hilbert spaces, introduced by Lions in[START_REF] Lions | Viscosity solutions of fully nonlinear second-order equations and optimal stochastic control in infinite dimensions. Part i: the case of bounded stochastic evolutions[END_REF][START_REF] Lions | Viscosity solutions of fully nonlinear second order equations and optimal stochastic control in infinite dimensions. Part ii: optimal control of Zakai's equation[END_REF][START_REF] Lions | Viscosity solutions of fully nonlinear second-order equations and optimal stochastic control in infinite dimensions. iii. Uniqueness of viscosity solutions for general second-order equations[END_REF]], but in the example studied in Section 6, we will see that the HJB equation under interest will admits a smooth solution.

Notice here that we have to go back to the probability P to apply the martingale representation theorem. Indeed, as shown in the celebrated example of Tsirelson (see Revuz and Yor[START_REF] Revuz | Continuous martingales and Brownian motion[END_REF][Chapter IX, Exercise (3.15)]), the representation may fail under P µ,q,α . We would like to thank Saïd Hamadène for pointing out this technical problem to us.

The authors gratefully acknowledge the support of the ANR project Pacman, ANR-16-CE05-0027 whose support is kindly acknowledged. The Chair Financial Risks (Risk Foundation, sponsored by Société Générale) is also acknowledged for financial support.