Emil Giulia

This thesis would not have been possible without Giulio and Silvia, so of course: Grazie mille per tutto. These three years haven't always been easy, but I've been lucky enough to be surrounded by some wonderful people who have made the journey much more enjoyable.

Preface

Recently, considerable theoretical effort has been devoted to understanding the ecological dynamics of complex communities, using tools from the statistical physics of disordered systems. However, a fundamental component, evolution, has rarely been considered and is attracting a lot of attention in both theory and applications. From this observation my initial PhD project was born, simply titled: "Statistical Physics, Ecology and Evolution: Eco-evolutionary dynamics of multi-species communities". The idea was to build simple models combining ecological interactions and evolution. The aim was to understand the interplay between ecological interactions and evolution, in particular to identify general mechanisms for the change of community-level properties over evolutionary time scales and the associated variation in community ecology. In the first chapter of this thesis, I'll introduce the ecological models used in this project, as well as the principle of evolution by natural and artificial selection.

We decided to focus first on the evolution of communities under artificial selection, using the framework of a well-known random Lotka-Volterra model. We were able to show how evolution under artificial selection imposes a structure on interactions that allows the community to perform well the function for which it is selected. This work is presented in Chapter 2 and is published in Fraboul et al. [START_REF] Fraboul | Artificial selection of communities drives the emergence of structured interactions[END_REF].

When we tried to study this interplay between structure and evolution in a model with species competing for resources, we drifted away from the artificial selection framework and ended up working on the evolution of species by natural selection in the presence of a metabolic trade-off. This work led to Chapter 3 and is the subject of a manuscript in preparation.

In parallel with this work, discussions led us to become interested in neutral models. While exploring different models, we discovered a link between neutral models and the Lotka-Volterra equation with random interactions mentioned above. We were able to clarify this link and began to investigate how to exploit it. I explain this in Chapter 4.

On another front, we have studied the effect of sparsity on the Lotka-Volterra model with random interactions. In Chapter 5 I will explain what the effect of sparsity is on the abundance distribution in this model.

As is often the case with research, these different projects may seem quite scattered. As a result, each chapter can be read independently. But if we dig a little deeper, we can see some common threads. In particular, the idea of structures and their impact on ecological patterns is recurrent, as is the interplay between structures and evolution. I hope you enjoy reading this thesis and that you find the various topics as interesting as I have.

A glossary of technical terms is provided in Appendix A.

Introduction

L'écologie est la science qui étudie les interactions entre les organismes vivants et avec leur environnement. Elle joue un rôle crucial dans la compréhension du fonctionnement des écosystèmes et de la dynamique des processus naturels, contribuant ainsi à l'élucidation des principes fondamentaux qui régissent l'équilibre délicat de la nature.

Cette thèse porte sur l'un des domaines qui composent l'écologie moderne : l'écologie des communautés. Une communauté est un groupe d'espèces différentes qui partagent une zone géographique commune et peuvent s'influencer mutuellement [START_REF] Gary | Community Ecology[END_REF]. Ces communautés peuvent être de différents types, notamment des communautés végétales (telles que les forêts tropicales [START_REF] Carson | Tropical Forest Community Ecology[END_REF]), des communautés animales (telles que les poissons de rivière [START_REF] Hugueny | Community Ecology of River Fishes: A Large-Scale Perspective[END_REF]) ou des communautés microbiennes (telles que le microbiote humain [START_REF] Karkman | The ecology of human microbiota: Dynamics and diversity in health and disease[END_REF]).

Ces communautés sont parfois composées de centaines, voire de milliers d'espèces, et sont organisées comme un réseau extrêmement complexe d'interactions [START_REF] Guimarães | The Structure of Ecological Networks Across Levels of Organization[END_REF], pouvant donner lieu à des phénomènes très riches. En effet, comme l'a énoncé P.W. Anderson, "more is different" [START_REF] Anderson | More Is Different[END_REF] : un grand nombre d'espèces en interaction peut conduire à des comportements très différents de ce que l'on peut observer dans des communautés comptant peu d'espèces.

L'étude mathématique de telles communautés est rendue compliquée par le nombre gigantesque de paramètres à prendre en considération. En effet, si l'interaction entre chaque paire d'espèces est représentée par un paramètre, alors un modèle de communauté avec mille espèces nécessitera au moins un million de paramètres ! De plus, nous avons généralement peu d'informations sur la valeur de ces paramètres.

Ce problème est commun à l'étude des systèmes complexes, en physique, en biologie ou en économie. L'une des méthodes pour le contourner consiste à remplacer cette complexité par de l'aléatoire. En effet, vu qu'on ne connaît pas la valeur de ces paramètres, pourquoi ne pas les remplacer par des variables aléatoires ? Cette approche permet d'avoir une hétérogénéité dans les paramètres, tout en réduisant grandement le nombre de paramètres nécessaires : il suffit généralement de connaître la moyenne et la variance de ces variables aléatoires. On parle alors de système désordonné [START_REF] Damay | Structure et dynamique des systèmes désordonnés[END_REF].

Bien que cette approche simplifie considérablement l'étude mathématique, les équations qui en résultent ont pour défaut de ne modéliser aucune communauté naturelle en particulier. Il s'agit en fait de modèles métaphoriques, qui permettent de comprendre le rôle de différents mécanismes dans l'écologie des communautés, sans faire aucune prédiction précise sur telle ou telle communauté.

La modélisation de communautés écologiques comme des systèmes désordonnés s'est avérée très fructueuse [START_REF] Barbier | Generic assembly patterns in complex ecological communities[END_REF][START_REF] Biroli | Marginally stable equilibria in critical ecosystems[END_REF][START_REF] Hu | Emergent phases of ecological diversity and dynamics mapped in microcosms[END_REF], cependant un ingrédient est souvent manquant : l'évolution.

L'évolution est le changement des caractéristiques (phénotypes) d'une population au cours de générations successives. Ces changements peuvent conduire à la création de nouvelles espèces et expliquent l'immense biodiversité sur Terre. L'évolution se produit lorsqu'il existe une certaine variabilité des traits phénotypiques dans une population et que ces traits sont héréditaires. La source de cette variabilité peut être des mutations dans le génome, le réarrangement des gènes par la reproduction sexuée [START_REF] Wilson | The Importance of Gene Rearrangement in Evolution: Evidence from Studies on Rates of Chromosomal, Protein, and Anatomical Evolution[END_REF], ou leur migration entre les populations [START_REF] Lenormand | Gene flow and the limits to natural selection[END_REF]. La fréquence de ces caractères dans la population est alors modifiée par la sélection naturelle [START_REF] Godfrey-Smith | Darwinian Populations and Natural Selection[END_REF] et la dérive aléatoire [START_REF] Masel | Genetic drift[END_REF].

Dans un système désordonné, les interactions sont fixées une fois pour toutes et n'ont pas de structure particulière. Cependant, dans toute communauté naturelle, les mutations et la sélection naturelle au niveau des espèces ou au niveau de la communauté provoquent l'évolution de ces interactions. Ces changements affectent en retour l'écologie de la communauté. Dans cette thèse, nous verrons comment l'évolution peut entraîner l'émergence de structures dans les interactions, et comment différents types de structures influent sur la dynamique écologique.

Sélection artificielle de communautés

Dans le Chapitre 2 (inspiré de Fraboul et al. [START_REF] Fraboul | Artificial selection of communities drives the emergence of structured interactions[END_REF]), nous étudions comment la sélection artificielle permet de faire évoluer des communautés microbiennes pour qu'elles accomplissent des tâches spécifiques, telles que la dégradation de composants chimiques ou la réduction d'émissions de CO2 [START_REF] Sánchez | Directed Evolution of Microbial Communities[END_REF][START_REF] Flor | Artificially selecting microbial communities: If we can breed dogs, why not microbiomes[END_REF]. Au cours de ce processus, les espèces qui composent les communautés évoluent, en particulier leurs interactions interspécifiques [START_REF] Raynaud | The central role of the interspecific interactions in the evolution of microbial communities[END_REF]. Cependant, la manière dont la sélection au niveau de la communauté façonne ces interactions et dont ces changements se répercutent sur la fonction que l'on sélectionne n'est pas claire.

Pour comprendre cela, nous avons construit un modèle simple d'évolution des communautés sous sélection artificielle basé sur le modèle de Lotka-Volterra avec interactions aléatoires. À l'aide de simulations numériques et de résultats analytiques, nous montrons que la sélection pour une fonction des abondances à l'équilibre fait émerger progressivement une structure dans la matrice d'interaction. Cette structure peut être résumée dans une composante de rang un qui reflète notre connaissance de l'aptitude de la communauté à la fonction pour laquelle elle est sélectionnée. Dans une première phase de croissance, l'abondance des espèces évolue en fonction de la dynamique écologique. Les m = 2 communautés ayant la meilleure fonction à la fin de cette phase (ici l'abondance totale la plus élevée) sont sélectionnées pour la reproduction. Les nouvelles communautés de la génération suivante sont générées à partir de ces m communautés les plus performantes, en les copiant. Les interactions entre les espèces sont ensuite modifiées par des mutations. Ces changements sont représentés par les différentes formes des jetons.

Description du modèle

Notre objectif est de décrire comment la sélection au niveau de la communauté façonne les interactions entre les espèces et comment ces changements affectent la fonction sélectionnée. Pour ce faire, nous considérons une population de n communautés, composées de S espèces, qui subissent des cycles de croissance écologique, de sélection et de reproduction, comme illustré sur la figure 1.

La dynamique écologique au sein d'une communauté est décrite par l'équation de Lotka-Volterra :

dN i dt = N i K i   K i -N i - j̸ =i α ij N j   . ( 1
)
où N i est l'abondance de l'espèce i, K i est sa capacité de charge et l'interaction α ij représente l'impact de l'espèce j sur la croissance de l'espèce i.

Dans la première génération de communautés, les interactions α ij sont choisies aléa-toirement, avec les statistiques :

E(α ij ) = µ/S Var(α ij ) = σ 2 /S
Corr(α ij , α ji ) = γ.

(

) 2
où µ, σ et γ sont des paramètres initialement fixées. Ici, µ représente la force d'interaction totale à laquelle une espèce est confrontée de la part de tous les autres et σ mesure la diversité des interactions. Le paramètre γ ∈ [-1, 1] détermine la symétrie des interactions écologiques : la compétition et le mutualisme correspondent à γ = 1 tandis que γ = -1 indique des interactions d'exploitation comme les interactions proie-prédateur et les interactions parasitaires.

Pour sélectionner les communautés, on les classe selon une fonction f (N) des abondances, appelé score. Les m communautés qui, à la fin d'une génération, ont le plus grand score sont choisies pour la reproduction, et le reste est rejeté (Figure 1). On duplique ensuite les m communautés pour en avoir à nouveau n. Ce processus de mort et de naissance caractérise la sélection au niveau de la communauté. Lorsqu'une communauté de descendants naît, elle acquiert la même composition que la communauté mère. En l'absence de variation des paramètres de la communauté, cela garantit que les fonctions de la communauté sont parfaitement héritées.

A chaque génération, les interactions entre espèces changent car certaines espèces subissent des mutations [START_REF] Raynaud | The central role of the interspecific interactions in the evolution of microbial communities[END_REF], ou en raison des effets d'échantillonnage [START_REF] Penn | Modelling Artificial Ecosystem Selection: A Preliminary Investigation[END_REF]. La caractérisation complète du processus stochastique associé à ces changements étant trop complexe, nous nous concentrons ici sur un modèle simplifié dans lequel ces changements, appelés "mutations au niveau de la communauté", sont aléatoires, de faible ampleur et non biaisés. Cette dernière propriété garantit que la fonction collective ne subit en moyenne pas de changements à moins que la sélection ne soit appliquée.

Résultats

Comme cela a été observé dans des études numériques antérieures [START_REF] Hywel | Artificial selection of simulated microbial ecosystems[END_REF][START_REF] Penn | Modelling Artificial Ecosystem Selection: A Preliminary Investigation[END_REF], nous constatons qu'en réponse à la sélection, les communautés évoluent de manière à améliorer la fonction collective sélectionnée.

L'amélioration observée découle des changements de la matrice d'interaction α, qui sont visibles sur ses statistiques empiriques µ(τ ) et σ(τ ) (définie comme dans l'équation [START_REF] Gary | Community Ecology[END_REF]). Comme le montre la partie de gauche de la figure 2, dans le cas où l'on sélectionne l'abondance totale f (N) = i N i , la moyenne empirique µ(τ )/S des α ij de la meilleure communauté diminue, ce qui indique que les interactions deviennent -en moyenneprogressivement plus mutualistes. Dans le même temps, leur variance augmente, de sorte que les interactions au sein de la communauté deviennent plus diverses.

Cependant, ce ne sont pas ces changements de statistiques qui expliquent la majeure partie de l'amélioration du score des communautés. Plus précisément, l'abondance totale est significativement plus élevée que ce que l'on pourrait prédire pour une matrice aléatoire ayant les mêmes statistiques. La trajectoire évolutive ne peut donc pas être Figure 2 : Changements de la matrice d'interaction le long d'une trajectoire évolutive. La matrice d'interaction α de la meilleure communauté évolue de telle sorte que la force d'interaction moyenne diminue linéairement avec le temps (à gauche, cyan), tandis que sa variance augmente (à gauche, rouge). Ces changements s'accompagnent d'une modification de la structure de la matrice, qui se manifeste dans le spectre de ses valeurs propres. La dynamique de leur partie réelle au cours des générations de la communauté (à droite) révèle l'apparition d'une valeur propre réelle négative isolée (vert), ainsi que la diminution de la valeur propre associée à µ (bleu). En dehors de l'émergence de ce mode collectif, la matrice conserve sa structure aléatoire initiale. expliquée uniquement par des statistiques sommaires. Cet écart peut être compris en examinant la dynamique d'évolution du spectre des valeurs propres de α.

Le spectre de la matrice d'interaction aléatoire initiale est, dans le plan complexe, un cercle de rayon σ centré sur l'origine [START_REF] Ginibre | Statistical Ensembles of Complex, Quaternion, and Real Matrices[END_REF], plus une valeur propre positive isolée (en bleu dans la partie droite de la figure 2) de magnitude µ. L'effet initial de la sélection est de réduire cette valeur. Au bout d'un certain temps, cependant, une valeur propre isolée λ (en vert sur la partie droite de la figure 2) émerge du cercle et s'en détache linéairement dans le temps.

L'émergence de cette valeur propre correspond à l'apparition d'une structure dans les interactions, qui explique les performances des communautés pour la fonction pour laquelle elles sont sélectionnées. Ce phénomène est commun à la sélection de n'importe quelle fonction des abondances. Pour le comprendre, nous avons dérivé une équation récursive pour l'évolution des matrices d'interactions au fil des générations. Elle est présentée en détail dans le Chapitre 2. Nous montrons aussi que cette structure peut être interprétée comme la structure minimale (ou la plus probable), compte tenu de ce que nous savons de la communauté grâce à ses performances.

Évolution d'espèces en compétition pour des ressources

Dans le Chapitre 3, nous étudions l'évolution d'espèces en compétition pour des ressources tout en respectant un compromis métabolique. Nous observons que l'évolution impose également une structure à la communauté. Contrairement au cas du Chapitre 2, cette structure n'est pas dans les interactions, mais dans les ressources : l'évolution les rend toutes également abondantes. Cette structure a la particularité de permettre la coexistence de plus d'espèces que de ressources, contrairement à ce que prédit le principe d'exclusion compétitive.

Modèle d'eco-evolution

Notre modèle est inspiré de Posfai et al. [START_REF] Posfai | Metabolic Trade-Offs Promote Diversity in a Model Ecosystem[END_REF] et Tikhonov and Monasson [START_REF] Tikhonov | Collective Phase in Resource Competition in a Highly Diverse Ecosystem[END_REF]. Une communauté est composée de S espèces, d'abondance N i , qui sont en compétition pour M ressources, d'abondance R µ . La dynamique des abondances est décrite par le modèle de Mac-Arthur :

Ṅi = N i × µ c iµ R µ -m i R µ = h µ i c iµ N i (3)
où c iµ est le taux à laquelle l'espèce i consomme la ressource µ, aussi appelé la préférence de l'espèce i pour la ressource µ, m i est le taux de mortalité de l'espèce i et h µ est une fonction décroissante qui reflète la dépendance négative entre l'abondance des ressources et le taux auquel elles sont consommées.

Quand il y a plus d'espèces que de ressources, ce modèle prédit que certaines espèces doivent s'éteindre, jusqu'à obtenir un équilibre avec moins d'espèces que de ressources. C'est le principe d'exclusion compétitive.

Cependant, si chaque espèce est soumise à un compromis métabolique, ce principe peut être brisé. Un compromis métabolique reflète le fait qu'une espèce capable de consommer beaucoup de ressources (en ayant des taux de c iµ élevés) aura besoin de plus d'énergie et aura donc un taux de mortalité plus élevé. Une des façons de modéliser ce compromis est d'imposer pour chaque espèce une proportionnalité entre son taux de mortalité m i et son budget métabolique total µ c iµ : m i = α µ c iµ (voir Figure 3).

Si toutes les espèces ont ce compromis, on peut montrer qu'il existe un état, appelé état neutre, où les abondances des ressources sont toutes égales à α et où peuvent coexister plus d'espèces que de ressources. Ce résultat a été proposé comme une explication au paradoxe du plancton : beaucoup de communautés naturelles (en particulier de planctons) sont composées de beaucoup d'espèces en compétition pour très peu de ressources, contredisant le principe d'exclusion compétitive.

Cependant, pour que cet état neutre soit possible, il faut que les préférences des espèces de la communauté satisfassent certaines conditions. Dans le Chapitre 3, nous étendons le modèle décrit par l'équation (3) pour prendre en compte l'évolution. Nous montrons alors que l'évolution aide à rendre cet état neutre possible. Nous étudions ensuite ce qu'il se passe quand, au cours de l'évolution, certaines espèces changent légèrement leur compromis métabolique. L'utilisation des ressources par chaque espèce est représentée par une jauge, remplie de différentes couleurs représentant les préférences de l'espèce. Le budget total est différent entre les espèces, mais les seuils métaboliques m i sont ajustés en conséquence.

Modèles neutres et neutralité apparente

Dans le Chapitre 4, nous nous intéressons aux modèles neutres. L'écologie des communautés consiste à expliquer des phénomènes, tels que la biodiversité ou la distribution d'abondance des espèces, en termes de processus. Le point de vue dominant en écologie est que les espèces diffèrent dans leur façon d'utiliser l'environnement. Cette utilisation de l'environnement, par exemple vis-à-vis de leur relation avec les ressources ou les prédateurs, est appelée niche. Ces différences de niche permettent aux espèces de coexister (et donc de maintenir la biodiversité) et de proliférer par déplacement de niche [START_REF] Gary | Community Ecology[END_REF].

Hubbell [START_REF] Stephen | The Unified Neutral Theory of Biodiversity and Biogeography (MPB-32)[END_REF] a adopté une approche totalement différente et a construit une théorie neutre dans laquelle les niches sont absentes et toutes les espèces sont fonctionnellement équivalentes. Bien que cette hypothèse semble très naïve et ait été très controversée, son idée n'était pas de dire que les espèces étaient réellement équivalentes. Au contraire, il voulait comprendre dans quelle mesure les phénomènes écologiques étaient le résultat de similitudes entre espèces plutôt que de différences entre espèces [START_REF] Stephen | Neutral Theory and the Evolution of Ecological Equivalence[END_REF]. Une autre façon d'envisager cette hypothèse de neutralité est de dire que même si les espèces d'une communauté ne sont souvent pas équivalentes sur le plan fonctionnel, il peut y avoir un ensemble de variables les décrivant (pas nécessairement les abondances) où elles semblent très similaires.

Nous nous intéressons à une classe de ces modèles neutres, qui s'écrivent comme des équations différentielles stochastiques. Dans ces modèles, l'abondance de chaque espèce N (t) suit une dynamique telle que :

dN (t) dt = rN (t) (1 -N (t)/K) + σ e N (t)ξ e (t) + σ d N (t) ξ d (t) (4)
où ξ d et ξ e sont des bruits aléatoires démographiques et environnementaux, qui sont différents pour chaque espèce. Les seules différences entre les abondances des espèces sont dues à ces bruits stochastiques. Nous montrons dans le Chapitre 4 comment calculer la distribution des abondances à l'équilibre pour de tels modèles avec des bruits corrélés en temps. Nous étudions aussi le lien qu'il existe entre ces modèles et des modèles de niche avec interactions aléatoires.

En effet, en partant du modèle avec interactions décrit par les équations (1) et [START_REF] Gary | Community Ecology[END_REF], et en prenant le cas simplifié K i = 1 et γ = 0, il est possible d'écrire une théorie dynamique en champ moyen pour les abondances :

dN (t) dt = N (t) (1 -N (t) -µm(t) -ση(t)) + λ (5)
où η est un bruit gaussien de corrélations en temps E[η(t)η(s)] = C(t, s), et les paramètres dépendant du temps sont définis par :

m(t) = E[N (t)] C(t, s) = E[N (t)N (s)] (6)
L'équation (5) semble définir un modèle neutre où les espèces sont équivalentes. Le bruit η est en effet similaire à un bruit environnemental. Cependant, l'environnement n'est pas externe à la communauté, mais est l'effet des autres espèces. Les fluctuations environnementales η(t) sont une conséquence des interactions et sont définies de manière auto-consistante. Dans le Chapitre 4, nous montrons que ce bruit peut être décomposé en une partie statique et une partie fluctuante, cette dernière ayant la propriété d'être neutre, c'est à dire qu'il est impossible de statistiquement distinguer ses effets sur différentes espèces. Cette neutralité apparente pourrait être à l'origine de la puissance des modèles neutres pour expliquer les phénomènes écologiques des communautés naturelles.

Interactions éparses

Le court Chapitre 5 présente quelques travaux préliminaires que j'ai effectués sur les modèles désordonnés avec des interactions éparses.

Les communautés écologiques sont composées de nombreuses espèces qui interagissent les unes avec les autres, mais toutes les espèces n'interagissent pas directement les unes avec les autres. En fait, seul un sous-ensemble d'espèces interagit avec les autres, tandis que d'autres restent relativement isolées. Il s'agit certainement de l'une des structures les plus importantes à prendre en compte dans les modèles désordonnés, en raison de son omniprésence dans les communautés naturelles et de son effet potentiellement important sur les modèles écologiques stationnaires et dynamiques [START_REF] Thébault | Stability of Ecological Communities and the Architecture of Mutualistic and Trophic Networks[END_REF][START_REF] Guimarães | The Structure of Ecological Networks Across Levels of Organization[END_REF]. Dans le modèle de Lotka-Volterra, "éparse" signifie que la plupart des éléments de la matrice d'interaction sont nuls. Dans un modèle désordonné, les éléments non nuls peuvent être choisis au hasard. Le réseau d'espèces en interaction qui en résulte est un graphe aléatoire.

L'ensemble aléatoire de graphes le plus simple consiste à choisir uniformément si une arête (ij) est incluse dans le graphe (c'est-à-dire si les espèces i et j interagissent) avec une probabilité p = k/S. Le paramètre k représente le nombre moyen d'espèces interagissant avec une espèce et est appelé connectivité de la communauté. Un tel graphe aléatoire est appelé graphe d'Erdös-Rényi.

Après avoir choisi un graphe au hasard, nous définissons une distribution de probabilité π(α ij ) pour les interactions non nulles. Ensuite, en combinant le caractère aléatoire du réseau et de π, la distribution de probabilité ρ des α ij peut être écrite :

ρ(α ij ) = k S π(α ij ) + (1 - k S )δ(α ij ). ( 7
)
avec les interactions réciproques qui ne sont pas indépendantes. Dans ce modèle, une connectivité finie n'a pas d'effet significatif sur l'écologie lorsque la connectivité est grande. Cependant, elle peut avoir un effet significatif lorsqu'une espèce interagit avec seulement quelques espèces (k ∼ 10), en fonction de la force et de l'hétérogénéité des interactions.

Une approche pour mieux comprendre les effets à petite connectivité consiste à calculer la distribution des abondances de la communauté à l'aide de la méthode des répliques. Cette méthode s'est avérée très utile pour comprendre les propriétés du modèle aléatoire de Lotka-Volterra dans le cas entièrement connecté [START_REF] Biroli | Marginally stable equilibria in critical ecosystems[END_REF][START_REF] Altieri | Properties of Equilibria and Glassy Phases of the Random Lotka-Volterra Model with Demographic Noise[END_REF] (voir Annexe B). Son extension aux systèmes à connectivité finie nécessite des techniques et des approximations supplémentaires [START_REF] Monasson | Some remarks on hierarchical replica symmetry breaking in finiteconnectivity systems[END_REF][START_REF] Biroli | A single defect approximation for localized states on random lattices[END_REF][START_REF] Semerjian | Sparse random matrices: The eigenvalue spectrum revisited[END_REF]. Une tentative d'utilisation de cette technique est présentée dans le Chapitre 5.

CHAPTER 1

Introduction to models in ecology and disordered systems

This chapter is intended as a non-technical introduction to community ecology, mathematical models of population dynamics and the use of disordered systems. I have tried to emphasise not the mathematical aspect but the logic behind the different models. In the last section I introduce the notion of evolution in biology, which is a major motivation for this thesis. In particular, I explain the idea of artificial selection of communities, which is the subject of the next chapter. I then outline the following chapters.

Community Ecology

Ecology is the study of how living organisms interact with each other and their environment. The roots of ecology can be traced back to the 19th century, when scientists began to explore the interconnectedness of different species and the impact of human activity on the environment. The term 'ecology' was coined by the German zoologist Ernst Haeckel in 1866 [START_REF] Levit | Ernst Haeckel in the history of biology[END_REF]. Haeckel was fascinated by the diversity of life on Earth and the relationships between different species, and he helped establish ecology as a distinct scientific discipline. In the decades that followed, ecological research expanded rapidly, with scientists studying everything from the behaviour of individual organisms to the structure of entire ecosystems.

Ecological research plays a crucial role in understanding the complex web of interactions between living organisms and their environment. It provides insights into the functioning of ecosystems and the dynamics of natural processes, contributing to the elucidation of the fundamental principles that govern the delicate balance of nature. This helps to understand the impact of human activities and climate change on biodiversity, as well as the benefits that ecosystems provide to humanity [START_REF] Pereira | Scenarios for Global Biodiversity in the 21st Century[END_REF][START_REF] Daily | Ecosystem services: From theory to implementation[END_REF].

This thesis deals with one of the fields that make up modern ecology: community ecology. A community is a group of different species that share a common geographical area and can influence each other [START_REF] Gary | Community Ecology[END_REF]. These communities can be of different types, including plant communities (such as tropical forests [START_REF] Carson | Tropical Forest Community Ecology[END_REF]), animal communities (such as river fish [START_REF] Hugueny | Community Ecology of River Fishes: A Large-Scale Perspective[END_REF]) or microbial communities (such as human microbiota [START_REF] Karkman | The ecology of human microbiota: Dynamics and diversity in health and disease[END_REF]).

Community ecology consists in the study of patterns in the diversity (i.e. the number of species), abundance (i.e. the number of individuals of a species), and composition of species in communities, and the processes underlying these patterns [START_REF] Vellend | Conceptual Synthesis in Community Ecology[END_REF]. These ecological patterns can be the distribution (i.e. the histogram) of species abundances in the community, the relationship between diversity and area, or the difference in species composition between two local sites within the community. These patterns are understood through the lens of different processes, that can be grouped into four categories [START_REF] Gary | Community Ecology[END_REF]: the interactions between species, the stochasticity (the 'chance') of birth and death, the movement of individuals within or outside the community, and the evolution of species over generations, including the appearance of new species.

In this thesis I will ignore spatial patterns and focus on species abundances, their dynamics and their distribution within the community. The main processes I will consider are species interactions, and their evolution (only Chapter 4 will deal with stochasticity). The interactions are the influences that species have on each other's growth, and can be of many types. The most common interactions are competition for resources, where each species has a negative effect on the growth of the other, and predation, where two species have an antisymmetric effect on each other's growth. There are other types of interactions such as mutualism (for example pollination) or parasitism.

In the past, ecologists were mainly interested in communities composed of dozens of species, where the empirical characterisation of interactions was still tractable. However, recent interest in microbial communities has changed the game.

A microbial community is a diverse collection of microorganisms, such as bacteria, archaea, fungi, viruses and other microscopic organisms, that live together in a particular environment. These communities can be found in a variety of habitats, including soil, water, plant roots or the human gut. Microbial communities play a crucial role in nutrient cycling, decomposition and maintaining the stability of ecosystems [START_REF] Waldrop | Response of Microbial Community Composition and Function to Soil Climate Change[END_REF]. They also have an impact on human health: the gut microbiome, for example, is thought to influence digestion, metabolism and even immune function [START_REF] Marchesi | The gut microbiota and host health: A new clinical frontier[END_REF]. Understanding the ecology of microorganisms is considered one of the major challenges in current ecological research [START_REF] Prosser | The role of ecological theory in microbial ecology[END_REF], but one of the main difficulties is their great diversity, which can reach several thousand species [START_REF] Lozupone | Diversity, stability and resilience of the human gut microbiota[END_REF][START_REF] Hoshino | Global diversity of microbial communities in marine sediment[END_REF].

Such communities of hundreds to thousands of species are organised as an extremely complex web of interactions [START_REF] Guimarães | The Structure of Ecological Networks Across Levels of Organization[END_REF] that can give rise to very complicated phenomena. Indeed, as P.W. Anderson put it, more is different [START_REF] Anderson | More Is Different[END_REF]: a large number of interacting species can lead to very different behaviours than just 'more' of what can be observed in communities with few species.

The abundance of the species that make up microbial communities (as well as any other ecological community) can be measured in experiments or in nature, for example using meta-barcoding [START_REF] Andersen | Meta-barcoding of 'dirt' DNA from soil reflects vertebrate biodiversity[END_REF]. While these measurements are useful, a full understanding of possible ecological scenarios requires mathematical models, especially for complex com-munities such as most microbial communities [START_REF] Prosser | The role of ecological theory in microbial ecology[END_REF]. These models can help understand scenarios that are likely to occur generically in complex communities, and identify those that require additional mechanisms.

In the next section, we will see how mathematical models have been developed to understand the ecological dynamics of communities, and discuss their limitations when dealing with complex communities. I will then explain how we can gain intuition about these communities by replacing complexity with randomness, as is done in disordered systems.

Mathematical models in ecology 1.2.1 Growth model

One of the oldest models proposed to describe population dynamics is the Malthusian growth model, which was designed to predict the growth of the human population over time. It represents population size by a continuous variable N (t), which evolves according to a simple differential equation:

dN dt = rN (t) (1.1)
where r is a constant called the growth rate of the population. Such a rate represents the proportion of the current population that is gained or lost per unit of time, namely the birth rate minus the death rate. A positive growth rate means that there are more births than deaths, so the population is increasing. Conversely, a negative growth rate implies that the population is decreasing. The solution of this differential equation is an exponential: N (t) = N (0) exp(rt) where N (0) is the initial population size. This simple model is capable of representing two different scenarios: the extinction of the species if r < 0, or a continuous unbounded growth if r > 0.

This model was later enriched to take into account limitation effects: typically, a larger population means fewer resources, and this implies a lower growth rate. This corresponds to a competitive interaction between the members of a population, also called intraspecific competition. To model this, we consider a growth rate that decreases as the population grows. Choosing a simple linear dependence r(N ) = r 0 -r 0 K N gives the logistic equation:

dN dt = r 0 N 1 - N K (1.2)
This equation was first derived by P-F Verhulst in 1838 to study the progress of human populations in different countries [START_REF] Vogels | s "notice sur la loi que la populations suit dans son accroissement" from correspondence mathematique et physique[END_REF]. The constant r 0 is the intrinsic growth rate, i.e. the growth rate at low abundance, during the exponential phase of growth; and K is called the carrying capacity and represents the abundance at which the growth rate becomes negative. This equation has two fixed-points: either the species is extinct (N = 0) or it is sustained at an abundance fixed by the carrying capacity (N = K).

Interacting species

"In nature nothing exists alone" [START_REF] Carson | Silent Spring[END_REF]. With these words, Rachel Carson sums up what makes ecosystems both beautiful and fragile: the species that make them up affect each other in such a way that any disturbance can affect the whole. This network of interactions is the source of the complexity of ecological communities, and understanding it requires a sophisticated mathematical formalism.

Vito Volterra faced this problem in 1926 when he studied the fish population in the Adriatic during the First World War [START_REF] Ginoux | The paradox of Vito Volterra's predator-prey model[END_REF][START_REF] Doob | Leçons sur la Théorie Mathématique de la Lutte pour la Vie[END_REF]. His data showed that during the war, when fishing was less intense, there had been a relative increase in the proportion of predatory fish. As the models of Malthus and Verhulst did not take into account the interaction between prey and predator fish, he had to modify them to explain this observation.

Considering a population of prey fish (of abundance x) and of predatory fish (of abundance y), he assumed that the growth rate of the prey population in the absence of predators is positive but decreases linearly with the abundance of predators. Conversely, because the predatory fish would disappear without anything to eat, its growth rate is negative in absence of prey fish and increases with y. He incorporated these relations This simple model displays a periodic oscillatory dynamics for the abundances (see Figure 1.2), with the amplitude and frequency of the oscillations depending on the parameters (a, b, c, d) and on the initial conditions (x(0), y(0)) [START_REF] Hofbauer | Evolutionary Games and Population Dynamics[END_REF]. Looking at the average values of the abundances, Vito Volterra was able to identify a "law of disturbance of the averages", which he proposed as an explanation for the observed increase in the number of predators [START_REF] Ginoux | The paradox of Vito Volterra's predator-prey model[END_REF].

A similar set of differential equations can be designed for two species that are in competition (for similar resources for example). The difference will be in the sign of the parameters: the growth rate of each species should be positive in isolation, but decrease with the abundance of the other species. A simple example is:

dx dt = x(a -by) dy dt = y(c -dx) (1.4)
In these examples, the interactions between two species, called interspecific interactions, have been defined as the effect of the abundance of one species on the growth rate

α ij > 0 α ij = 0 α ij < 0 α ji > 0 Competition Commensalism Predator-prey / Parasitism α ji = 0 Commensalism Neutralism Amensalism α ji < 0 Predator-prey / Parasitism Amensalism Mutalism
Table 1.1: The different types of reciprocal interactions. In this notation, α ij > 0 stands for a harmful influence of species j on the growth of species i. Conversely, α ij < 0 stands for a beneficial influence and α ij = 0 for no interactions.

of the other. We have approximated this effect by a simple linear dependence, and the slope of this dependence is called the interaction strength. It is important to remember that these are just numbers chosen to represent a knowledge of the interaction between two species: the sign represents a negative or positive influence, and two different values can represent a stronger or weaker effect. In most cases it is not possible to determine these numbers from first principles (using size, temperature, etc...), but empirical observations may allow their sign and value to be inferred.

Generalised Lotka-Volterra model

Two species is a good start, but natural communities are typically made up of dozens to thousands of species! A natural approach is to use our system of two species as a building block for a larger community. Each species will experience logistic growth in isolation. Furthermore, by isolating each pair of species, we get back the previous systems, defining the pairwise interaction between these species. If we include only these components, we get a model where the growth rate of each species depends on the abundance of each other species and the pairwise interaction with these species. This can be summarised in a system of differential equations called the generalised Lotka-Volterra equations (gLV), which have been widely used to link species interactions to community dynamics in various complex communities [START_REF] Iris Van Den | Ecological modelling approaches for predicting emergent properties in microbial communities[END_REF]. Each species is identified by an integer i from 1 to S. It has an abundance N i and its growth in isolation is characterised by a intrinsic growth rate r i and a carrying capacity K i . The interaction between species i and j is represented by a parameter denoted α ij . Each abundance follows a differential equation:

dN i dt = N i   r i - r i N i K i - j̸ =i α ij N j   (1.5)
In this convention, α ij < 0 accounts for a positive influence of the species j over the species i, whereas α ij > 0 is for a negative influence and α ij = 0 represents lack of interaction. Different kind of reciprocal interactions, depending on the sign of α ij and α ji , are given different names, see table 1.1. and3). Species 1 and 2 both consume the resource A, so they interact through competition. Species 2 and 3 also interact by competing for resource B, but species 1 and 3 do not interact.

Note that by construction we have only considered pairwise interactions, whereas more complex interactions involving three or more species at a time may exist in natural communities. A model that accounts for these effects requires higher order terms of the form β ijk N i N j N k [START_REF] Sloan | Complex Interactions in Metacommunities, with Implications for Biodiversity and Higher Levels of Selection[END_REF][START_REF] Gibbs | Can higher-order interactions resolve the species coexistence paradox?[END_REF], but we will see that a model with only pairwise interactions is already very rich and complicated when there are many species.

Mac-Arthur model

In the Lotka-Volterra model, the interactions have been effectively constructed, so that it is not so easy to give a clear interpretation to these coefficients. For example, in the case of competing species, the interaction coefficient is nothing more than a linear expansion of the dependence of the growth rate of one species on the abundance of the other, and its sign reflects the competition. It does not, however, provide any information about the source of this competition.

Mac-Arthur decided to take a different approach and build a mechanistic model of competition. He focused on the case of species that only interact through competition for some resources (see Figure 1.3). The model then needs some additional variables, namely the abundance or availability of the resources.

The Mac-Arthur model [START_REF] Macarthur | Species packing and competitive equilibrium for many species[END_REF] describes the ecological dynamics of a community composed of S species, of abundance N i , competing for M resources, of abundance R µ :

dN i dt = N i µ c iµ R µ -m i dR µ dt = rR µ   1 -R µ - j c jµ N j   (1.6)
with c iµ the rate at which the species i consumes the resource µ (also called the preferences), r the resources intrinsic growth rate and m i the metabolic threshold of species i.

The equations (1.6) have a simple interpretation: the growth rate of each species i is equal to the amount of resources it consumes, minus a death rate m i . Conversely, resource abundances follow a logistic equation with an additional term that takes into account the amount of resources consumed by all species.

In the fast dynamics limit for resources (1 ≪ r), a typical assumption is that resources are in equilibrium [START_REF] Macarthur | Species packing and competitive equilibrium for many species[END_REF]. The dynamics for the species abundances is then reduced to:

dN i dt = N i µ c iµ R µ -m i R µ =   1 - j c jµ N j   + (1.7)
If we also assume that all resources have non-zero abundances, the species abundances follow the generalised Lotka-Volterra equations:

dN i dt = N i   C i - j A ij N j   (1.8)
where C i = µ c iµ -m i is the intrinsic growth rate of species i and A ij = µ c iµ c jµ is the interaction matrix. Each resource contributes to the interaction matrix through a rank one term c iµ c jµ , which is positive (i.e. competitive) because the preferences are positive by construction. Species that have similar preferences compete more. For a detailed study on the equivalence of Lotka-Volterra and Mac-Arthur models, see [START_REF] James | Whence Lotka-Volterra?: Conservation laws and integrable systems in ecology[END_REF].

The dynamics for the resources chosen by Mac-Arthur is quite specific. Other choices can be made, but we can also think of a more general setting where we simply specify that the resource abundances are decreasing functions of the total consumption:

dN i dt = N i µ c iµ R µ -m R µ = h µ i c iµ N i (1.9)
where h µ can be any decreasing function. This set-up will be explained in detail in Chapter 3.

The disordered systems approach to ecology

The models presented above can provide some general insight and can be solved analytically for a small number of species. However, as the number of species increases, the complexity increases exponentially, making it impossible to draw general conclusions.

In addition, parameter sensitivity becomes problematic and inferring interactions from ecological data remains a major challenge. Even with numerical simulations, exploring the full parameter space becomes intractable when there are more than a dozen species.

To maintain analytical tractability, we need a way to reduce the number of parameters (reduce the dimensionality of the problem). One way to reduce dimensionality is to eliminate heterogeneity. For example, we can assume that all species are equivalent (they have the same parameters). This is the idea behind the neutral models presented in Chapter 4. While this greatly simplifies the problem and may allow us to find analytical solutions, it also eliminates by construction the interesting aspects of an ecological community: its 'diversity'.

In contrast, the powerful disordered systems approach allows us to reduce the number of parameters while preserving heterogeneity. This approach uses the complexity of the problem (i.e. the large number of parameters) to simplify it.

Disordered systems

This idea was introduced by Wigner to calculate the energy levels of large complex atomic nuclei [START_REF] Wigner | Random Matrices in Physics[END_REF]. These calculations involved the diagonalisation of matrices describing the interactions between the nucleons contained in the nucleus. These matrices were very large and not well determined, making the task incredibly complicated. Wigner decided to take the opposite approach and build a statistical theory of energy levels in which all structure was washed out and replaced by randomness.

As explained by Dyson [START_REF] Dyson | Statistical Theory of the Energy Levels of Complex Systems[END_REF]: "This statistical theory will not predict the detailed sequence of levels in any one nucleus, but it will describe the general appearance and the degree of irregularity of the level structure that is expected to occur in any nucleus which is too complicated to be understood in detail. (...) What is here required is a new kind of statistical mechanics, in which we renounce exact knowledge not of the state of a system but of the nature of the system itself."

In practical terms, this amounts to replacing the Hamiltonian with a random matrix with the correct symmetry properties. This idea has been incredibly successful, leading to the development of a branch of mathematical physics called random matrix theory [START_REF] Bouchaud | The Oxford Handbook of Random Matrix Theory[END_REF].

Classical results in random matrix theory concern the eigenvalue distribution of these matrices. As we will see, this will prove useful when studying the stability of complex communities. For example, consider a matrix A of size S × S, whose entries are random variables, independently drawn from the same Gaussian distribution with zero mean and variance σ 2 /S. The circular law [START_REF] Ginibre | Statistical Ensembles of Complex, Quaternion, and Real Matrices[END_REF] states that for large S, the eigenvalues of A will be, in the complex plane, uniformly distributed inside the circle of radius σ (see figure 1.4). The universality of this result, regardless of the specific realisation of the matrix, shows the power of this approach. Although the matrix is random, we are able to make a certain prediction because of the aggregation of all the randomness.

Disordered systems in ecology

In all the models presented, the ecological dynamics depend on a number of parameters that increase with the number of species. In particular, the interaction matrix α in the gLV model is of size S × S, where S is the number of species; and the preference matrix in the Mac-Arthur model is of size S × M , where M is the number of resources. For communities with thousands of species, these matrices become huge and it is difficult to assign precise values to these parameters, just as in the case of Wigner's nuclei. Applying Wigner's idea simplifies the problem. By randomly choosing these matrices, the number of parameters is reduced to just a few to define the probability distribution, while retaining some heterogeneity in the interactions.

This reduction in dimensionality comes at a cost. To rephrase Dyson's words in the case of ecology, the resulting statistical theory will not predict the detailed ecological patterns in any community, but it will describe the general dynamics and the degree of irregularity of abundances that can be expected to occur in any community which is too complicated to be understood in detail.

The various disordered ecological models presented below should therefore be thought of as toy-model (or metaphorical models). Such models are deliberately simplistic, but can provide explanatory scenarios with qualitative results, and can be enriched later. Modern physics has been built on toy models, including the Ising model of ferromagnetism [START_REF] Brush | History of the Lenz-Ising Model[END_REF], the Hopfield network model [START_REF] Hopfield | Neural networks and physical systems with emergent collective computational abilities[END_REF], and Derrida's random energy model [START_REF] Derrida | Random-energy model: An exactly solvable model of disordered systems[END_REF].

Because the diversity of biological processes makes the study of living systems incredibly complicated, the use of toy models is even more relevant in this field. In fact, even without the use of random matrices, the population dynamics models presented earlier can be considered as toy models: they are indeed very simplistic: continuous abundance, simplified interactions, no environment, no noise, etc. But they were not really intended to model natural communities quantitatively. Verhulst's model helped to understand population dynamics in cities over the years, and Vito Volterra's model is able to describe the oscillatory dynamics of prey and predator that occur in nature. But these models ignore so many factors that we can't expect them to be completely predictive.

With the improvement of experimental abundance measurements, many people have tried to infer pairwise interactions from experimental data assuming Lotka-Volterra dynamics, with quite mixed results [START_REF] Voit | Inference and Validation of the Structure of Lotka-Volterra Models[END_REF]. Recent techniques of non-parametric inference even seem to indicate that the dependence of the growth rate of one species on the abundance of another is often non-linear [START_REF] Bonnaffé | Fast fitting of neural ordinary differential equations by Bayesian neural gradient matching to infer ecological interactions from time series data[END_REF]. This means that the Lotka-Volterra model is a poor model for accurately reflecting the ecological dynamics of some natural communities. But that doesn't mean it's a bad model for understanding the effects of interactions on abundance in a community.

The disordered models take this reasoning one step further, starting from an inherently false assumption (that interactions are iid random variables) in order to gain intuitions about the general phenomenon expected to occur in natural communities. Even if the assumptions are wrong, this can sometimes lead to qualitative agreement with experiment [START_REF] Hu | Emergent phases of ecological diversity and dynamics mapped in microcosms[END_REF].

Some variants of ecological disordered models

I present here some ecological models that use the disordered systems approach to give a clearer understanding of this concept. I will first present May's model of stability, which was probably the first (and at least the best known) ecological model to use analytical results on large random matrices. I will then introduce one of the most widely used random Lotka-Volterra models and look at recent results and variants of this model.

May's model for the stability of large communities

May was the first to use random matrices in the field of ecology. He was interested in the stability of ecological community with a large number of species.

Say that the abundances N i of a community have their dynamics described by the differential equation (in vector notation):

dN dt = f (N) (1.10)
where f can be any function.

An equilibrium of the dynamics N ⋆ satisfies the equation f (N ⋆ ) = 0. To study the stability of this equilibrium, we introduce the variable x = N -N ⋆ that measures the deviation from this equilibrium. For small x, it satisfies the dynamical equation:

dx dt = Jx (1.11)
Figure 1.5: Spectra of two random Jacobian matrices. The left one is stable because all the eigenvalues have negative real parts, whereas the right one is unstable.

with J the Jacobian matrix of f at N ⋆ :

J ij = ∂ j f i (N ⋆ ).
The elements J ij of this matrix characterise the effect of species j on species i near the fixed-point. The stability of the equilibrium is then completely characterised by the real part of the eigenvalues of J: if all the eigenvalues have a negative real part, the equilibrium is stable; but if at least one eigenvalue has a positive real part, it is unstable (see Figure 1.5 for an illustration).

In practice, we can't measure this matrix for a natural community. That is why May made some assumptions to get a general idea of the condition for the community to be stable or not. He first assumed that all the diagonal elements of J are negative, so that each species is stable by itself, and set them all equal to J ii = -1. The non-diagonal elements, that represent the interactions, are then assumed to be either 0 (meaning no interaction) with probability 1 -C or assigned from a probability distribution of mean zero and variance σ 2 with probability C. The parameters C and σ 2 represent the connectivity and the mean interaction strength of the community.

Similar to the circular law, it is known that in the limit of a large number of species, the eigenvalues of such a matrix are distributed inside a circle in the complex plane [START_REF] Ginibre | Statistical Ensembles of Complex, Quaternion, and Real Matrices[END_REF]. This circle is centred at -1 and has a radius of σ √ SC. Thus, in the limit of many species, the equilibrium will almost certainly be stable if σ √ SC < 1 and almost certainly unstable otherwise. This condition is known as May's bound. In this model, increasing the number of species destabilises the community, as do stronger interactions and higher connectivity. Furthermore, the transition from stable to unstable is sharp, going from certainly stable to certainly unstable as the number of species S increases.

This result is of course useless when trying to assess the stability of a particular community: the assumptions are very questionable, and it is not clear how to access the σ and C parameters. However, it does provide an explanatory scenario for why a larger community might be unstable. Indeed, before this work it was thought that diversity would stabilise a community.

The message that more diverse communities are expected to be less stable should however be nuanced: it is true (in this model at least) all other things being equal. Indeed more diverse communities might have lower connectivity or lower σ.

Various elaborations of this model have been made, including the consideration of specific types of interactions [START_REF] Allesina | Stability criteria for complex ecosystems[END_REF] or the dependence of the Jacobian on the abundances [START_REF] Gibbs | Effect of population abundances on the stability of large random ecosystems[END_REF].

Random Lotka-Volterra models

May's model is only about the stability of a given fixed-point but says nothing about the dynamics of a community. For that purpose, the Lotka-Volterra model has been widely studied in the context of disordered systems.

There are a number of Lotka-Volterra models with disordered interactions, which differ in the choice of the probability distribution (leading to weak or strong interactions; competitive, mutualistic or both; completely disordered or with some structure; etc.) or in the additional phenomena taken into account (immigration, demographic or environmental noise, space, etc.). Different models can give different results. Here I present in detail one of the most commonly used models, which will be used in Chapter 2. I then briefly list variants of this model.

One of the first and most studied random Lotka-Volterra model has been proposed by Bunin [START_REF] Bunin | Ecological communities with Lotka-Volterra dynamics[END_REF]. The model starts from the gLV equation where for simplicity we will assume that all the carrying capacities K i and all the intrinsic growth rates r i are equal to 1:

dN i dt = N i   1 -N i - j α ij N j   (1.12)
The interaction coefficients α ij are Gaussian random variables with means, variances and correlations defined as:

E(α ij ) = µ/S Var(α ij ) = σ 2 /S Corr(α ij , α ji ) = γ.
(1.13)

We also set α ii = 0, as intraspecific interactions are accounted for by the saturation of single-species dynamics.

Here µ tunes the average interaction strength , while σ measures the diversity of interactions. The parameter γ ∈ [-1, 1] determines the symmetry of ecological interactions: competition and mutualism correspond to γ = 1, whereas γ = -1 indicates exploitative interactions such as predator-prey and parasitic interactions. Intermediate values of γ allow a mixing between the different kinds of reciprocal interactions, also including commensalism and amensalism.

This choice of scaling of the interaction statistics with S is called the Weak or Diffuse interaction regime. This choice of probability distribution is natural to a physicist, but may seem questionable from an ecological perspective. Looking at the distribution of α ij in the large S limit, due to the normalisation of the mean and variance by the number of species S, we would see a Gaussian distribution of very small width σ/ √ S and centred on zero (µ/S is negligible compared to σ/ √ S). So all the interactions are very small and half of them are positive and half of them are negative. So it seems that µ is a useless parameter. However, what is important in this model is not the value of the pairwise interactions, but their aggregated effect. In fact, the effect of all species on a species i is a sum of many small terms: j α ij N j . If the species abundances are of order 1, this quantity is of order µ, with variations of order σ.

Again, this model is not intended to be an exact representation of a community, but to understand the phenomenology of a community with a highly interconnected and diffuse network of interactions. The choice to renormalise the mean and variance of the probability distribution by S is convenient to take the large S limit: it makes the quantity j α ij N j well behaved in this limit, and allows the use of tools such as the central limit theorem.

As an aside, this model of species interacting in such a diffuse way only seems suitable for communities composed of very similar species. However, one idea is that it could also apply to communities with more diverse species when choosing the good variables: instead of considering the number of individuals, we could divide this number by the carrying capacity of the species, or the mass of an individual, for example. This would define new interactions that could be more 'diffuse'. It boils down to finding the representation where the species are most equivalent. This idea is also applied to justify the use of neutral models (see Chapter 4).

I'll roughly explain how, using the cavity method [START_REF] Barbier | The cavity method for community ecology[END_REF], it is possible to characterise the different dynamics as well as the distribution of abundances at equilibrium as a function of the parameters µ, σ and γ. The idea is to study the equilibrium of the generalised Lotka-Volterra equation:

0 = N i   1 -N i - j α ij N j   (1.14)
The last term is the total interaction perceived by species i. It is a large sum of very small terms, that are weakly correlated. Using a central limit theorem, we can approximate this sum by a random variable whose statistics will depend on the statistic of the other species abundance. The proper way to do this approximation (à la physicienne) is detailed in Barbier and Arnoldi [START_REF] Barbier | The cavity method for community ecology[END_REF]. As a result, the abundances at equilibrium are written as solutions of:

0 = N 1 -N -µm -σqη + γσ 2 χN + h (1.15)
with the self-consistent parameters:

m = E[N ] q 2 = E[N 2 ] χ = E δN δh h → 0 (1.16)
and η is a Gaussian variable of mean 0 and variance 1. The quantity h is used to define χ and then set to zero.

This result may seem a bit mysterious at first, but it is actually simpler than it looks. At equilibrium, each species abundance is a solution of the equation (1.15) for its own realisation of the random variable η. This equation is just the equilibrium equation (1.12) where the interaction part has been replaced by a quantity -µm -σqη. The first part of this quantity (µm) is the same for each species and represents the average effect of the interactions. It is equal to the mean interaction multiplied by the number of species and the mean abundance. The second term is random and represents the variation in the total effect due to heterogeneity in the interactions. It is therefore proportional to σ. The term γσ 2 χN then indicates how a change in the abundance of one species affects the whole community and feeds back to the species. It is intuitive that this term is stronger when there are some symmetries in the interactions, i.e. when γ = 1 or γ = -1. The parameter χ represents the susceptibility of the community to a perturbation.

For a fixed value of η we can compute the solution of equation 1.15. Since different values of η give different values of N , the distribution of η can be mapped into the distribution of N . Since η is Gaussian, the resulting distribution for the abundances is a truncated Gaussian (the abundances should be positive). The parameters of this distribution of abundances can be defined by the parameters µ, σ, γ, K, m, q and χ. However, the last three parameters come from the effect of the other species' abundances on the perceived total interaction and are defined by the abundance distribution (equations (1.16)). This is therefore a self-consistent equation that has no explicit solution, but it can be easily solved numerically [START_REF] Roy | Numerical implementation of dynamical mean field theory for disordered systems: Application to the Lotka-Volterra model of ecosystems[END_REF].

Investigating on the solution of this self-consistent equation, it is possible to show that it displays three different behaviours depending on µ, σ and γ [START_REF] Bunin | Ecological communities with Lotka-Volterra dynamics[END_REF]. The arrangement of these three phases in the space (µ, σ) for γ = 0 is represented in Figure 1.6.

• Unique equilibrium phase. In this phase, characterised by low heterogeneity of interactions (small σ), ecological dynamics drive the community towards the same stable equilibrium, regardless of the initial conditions (see top panel of Figure 1.7). At this equilibrium, the distribution of species abundance is a truncated Gaussian. A finite fraction of species are extinct, except in a small part of this phase where σ is of order 1/ log(S) (this becomes smaller and smaller as S becomes larger). This small part is called the feasible phase and it allows a rigorous mathematical study [START_REF] Bizeul | Positive solutions for large random linear systems[END_REF].

• Multiple attractors phase. From the unique equilibrium phase, if we gradually increase σ, at some point the equilibrium becomes unstable. This transition is similar to that observed in May's model. After this transition, the community will have an exponentially large number of mostly unstable equilibria. The resulting dynamics appears chaotic, but gradually slows down as some species become extinct (see middle panel of Figure 1.7).

• Unbounded growth phase. Starting from one of the previous phases, we could now decide to change µ instead of σ. As we move towards lower µ, the community be- comes more and more cooperative: the total interaction perceived by a species is more and more likely to increase its growth rate. At a certain point, this cooperation becomes so strong that it overcomes the self-competition term (which defines the carrying capacity). As a result, the abundances of the species will diverge (see bottom panel of Figure 1.7). This phase is a pathology of the Lotka-Volterra equations that can be corrected by choosing a saturation stronger than quadratic [START_REF] Sidhom | Ecological communities from random generalized Lotka-Volterra dynamics with nonlinear feedback[END_REF].

This model has been analysed from top to bottom. In particular, it is possible to obtain an equation similar to equation (1.15) but for the full dynamics (i.e. not only at equilibrium) using dynamical mean field theory [START_REF] Roy | Numerical implementation of dynamical mean field theory for disordered systems: Application to the Lotka-Volterra model of ecosystems[END_REF][START_REF] Altieri | Dynamical mean-field theory and aging dynamics[END_REF] or path integrals [START_REF] Galla | Dynamically evolved community size and stability of random Lotka-Volterra ecosystems[END_REF]. This approach has recently been extended to non-Gaussian interactions [START_REF] Azaele | Large system population dynamics with non-Gaussian interactions[END_REF].

The statistics of the interaction matrix, reduced to only extant (not extinct) species in the unique equilibrium phase has been investigated and shows surprising non-Gaussian behaviour [START_REF] Bunin | Interaction patterns and diversity in assembled ecological communities[END_REF][START_REF] Baron | Breakdown of Random-Matrix Universality in Persistent Lotka-Volterra Communities[END_REF].

The fluctuations of the abundances in the multiple attractors phase can be maintained by adding a small immigration term and has been extensively studied numerically [START_REF] Pirey | Many-species ecological fluctuations as a jump process from the brink of extinction[END_REF][START_REF] Roy | Dynamics of Populations in Large Ecosystems[END_REF].

The case of symmetric interactions (γ = 1) allows the use of powerful tools from the world of spin glasses (such as the replica method or the replicated Kac-Rice) to better understand the dynamics of the multiple attractor phase in the presence of a small demographic noise [START_REF] Biroli | Marginally stable equilibria in critical ecosystems[END_REF][START_REF] Altieri | Properties of Equilibria and Glassy Phases of the Random Lotka-Volterra Model with Demographic Noise[END_REF][START_REF] Ros | Quenched complexity of equilibria for asymmetric Generalized Lotka-Volterra equations[END_REF].

All of the results presented have been proven using physicists' tools, such as the cavity method, which are useful but are not mathematically rigorous. Some of the results have recently been proved mathematically using random matrix theory and mathematical optimisation tools [START_REF] Akjouj | Complex systems in Ecology: A guided tour with large Lotka-Volterra models and random matrices[END_REF]. One example is the existence of a globally stable equilibrium in the unique equilibrium phase [START_REF] Clenet | Equilibrium and surviving species in a large Lotka-Volterra system of differential equations[END_REF]. This model has also been used as a building block to understand the effect of additional structures. In particular, what is the effect of spatial structure on endogenous fluctuations [START_REF] Roy | Complex interactions can create persistent fluctuations in high-diversity ecosystems[END_REF][START_REF] Michael | Stabilization of extensive fine-scale diversity by ecologically driven spatiotemporal chaos[END_REF] or what are the effects of intraspecific cooperative interactions (also called Allee effect) [START_REF] Altieri | Effects of intraspecific cooperative interactions in large ecosystems[END_REF].

It is also possible to consider a random Lotka-Volterra model with different probability distributions. For example, one can consider only competitive interactions [START_REF] Kessler | Generalized model of island biodiversity[END_REF] or include a more complex ecological structure [START_REF] Poley | Generalised Lotka-Volterra model with hierarchical interactions[END_REF][START_REF] Barbier | Generic assembly patterns in complex ecological communities[END_REF]. An important feature of an interaction network is its connectivity. The model I presented is characterised by a fully connected interaction network, which causes species to interact in a 'diffuse' manner. Conversely, a sparse interaction network can lead to very different behaviour [START_REF] Marcus | Local and collective transitions in sparsely-interacting ecological communities[END_REF][START_REF] Valigi | Local sign stability and its implications for spectra of sparse random graphs and stability of ecosystems[END_REF], as we will see in Chapter 5. A 'strong interaction regime' where the mean and variance of the distribution are not renormalised by the number of species has also been studied recently, showing a complex chaotic dynamics [START_REF] Mallmin | Chaotic turnover of rare and abundant species in a strongly interacting model community[END_REF].

Evolution

Evolution in biology

Evolution is the change in characteristics (phenotypes) of individuals within a population over successive generations. These changes can drive the diversification of species and explain the enormous biodiversity on Earth. Evolution occurs when there is some variability of phenotypes within a population, and these phenotypes are heritable. The sources of this variability are mutations in the genome, the rearrangement of genes through sexual reproduction [START_REF] Wilson | The Importance of Gene Rearrangement in Evolution: Evidence from Studies on Rates of Chromosomal, Protein, and Anatomical Evolution[END_REF], or their migration between populations (gene flow [START_REF] Lenormand | Gene flow and the limits to natural selection[END_REF]). The frequency of phenotypes in the population can then be modified by natural selection and drift.

Natural selection is the phenomenon by which different phenotypes can have a reproductive advantage or disadvantage, leading to a difference in ecological growth that makes them more or less common in the population [START_REF] Godfrey-Smith | Darwinian Populations and Natural Selection[END_REF]. Drift is the change in the frequency of a phenotype in a population due to random fluctuations [START_REF] Masel | Genetic drift[END_REF].

The combined effects of mutation, natural selection and drift cause the phenotypes of species to evolve over time. These changes in phenotype can lead to changes in the way a species interacts with other species, or in the type of resources it consumes. In the mathematical models presented in section 1.2, this corresponds to changes in parameters over time. These ecological changes can in turn affect the outcome of evolution [START_REF] Koch | Why rapid, adaptive evolution matters for community dynamics[END_REF]. This complex feedback between ecology and evolution is called eco-evolutionary dynamics and its study is a rapidly expanding branch of ecology [START_REF] Pelletier | Eco-evolutionary dynamics[END_REF].

Evolution of communities

Following Darwin's work [START_REF] Darwin | On the Origin of Species[END_REF], Lewontin formalised the three conditions that must be met for natural selection to occur [START_REF] Lewontin | The Units of Selection[END_REF]:

• Different individuals in a population have different morphologies, physiologies, and behaviours (phenotypic variation).

• Different phenotypes have different rates of survival and reproduction in different environments (differential fitness).

• There is a correlation between parents and offspring in the contribution of each to future generations (fitness is heritable).

Whatever scale we look at, a population composed of different units can evolve if these conditions are met. Thus, evolution typically occurs at different scales: in a population of genes, in a population of individual organisms that make up a species, or in a meta-community composed of different communities. The idea that selection can act at multiple levels of organisation was formalised by Wilson [START_REF] Wilson | A theory of group selection[END_REF] and led to the concept of 'superorganism'.

While the relevance of this theory to evolution in the wild is still debated, its application to artificial selection has recently gained momentum. Artificial selection has been used for centuries to shape the characteristics of individual organisms: the diversity of (mostly maladapted but "cute") dogs around the world is one example. The idea is to get only the individuals with the best characteristics to reproduce. This amounts to artificially changing the fitness of individuals according to the function you want to achieve.

In 2000, Swenson and Wilson performed an experiment in which, instead of artificially selecting organisms in a population, they selected microbial communities in a population of communities [START_REF] Swenson | Artificial ecosystem selection[END_REF][START_REF] Swenson | Artificial selection of microbial ecosystems for 3-chloroaniline biodegradation[END_REF]. In the first experiment they selected soil ecosystems for an increased above-ground plant biomass, while in the second they selected aquatic ecosystems for an increased hydrogen ion concentration. Following Swenson's seminal work, artificial selection has been used to improve various functions of microbial communities, such as low CO2 emissions in aquatic ecosystems [START_REF] Blouin | Levels and limits in artificial selection of communities[END_REF], with mixed results [START_REF] Sánchez | Directed Evolution of Microbial Communities[END_REF].

The hypothetical advantage of artificially selecting communities rather than individual species has been summarised in Swenson et al. [START_REF] Swenson | Artificial ecosystem selection[END_REF]: "The most difficult problems in human life cannot be solved by single individuals, but require coordinated teams of specialists". However, the implementation of this idea requires a number of operational choices.

Figure 1.8 illustrates the typical structure of an artificial selection experiment at the community level [START_REF] Flor | Artificially selecting microbial communities: If we can breed dogs, why not microbiomes[END_REF]. Multiple microbial communities are created and maintained for a period of time as cells grow and divide. The function we want to select is then measured for each ecosystem, and the communities are ranked from best to worst. The best communities are redistributed to start a new round of selection. Different methods can be used to implement the selection and redistribution processes. Since Lewontin's conditions apply to this protocol, it can theoretically lead to an improvement in the selected function. In this case, phenotypic variation can arise from differences in species composition between communities (driven by recombination from migration), from mutations at the species level, or from randomness (e.g. demographic fluctuations). Differential survival is ensured by the selection process. The property of inheritance depends on the redistribution process.

This setting can also be relevant to the study the evolution of natural communities such as plant microbiota [START_REF] Lemanceau | Let the Core Microbiota Be Functional[END_REF]. Indeed, plants host a wide variety of microorganisms that are involved in important functions such as plant nutrition. The microbiota therefore influences plant growth and survival, and plant fitness is therefore a consequence of the plant itself and its microbiota, which together form a 'holobiont' [START_REF] Vandenkoornhuyse | The importance of the microbiome of the plant holobiont[END_REF].

Although the idea of artificially selecting communities seems very promising, there are still some challenges. One problem is that the inheritance of the function of interest is not always guaranteed, for example because the ecological dynamics are unstable or because the duration of a selection round is too short [START_REF] Flor | Artificially selecting microbial communities: If we can breed dogs, why not microbiomes[END_REF]. It is also possible that selection at the community level competes with natural selection within each community.

Many theoretical models have been developed to understand the different phenomena that occur and to find optimal protocols. In the next chapter I will briefly present some of these models and then describe our model of artificial selection of communities based on the evolution of interactions.

Chapter outlines

I will briefly explain what is to be found in the following chapters of this thesis in relation to what has been presented in this introduction.

In Chapter 2 we study the evolution of communities that are selected to perform specific functions, as explained in the previous section. In particular, we look at how selection at the community level shapes the interactions between species and how these changes feed back to the selected function. For this purpose, we build a model based on the generalised Lotka-Volterra equation (1.5) with random interactions as in equation (1.13).

In Chapter 3 we study the ecology and evolution of species competing for resources using the Mac-Arthur model defined in equation (1.6). While this model predicts that the number of coexisting species cannot exceed the number of resources, we will see that this limitation can be overcome by the existence of a metabolic trade-off. Such a trade-off reflects the fact that a species capable of consuming a lot of resources will require more energy and therefore have a higher mortality rate. We will then consider how evolution affects this possibility of having more species than resources.

In Chapter 4 I briefly introduce the neutral theory of biodiversity, and its generalisations. We will see how the random Lotka-Volterra model can be linked to such neutral models using dynamical mean field theory.

In Chapter 5 I study the same random Lotka-Volterra model, but with sparse interactions (i.e. not all pairs of species interact). In particular, I show that at high connectivity the stationary distribution of abundances is similar to the fully connected case (equation (1.15)). I then investigate whether this result still holds at low connectivity.

CHAPTER 2

Artificial selection of complex communities

We have seen that evolution can occur on different scales under certain conditions. In particular, artificial selection allows to evolve microbial communities to perform specific functions [START_REF] Flor | Artificially selecting microbial communities: If we can breed dogs, why not microbiomes[END_REF]. During this process, the species that make up the communities evolve, in particular their interspecific interactions [START_REF] Raynaud | The central role of the interspecific interactions in the evolution of microbial communities[END_REF]. However, it is not clear how selection at the community level shapes these interactions and how these changes feed back to the selected function.

To understand this, we built a simple model of community evolution under artificial selection based on the random Lotka-Volterra model. Using numerical simulations and analytical results, I will show that selection for a function of equilibrium abundances gradually imprints a structure on the interaction matrix. This structure can be summarized in a rank-one component that reflects our knowledge of the function of the community.

This chapter elaborates on the results presented in Fraboul et al. [START_REF] Fraboul | Artificial selection of communities drives the emergence of structured interactions[END_REF] and adds new results and avenues for further development. The presentation of the model is similar to the paper, but the other sections are different.

Introduction

Artificial selection has been used for millennia to drive plant and animal traits towards desired phenotypes. More recently, it has attracted much interest as a way of controlling and tuning ecosystem services and functions, which are emergent properties of biological communities composed of many different species [START_REF] Hooper | Effects of Biodiversity on Ecosystem Functioning: A Consensus of Current Knowledge[END_REF]. Of particular interest are microbial communities, which provide highly relevant functions contributing to human health [START_REF] Kei E Fujimura | Role of the gut microbiota in defining human health[END_REF] and to global biogeochemical cycles [START_REF] Katz | Evolutionary Trajectories and Biogeochemical Impacts of Marine Eukaryotic Phytoplankton[END_REF]. However, the widespread application of artificial community evolution is hampered by the large number of parameters that potentially affect the efficiency of the selection protocol and that need to be critically evaluated 37 in the design of these experiments [START_REF] Flor | Artificially selecting microbial communities: If we can breed dogs, why not microbiomes[END_REF]. Such decisions are still largely based on the experimenter's intuition and experience rather than on general design principles. It is therefore difficult to set expectations that can be compared with empirical observations. This is particularly important because directed evolution of microbial communities has yielded mixed results [START_REF] Sánchez | Directed Evolution of Microbial Communities[END_REF], suggesting that the success of artificial selection may depend on some unresolved details of the fit between the selection target and the ancestral community.

Numerical simulations of relatively large, virtual communities have begun to explore how selection for a collective function affects community composition. Penn [START_REF] Penn | Modelling Artificial Ecosystem Selection: A Preliminary Investigation[END_REF] studied ten-species communities modelled by a Lotka-Volterra equation with competitive interactions. Under selection for increased diversity (taken as Shannon's index), it showed a positive response, with the only sources of variation being sampling error in the production of 'offspring' ecosystems. Williams and Lenton [START_REF] Hywel | Artificial selection of simulated microbial ecosystems[END_REF] designed a 'flask' model consisting of nutrients and microbes subjected to evolution. They showed that artificial selection of the community for a target level of abiotic factors results in a response that is not only due to implicit selection at lower levels, and that beneficial interactions play an important role. Chang et al. [START_REF] Chang | Engineering complex communities by directed evolution[END_REF] built a model of artificial selection of consumer resource communities to test the different protocols used in experiments. They identify a number of strategies that, particularly when used in combination, are better suited to engineering large, diverse and stable communities. Vessman et al. [START_REF] Vessman | Novel artificial selection method improves function of simulated microbial communities[END_REF] studied a similar model where they also had mutations, and found a new method that outperformed previous methods used in experiments.

All of these models are very sophisticated, often taking into account multiple sources of variability (from different species composition, from mutations in the species phenotype, and from sampling error) at the same time, and also quite specific to a particular type of community and selected community functions. Consequently, they have a large number of parameters and any analytical treatment is impossible. The analysis was then limited to a few numerical simulations, from which it is difficult to draw general conclusions.

To better understand the mechanisms involved in the artificial selection of communities and how competition between constituent species can be overcome to achieve collective functions, one option is to consider simpler communities composed of only two species. Xie et al. [START_REF] Xie | Simulations reveal challenges to artificial community selection and possible strategies for success[END_REF] (also [START_REF] Xie | Steering ecological-evolutionary dynamics to improve artificial selection of microbial communities[END_REF]) considered communities composed of "helper" and "manufacturer" species. They showed that community selection for costly community functions can work if done carefully, even forcing species to evolve slow growth to achieve coexistence. Doulcier et al. [START_REF] Doulcier | Ecoevolutionary dynamics of nested Darwinian populations and the emergence of community-level heredity[END_REF] showed that when considering a two-species community modelled by competitive Lotka-Volterra equations, the evolution of a specific community composition depended essentially on modifications of interspecific interactions. However, methods used to obtain theoretical insights for communities composed of a few species are not scalable to more complex communities where a large number of species coexist.

Here, we use the general mathematical framework of disordered systems presented in Chapter 1 to study the evolutionary dynamics of species-rich communities under artificial selection. Mirroring experimental protocols, communities are selected for a community-level function of species abundance (e.g. total abundance). Communities that maximise the function are given the chance to seed the next generation of communities, but these are 'mutated' with respect to the parent community. The novelty introduced by such mutations drives open-ended evolution, which can reshape the ecology of the evolved communities. On the ecological time scale (between two selection events -or community generations), we assume that species abundances are described by deterministic equations.

In the spirit of providing null expectations for species-rich ecosystems with minimally imposed structure [START_REF] May | Will a Large Complex System be Stable?[END_REF][START_REF] Alessina | Going Big[END_REF], we model community ecology by generalised Lotka-Volterra equations (gLVs) with random interactions. In this framework, species are characterised by the intensity of intra-and inter-specific pairwise interactions. The statistics of such interactions determine the overall nature of ecological relationships -e.g. competitive vs. mutualistic -in the community. The study of disordered gLVs has recently been stimulated by the application of methods from statistical physics [START_REF] Bunin | Ecological communities with Lotka-Volterra dynamics[END_REF] and has provided important insights into the ecological dynamics of complex communities [START_REF] Barbier | Generic assembly patterns in complex ecological communities[END_REF][START_REF] Hu | Emergent phases of ecological diversity and dynamics mapped in microcosms[END_REF]. Such models of species-rich communities assume that interaction rates are constant and focus on the resulting ecological dynamics.

Here we consider the evolution of the interspecies interaction matrix when selection is imposed on a collective function. To highlight the effect of selection at the community level, we have chosen to represent mutations as a process that randomly alters interactions without altering, in expectation, the target function. This simplification allows us to analytically derive, in the limit where the ecological and evolutionary time scales are separated, the equation for the matrix dynamics that captures the effects of communitylevel selection on interactions. When the function to be maximised is total abundance, selection drives the emergence of a global mutualistic term similar to collective crossfeeding. Our analytical results predict the interplay of several parameters, including the choice of ancestral community, the number of communities, and the nature of mutations, in determining the speed and achievability of the target function. This analysis shows that community-level selection modifies interactions by progressively evolving a complex, structured matrix from an initially featureless one.

Model for the evolution of Lotka-Volterra communities

Before presenting in detail the model, I start by describing the biological problem we want to solve in the manner of a simplified experimental protocol. Let's imagine we want to improve the ability of a microbial community to perform a specific function, such as increasing its total biomass or breaking down chemical compounds. We would start by inoculating culture vials with samples of a same initial 'ancestral' community. After an initial growth phase where the abundances of the composing species stabilise, we obtain the first generation of 'adult' communities, that we can then score based on how well they perform the desired function.

'Newborn' communities of the second generation can be derived from adult communities of the first generation in multiple ways [START_REF] Chang | Engineering complex communities by directed evolution[END_REF][START_REF] Vessman | Novel artificial selection method improves function of simulated microbial communities[END_REF]. The simplest method, called 'propagule pool', is to select the communities with the highest score and let each of them seed one or more newborn communities, without mixing. This ensures that the characteristics acquired in one generation are inherited by the next, except for variations due to mutations, population stochasticity or sampling at reproduction. The same sequence of growth, selection and reproduction is repeated over and over again, following the same 'serial transfer' scheme used in artificial selection experiments on microbial populations.

Throughout the process, microbes will undergo mutations that can affect the ability of the community to perform its function. In particular, these mutations can cause changes in the interactions between the different species, resulting in functional variation between communities on which selection can act [START_REF] Raynaud | The central role of the interspecific interactions in the evolution of microbial communities[END_REF]. Some mutations are maintained in those communities that survive multiple rounds of artificial selection, and in turn affect their ecological dynamics [START_REF] Penn | Modelling Artificial Ecosystem Selection: A Preliminary Investigation[END_REF].

Our goal is to describe how community-level selection shapes interactions between species, and how these changes affect the selected function. To this avail, we consider a population of n communities that undergo cycles of ecological growth, selection and reproduction, as illustrated in Figure 2.1. The ecological dynamics within a cycle is described by a deterministic model, as often done in numerical models that addressed similar questions [START_REF] Penn | Modelling Artificial Ecosystem Selection: A Preliminary Investigation[END_REF][START_REF] Hywel | Artificial selection of simulated microbial ecosystems[END_REF][START_REF] Chang | Engineering complex communities by directed evolution[END_REF]. The abundance N i of any species i belonging to the community is therefore a function of a continuous time variable t. Selection is applied by letting the probability that a community reproduces depend upon a collective function, evaluated at t = T , the duration of one community generation. Reproduction occurs via monoparental seeding of the next community generation ('propagule' reproduction). Community generations are indexed with a discrete variable τ . The evolutionary dynamics that we aim to describe consists in the change of the community composition, thus of the species' abundance, across multiple generations. Such changes are associated to the evolution of ecological parameters, notably inter-specific interactions. For simplicity, we assume that mutations only occur in newborn communities, so that within one collective generation species abundances are only ruled by the ecological dynamics.

In the following, I first detail the model for the dynamics of a single community within one generation, and then the rules for community reproduction and mutation.

Within-generation community ecology.

Each of the n communities is composed of S species with continuous abundances (N i ) i=1,...,S , whose variation is described by the generalised Lotka-Volterra equations [START_REF] Iris Van Den | Ecological modelling approaches for predicting emergent properties in microbial communities[END_REF]:

dN i dt = N i K i   K i -N i - j̸ =i α ij N j   . (2.1)
The constants K i are the carrying capacities and the interaction coefficients α ij represent the effect of species j on the growth of species i.

We are mainly interested in the evolution of interspecific interactions, so carrying capacities will not change over evolutionary time. In the simulations, K i are assigned by randomly and independently drawing from a uniform distribution, but the analytical Each community in a population of n (here n = 4) communities is represented by a circle and is composed of a set of individuals (represented by the tokens) belonging to different species (represented by the colour). In a first growth phase, the abundance of species changes according to the ecological dynamics. The m = 2 communities with the best function at the end of this phase (here the highest total abundance) are selected for reproduction. New communities of the next generation are generated from these best performing communities, but the parameters of the interactions between species are mutated. These changes in interactions, which are different for each newborn community, are represented by the different shapes of the tokens. This leads to a change in community composition within the current generation of communities, at the end of which selection is again applied to the function of the adult community. The same selection-reproduction-ecological growth scheme is repeated in each generation. results hold for any vector K. The matrix of interspecies interactions, on the other hand, is subjected to mutations, starting from an ancestral random matrix, as described below.

Species interactions in the ancestral community.

We choose ancestral communities with random interactions, in the Diffuse interactions regime (see Chapter 1). Specifically, the coefficients α ij are drawn from a normal distribution of parameters:

E(α ij ) = µ/S Var(α ij ) = σ 2 /S Corr(α ij , α ji ) = γ. (2.2)
Where µ represents the total interaction strength faced by one species from all of its partners and σ measures the diversity of interactions. The parameter γ ∈ [-1, 1] determines the symmetry of the ecological interactions: competition and mutualism correspond to γ = 1 whereas γ = -1 indicates exploitative interactions like predatorprey and parasitic interactions.

As explained in Chapter 1, the ecological dynamics of such communities has been characterised in the limit of large number of species S [START_REF] Bunin | Directionality and community-level selection[END_REF], where it only depends on the summary statistics of the interaction matrix: µ, σ and γ. Among the three qualitatively different dynamical regimes the system can display, we chose the matrix of the ancestral community in a region where interactions are competitive and not too diverse, so that the system has a unique, globally stable equilibrium.

State of the community at the end of a generation

The state of the community at the end of one generation (at time t = T ) generally depends on the abundances of the newborn community (at time t = 0). If T is too small for the dynamics to have reached an attractor, the transient composition of adult communities can have, when selection is applied to a community function, unpredictable effects on long-term evolution [START_REF] Chang | Engineering complex communities by directed evolution[END_REF]. For this reason, we assume that the duration of one generation is large enough for abundances of adult communities to be close to their asymptotic attractor, that is the ecological steady state defined by the interaction matrix at that generation.

We start from a situation where the ancestral community has a unique, globally stable equilibrium. By its structural stability, small perturbations of the interaction matrixas those realised in the first steps of evolution -will still give rise to stable equilibria. This is however not guaranteed after many generations of community selection, and the stability of the ecological equilibrium may eventually be lost. As I will discuss later, we will focus on the region where the within-generation ecological dynamics has a stable equilibrium.

Community-level selection and reproduction.

Selecting communities requires ranking them according to a single collective function. I will essentially focus on the total community abundance N T = i N i , but our approach can be generalised to any function f (N) of the abundances, as I will point out later. The m communities (m = 1 for the analytical derivation) that at the end of one generation have larger N T are chosen for reproduction, and the rest is discarded (Figure 2.1). Such death and birth processes is what characterises community-level selection. When an offspring community is born, it acquires the same composition of the parent community. In the absence of variation in the community parameters, this guarantees that community functions are perfectly inherited.

Unlike other models, we don't have dilution, which can stochastically change the composition of communities between successive generations. This choice is voluntary and allows us to simplify the model. It avoids having to disentangle the effects of different variations (in composition and in species phenotype) on the response of the community to selection.

Community-level mutations.

One of Lewontin's conditions for evolution to occur at the level of communities is that there must be variation in the collective function [START_REF] Lewontin | The Units of Selection[END_REF]. In each generation, the interactions between species change as some species undergo mutations [START_REF] Raynaud | The central role of the interspecific interactions in the evolution of microbial communities[END_REF]. If we consider the interaction coefficients of a species as averages over the different individuals, they can also change between successive generations due to sampling effects [START_REF] Penn | Modelling Artificial Ecosystem Selection: A Preliminary Investigation[END_REF]. Fully characterising the stochastic process associated with these changes is an open challenge. Here we focus on a simplified model in which these changes, called 'community-level mutations', are random, small and unbiased. The latter property ensures that the collective function does not undergo directional changes unless selection is applied. Although this is a strong simplification, it allows us to specifically study the evolutionary consequences of community-level selection on species interactions. For mutations not to bias a priori the change in the trait under selection, they must maintain the mean and variance of the interaction matrices of the newborn communities. Although the expected value of the collective function remains unchanged after the mutation, individual realisations of the mutation will yield different collective functions, producing the variation between communities on which selection acts.

We write the interaction matrix at generation τ as:

α ij (τ ) = µ(τ ) S + σ(τ ) √ S b ij (2.3)
where:

µ(τ ) S = 1 S 2 ij α ij (τ ) σ(τ ) √ S = 1 S 2 ij α ij (τ ) - µ(τ ) S 2 (2.4)
are the empirical mean and standard deviation of the matrix α, and the reduced matrix b has empirical mean 0 and empirical variance 1.

The mutated interaction matrix of one newborn community is then defined as:

α ij (τ + 1) = µ(τ ) S + σ(τ ) √ S bij (2.5) with: bij = b ij + εη ij √ 1 + ε 2 , (2.6)
where η is a realisation -different for every τ and each community -of a Gaussian random matrix of expected value 0, variance 1 and symmetric correlation γ. Therefore, when averaging over all possible communities of generation τ +1 (thus, over η), the interaction matrices have the same summary statistics. Mutations therefore don't introduce any bias in between-community variation of interaction matrices, so that interactions get reshaped along an evolutionary trajectory only by the action of community-level selection. To test this, it is interesting to study evolution in the absence of selection.

Community evolution without artificial selection

In this section I look at the evolutionary dynamics of the interaction matrix when each community produces offspring (i.e. there is no selection). This study is a 'control experiment' that tests whether, in the absence of selection at the community level, community function evolves by drift. Focusing on a lineage of communities, the interaction matrix at each generation can be described as a Markov process due to successive mutations:

• At generation τ , we write α ij (τ ) = µ(τ ) S + σ(τ ) √ S b ij • We then define bij = b ij +εη ij √
1+ε 2 where η ij ∼ N (0, 1) .

• The interaction matrix at generation τ + 1 is

α ij (τ + 1) = µ(τ ) S + σ(τ )
√ S bij Note that, by definition, b ij has an empirical mean equal to zero and an empirical variance equal to one.

We want to understand how µ(τ ) and σ(τ ) evolve. Because of our choice of mutation, we expect them to follow an unbiased Markov process. To show this, we need to express µ(τ +1) as a function of µ(τ ) and η, and σ(τ +1) as a function of σ(τ ) and η. To simplify the notation, we use brackets to denote the empirical mean (⟨α⟩ = i,j α ij /S 2 ). We can then write:

µ(τ + 1) S = ⟨α(τ + 1)⟩ = µ(τ ) S + σ(τ ) √ S ⟨ b⟩ = µ(τ ) S + σ(τ )ε S(1 + ε 2 ) ⟨η⟩ (2.7)
where we used in the last step that ⟨b⟩ = 0. The central limit theorem state that ⟨η⟩ follows a Gaussian distribution with mean zero and variance 1/S1 , so that we get:

µ(τ + 1) ∼ N µ(τ ), σ(τ ) ε √ S (2.8)
at first order in ε/ √ S. To have a similar expression for σ, we write:

σ(τ + 1) 2 S = ⟨ (α(τ + 1) -⟨α(τ + 1)⟩) 2 ⟩ = σ 2 (τ ) S ⟨ b -⟨ b⟩ 2 ⟩ = σ 2 (τ ) S(1 + ε 2 ) ⟨(b -⟨b⟩) 2 ⟩ + 2ε⟨(b -⟨b⟩)(η -⟨η⟩)⟩ + ε 2 ⟨(η -⟨η⟩) 2 ⟩ = σ 2 (τ ) S(1 + ε 2 ) 1 + 2ε⟨bη⟩ + ε 2 ⟨(η -⟨η⟩) 2 ⟩ (2.9)
where we used ⟨(b -⟨b⟩) 2 ⟩ = 1 and ⟨b⟩ = 0. Again using the central limit theorem and the independence of b and η, we have that ⟨bη⟩ is a Gaussian random variable with mean 0 and variance 1/S. To first order, we also have that ε 2 ⟨(η -⟨η⟩) 2 ⟩ = ε 2 so that:

σ(τ + 1) 2 = σ 2 (τ ) 1 + 2 ε S N (0, 1) + o ε S (2.10)
Taking the square root and the expansion for small ε/S, we finally get:

σ(τ + 1) ∼ N σ(τ ), σ(τ ) ε S (2.11)
We observe that this process is a random walk in the space (µ, σ) and that the variations in σ are small compared to those in µ: it scales like ε S for σ and ε √ S for µ. Thus, for large S, σ evolves more slowly than µ. We also get that the variation of both µ and σ is proportional to σ, so a more heterogeneous community could evolve faster. These results are in agreement with the numerical simulations (Figure 2.2).

In the absence of selection, therefore, the summary statistics of the interaction matrix evolve by neutral drift and the matrix retains its ancestral random character. In expectation over different realisation of mutational change, the interaction matrices at two successive generations have the same summary statistics. As a consequence, any community function will also change by drift. The lack of directionality of evolution in the absence of selection is a consequence of our choice not to represent the biases that can be induced by within-community selection, in order to establish a null model against which to assess the effect of selection. The initial interactions are random with parameters µ = 3, σ = 0.5 and γ = 0. The mutation strength is ε = 0.02. The blue lines are the means across communities. The lower panel shows the evolution of the communities in (µ, σ) space. We observe that µ and σ diffuse without bias (at least in the first order). The expansion in σ is smaller than the expansion in µ, in agreement with what was found analytically.

Numerical simulations of community evolution under artificial selection

Before presenting the analytical approximations that allowed me to describe the process of evolution under community-level selection, I use numerical simulations to illustrate the main features of the changes that the selective process imposes on species-rich communities.

Code description

Numerical simulations were performed in python using the code accessible at https: //github.com/jules-fbl/LV_community_selection. All the figures of the paper were obtained with a number of species S = 100, m = 1 selected communities out of n = 10, a mutation strength ε = 0.02, an initial interaction matrix drawn from a Gaussian distribution of parameters µ = 3, σ = 0.3 and γ = 0 and random carrying capacities drawn uniformly between 0.5 and 1.5. The collective generation time was chosen to be T = 500 (with the exception of the first generation where a time T = 5000 was used in order to avoid the propagation of transient effects). This time is long enough for the mutated communities to approach their equilibrium abundances. To integrate the Lotka-Volterra equations, we used an integration scheme described in Appendix C. We also imposed an abundance cut-off N min = 10 -20 below which species are deemed extinct. This cut-off was added for numerical convenience but has no significant impact on the results.

Selection for increased total abundance

As observed in past numerical studies [START_REF] Hywel | Artificial selection of simulated microbial ecosystems[END_REF][START_REF] Penn | Modelling Artificial Ecosystem Selection: A Preliminary Investigation[END_REF], we find that, in response to selection, communities evolve so as to improve the desired collective function (Figure 2.3). In our case, the rate of improvement increases over time, so that the ecological dynamics is eventually pushed in a region where some abundances diverge. Such divergence is a well-known pathology of the Lotka-Volterra equations that can be corrected by choosing a saturation stronger than quadratic [START_REF] Sidhom | Ecological communities from random generalized Lotka-Volterra dynamics with nonlinear feedback[END_REF]. I will focus here on the regimes where the total abundance increases, but does not diverge. The observed improvement of community function derives from changes of the interaction matrix α, that are also visible on its empirical statistics µ(τ ) and σ(τ ). As shown in Figure 2.4, the mean decreases, indicating that interactions become -on average -progressively more mutualistic. At the same time, their variance increases, so that interactions within the community become more diverse.

Analytical results obtained for disordered communities show that for random matrices defined by equation (2.2) the total population size N T is purely a function of µ and σ. Thus, one could envision selection as a process in which the empirical moments of α change across community generations but the interaction matrix remains structureless as in equation (2.2). The evolutionary process could then be described as climbing along the gradient of the function N T (µ, σ) (see Figure 2.5 for a schematic representation). This idea is consistent with the decrease in µ(τ ) and the increase in σ(τ ). The relationship between total abundance and the moments of the interaction matrix [START_REF] Bunin | Ecological communities with Lotka-Volterra dynamics[END_REF] would thus allow the evolution of total abundance to be predicted from these statistics.

However, this is not the case: the evolutionary trajectory deviates from the gradient climbing process (Figure 2.6). More precisely, the evolved total abundance is significantly higher than what would be predicted for a random matrix with the same moment. Thus, the evolutionary trajectory cannot be explained by summary statistics alone. One has to consider the evolution of the fine-scale properties of the interaction matrix.

The mismatch between the evolved and the corresponding random matrices in eq. (2.2) (with the same µ and σ) can be understood by looking at the evolutionary dynamics of the eigenvalue spectrum. The spectrum of the initial random interaction matrix is, in the complex plane, a circle of radius σ centred in the origin [START_REF] Ginibre | Statistical Ensembles of Complex, Quaternion, and Real Matrices[END_REF], plus an isolated positive eigenvalue (blue in the top panel of Figure 2.7) of magnitude µ2 . The initial effect of selection is to reduce this value. After some time, however, an isolated negative eigenvalue λ (green in Figure 2.7) emerges from the circle and detaches from it linearly in time. When this happens, the interaction matrix α has two components. The random component, represented by a circle of eigenvalues, changes only slightly its radius along the evolutionary trajectory. The isolated eigenvalues, on the other hand, and their associated eigenvector change on the evolutionary time scale.

At the dominant order, the structure imprinted by selection on the interaction matrix is determined by its smallest eigenvalue, that corresponds to the slowest mode of the gLV equation. Such rank-one perturbation adds to equation (2.1) a global mutualistic term, which pushes towards higher abundances all species that do not go extinct.

The right eigenvector q associated to the outlier eigenvalue essentially retains the information on the evolved community composition, as it is strongly correlated to the equilibrium abundance vector (Figure 2.8). Moreover, both vectors are correlated to the vector of carrying capacities K. As a result, species that have become more mutualistic after 2000 generations are mostly those that initially had higher carrying capacity. The imprinted structure that emerged along the evolutionary trajectory thus appears when the entries of α for early and late stages of community evolution are compared. By ordering species in terms of their carrying capacity (from larger to smaller, Figure 2.9), no structure of the off-diagonal entries is visible in the ancestral matrix, while a gradient appears after selection has acted for a sufficiently long time.

If we stop selection for increased total abundance but maintain mutations, the outlier eigenvalue goes back slowly to the circle. The evolutionary trajectory thus approaches the surface in Fig 2 .6, so that the total abundance becomes purely a function of µ and σ, as it was in the ancestral community. The only trace of the elapsed community evolution remains then in the modified summary statistics of the interaction matrix, while selection is no longer directly detectable.

We have checked that the features presented in the main text hold for a wide range of parameters in the numerical simulations, in particular for most initial values of (µ, σ) as long as we are in the unique equilibrium phase, for arbitrary values of m and n (when selecting m communities from n) as long as n > 1 and m < n (these two extreme cases lead to no selection), and for arbitrary values of γ except for γ = -1, which will be discussed later. The addition of a small immigration term to the ecological dynamics

Selection for other functions

It is also interesting to consider different community functions. Indeed, the total abundance has the peculiar property that it can only be changed by tuning the mean and variance of a completely disordered interaction matrix (but the structure that evolution imposes on the matrix makes this increase faster). But what if we want to select a function that can't be optimised by an interaction matrix from this random ensemble? A simple choice for such a function can be guided by the observation that the distribution of species abundances (i.e. the histogram of abundances) at equilibrium is a truncated Gaussian for any random interaction matrix defined by the equation (2.2). Selecting a different distribution can therefore lead to changes in the structure of the interaction matrix. Based on what happens for the selection of the total abundance, we can expect that this structure will also take the form of a rank one structure.

A score maximised by a community with a species abundance distribution that is not a truncated Gaussian is the deviation of the abundances from some target abundances. For a vector of target abundances n, we define the score of a community as:

f (N) = - i (N i -n i ) 2
(2.12)

where N i are the abundances at equilibrium. This score is the opposite of a distance between N and n and is maximised by N = n. This may represent a function of the community where each species abundance needs to be fine-tuned. Williams and Lenton [START_REF] Hywel | Artificial selection of simulated microbial ecosystems[END_REF] considered a similar score but with the abundances of abiotic factors instead of the species abundance.

I performed numerical simulations of artificial selection using this score and different choices of target abundances n. Figure 2.10 shows what happens when we choose half of n i to be equal to 0.5 and the other half to be equal to 1. Evolution gradually manages to obtain an interaction matrix that gives this particular distribution. Again, this is done by the emergence of a rank-one structure, which can be observed by looking at the eigenvalues of the interaction matrix. The same phenomenology appears for different choices of n.

We also considered less peculiar functions, such as f (N) = i w i N i where all weights w i are positive, as was done in Chang et al. [START_REF] Chang | Engineering complex communities by directed evolution[END_REF]. Evolution once again leads to the same qualitative result: the emergence of an order-one eigenvalue that determines the structure of interactions. This can be understood by interpreting the selection process as a modification of the selection for total abundance, obtained by rescaling the species abundances as w i N i , so that species i have carrying capacities w i K i and an interaction matrix α ij w i /w j .

We obtained the emergence of a single eigenvalue whatever community function we chose. However, the eigenvector associated with this eigenvalue depended on the function. When switching back and forth between two selective targets, we observed oscillations of the single eigenvalue as well as its associated eigenvector.

Analytical description of the evolutionary dynamics

To understand the origin of this generality and to derive the laws governing the evolution of the interaction matrix, we introduce a theoretical framework that links the dynamics of interactions to the parameters of the system, including those defining the experimental protocol, the target of selection, and the ancestral community. In this part, I derive equations for an arbitrary community-level function f in the case γ = 0 and discuss their interpretation in terms of the numerical results presented above. I then examine the effect of γ and explain how we can understand the emergence of an isolated eigenvalue. Finally, I discuss these results in a Bayesian perspective.

In this section, matrices are underlined to avoid confusion with scalars.

Derivation of the recursive equations

Given a community with interaction matrix α(τ ) (not necessarily random) and the corresponding equilibrium abundances N(τ ) at a given generation τ , we aim to characterise the interaction matrix α(τ +1) of the selected offspring community -the one that provides the largest community-level function f at equilibrium. Because of mutations, the interaction matrix of each offspring community can be written for small ε as α = α(τ ) + εσ(τ ) √ S η, with a different realisation of η for each community (from Eq. (2.6)). The changes of the equilibrium abundances induced by a modification of the interaction matrix are mathematically equivalent to those obtained after small random perturbations of the carrying capacities δK = -εσ(τ ) √ S η N(τ ). Linear Figure 2.10: Numerical simulations of artificial selection for minimising the distance between the abundance and a vector of components equal to 0.5 or 1. Equilibrium abundances evolve with generation (top panel). In red (or blue) are the species that minimise their contribution to the score when their abundance is 1 (or 0.5). Even if some species go extinct, most of them evolve towards their 'optimal' abundance. This causes the score to increase (middle panel) until it reaches a plateau. This evolution imprints a structure on the interaction matrix, which can be seen by the appearance of an isolated negative eigenvalue in the spectrum of α (bottom panel).

response theory provides the corresponding change induced on the equilibrium abundances:

δN = χ(τ ) δK = - ε σ(τ ) √ S χ η N(τ ) (2.13)
with χ ij = ∂N i ∂K j the stability matrix. This matrix measures the effect of a small change in the carrying capacities on the abundances at equilibrium and depends non-linearly on the interaction matrix: χ ⋆ = (I ⋆ + α ⋆ ) -1 where the ⋆ indicates that we only consider extant species.

If f (N) is the community-level function to be maximised, then its value at equilibrium for each community is equal to its value at generation τ , plus a small random change due to the variation in abundances. Using eq. (2.13), this random contribution can be written as

δf = ∇f (N) • δN = - ε σ(τ ) √ S ∇f (N) • χ(τ ) η N. (2.14)
The largest improvement in function achieved in the pool of mutated communities can therefore be identified as the largest of the n independent random variables δf . With a little algebraic manipulation, this expression can take the form:

δf = -ε σ(τ ) √ S [v ⊗ N] : η. (2.15)
where v = χ ⊤ (τ )∇f (N), ⊗ is the tensor product ((a ⊗ b) ij = a i b j ) and : the tensor contraction (A :

B = ij A ij B ij )
. This formulation has an advantage: if we identify η with a random vector η of size S 2 instead of a matrix of size S × S, and similarly define the vector u of components equal to the components of the matrix -ε σ(τ ) √ S v ⊗ N, then δf can be written as a simple scalar product:

δf = u • η.
(2.16)

Then the largest of the n independent random variables δf corresponds to the largest of the n projections of the Gaussian random vector η onto a fixed vector u, an easy problem to solve [START_REF] Julius | Statistics of Extremes[END_REF]. Using Cochran's theorem, these projections are also independent Gaussian variables, so the largest contribution can be written:

δf ⋆ = M n ∥u∥ (2.17)
where M n is a random variable following the law of the maximum of n independent Gaussian variables with mean 0 and variance 1. Its distribution for different values of n is represented in Figure 2.11.

The vector η ⋆ corresponding to this contribution can be written:

η ⋆ = M n u ∥u∥ + b (2.18)
where b is a random Gaussian vector orthogonal to u. The community-level function of the selected community is then simply the sum of its value in the previous generation and this largest contribution:

f (τ + 1) = f (τ ) + δf ⋆ .

Interpretation of the equations

Going back to the original notation, we obtain the recursive equation:

f (τ + 1) = f (τ ) + M n (τ ) εσ(τ ) √ S ∥v(τ )∥ ∥N(τ )∥, (2.19)
where:

v(τ ) = χ ⊤ (τ ) ∇f (N(τ )) (2.20)
is a vector representing how the function f measured at equilibrium changes when we vary the carrying capacities: v i = ∂f (N) ∂K i by chain rule3 . This "sensitivity vector" depends both on the interaction matrix and on the function f . In the specific case of f (N) being the total abundance

N T = N • 1, we have v(τ ) = χ ⊤ (τ ) 1.
Equation (2.19) implies that the community function increases on average along an evolutionary trajectory, as the product of the norms is always positive and M n has a positive expected value for n > 1 (see Figure 2.11). When the number of communities is too small, it can also transiently decrease, thus breaking the alignment between selection and community response. For large n the distribution of M n concentrates around its mean for n ≫ 1, thus making this event very unlikely.

Changes in the community-level function are ultimately based on the evolution of the interaction matrix. As shown by equation (2.18), its change across one collective generation can be decomposed in a directional term -contributing to the evolution of f CHAPTER 2. ARTIFICIAL SELECTION OF COMMUNITIES -and its complement, that acts as a random fluctuation. The interaction between any two species i and j thus evolves according to:

α ij (τ + 1) = α ij (τ ) - εσ(τ ) √ S M n (τ ) v i (τ ) ∥v(τ )∥ N j (τ ) ∥N(τ )∥ + B ij , (2.21)
where B is a Gaussian matrix of mean 0 and variance 1, that is orthogonal to v i N j in the sense of the tensor product. This expression has a simple interpretation: among the random mutations of the interaction matrix, only matter those in the special "direction" v i N j , that combines the sensitivity of the community function f and the equilibrium abundances. The selected community is the one having the largest random Gaussian contribution associated to such direction.

A direct consequence of equation (2.21) is that the most abundant species will experience greater changes in the impact they have on other species (α ij ), but these changes can be of any sign, depending on the sensitivity with respect to the other species involved (v i ). Conversely, species with the most positive impact on the function (those with larger v i ) will face a greater reduction in the effects that any other species has on them.

It is interesting to note that in equations (2. [START_REF] Penn | Modelling Artificial Ecosystem Selection: A Preliminary Investigation[END_REF]) and (2.21), the community function only appears through the vector v. Because this vector depends both on the interaction matrix of the community and on the function f , different communities will have different responses to the same target functions, and, vice versa, the same community may react differently to selection depending on the function it is selected for. Matching selection target and community structure is therefore determinant for speeding up evolution, and could be improved by preliminary tests of the community response to perturbations. In the special case when f (N) does not depend on N, instead, selection at the community level is neutral (any community composition is equivalent), and interactions evolve by drift, driven by the random term B ij .

Equations (2.19) and (2.21) apply to any initial interaction matrix (not only random ones) and allow us to draw general conclusions, which I spell out below, on how speed and direction of evolutionary change depend on the numerous parameters of the system.

As could be intuited, evolution is faster when selection screens a larger number of communities, since the expected value M n is an increasing function of n (see Figure 2.11 right). When only one community is considered, on the other hand, the total abundance and the interaction matrix undergo unbiased stochastic changes (see section 2.3), as M 1 is Gaussian with zero mean. Under these conditions, collective functions cannot be selected and evolve by community-level drift. However, increasing the number of communities may not always be the key to success. The growth of M n with n, indeed, scales as log(n) (see Figure 2.11 right), which increases slowly for large n, so that transition to high community throughput may be of little avail to speed up evolution.

Other parameters can be changed to improve the effectiveness of the community selection. The variation of the interaction matrix, thus of the selected function, across one community generation occurs on a time scale dt = ε/ √ S. Thus, in our model, evolution has faster pace in communities with a smaller number of species and for larger mutational steps. This is however linked to the choices we made for the initial interactions and for the mutations, and we expect that different assumptions may lead to other scaling laws.

Generalisation to arbitrary γ, and small σ limit

Equations (2. [START_REF] Penn | Modelling Artificial Ecosystem Selection: A Preliminary Investigation[END_REF]) and (2.21) have their counterpart for any γ. The additional subtlety lies in the fact that η ij and η ji are now correlated. This problem can be overcome by using the decomposition

η = x + κx ⊤ √ 1 + κ 2 (2.22)
where κ =

1- √ 1-γ 2 γ
and x is a Gaussian matrix of mean 0, variance 1 with no correlations between x ij and x ji (see SI of [START_REF] Barbier | Generic assembly patterns in complex ecological communities[END_REF]). This allows to obtain the following recursive equations for f and α.

f (τ + 1) = f (τ ) + M n (τ ) εσ(τ ) S(1 + κ 2 ) ∥v ⊗ N + κ N ⊗ v∥ α ij (τ + 1) = α ij - εσ(τ ) √ S M n √ 1 + κ 2 ∥v ⊗ N + κ N ⊗ v∥ [v i (τ )N j (τ ) + γN i (τ )v j (τ )] + B ij
(2.23) This nonlinear recursive matrix equation cannot be solved in a general way to predict exactly how the ancestral community changes along an evolutionary trajectory. One of our attempts to solve this recursive equation in the symmetric case γ = 1 was to construct chains of replicas along the generations, as done in Franz and Parisi [START_REF] Franz | Quasi-equilibrium in glassy dynamics: An algebraic view[END_REF] (see Appendix B for a presentation of the replica method), but resulted in an uninterpretable equation.

Whatever the exact change, however, we can qualitatively understand that these successive additions of highly correlated rank-one terms lead to a perturbation of the interaction matrix, which translates into the addition of a rank-one term in the original gLV equation (2.1). This term, as well as the whole dynamics, can be computed explicitly if the chosen function is the total abundance and in the limiting case of small variability of the interactions σ ≪ 1. In this simplistic case the interactions are only characterised by µ(τ ). The effect of selection here is simply to reduce µ(τ ) (i.e. all interactions by the same amount) by εM n σ √ 1 + γ/ √ S in each generation, so that the community becomes progressively more mutualistic up to the point where the selected function diverges. This approximation highlights the role of interaction symmetry in the efficiency of artificial selection to increase overall abundance. Indeed, evolution is fastest when γ = 1, i.e. for competitive or mutualistic interactions. Conversely, for antagonistic interactions, such as predator-prey or host-parasite (in extreme cases, γ = -1), very little improvement can be expected from applying selection for increased abundance. Intuitively, this is because variations in the abundance of the two interacting partners are negatively correlated, so that their global effects cancel each other out.

Eigenvalue emergence

A notable feature in the evolution of the interactions, as previously illustrated by numerical simulations (Figure 2.7), is the existence of a finite time at which the matrix transitions from random to acquiring a new structure in the spectrum. The emergence of an isolated eigenvalue from the random circle when a strong enough rank one term is added to a random matrix is known in statistical physics and signal processing as the BBP phase transition [START_REF] Edwards | The eigenvalue spectrum of a large symmetric random matrix[END_REF][START_REF] Baik | Phase transition of the largest eigenvalue for nonnull complex sample covariance matrices[END_REF] (BBP is for Baik, Ben Arous and Péché, the authors of [START_REF] Baik | Phase transition of the largest eigenvalue for nonnull complex sample covariance matrices[END_REF]). The transition we find has exactly the same properties as a BBP transition. However, unlike this transition, in our case the moment of occurrence and the associated eigenvalues cannot be predicted due to the randomness of M n and B ij in eq. (2.21). As a consequence, the composition of the evolved community at the moment of transition is not unique, despite the clear statistical signature. Moreover, it is not always the same rank-one contribution that is added, but it changes over time. Even if the contributions in two successive generations are highly correlated, we haven't been able to prove that this can't lead to a higher-order perturbation. Indeed, if the correlations are too weak, as would be the case if ε is too large, it seems possible that these successive contributions won't line up and result in just noise.

An observed feature of the right eigenvector associated with this eigenvalue was its correlation with the equilibrium abundances (Figure 2.8). Looking at the equation (2.21), this correlation can be understood by the presence of N j (τ ) in the rank-one contribution. Another explanation comes from the fact that when this eigenvalue is close to -1, it has a dominant effect on the equilibrium abundances. This correlation is indeed caused by these two effects feeding back on each other. A crude explanation of what happens is that species with mutualistic interactions are more likely to be abundant than those with competitive interactions, and as shown in Eq. (2.21), the most abundant species will see their interactions evolve faster towards mutualism.

Bayesian interpretation

I here relate the obtained results to a seemingly different problem of inference, as presented in [START_REF] Barbier | Fingerprints of High-Dimensional Coexistence in Complex Ecosystems[END_REF]. The idea is the following: consider a community whose species abundances at equilibrium N are known (from an experimental measure for example). What is the most likely species interaction matrix α? More precisely, given a prior distribution for the interaction matrix α reflecting the knowledge we have on the community, how is such a distribution modified by imposing that the abundances at equilibrium are N? Solving this problem is tantamount to inferring species-level interaction coefficients without measuring them directly, which is very tedious in practice.

As prior distribution for α, let us consider a Gaussian with mean µ/S and variance σ 2 /S, consistent with our random Lotka-Volterra model, and make the simplifying assumption that all carrying capacities are equal to 1 (this is not necessary, but it simplifies the equations). The conditioning on the equilibrium abundances N can be written as j α ij N j = 1 -N i . Geometrically, this amounts to conditioning each row of α to be in an affine hyperplane. Such conditioning of a multivariate Gaussian distribution is still Gaussian, but with different statistics [START_REF] Barbier | Fingerprints of High-Dimensional Coexistence in Complex Ecosystems[END_REF]. In particular, this introduces biases and correlations. The biases are (in the large S limit):

E(α ij |N) = µ S + l i N j k N 2 k (2.24)
where l i = 1 -µ j N j /S -N i . Ignoring the correlations (that are of order 1/S in this case), this result means that the interaction matrix conditioned on the equilibrium abundances N can be written:

α ij = µ S + σ √ S z ij + l i N j k N 2 k (2.25)
where z is a Gaussian random matrix with zero mean and unit variance. This corresponds to the prior distribution with a rank-one perturbation. What I want to emphasise here is that imposing knowledge of the equilibrium abundances deforms the probability distribution of α by adding a rank-one term. Returning to our artificial selection model, we can then interpret the gradual emergence of a rank one perturbation as the most likely structure given knowledge of the abundances, which is linked to knowledge of the score. To make this a little more concrete, we constructed all along the evolutionary trajectory of Figures 2.3, 2.4 and 2.7 some synthetic interaction matrices of same statistics µ(τ ) and σ(τ ) and with imposed equilibrium abundance N(τ ):

β ij (τ ) = l i (τ )N j (τ ) k N 2 k (τ ) + σ(τ )z ij . ( 2.26)
Figure 2.12 shows the comparison between the eigenvalues of the evolved interaction matrix α ⋆ and of the synthetic matrix β ⋆ and the agreement is remarkable. On may also notice the resemblance between equations (2.26) and (2.21), in particular the common component N j (τ ) in the rank-one term.

It is worth stressing the limitation of this parallel: the knowledge we acquire through artificial selection is not about the entire vector of abundance at equilibrium, but only about the score, which is a scalar function of that vector. There is a strong degeneracy between the two: different vectors of abundance can give the same score. There is therefore less information in the score than in the equilibrium abundances, which can be characterised by an entropy. Unfortunately, we were not able to perform a similar inference calculation using only the imposed score.

Conclusion

This study aims to identify key and general features of the evolutionary dynamics of species-rich communities under a scheme commonly used for artificial selection of collective functions. I showed that the interaction matrix evolves in response to selection on total abundance, and that this generally results in interspecific interactions becoming progressively less competitive. We interpret this as the evolution of facilitation, similar Figure 2.12: Evolved and synthetic matrix have similar structure of eigenstates. Comparison between the eigenvalues of the evolved reduced interaction matrix α ⋆ (blue) and of the synthetic matrix β ⋆ (green) at generation τ = 1500 (Top) and the coefficient of the eigenvector of the minimal eigenvalue (middle). Evolution of the minimum eigenvalue of both matrices for every generations (Bottom). In each panel, the asterisk indicates that the matrices are reduced to extant species only.

to what has been observed in a two-species model [START_REF] Doulcier | Ecoevolutionary dynamics of nested Darwinian populations and the emergence of community-level heredity[END_REF]. At the same time as the average strength of interspecific interactions decreases, they become more variable. In particular, the evolutionary process imposes a structure on the interaction matrix. The key to this structure is an isolated eigenvalue that emerges as a 'collective mode' that positively affects the abundances of all species. In the analytical description, this corresponds to a rank-one perturbation of the interaction matrix, which otherwise retains its original disordered nature.

The emergence of structure in the form of a low-rank perturbation is not specific to selection acting on total abundance, but is predicted to hold for any function of abundances at equilibrium. I showed that this could be interpreted as the minimal (or most likely) structure, given what we know about the community from its performance. Indeed, this appears to be a general feature of systems with many degrees of freedom whose interactions are dynamically tuned to achieve a specific collective goal, such as lower ground state energy in spin glasses and learning in neural networks [START_REF] Penney | Coupled dynamics of fast spins and slow interactions in neural networks and spin systems[END_REF][START_REF] Saxe | A mathematical theory of semantic development in deep neural networks[END_REF][START_REF] Schuessler | The interplay between randomness and structure during learning in RNNs[END_REF]. The ubiquity of this phenomenon raises the question of whether and when selection can lead to the emergence of more complex structures, such as the emergence of multiple distinct dominant eigenvalues. All our attempts to obtain the evolution of perturbations more complex than rank one have failed.

These results have valuable implications for the formulation of models that incorporate further biological realism. In particular, they suggest that, from the point of view of community-level selection, relevant modifications of basic disordered models are those that generate low-rank terms in the interaction matrix. These terms can compete with selection acting at the collective level and drive the evolutionary trajectory of the community.

We chose to analyse an idealised model in order to achieve analytical tractability. If disordered models are certainly an oversimplification of real communities, they have the double advantage of not relying on detailed descriptions of the community, and of providing null expectations for how collective properties would evolve in the absence of species-level constrains. In fact, the actual strength of ecological interactions is unknown in most microbial communities. Statistical approaches, that represent interactions in terms of a few key parameters, can then be a valuable method for identifying general prescriptions relevant in experiments [START_REF] Barbier | Generic assembly patterns in complex ecological communities[END_REF][START_REF] Hu | Emergent phases of ecological diversity and dynamics mapped in microcosms[END_REF].

The model we have examined can be extended in a number of useful ways. Instead of modelling species interactions through direct effects, one could explicitly include the resources that are consumed or exchanged [START_REF] Hywel | Artificial selection of simulated microbial ecosystems[END_REF][START_REF] Cui | Diverse communities behave like typical random ecosystems[END_REF][START_REF] Chang | Engineering complex communities by directed evolution[END_REF]. Given the equivalence of the Lotka-Volterra and MacArthur models when resource dynamics are much faster than ecological dynamics, we expect our main results to hold qualitatively in this case. However, a formulation in terms of resource consumption would link theoretical results to experiments exploring the metabolic basis of ecological interactions in microbial communities [START_REF] Faust | Microbial interactions: From networks to models[END_REF][START_REF] Estrela | Multi-Replicated Enrichment Communities as a Model System in Microbial Ecology[END_REF]. In particular, this may guide the choice of more realistic interaction matrices, such as sparse networks [START_REF] Marcus | Local and collective transitions in sparsely-interacting ecological communities[END_REF][START_REF] Bunin | Directionality and community-level selection[END_REF] or networks with empirical biases [START_REF] Machado | Polarization of microbial communities between competitive and cooperative metabolism[END_REF].

Even maintaining random direct interactions, the model we considered could be explored in regimes where the perturbative approach is expected to break down. This would be the case, for example, when the ecological dynamics of the community fail to reach equilibrium due to transients [START_REF] Chang | Engineering complex communities by directed evolution[END_REF], stochastic demographic fluctuations [START_REF] Altieri | Properties of Equilibria and Glassy Phases of the Random Lotka-Volterra Model with Demographic Noise[END_REF] or chaotic population dynamics [START_REF] Biroli | Marginally stable equilibria in critical ecosystems[END_REF]. All of these processes can reduce the heritability of community function and thus alter the evolutionary trajectory.

Finally, consistent with the idea that communities are Darwinian individuals [START_REF] Godfrey-Smith | Darwinian Populations and Natural Selection[END_REF], we chose mutations that would provide unbiased variation in the target function at the community level. This assumption allowed us to develop a null model that was independent of the details of the underlying community interactions. Community-level mutations can be thought of as the result of multiple changes in species interactions that have occurred over the lifetime of a community. More detailed descriptions of how sequential specieslevel mutations lead to variation in the interaction matrix at the time of community reproduction -i.e. when the function is evaluated -are worth studying and may prove necessary for specific applications (they could provide additional constraints, as observed for simpler models [START_REF] Doulcier | Ecoevolutionary dynamics of nested Darwinian populations and the emergence of community-level heredity[END_REF]). Furthermore, the model could be extended to include mutations of intraspecific interactions via changes in carrying capacity or speciation events that would increase diversity.

Communities are increasingly conceived of as coherent units that perform functions at the collective level, to the point where they can be given the status of 'organisms' [START_REF] Wilson | Reviving the superorganism[END_REF][START_REF] Loreau | The Ecosystem: Superorganism, or Collection of Individuals? In The Ecosystem: Superorganism, or Collection of Individuals?[END_REF]. If this view can reflect the way in which ecological interactions produce a given population structure [START_REF] Liautaud | Superorganisms or loose collections of species? A unifying theory of community patterns along environmental gradients[END_REF], it can go as far as identifying communities as fully fledged evolutionary units. In the latter case, how they are 'scaffolded' by physical compartmentalisation and the establishment of lineages at the community level is crucial in determining the action of natural selection at the community level [START_REF] De | Nascent multicellular life and the emergence of individuality[END_REF][START_REF] Black | Ecological scaffolding and the evolution of individuality[END_REF].

CHAPTER 3

Evolution of competitive communities under metabolic trade-offs

In this chapter we will study the ecology of species competing for resources. To model the ecological dynamics of such a community we will use the Mac-Arthur model defined in Chapter 1. This model has the property of predicting that the number of species coexisting in equilibrium cannot exceed the number of resources. We will see that, under certain conditions, this limitation can be overcome by the existence of a metabolic tradeoff, reflecting the fact that a species capable of consuming a lot of resources will require more energy and therefore have a higher mortality rate.

We will investigate how evolution affects the possibility of having more species than resources. In particular, we will consider the evolution of species that satisfy the metabolic trade-off, as well as the evolution of this trade-off. This chapter essentially follows the structure of a paper that will soon appear on arXiv.

Introduction

Communities composed of several species competing for similar resources are ubiquitous in nature. Their theoretical study began with the pioneering work of Mac-Arthur [START_REF] Macarthur | Species packing and competitive equilibrium for many species[END_REF] and led to the competitive exclusion principle, which states that the number of species forming a community cannot exceed the number of available resources. However, it was discovered that many communities violate this principle. This is known as the plankton paradox because it is particularly prevalent in planktonic communities: hundreds of species of phytoplankton coexist with only a few different resources [START_REF] Roy | Towards a resolution of 'the paradox of the plankton': A brief overview of the proposed mechanisms[END_REF]. Many explanations for this observation have been proposed, including chaotic dynamics [START_REF] Mallmin | Chaotic turnover of rare and abundant species in a strongly interacting model community[END_REF], spatial structure [START_REF] Tilman | Spatial Ecology: The Role of Space in Population Dynamics and Interspecific Interactions[END_REF] and self-regulation [START_REF] Yang | Enhancing Biodiversity through Self-Regulation[END_REF].

One of these explanation is based on the existence of a metabolic trade-off between species [START_REF] Posfai | Metabolic Trade-Offs Promote Diversity in a Model Ecosystem[END_REF], which would apply to similar species or could result from a physical constraint on the consumption of each species. In the following, I will summarise the different trade-off models and explain why this mechanism can lead to the existence of a neutral state, defined by the equal availability of resources, in which any number of species can coexist. In a community with species of fixed phenotype, it is not always possible to have equal availability of resources. This determines whether the neutral state is feasible or not. Using a simple mathematical formulation, I will show that if it is feasible, ecological dynamics will always drive the community towards neutrality.

The likelihood that the neutral state is feasible in a community has been studied using models of randomly assembled communities [START_REF] Tikhonov | Collective Phase in Resource Competition in a Highly Diverse Ecosystem[END_REF]. These models assume that communities are formed by a large number of independent species all at once. However, natural communities composed of very similar species are more likely assembled by a complex mechanism of evolution, especially for microbial communities, which are known to evolve on timescales on the order of the ecological timescale [START_REF] Koch | Why rapid, adaptive evolution matters for community dynamics[END_REF]. We therefore investigated how evolution affects the feasibility of the neutral state. I will show that evolution consistently drives the community towards neutrality, similarly to what was recently found in the case of adaptation [START_REF] Pacciani-Mori | Dynamic metabolic adaptation can promote species coexistence in competitive microbial communities[END_REF], and that it increases the number of species beyond the number of resources. I also investigate the limitations of this model by studying how this neutral state is affected by mutants with a small variation in the metabolic trade-off.

Ecological equilibrium of species with metabolic tradeoff 3.2.1 Mac-Arthur model

To study the ecological dynamics of a community composed of S species interacting through competition for multiple resources, let us consider a generalisation of the mathematical model initially proposed by Mac-Arthur [START_REF] Macarthur | Species packing and competitive equilibrium for many species[END_REF] and introduced in Chapter 1. In this model, the abundance N i of species i satisfies the differential equation:

dN i dt = N i × µ c iµ R µ -m i (3.1)
where R µ is the availability of resource µ (related to the resource concentration, for example through a Monod function), c iµ is the rate at which the species i consumes the resource µ, also called the preference, and m i is a metabolic threshold, that measures the quantity of resource that species i must consume to survive. In principle, each resource availability also follows its own dynamics, depending on species abundances and preferences, and on resource influx. To simplify the model, we follow the idea of Mac-Arthur [START_REF] Macarthur | Species packing and competitive equilibrium for many species[END_REF] in assuming a short relaxation time for the resources compared to the species dynamics. The resources are then considered to be constantly at equilibrium, and such equilibrium depends on the species abundances and consumption rates. As we will be focusing mainly on the equilibrium of the dynamics, this simplification is not very restrictive. In general, the availability of the resource µ will be a function of the total consumption of the resource:

R µ = h µ i c iµ N i . (3.2)
These functions can be for instance affine : R µ = k µi c iµ N i , so that equation (3.1) takes the form of a Lotka-Volterra equation [START_REF] Macarthur | Species packing and competitive equilibrium for many species[END_REF], as we saw in Chapter 1. This choice is the result of balancing the production and consumption of a biotic resource.

Conversely, the dynamics of abiotic resources added to the system with a constant inflow ϕ µ and a degradation rate d µ can be modelled by the linear differential equation:

dR µ dt = ϕ µ -d µ + i c iµ N i R µ (3.3)
The equilibrium is obtained by equating the inflow term with the degradation and consumption terms, resulting in an inverse function:

R µ = ϕ µ / (d µ + i c iµ N i )
In general, to reflect the negative relationship between resource consumption and availability, we assume that the function h µ is decreasing. The numerical simulations are carried out with abiotic resources, but the mathematical results do not depend on this choice.

Trade-off and neutral state

We will first focus on the ecological equilibrium of the Mac-Arthur model, defined by equations (3.1) and (3.2), and in particular the number of species that can coexist at this equilibrium.

If all species are extant (i.e. not extinct), the equilibrium condition of equation (3.1) is, in matrix notation,

CR = m (3.4)
where C is the preference matrix (of size S × M ) of elements c iµ , R is the resource availability vector (of size M ), and m is the metabolic threshold vector (of size S).

If there are more species than resources (S ≥ M ), the preference matrix is not invertible. Equation (3.4) thus has no solution R for a 'typical' choice of C and m1 . As a consequence, species should go extinct for the community to reach an equilibrium where no more than M species coexist. This condition is known as the competitive exclusion principle [START_REF] Hardin | The Competitive Exclusion Principle[END_REF].

However, it is possible to have a solution of equation (3.4) if C and m are constrained (i.e. we redefine the class of 'typical' C and m).

One approach is to assume that each species faces a trade-off between the use of different resources. In Posfai et al. [START_REF] Posfai | Metabolic Trade-Offs Promote Diversity in a Model Ecosystem[END_REF], for instance, each species has the same metabolic threshold m and has the same 'total metabolic budget': µ c iµ = E (represented in Figure 3.1). Such constraint was already mentioned in Mac-Arthur seminal paper [START_REF] Macarthur | Species packing and competitive equilibrium for many species[END_REF] E Species 1 Species 2 Species 3

C 3,4 C 3,3 C 3,2 C 3,1
Figure 3.1: Cartoon of a three species community with the trade-off presented in [START_REF] Posfai | Metabolic Trade-Offs Promote Diversity in a Model Ecosystem[END_REF]. Each species use of resources is represented by a gauge, filled with different colours representing the species' preferences. The metabolic trade-off imposes that each species has the same total 'budget' µ c iµ , so the length of each gauge is the same, but the allocation of this total budget is not imposed and is different for each species.

and could be relevant either to model very similar species that have the same metabolic function, or to model a physical constraint on the consumption of each species. It is then straightforward to check that if all the species satisfy this trade-off, then R = m/E 1 is always a solution of equation (3.4). An alternative formalisation of the constraints was proposed in Tikhonov and Monasson [START_REF] Tikhonov | Collective Phase in Resource Competition in a Highly Diverse Ecosystem[END_REF]. In their model, each species can have a different total metabolic budget E i = µ c iµ . However, a high budget is balanced by a high metabolic threshold. This balance is written as a proportionality relation between these two quantities: m i = α µ c iµ , where the proportionality coefficient α is the same for each species (see Figure 3.2 for a pictorial representation). This can be thought of as an unconstrained choice of preferences, which constrain m i , or vice-versa.

Using this trade-off, the equilibrium condition of equation (3.1) can be written:

C(R -α1) = 0 (3.5)
and admits a generic solution R = α1. The proportionality coefficient α thus correspond to the mean resource availability at equilibrium. In fact, the choice made by Posfai et al. is just a particular case of the set-up of Tikhonov and Monasson, where m i = m is additionally imposed and with E = m/α. This additional condition allows a simpler representation of the species phenotypes using the simplex space and a more direct analytical treatment, but for the sake of generality we will mainly focus on Tikhonov and Monasson's choice.

Using this metabolic trade-off, it is therefore possible to observe an equilibrium with more species than resources. Furthermore, as long as all resources are such that R µ = α, the growth rate of any species will be zero, regardless of its preferences c µ and metabolic threshold, provided it satisfies the metabolic trade-off. This means that any species that invades the community with very low abundance (and thus does not affect resource availability) will have a zero growth rate. For this reason we call this equilibrium the neutral state. So far we have only considered the equation for the species equilibrium. At this equilibrium, however, the abundances of the species should be such that the solution of equation (3.2) is also R = α1. This condition may not always be possible, depending on the preferences and the functions h µ . If this condition is met, i.e. there are positive abundances such that R µ = h µ ( i c iµ N i ) = α, we say that the neutral state is feasible.

m 1 /α m 2 /α m 3 /α Species 1 Species 2 Species 3 C 3,4 C 3,3 C 3,2 C 3,1

Ecological trajectories converge to the neutral state

If it is feasible, it is not yet obvious that the ecological dynamics will drive the community towards the neutral state. To demonstrate this, I propose an analytical formulation that provides a clearer understanding of this phenomenon.

The dynamical system defined by equations (3.1) and (3.2) is known to possess a Lyapunov function [START_REF] Tikhonov | Collective Phase in Resource Competition in a Highly Diverse Ecosystem[END_REF]:

L(N 1 , . . . , N S ) = i m i N i - µ ĥµ i c iµ N i (3.6)
with ĥ a primitive of h : ĥ(x) = x 0 h(y)dy. The ecology of each species will go towards a minimisation of L. Indeed, equation (3.1) can be written:

dN i dt = -N i ∂L ∂N i (N 1 , . . . , N S ) (3.7)
As a result, this quantity evolves along an ecological trajectory according to:

dL(N 1 , . . . , N S ) dt = - i N i ∂L ∂N i 2 (3.8)
This derivative is strictly negative, except at equilibrium when none of the abundances change, in which case it is zero. Therefore, L(N 1 , . . . , N S ) can only decrease along an ecological trajectory, and the equilibrium of the dynamics are local minima of the function L. These local minima should however be considered in the subset of extant (alive) species. Indeed, for each species i, N i = 0 defines an absorbing set, meaning that the dynamics can't escape from this set. It is possible that a local minimum of L in such a subset is not a local minimum in the full set R S if one of the extinct species can invade2 .

The Lyapunov function L is convex because the functions h µ are decreasing. This important property ensures that, given the set of extant species, the dynamics will always lead to the same equilibrium, regardless of the initial non-zero abundances.

Because of the metabolic trade-off, the Lyapunov function can be written:

L(N 1 , . . . , N S ) = µ α i c iµ N i -ĥµ i c iµ N i (3.9)
Defining the uptake rate of resource µ, k µ = i c iµ N i , the Lyapunov function coincides with a function of the (k µ ) only:

L(k 1 , . . . , k M ) = µ α k µ -ĥµ (k µ ) (3.10) i.e. L(N 1 , . . . , N S ) = L(k 1 , . . . , k M ) where k µ = i c iµ N i .
This function L of variables k µ is also convex and the position of its global minimum is given by the k µ satisfying h µ (k µ ) = α. By equation (3.2), this correspond to R µ = α, that defines the neutral state.

Therefore, this state is also a global minimum of the Lyapunov function L as long as there exist abundances (N 1 , . . . , N S ) such that the uptake rates k µ = i c iµ N i are solutions of h µ (k µ ) = α. This is the condition of feasibility of the neutral state. Because it is a global minimum of the Lyapunov function, the ecological dynamics will always drive the community towards the neutral state if it is feasible with the existing species.

Feasibility of the neutral state

The feasibility of the neutral state is conditioned on the existence of non-negative abundances (N 1 , . . . , N S ) such that, for each resource, R µ = α. This condition depends on the set of preferences (c i ) and the functions h µ , and can be reformulated geometrically. Defining the vector k ⋆ of components k ⋆ µ = h -1 µ (α), the neutral state is feasible if there are non-negative abundances (N 1 , . . . , N S ) such that k ⋆ = i N i c i . The set of all vectors equal to such a weighted sum i N i c i with non-negative weights defines the conic hull of the S vectors c i . So the neutral state is feasible if and only if the vector k ⋆ lies in this conic hull (see Figure 3.3). The abundances at equilibrium will then correspond to the weights of the conic combination. In the special case of Posfai et al., the conic hull becomes a convex hull due to the additional condition m i = m.

A direct consequence of this geometric condition is that the more species there are in the community, the more likely it is that the neutral state is feasible. Furthermore, there must be at least M potential species to access the neutral state, except if the preferences are very fine tuned (that happens with zero probability in nature) 3 .

Another consequence is that not all species contribute equally to the neutrality of the community. A neutral community can contains a keystone species: if it is removed, the conic hull is reduced so that it no longer contains k ⋆ so the community is no longer neutral, causing massive extinctions [START_REF] Posfai | Metabolic Trade-Offs Promote Diversity in a Model Ecosystem[END_REF].

We have seen that when the feasibility condition is met, ecological dynamics will drive the community towards the neutral state. But how often is a community feasible?

The geometric interpretation may be of some help to visualise this when there are few resources, but it is unclear when there are many resources. To answer this question, in the next section we consider disordered communities.

Feasibility in communities with random traits

In models of communities with large numbers of species and resources, the number of parameters quickly becomes intractable. For this reason, we use the disordered systems approach explained in Chapter 1. In the case of the consumer resources model presented above, this approach amounts to consider the species' preferences as identically and independently drawn from a probability distribution (the metabolic thresholds are then fully determined by the metabolic trade-off) [START_REF] Advani | Statistical physics of community ecology: A cavity solution to MacArthur's consumer resource model[END_REF][START_REF] Cui | Diverse communities behave like typical random ecosystems[END_REF]. I will now present two possible choices for the probability distribution, with binary and continuous preferences. Tikhonov and Monasson focused on a case where the preferences can take only two values: c iµ = 1 if species i consumes resource µ and c iµ = 0 otherwise. In this binary rate model, there is no in-between and the total budget µ c iµ is the number of resources that species i consumes. The natural choice to assemble such community with random traits is to independently draw the preferences from a Bernoulli distribution of parameter p: P (c iµ = 1) = p and P (c iµ = 0) = 1 -p.

In natural communities, species don't necessarily use resources in the same way: some species may have a primary resource that they consume the most, then a secondary resource that they consume less. For this reason, we propose a similar model, but with continuous preferences, which allows consumption rates to be modulated. Because the rates are positive quantities, we write them as the square of random variables x iµ (i.e. c iµ = x 2 iµ ). To assemble a community, we draw the x iµ from a Normal distribution4 . Considering the resources, the functions h µ can either be taken all equal to one standard function h or depend on one parameter drawn at random for each µ to account for heterogeneities. For example in the case of abiotic resources where h µ ( i c iµ N i ) = ϕ µ / (d µ + i c iµ N i ), we can take all the resources degradation rates d µ equals but draw the resources influx ϕ µ from a normal distribution of mean µ R and standard deviation σ R .

For such disordered communities, it is possible to compute the probability of feasibility of the neutral state given a distribution of preferences and a choice for the functions h µ . In the limit of large number of species and resources, and in the simple case of equivalent resources (h µ = h), this probability exhibits a discontinuous behaviour: it is equal to one if there is twice as many species as resources, and zero otherwise [START_REF] Landmann | Systems of random linear equations and the phase transition in MacArthur's resource-competition model[END_REF] 5 . This means that it is very unlikely6 to find a community composed of less than 2M species in the neutral state. This phase transition is equivalent to the well-known transition of iµ , where all x iµ are independent and identically distributed from a normal distribution of mean zero and variance 1. The metabolic thresholds are imposed by the trade-off: m i = α µ c iµ with α = 1. Resource availability satisfies the equation R µ = ϕ/(1 + i c iµ N i ) with inflow ϕ = 10. Species whose abundance falls below a threshold N min = 10 -6 are considered extinct. The equilibrium is not the neutral state because it is not feasible, so resource availabilities are not all equal and some species go extinct. the perceptron problem [START_REF] Gardner | Optimal storage properties of neural network models[END_REF]. It doesn't depend on the choice of α or h, as long as there is a solution to h(x) = α.

Figures 3.4 and 3.5 represent the ecological dynamics of randomly assembled communities using a Normal distribution for the x iµ and with similar abiotic resources of availability R µ = ϕ/(1 + i c iµ N i ). In Figure 3.4, there are as many species as resources so the neutral state is not feasible. Conversely in Figure 3.5, there are three times more species than resources so the neutral state is feasible. Indeed, after some time the resource concentrate around the value R µ = α and the equilibrium counts more species than resources.

If the functions h µ are different, for example with abiotic resources with influx distributed with a standard deviation σ R , a similar transition happens but the number of species at which this transition takes place is larger and depends on σ R [START_REF] Landmann | Systems of random linear equations and the phase transition in MacArthur's resource-competition model[END_REF]. This has been computed for the binary rate model of Tikhonov and Monasson [START_REF] Tikhonov | Collective Phase in Resource Competition in a Highly Diverse Ecosystem[END_REF] 7 .

For communities with many resources, it then appears that a lot of species (at least 2M ) are needed for the neutral state to be feasible. However, it seems rather unlikely that a community with so many independent species could be assembled by immigration. In fact, natural communities are rather the result of a long-term process of evolution, where novel variants are introduced by mutation of existing species. We will therefore investigate how, starting from a community with few species, evolution can make the neutral state feasible.

Evolution of the preferences

In this species-based model, evolution amounts to the iterative addition of new species with low abundance, called mutants, whose phenotype is more or less close to the phenotype of an existing species, called resident. In the context of a consumer-resource model with trade-offs, evolution has been studied by randomly adding new species (which is equivalent to gradually increasing the size of the pool) [START_REF] Tikhonov | Innovation Rather than Improvement: A Solvable High-Dimensional Model Highlights the Limitations of Scalar Fitness[END_REF]. Instead of evolution with the addition of new species, the adaptation of the strategies of a fixed number of species has been considered [START_REF] Pacciani-Mori | Dynamic metabolic adaptation can promote species coexistence in competitive microbial communities[END_REF].

Here, we study an intermediate case where the 'distance' between the mutant and resident phenotypes is tuned by a parameter θ. The limit of large θ corresponds to the addition of new species with no correlation to the resident [START_REF] Tikhonov | Innovation Rather than Improvement: A Solvable High-Dimensional Model Highlights the Limitations of Scalar Fitness[END_REF], and the limit of small θ is similar to the adaptive dynamics [START_REF] Pacciani-Mori | Dynamic metabolic adaptation can promote species coexistence in competitive microbial communities[END_REF].

Evolutionary dynamics with conserved metabolic trade-off

Evolution is implemented in our model using the following procedure. First, we randomly sample a pool of S init species. At each time step dt, a species (the resident) can produce a mutant with probability p i = µ mut N i dt, where µ mut is the mutation rate. For simplicity, we allow only one mutant to appear during a time interval (this is not very binding as long as the mutation probability is small).

The choice of the phenotype of the mutant should be random, unbiased, close to the phenotype of the resident up to a 'distance' θ. Furthermore, the initial distribution of phenotypes should be a stationary distribution of mutations in the absence of ecological selection, so that we can be sure that the observed effects on the community are due only to selection and not to the distribution of the phenotype being changed by the mutation process.

I first present how I have implemented evolution in the binary rate model. To satisfy the above conditions, we define the probability that the mutant's rates are different from the resident's rates ('flip' probability) to be:

p 0→1 = θ p p 1→0 = θ (1 -p) (3.11)
where θ is a free parameter tuning the average number of flips per mutation. The remaining probabilities are given by p 0→0 = 1 -p 0→1 and p 1→1 = 1 -p 1→0 . This choice of probabilities makes the initial Bernoulli distribution of parameter p stable by mutations.

The same can be done with continuous preferences. Writing c iµ = x 2 iµ , we initially sample x iµ as independent Normal random variables (of mean 0 and variance 1). From a randomly chosen species of parameters x iµ , we create a mutant of parameters:

xiµ = x iµ + θη iµ √ 1 + θ 2 (3.12)
with η iµ a Normal random variable. This mutation process also leaves the initial normal distribution of x i stable. The parameter θ represents the strength of the mutations, or how correlated the phenotype of the mutant is to the phenotype of the resident. The limit θ → 0 is for a similar phenotype and gives phenomenology asymptotic to adaptation [START_REF] Pacciani-Mori | Dynamic metabolic adaptation can promote species coexistence in competitive microbial communities[END_REF], while θ → ∞ is for a completely uncorrelated phenotype [START_REF] Tikhonov | Innovation Rather than Improvement: A Solvable High-Dimensional Model Highlights the Limitations of Scalar Fitness[END_REF]. Instead of just adding the mutant to the species pool, we first check whether the mutant will invade by looking at its growth rate at the time of invasion r m . If this is positive, the mutant will invade, so it is added to the pool with a small abundance N 0 . Otherwise it will die out, so we don't add it to the pool. To avoid invasions in very long time, we can even impose this growth rate to be greater than a threshold 1/τ , where τ is the maximum allowed invasion time.

In parallel to this evolutionary process, species and resources follow the ecological dynamics described by equations (3.1) and (3.2). In addition, species whose abundance falls below a threshold N min are considered extinct.

Evolution drives the community to neutrality

Numerical simulation of the eco-evolutionary dynamics described above, in the case of continuous preferences, is presented in Figure 3.6. Figure 3.6: Eco-evolutionary dynamics of the resources availability and the species abundance. We start with a community with S init = M = 50, using the same parameters as in Figure 3.4. In the first period (indicated by the shaded area), only ecological dynamics is at stake. We then turn on evolution following the procedure described in the main text, with parameters µ mut = 0.02, θ = 0.2 and N 0 = 10 -4 and no threshold 1/τ . Resources become increasingly concentrated, indicating that the community is approaching the neutral state. In the final period (shaded), we switch off evolution to observe that this state is ecologically stable. Starting from a randomly sampled community where the neutral state is not feasible, turning on evolution makes it feasible. Due to evolution, the number of species increased during this simulation. This increase is shown in Figure 3.7.

We start with a randomly assembled community with as many species as resources, so that the community cannot access the neutral state. After a transition period where there is only ecology (indicated by the shaded area), we start evolution. As a result, resources become increasingly concentrated, indicating that the community is approaching the neutral state. During a final period (again shaded), we switch off evolution to observe that this state is ecologically stable and not dynamically maintained by evolution.

This phenomenon has a simple ecological interpretation. If a resource is more abundant than others, it is advantageous to consume more of it, so selection will favour mutants that do so. Conversely, if a resource is less abundant, the metabolic trade-off makes it costly to consume, so selection will favour mutants that consume less of it. In the long run, evolution will ensure that all resources are equally available.

An analytical explanation can be obtained using the Lyapunov function formalism, but it requires a small trick to account for the addition of species. When we add a new species (mutant) to the community, we add a new variable to L, so it is no longer the same function. We can however consider that this new species already existed (its abundance was a variable of L), but that its abundance was zero. A species with zero abundance does indeed have a zero contribution to L, and we have seen that this defines an absorbing set.

Adding a mutant is tantamount to changing its abundance slightly to a non-zero value, leading to two possible outcomes. It is possible that the mutant cannot invade and dies out, so the system returns to its initial state. This happens if the partial derivative of L with respect to the mutant's abundance is positive. Another possibility is that the mutant invades and the system evolves towards a new local minimum of L. During this process, L(N 1 , . . . , N S ) will have decreased, and so L(k 1 , . . . , k M ) will also have decreased. Since L(k 1 , . . . , k M ) is convex, it will only decrease as k gets closer to the location of the global minimum, k ⋆ , which is the neutral state. This explains why resource availabilities become increasingly concentrated around their mean.

We will now examine this iterative process of mutant invasion in more detail, to gain a little more intuition and to understand how the speed of evolution and the final number of species depend on the various parameters.

Speed of evolution

This evolution towards neutrality can occur at different speeds and end up with different numbers of species at the end, depending on the mutation and selection parameters. Figure 3.7 shows the total number of species S and the number of extant species S ⋆ (those with non-zero abundance) during the numerical simulation of the eco-evolutionary dynamics shown in Figure 3.6 and in a similar simulation with a selection threshold of 1/τ . While in the first case the total number of species increases linearly with time, this increase progressively slows down in the second case.

To understand this, consider a species with preferences c µ and a mutant of that species with preferences cµ = c µ + θδ µ with δ µ of order one (θ representing the average phenotypic 'distance' between a resident and a mutant). Since the mutant also fulfils the trade-off, its growth rate is r m = µ cµ (R µ -α).

Assuming that the resident is in equilibrium at the time of the invasion (it has a zero growth rate), the mutant's growth rate can be written as r m = θ µ δ µ (R µ -α). This is the scalar product between the vector of resource 'surpluses' R -α1 and the change in rates θδ. This expression is intuitive: any resource with a positive surplus will contribute positively to the mutant's growth rate if it consumes more of it than the resident. Conversely, it will contribute negatively if it consumes less of it, and vice versa for resources with a negative surplus. Finally, the mutant's advantage over the resident is the sum of these contributions and determines whether the mutant will invade.

Since the distribution of δ is isotropic (there is no preferred direction for mutations), there is a half chance that the growth rate is positive unless R -α1 = 0. So there is always a half chance that the mutant will invade, unless the community is exactly neutral. When it is neutral, all mutants have a zero growth rate. Because of this, the total number of species increases linearly with time (see Figure 3.6). However, most of these species will take a long time to invade (any mutant with an initial growth rate r m will take a time of the order of 1/r m to invade). In particular, the average invasion growth rate decreases as the community becomes more neutral, so the dynamics slows down (see Figure 3.6). These slow invasions are less relevant in natural communities, where demographic fluctuations would drive the low-growth mutants to extinction. The bottom panel is the same as the top panel, but for a simulation where we have selected only those mutants that invade the community in time less than τ = 300. Because of this selection, the number of species increases more slowly and eventually stabilises.

Instead, we can consider invasions only in the short term by requiring the growth rate to be greater than a threshold: r m > 1/τ . The probability of a mutant invading is less than half: it is equal to the probability that δ • (R -α1) is greater than 1/τ θ. Furthermore, as the community gets closer to neutrality, R -α1 becomes smaller, so this probability decreases. This leads to a slowing down of the increase in the total number of species (see Figure 3.7). Evolution will eventually stop when all R µ are too close to α compared to 1/τ θ. The number of species at the end of evolution is then an increasing function of τ θ and of the mutation rate µ mut .

We saw that evolution gradually drove the community towards the neutral state by increasing the number of species beyond the number of resources. Evolution acted on preferences and metabolic thresholds, satisfying the metabolic trade-off. However, this assumption is questionable, as one might expect mutations to introduce small variations in the trade-off. We will therefore investigate how such variation might affect the neutral state.

Breaking the neutral state

The existence of a neutral state with more species than resources is based on a relation between the preference matrix C and the metabolic thresholds m, which allows the existence of a solution to equation (3.4). It doesn't depend on the dynamics or the equilibrium of the resources.

However, a simple analysis shows that any small perturbation of the trade-off condition (the relation between C and m) can make the neutral state disappear. Indeed, if m is not exactly in the image of C, there is no more natural solution to equation (3.4).

For example, if we introduce from the neutral state a new disruptive species i = 0 with a slightly altered metabolic threshold m 0 = α µ c 0µ -ε, then this species will have a positive growth rate (equal to ε) and will invade. As a result, resource availabilities will no longer be equal (with differences of order ε) and the community will no longer be neutral. Some species will inevitably go extinct to return to a maximum of as many species as resources. Figure 3.8 shows a numerical simulation of this scenario.

In a natural ecosystem, one would expect to observe some looseness in any metabolic trade-off, so this sensitivity of the neutral state makes it hardly relevant. However, even if the system is no longer neutral, if ε is small, it can be described as quasi-neutral. This means that species will go extinct on a time scale of the order of 1/ε (which is the invasion time scale of the perturbing species). Thus, on a short time scale, a (dynamical) state with more species than resources is observable.

Heterogeneity models and a dynamical state with more species than resources

To model such looseness, we can introduce some heterogeneity in the efficiency of the metabolic threshold: m i = α i µ c iµ , where α i can be different for each species. In particular, in the spirit of disordered systems, we can choose these efficiencies at random: Figure 3.8: Ecological dynamics of a community at the neutral state when adding a disruptive species. We start with a randomly assembled community with the same parameters as in Figure 3.5, already in the neutral state. At time t = 100 we introduce a disruptive species (of abundance in blue) with a metabolic threshold m 0 = α µ c 0µ -ε with ε = 0.3. It invades in a time of order 1/ε and disrupts the neutral state, causing the resources availabilities to spread around their mean α by an order ε. As a result, some species become extinct and the number of extant species gradually declines.

α i ∼ N (α, ε).
When ε is small but not zero, the neutral state is replaced by a quasineutral state where extinctions occur at times of order 1/ε. This loss of diversity can be compensated for by evolution, which introduces new species at a rate of µ mut . For example, Figure 3.9 shows a numerical simulation of an eco-evolutionary dynamic similar to that in Figure 3.5, but with heterogeneity in metabolic efficiencies. In this model, each mutant inherits the same metabolic efficiency α i as its ancestor. This input of species can lead to a dynamical state with more species than resources, as is the case in Figure 3.9: the loss of diversity due to competition is offset by new species (mutants) invading the community. However, this depends on the relative importance of µ mut with respect to ε: if µ mut is too small, the number of extant species will inevitably decrease. In this case, we find that the interplay between ecological dynamics and evolution keeps the system in a state with a number of species higher than that determined by the principle of competitive exclusion.

Tikhonov and Monasson studied the ecological dynamics with a different kind of heterogeneities: m i = α µ c iµ + ∆ i with random metabolic deviations ∆ i ∼ N (0, ε), in the limit of small ε. They showed that the same transition in the feasibility of the neutral state occurs when ε → 0 + , but that the neutral state is characterised only by the equal availability of resources, and not by the coexistence of more species than resources. The metabolic deviations ∆ i could represent a metabolic phenomenon independent of the trade-off: in the case of a species that does not consume resources (c = 0), it still has a metabolic threshold m i = ∆ i , which can cause the species to grow or decline, depending on the sign of ∆ i . Also in this model, thanks to evolution, it is possible to have a dynamical state with more species than resources.

Discussion

The competitive exclusion principle and its incompatibility with observations of natural communities remains a challenge for theorists. The multiplicity of proposed mechanisms does not allow a consensus to be reached, as there seems to be no general answer, but rather specific solutions in specific cases. However, it is important to study in detail the robustness of each mechanism with respect to evolution.

Using a general model of species competing for resources, I presented a mechanism for the coexistence of a large number of species based on the existence of metabolic trade-offs due to species similarity or physical constraints. I showed that this model has a Lyapunov function, and that such trade-offs make this function coincide with another function that depends only on resource uptake rates. This function is convex and has a global minimum where all resources are equally available. In this state, the community is completely neutral, allowing the coexistence of more species than resources.

The possibility of reaching this global minimum, i.e. the feasibility of this neutral state, depends on the phenotypes of the existing species. Each species can be seen as an additional degree of freedom that can help to reach the global minimum. Evolution means that the number of degrees of freedom is gradually increased, bringing the community closer to neutrality. This is supported by numerical simulations of eco-Figure 3.9: Evolution maintains a dynamical state with more species than resources. We start with a randomly assembled community with the same parameters as in Figure 3.5, but with random metabolic efficiencies α i ∼ N (α, ε) where ε = 0.002. The ecological and evolutionary dynamics are the same as in Figure 3.5, and each mutant inherits the same metabolic efficiency as its ancestor. After a short decrease in diversity, evolution is able to maintain a dynamical state with more species than resources. In the last shaded area, we switch off evolution and the diversity decreases. evolutionary dynamics.

However, we saw that this neutral state is not robust to small perturbations that might occur in natural communities. In particular, the addition of a species that satisfies a slightly different trade-off leads to the disappearance of the neutral state and a progressive decline in the number of species. However, a community composed of species with a looser metabolic trade-off could still be maintained in a dynamical quasi-neutral state by evolution.

Heterogeneity in the metabolic trade-off may also be subject to evolution. Whether evolution increases or decreases the heterogeneity of the community, moving it towards or away from neutrality, is an important issue that may affect the relevance of the tradeoff mechanism for the plankton paradox. However, much depends on the nature of this heterogeneity and the resulting modelling choices.

In the case of metabolic heterogeneity independent of the metabolic trade-off (m i = α µ c iµ + ∆ i ), natural selection will favour lower mortality rates, i.e. lower deviations ∆ i . Assuming the existence of a minimum value of ∆, evolution will lead to a concentration of the deviations close to this minimum. The heterogeneity of the community will then be reduced, but this is not enough to observe a neutral or quasi-neutral state: in fact, even if all ∆ i are equal to ∆, there is only a neutral state when ∆ = 0. It is not clear why this would be the case in natural communities.

In the alternative case of heterogeneity in metabolic efficiency, this is no longer a problem. Natural selection will also favour lower values of the efficiencies α i , so they may be concentrated around the minimum value (if it exists). Even if this value is not zero, the system would be quasi-neutral. However, the assumption that mutations in efficiencies are independent of those in preferences, which is necessary to draw such a conclusion, may be biologically unsound.

Scenarios exist to explain how a dynamical quasi-neutral state could survive the evolution of the metabolic trade-off, but it is not yet clear whether they can be applied to natural communities. Experiments investigating microbial communities under metabolic constraints, and in particular their evolution, could clarify our understanding of competitive communities, and in particular help to rationalise the relevance of the various proposed mechanisms for the plankton paradox.

CHAPTER 4

Neutral models and apparent neutrality in disordered models of communities

In the previous chapters, the ecological dynamics we considered were purely deterministic. However, in any population of biological units, the birth and death of individuals are not deterministic but stochastic processes. The study of the effects of stochasticity on ecological patterns is a field in itself. In this chapter we will focus on an ecological theory that considers only these stochastic processes and ignores all differences between species: the Neutral Theory. This chapter is the result of an unfinished work on neutral models. First, I present the idea of neutral theory through its history, then I present a specific type of neutral model based on stochastic differential equations. We will see how the disordered models can be linked to such neutral models using dynamical mean field theory. Finally, I'll show how to compute the stationary species abundance distribution of neutral models with correlated environmental noise.

A short history of neutral models

As we saw in Chapter 1, one of the main aims of theoretical community ecology is to explain patterns, such as biodiversity or species abundance distribution (SAD) in terms of some processes. The dominant view in ecology has long been that species differ in their relation with the environment. This relation with the the environment, for example with resources or predators, is called an ecological niche [START_REF] Polechová | Ecological niche[END_REF]. These niche differences explain the coexistence or the exclusion of species in a community.

Hubbell [START_REF] Stephen | The Unified Neutral Theory of Biodiversity and Biogeography (MPB-32)[END_REF] took a completely different approach and constructed a neutral theory in which niches are absent and all species are functionally equivalent. More specifically, species are assumed to be demographically equivalent on a per capita basis. While this assumption seems very naive and has been very controversial, his idea was not to say that species were actually equivalent. Instead, he wanted to understand how many of the patterns of ecological communities were the result of species similarities rather than species differences [START_REF] Stephen | Neutral Theory and the Evolution of Ecological Equivalence[END_REF]. Another way of looking at this assumption of neutrality is to say that even if the species in a community are often not functionally equivalent, there may be a set of variables describing them (not necessarily the abundances) where they appear very similar.

In the original neutral model, the number of individuals in the community was kept constant. All individuals, regardless of species, had the same probability of dying. After a death, the vacant space was replaced by a coloniser copied from an individual randomly chosen in the population, so that the probability of a given species being selected is equal to the relative abundance of a species [START_REF] Gary | Community Ecology[END_REF]. This model was later enriched to include speciation mechanisms and local communities (islands) connected by immigration [START_REF] Stephen | The Unified Neutral Theory of Biodiversity and Biogeography (MPB-32)[END_REF]. The SAD obtained from this model was then compared with those of tropical trees in Panama and it was found that the neutral model fits the SAD very well [START_REF] Volkov | Neutral theory and relative species abundance in ecology[END_REF]. However, a variety of models (including niche models) fit the SAD almost equally well [START_REF] Chave | Neutral theory and community ecology[END_REF]. For a complete review of the principles and tests of the Neutral Theory, see Chave [START_REF] Chave | Neutral theory and community ecology[END_REF]. For a more technical review of the different models and the link with statistical mechanics, see Azaele et al. [START_REF] Azaele | Statistical mechanics of ecological systems: Neutral theory and beyond[END_REF].

The models presented in Azaele et al. [START_REF] Azaele | Statistical mechanics of ecological systems: Neutral theory and beyond[END_REF] are simple extensions of the original model of Hubbell [START_REF] Stephen | The Unified Neutral Theory of Biodiversity and Biogeography (MPB-32)[END_REF], but some of them also modify the founding assumption of equivalence. In fact, Hubbell initially assumed neutrality at the individual level: "I use neutral to describe the assumption of per capita ecological equivalence of all individuals of all species in a trophically defined community" [START_REF] Stephen | The Unified Neutral Theory of Biodiversity and Biogeography (MPB-32)[END_REF]. The processes of birth and death are therefore blind to the species to which the individuals belong. This equivalence between individuals is a stronger assumption than equivalence between species, i.e. neutrality at the species level. [START_REF] Chave | Neutral theory and community ecology[END_REF]. However, some models introduced density-dependent regulation (see Chapter 1) to stabilise the coexistence of species within a group. Hubbell suggested that such models can be called neutral as long as the intensity of regulation is the same for each species (i.e. species equivalence), but this is still controversial [START_REF] Chave | Neutral theory and community ecology[END_REF].

Calling them neutral or not, these models convey the same objective of understanding the patterns resulting from stochasticity alone. This allows to understand if it is necessary to take into account niche differences to explain the patterns we observe in nature.

Neutral models as stochastic differential equation

A class of such neutral models with density-dependent regulation are very similar to the growth models presented in Chapter 1. To construct them, one usually starts with the Markovian birth-death process that defines neutral models, then writes the associated master equation and performs a Kramers-Moyal expansion to obtain a Fokker-Planck equation [START_REF] Azaele | Statistical mechanics of ecological systems: Neutral theory and beyond[END_REF]. This Fokker-Planck equation can then be associated to a stochastic differential equation (SDE), where all stochasticity is contained in a white noise term.

Such derivation is done in Azaele et al. [START_REF] Azaele | Statistical mechanics of ecological systems: Neutral theory and beyond[END_REF] and the resulting SDE takes the form:

dN (t) dt = b -N (t)/τ + σ d N (t) ξ(t) (4.1)
where ξ is Gaussian white noise: E[ξ(t)] = 0 and E[ξ(t)ξ(s)] = δ(t -s). The parameters b and τ are related to the birth and death processes, and σ d represents the strength of the noise. The fact that the noise scales like √ N is typical of demographic noise, which represents the randomness coming from births and deaths [START_REF] Altieri | Properties of Equilibria and Glassy Phases of the Random Lotka-Volterra Model with Demographic Noise[END_REF].

In this model, the abundance of each species follows the dynamics of equation (4.1) for a different realisation of the noise ξ. As there are no interactions and each species follows the same ecological dynamics (the parameters are the same for each species), it is indeed a neutral model with equivalent species. The only differences between species abundances are due to demographic stochasticity. Indeed, in the absence of noise, the abundance of each species converges to the same equilibrium N = bτ .

This formalism can then be used to extend a growth model that we know very well, the logistic growth, to take demographic fluctuations into account:

dN (t) dt = rN (t) (1 -N (t)/K) + σ d N (t) ξ(t) (4.2)
This results in a neutral model, in the sense that species are equivalent (but not individuals) and the main driver of difference is stochasticity, as in equation (4.1). We can do the same with any kind of deterministic growth, just adding the demographic noise. However, the resulting SDE (like equation (4.2)) may not be the continuum limit of a Markovian process, as equation (4.1) was. In fact, if we wanted to construct the equation (4.2) from a Markovian process, the noise prefactor would be more complicated [START_REF] De | Dynamical mean-field theory: From ecosystems to reaction networks[END_REF]. Nevertheless, we will approximate it with √ N . Another type of stochasticity can be considered: environmentally induced variations in growth rates can affect the static and dynamic properties of the community [START_REF] Kalyuzhny | A neutral theory with environmental stochasticity explains static and dynamic properties of ecological communities[END_REF][START_REF] Kessler | Neutral dynamics with environmental noise: Age-size statistics and species lifetimes[END_REF]. These environmental fluctuations can be due to rapid deterministic changes that are too complicated to model accurately, or to actual stochastic changes in environmental conditions, such as the weather or the quantity of some resources.

Such environmental noise affects the growth rate, so its effect on the derivative of the abundance is assumed to be proportional to N (t). This allows us to construct a simple neutral model with logistic growth, demographic and environmental noise:

dN (t) dt = rN (t) (1 -N (t)/K) + σ e N (t)ξ e (t) + σ d N (t) ξ d (t) (4.3)
where ξ e and ξ d are random noises and σ e and σ d are their intensities. It is usually easier to consider Gaussian white noise, and this makes sense for demographic noise. However, environmental fluctuations are expected to be correlated over time. We will see in section 4.4 how to deal with such correlated noise.

To conclude this section, I would like to mention a recent hybrid model that lies between the neutral and disordered models. The stochastic logistic model of Grilli [START_REF] Grilli | Macroecological laws describe variation and diversity in microbial communities[END_REF] showed a very good agreement with a lot of data from very different microbial communities. In this model, the abundance of each species also follows an SDE with environmental noise. However, the species are not equivalent as each species has its own intrinsic growth rate r i , carrying capacity K i and noise strength σ i :

dN i dt = r i N i 1 - N i K i + √ r i σ i N i ξ i (t) (4.4)
where ξ i is Gaussian white noise. The parameters r i , K i and σ i are then independently drawn from probability distributions.

The similarity of this model to neutral models stems from the fact that there are no interactions between species and that environmental stochasticity is one of the drivers of species differences. However, another source of difference lies in the disorder that accounts for niche differences.

Disordered systems and apparent neutrality

I will now explain how a model of a community with disordered interactions can be mapped to an apparently neutral model with correlated environmental noise.

We start with the random Lotka-Volterra model presented in Chapter 1. The abundance of each species follows a deterministic differential equation:

dN i dt = N i   1 -N i - j α ij N j   + λ (4.5)
and the interaction coefficients α ij are Gaussian random variables with means, variances and correlations defined as:

E(α ij ) = µ/S Var(α ij ) = σ 2 /S Corr(α ij , α ji ) = γ. ( 4.6)
with α ii = 0. I added a small positive immigration term λ to equation (4.5), representing either immigration from other communities, or the existence of a 'seed bank' that guarantee that every species can in principle re-invade the community.

In Chapter 1 I showed how to study the equilibrium of equation (4.5) using the cavity method. This method can be extended to a dynamical mean field theory (DMFT), which allows to study the dynamics of the community, and not only its steady-states [START_REF] Roy | Numerical implementation of dynamical mean field theory for disordered systems: Application to the Lotka-Volterra model of ecosystems[END_REF]. The key idea of DMFT is to replace the total interaction perceived by species i, j α ij N j (t), by a random variable, as in the cavity method, but now dependent on time.

I will not go into detail here, but a rigorous derivation can be found in Roy et al. [START_REF] Roy | Numerical implementation of dynamical mean field theory for disordered systems: Application to the Lotka-Volterra model of ecosystems[END_REF]. For simplicity, we focus on the case γ = 0. The result of the DMFT is a model where each species abundance follows an SDE:

dN (t) dt = N (t) (1 -N (t) -µm(t) -ση(t)) + λ (4.7)
where η is a Gaussian noise with zero mean and correlator E[η(t)η(s)] = C(t, s), and the time dependent parameters are self-consistently defined:

m(t) = E[N (t)] C(t, s) = E[N (t)N (s)] (4.8)
For the same reasons that equations (4.2) and (4.3) define neutral models, equation (4.7) also seems to define a model where species are equivalent. The noise η is indeed similar to environmental noise (as ξ e in equation (4.3)). It comes from the effects of the other species on the growth of one species, so the 'environment' is the ecological state of the community. This is why the correlations of η(t) are defined by the statistics of N (t). There is also a deterministic change in the growth rate through m(t), which is also self-consistently defined.

In the following, I will show what this self-consistency means and implies. We know that the nature of the dynamics depends only on the parameters µ and σ, and that there are mainly two interesting phases: a phase in which the ecological dynamics gradually stabilise towards a stable equilibrium, and a phase in which the dynamics is chaotic, wandering between many unstable equilibria. How can we understand these two phases in the framework of equations (4.7) and (4.8)?

The first phase is the easiest to understand. At equilibrium, the abundances do not depend on time, so m(t) and C(t, s) should also not depend on t (and s) because of equation (4.8). Since C(t, s) = C does not depend on time, η(t) and η(s) are both random variables with mean zero, variance C and covariance C. So they have a correlation of 1, which means η(t) = η(s). The noise is just a constant random variable η with mean zero and variance C. Putting all this together, we get that the abundances are solutions of:

0 = N (1 -N -µm -ση) + λ (4.9)
where η is Gaussian with zero mean and variance C, and

m = E[N ] C = E[N 2 ] (4.10)
These are exactly the cavity equations I presented in Chapter 1 with the only addition of the immigration term.

In the second phase, there is no longer a single stable equilibrium, and abundances are time-dependent. However, we can assume the existence of a time-transational invariant (TTI) state [START_REF] Roy | Dynamics of Populations in Large Ecosystems[END_REF], because of the immigration λ which prevents species from going extinct. TTI means that the one-time statistics of N (t) don't depend on t and the correlations between times t and s depend only on t -s, so we can write m(t) = m and C(t, s) = C(t -s). Since C(t -s) is not constant, the noise η(t) depends on time. Its stochastic fluctuations cause the fluctuations of the abundances, which feed back into C(t -s).

We can decompose C(t -s) into two components: an asymptotic plateau C ∞ = C(∞) and its remainder ∆(t -s) = C(t -s) -C(∞), that encode the time-dependent fluctuations. The noise is thus decomposed into a static and a dynamic part: η(t) = z + ξ(t), where z is a Gaussian with mean zero and variance C ∞ and ξ(t) is a Gaussian noise of correlator ∆(t -s) [START_REF] Roy | Dynamics of Populations in Large Ecosystems[END_REF]. The random variable z is similar to the constant value of the noise we found in the unique equilibrium phase. The advantage of removing this constant part of the noise is that ξ(t) does not have infinite-time correlations and can be approximated, for example, by coloured noise such as an Ornstein-Uhlenbeck process.

With this decomposition, equation (4.7) becomes:

dN (t) dt = N (t) (1 -N (t) -µm -σz -σξ(t)) + λ (4.11)
This decomposition of the noise is not only convenient [START_REF] Roy | Dynamics of Populations in Large Ecosystems[END_REF] but also ecologically relevant. The static part z of the noise represents the niche effects (the species differences), while the remaining part ξ(t) appears neutral.

In fact, the static part is the only one that remains when there is a stable equilibrium and the abundances are constant. The equilibrium of the community defines the state of the 'biotic environment' and the value of z for a species characterises the effect of this biotic environment on the growth of that species. The randomness of z comes from the randomness of the interactions. Therefore it represents the effect of niches.

The fluctuating part ξ is only present when the abundances are changing. The fluctuations of all abundances cause the biotic environment perceived by a species to change, and ξ(t) characterises the effect of these fluctuations on the growth of that species. It also arises from the interactions, but it affects the species stochastically in the same way, thus causing apparent neutrality.

To visualise this, we can write equation (4.11) for every species i:

dN i (t) dt = N i (t) (1 -N i (t) -µm -σz i -σξ i (t)) + λ (4.12)
where z i are identically distributed from a Gaussian with zero mean and variance one, C ∞ and ξ i are random Gaussian noise with zero mean, correlator ∆(t-s) and no correlations between ξ i and ξ j for i ̸ = j. In the case of all z i = 0 (i.e. C ∞ = 0), equation (4.12) is similar to a completely neutral model with correlated environmental noise. In the long run, it would be impossible to distinguish two species statistically. In the opposite case of no fluctuations ξ i = 0 (i.e. ∆(0) = 0), equation (4.12) is similar to a disordered logistic model with no interactions. However, even if there are no interactions in this effective description, species are not demographically equivalent because they have a different intrinsic growth rate depending on their value of z i . When C ∞ ̸ = 0 and ∆(0) ̸ = 0, equation (4.12) can be seen as a hybrid model, very similar to equation (4.4). The relative importance of ξ i to z i , quantified by the quantity ∆(0)/C ∞ , characterises how apparently neutral the community is. This apparent neutrality may explain why neutral models (and hybrid models) with no interactions can be so effective at reproducing some patterns, even in communities where species interact.

Computing SADs

I have shown that we can define neutral models from SDE with demographic and environmental noise. This noise is usually assumed to be Gaussian white noise, but environmental fluctuations are expected to be correlated over time. We also saw how a community with random interactions can be mapped to an apparently neutral model with environmental noise that is also correlated over time.

In this section I will show how to compute the stationary SAD of neutral models defined as SDE. I focus on the logistic model defined in equation (4.3), but these methods can be applied to any types of growth. I will first show how to deal with white demographic and environmental noise, and then present an approximation that allows the study of correlated noise.

SADs with white noise

We start with a general neutral model where each species abundance dynamics is described by a SDE:

dN (t) dt = f (N ) + g(N )ξ(t) (4.13)
where ξ is Gaussian white noise with zero mean: E[ξ(t)] = 0 and correlations E[ξ(t)ξ(s)] = δ(t -s). The function f (N ) characterises the deterministic growth of the species. For logistic growth, f (N ) = rN (1 -N/K). The function g(N ) characterises how the noise intensity scales with the abundance, reflecting differences in the origin of the fluctuations. We take g(N ) = σ d √ N for demographic noise and g(N ) = σ e N for environmental noise, where σ d and σ e are the respective intensities. Demographic and environmental noise can be combined by taking their geometric mean g(N ) = σ 2 d N + σ 2 e N 2 . Let P (N, t) be the probability that a species has abundance N at time t. Since all species are equivalent, the SAD of the community is exactly P (N, t).

If N follows the SDE (4.13) (in Ito's convention), it is known that P (N, t) evolves according to the Fokker-Planck equation:

∂P (N, t) ∂t = - ∂ ∂N [f (N )P (N, t)] + ∂ 2 ∂N 2 g(N ) 2 2 P (N, t) (4.14)
The stationary SAD P (N ) is thus the solution of:

0 = - d dN [f (N )P (N )] + d 2 dN 2 g(N ) 2 2 P (N ) (4.15)
Solving such an equation is quite straightforward if we know f and g. For example, we can apply this to logistic growth with white demographic noise and immigration: Immigration λ is necessary to have a stationary distribution other than all species going extinct. In fact, without immigration, it is inevitable that demographic fluctuations will drive species to extinction. The Fokker-Planck equation associated to this process reads:

dN (t) dt = rN (t) 1 - N (t) K + σ d N (t)ξ(t) + λ (4.16)
∂P (N, t) ∂t = - ∂ ∂N rN (1 - N K ) + λ P (N, t) + ∂ 2 ∂N 2 σ 2 d N 2 P (N, t) (4.17)
and has for stationary distribution:

P (N ) = 1 Z N 2λ/σ 2 d -1 exp - rK σ 2 d (1 - N K ) 2 (4.18)
where Z is a normalisation constant.

The main component of the stationary distribution is a Gaussian centred in K and with a width proportional to σ d , which is what one would first guess. This Gaussian behaviour is dominant for reasonably small values of σ d (see Figure 4.1). However, when σ d gets large, the distribution is deformed at low abundances N , because of the species that should stochastically go extinct but are prevented to because of immigration. This is the meaning of the N 2λ/σ 2 d -1 factor in the distribution. Mathematically speaking, we see that the immigration term λ is required for the distribution to be normalisable. For λ = 0, the only stationary state is all species extinct (N = 0).

If we consider environmental noise instead of demographic noise, we no longer need an immigration term to have a stationary distribution other than all species going extinct. So I will set λ = 0 to simplify the equations, but it is possible to do the same calculations with a positive λ. The SDE is:

dN (t) dt = rN (t) 1 - N (t) K + σ e N (t)ξ(t) (4.19)
and it has for stationary distribution:

P (N ) = 1 Z N 2(r/σ 2 e -1) exp - 2rN σ 2 e K (4.20)
where Z is a normalisation constant. This distribution has a different behaviour depending on the sign of r/σ 2 e -1. For σ 2 e < r, the distribution has a peak at non-zero abundances (see Figure 4.2). However for σ 2 e > r the environmental noise is too strong and drives the species near extinction, so the distribution has a peak at N = 0 (see Figure 4.3) and is strictly decreasing.

A striking feature of this distribution is that in the limit of large environmental noise σ 2 e ≫ r, it is asymptotic to Fisher's logseries distribution:

P (N ) = 1 Z x N N (4.21)
where x = exp -2r/σ 2 e K . This distribution was proposed in Fisher et al. [START_REF] Fisher | The Relation Between the Number of Species and the Number of Individuals in a Random Sample of an Animal Population[END_REF] to fit some SAD of butterflies.

Compared to the effect of demographic noise, SAD due to environmental fluctuations are biased towards lower abundances.

Correlated noise

We have seen how to deal with white noise, but environmental noise is expected to be correlated over time. If the noise is not white, it is no longer possible to write a Fokker-Planck equation for P (N, t). However, in the case of short correlation time, it is possible to write an effective Fokker-Planck equation, as first derived in Fox [START_REF] Forrest | Uniform convergence to an effective Fokker-Planck equation for weakly colored noise[END_REF] using functional-calculus methods.

We start from the same general SDE

dN (t) dt = f (N ) + g(N )ξ(t) (4.22)
but this time with correlated noise. To model the correlations in time of the noise, we write E[ξ(t)ξ(s)] = 1 τ exp{-|t -s|/τ } where τ is the correlation time-scale. This exponential decay of the correlations can be obtained with an Ornstein-Uhlenbeck process. As we saw in section 4.3, it is important to have a correlation that goes to zero when t -s → ∞ to keep the model neutral. If N follows the SDE (4.22) and the correlation time scale τ is small, the evolution of P (N, t) can be approximately described by the Fokker-Planck effective equation [START_REF] Forrest | Uniform convergence to an effective Fokker-Planck equation for weakly colored noise[END_REF]:

∂P (N, t) ∂t = - ∂ ∂N [f (N )P (N, t)] + ∂ ∂N g(N ) ∂ ∂N   g(N )P (N, t) 1 -τ f ′ (N ) -g ′ (N ) g(N ) f (N )   (4.23)
which is exact in the τ → 0 limit. As a side note, it is normal that taking the limit τ → 0 in the equation (4.23) does not give back the equation (4.14). This is because the limit of zero correlation time gives a white noise in Stratonovich's description, whereas equation (4.14) was obtained in Ito's description. The Fokker-Planck associated with the SDE (4.13) in Stratonovich's description is in fact the limit τ → 0 of equation (4.23).

In the case of logistic growth with correlated environmental noise and no immigration, the stationary distribution solution of equation (4.23) is:

P ∝ exp - 2rN σ 2 e K (1 -rτ ) -τ r 2 N 2 σ 2 e K 2 + 2r σ 2 e -1 log N + log 1 + τ rN K (4.24)
In the limit of small correlation time τ → 0, this distribution converges to the one we obtained in the case of white noise (equation (4.20)), with a change of parameters r → r -σ 2 e /2 and K → K(r -σ 2 e /2)/r to go from Stratonovich's description to Ito's description. As we can see in equation (4.24), the inclusion of time correlations in the noise affects the stationary SAD in a non-trivial way: we can't just absorb their contribution by rescaling the parameters r, σ e and K. However, it is not clear how to interpret these different additional terms.

Conclusions

In this chapter I introduced the concept of neutral models and showed that they can take the convenient form of stochastic differential equations. These equations are similar to the growth equations presented in Chapter 1, but with an additional noise term to account for demographic and environmental fluctuations. The peculiarity of neutral models is that species do not interact and are equivalent. The only differences in species abundance arise from the stochasticity of the noise. The aim of these models is to understand the patterns caused by stochasticity alone, so that we can see when niche differences are necessary to explain the observed patterns. This approach proved to be quite good at fitting species abundance distributions [START_REF] Chave | Neutral theory and community ecology[END_REF].

I then showed that the random Lotka-Volterra model can be mapped to an apparently neutral model using dynamical mean field theory. This method self-consistently defines an environmental noise that describes the effect of all species (condensed in the 'environment') on the growth of a species. I showed that this noise can be decomposed into a static part and a fluctuating part, the latter having the property of being apparently neutral. I introduced a quantity, ∆(0)/C ∞ , which measures how apparently neutral the community is. This apparent neutrality may be the source of the power of neutral models.

This concept of apparent neutrality should not be confused with the concept of emergent neutrality [START_REF] Holt | Emergent neutrality[END_REF], i.e. the idea that in competitive communities self-organised clusters of similar species can emerge spontaneously from co-evolution [START_REF] Scheffer | Self-organized similarity, the evolutionary emergence of groups of similar species[END_REF]. It also differs from the idea that strong demographic fluctuations can make a niche model appear neutral [START_REF] Fisher | The transition between the niche and neutral regimes in ecology[END_REF]. In our case, there are no demographic fluctuations and the randomness comes from the interactions and fluctuations in abundance.

I then applied known techniques of approximated Fokker-Planck equations to compute the stationary SAD of a neutral model with coloured environmental noise. We saw that time correlation has a non-trivial effect on the stationary distribution, even though it was expected to affect mainly the dynamical properties of the community. This approximated Fokker-Planck could also be used to study dynamical properties, and I believe it could help to characterise the effect of effective environmental noise resulting from the aggregation of many interactions.

CHAPTER 5

Random Lotka-Volterra with sparse interaction network This short chapter presents some preliminary work I have done on random Lotka-Volterra models with sparse interactions.

Generalised Lotka-Volterra equations are typically studied in the limit where all species interact with all others (fully connected) [START_REF] Bunin | Ecological communities with Lotka-Volterra dynamics[END_REF] and when the interaction matrix is sparse [START_REF] Marcus | Local and collective transitions in sparsely-interacting ecological communities[END_REF]. These two limits have similarities and differences, which I'll describe below, but little is known about which of these features might be retained in real ecosystems with intermediate connectivity. In particular, I will show that when the connectivity is large (but still smaller than the total number of species), the stationary distribution of abundances is similar to the fully connected case. I will then numerically test whether this result still holds at low connectivity.

Introduction

I presented in Chapter 1 the disordered systems approach to ecology. The model we focused on and that we used in Chapter 2 is the random Lotka-Volterra model in the diffuse interaction regime and in the limit of large number of species S. As a reminder, we have studied so far the ecological dynamics described by the Lotka-Volterra equation:

dN i dt = N i   1 -N i - j α ij N j   (5.1)
and the interaction coefficients α ij are Gaussian random variables with means, variances and correlations defined as:

E[α ij ] = µ/S Var[α ij ] = σ 2 /S Corr[α ij , α ji ] = γ.
(5.2)

97

with α ii = 0. We saw that in the limit of a large number of species S, the parameters (µ, σ, γ) are sufficient to completely determine the type of ecological dynamics and the distribution of species abundances at equilibrium. To find this result, we used the cavity method, which replaces the total interaction perceived by a species j α ij N j by a random variable using the central limit theorem. Because of the generality of the central limit theorem, these results are expected to hold for a broad class of probability distributions with moments defined by equation (5.2) [START_REF] Mezard | Spin Glass Theory And Beyond: An Introduction To The Replica Method And Its Applications[END_REF].

The question in this chapter is whether these results hold when we add some structure to the interactions, in particular sparsity. Accounting for sparsity in interactions is crucial when dealing with ecological communities. Ecological communities are made up of many interacting species, but not all species interact directly with each other. In fact, only a subset of species interact, while others remain relatively isolated. Sparsity can lead to very complex network architectures that affect the stability and dynamics of the community [START_REF] Thébault | Stability of Ecological Communities and the Architecture of Mutualistic and Trophic Networks[END_REF][START_REF] Guimarães | The Structure of Ecological Networks Across Levels of Organization[END_REF].

Sparsity in Lotka-Volterra models has received some attention recently. In particular, Marcus et al. [START_REF] Marcus | Local and collective transitions in sparsely-interacting ecological communities[END_REF] built a model where all non-zero interactions are equal and each species interacts with exactly k species. They showed the existence of a sharp transition as the strength of the non-zero interactions increases. The community goes from a single equilibrium with all species abundances equal (when interactions are small) to multiple equilibria with some species extinct and different abundances. The transition occurs when the first equilibrium becomes unstable, similar to May's model. More recently, Valigi et al. [START_REF] Valigi | Local sign stability and its implications for spectra of sparse random graphs and stability of ecosystems[END_REF] studied the spectral properties of sparse random matrices, such as the interaction and Jacobian matrices of a Lotka-Volterra community. In particular, they present a general criterion for predicting the stability of sparse communities based on the concept of local sign stability.

Random Lotka-Volterra model with sparse interactions

In the Lotka-Volterra model, sparsity means that most elements of the interaction matrix α are zero. The pairs (i, j) of species associated with a non-zero α ij are interacting, while the pairs (i, j) with α ij = 0 are not. It is possible to represent the community as a graph, with nodes representing species, connected by edges when they interact (see Figure 5.1 for an example). In natural communities, the structure of these graphs can be quite complicated [START_REF] Guimarães | The Structure of Ecological Networks Across Levels of Organization[END_REF]. In keeping with the idea of building simple ecological models (as explained in Chapter 1), we will also use the disordered systems approach and approximate the complexity of these graphs by randomness. In a disordered model, the non-zero elements can be chosen at random. The resulting network of interacting species is a random graph. For ecological communities, we might expect that if one species i has an effect on the growth of another species j (i.e. α ij ̸ = 0), then the opposite is also true (i.e. α ji ̸ = 0), even if the effect is not the same (i.e. α ij ̸ = α ji ). For this reason, we will only consider undirected random graphs, but it is possible to relax this assumption. In both graphs, each node corresponds to a species, labelled from 1 to 6, and the nodes are connected by edges when the species interact. The graph on the left corresponds to a fully connected community, where all species interact. On the right, some pairs of species don't interact (e.g. species 1 and 4). The resulting structure is reminiscent of a trophic network.

A simple ensemble of random graphs is obtained by uniformly choosing whether an edge (ij) is included in the graph (i.e. species i and j interact) with probability p = k/S. The parameter k represents the average number of species interacting with a species and is called the connectivity of the community. Such a random graph is called an Erdös-Rényi graph [START_REF] Erdős | Spectral statistics of Erdős-Rényi graphs I: Local semicircle law[END_REF]. It is also possible to consider more complicated random ensembles of graphs, such as random geometric graphs [START_REF] Grilli | Metapopulation Persistence in Random Fragmented Landscapes[END_REF] or random regular graph [START_REF] Marcus | Local and collective transitions in sparsely-interacting ecological communities[END_REF].

After having specified the statistics of the random graph, we define a probability distribution π(α ij ) for the non-zero interactions. Then, by combining the randomness of the network and of π, the probability distribution ρ of any α ij can be written:

ρ(α ij ) = k S π(α ij ) + (1 - k S )δ(α ij ). (5.3)
with α ii = 0 and with the additional constraint that if α ij ̸ = 0, then α ji ̸ = 0 is distributed according to the distribution π.

To compare the dynamics resulting from a model with sparse interactions with the model with fully connected interactions defined by equation (5.2), we have to choose suitably the scaling of the moments of the distribution π with k and S. We write the mean and variance over π as µ π /k and σ 2 π /k, and define γ π as the correlation between α ji and α ji over π. This choice of scaling with k makes sense when considering the total interaction perceived by a species j α ij N j . Due to sparsity, there are on average only k non-zero terms in the sum. Therefore, for abundances of order one, this sum is of order µ π , with variations of order σ π . These parameters thus appear to be analogous to the µ and σ parameters for the fully connected model.

To be more precise, we can compute the effective statistics of α over ρ. In the limit of large S it is:

E[α ij ] = µ π S Var[α ij ] = σ 2 π + µ 2 π /k S Corr[α ij , α ji ] = γ π σ 2 π + µ 2 π /k σ 2 π + µ 2 π /k
(5.4) so that we can define the effective parameters :

µ = µ π σ 2 = σ 2 π + µ 2 π /k γ = γ π σ 2 π + µ 2 π /k σ 2 π + µ 2 π /k (5.5)
that give back equation (5.2) for the statistics of α.

The difference between the parameters of π and ρ reflects the effect of sparsity on the statistics of the interactions. Sparsity has no particular effect on the mean of the interactions apart from rescaling everything by k/S, so we have µ = µ π . However, it has a non-trivial effect on the variance. This effect is easily understood in the limit σ π = 0: all non-zero interactions are equal, but because some interactions are equal to zero there is still some heterogeneity, so the variance over ρ is not zero. This part of the variance depends on µ π and k and becomes negligible when the connectivity becomes large. The form of the symmetry correlations γ comes from our assumption that if α ij ̸ = 0, then α ji ̸ = 0. This assumption introduces correlations even when γ π = 0. The only case where it does not change the correlations is the symmetric case γ π = 1. This effect also becomes negligible when k is large.

Limit of large connectivity

In the limit of large connectivity k ≫ 1, for example when k is a sizeable fraction of S, the statistics µ and σ, as well as the symmetry correlation γ, are the same for ρ and π. The only effect of sparsity on the statistics of the interaction matrix is to rescales the statistics by k/S. However, sparsity can still have an effect on the dynamics and equilibrium of the abundances.

An interesting result is that in the case of a random Lotka-Volterra model with sparse interactions, as defined in equation (5.3), the limit of large connectivity k ≫ 1 gives exactly the same stationary abundance distribution as in the fully connected case (k = S). Indeed, it is possible to perform the same cavity calculation than in Bunin [START_REF] Bunin | Ecological communities with Lotka-Volterra dynamics[END_REF], which leads to the same self-consistent equation presented in Chapter 1. Thus, not only is the distribution of abundances the same, but there are also the three different phases (unique equilibrium, chaotic and unbounded growth), which depend only on µ, σ and γ. This property, that sparsity has no particular effect when connectivity is large, is similar to what is known about the eigenvalue distribution of random matrices [START_REF] Rodgers | Density of states of a sparse random matrix[END_REF][START_REF] Khorunzhy | Eigenvalue distribution of large dilute random matrices[END_REF]. I will try to give an intuition as to why this result is true. Since k is large, µ, σ and γ are respectively equal to µ π , σ π and γ π , in the following I will drop the π indices. For each interacting pair of species (ij) we write α ij = µ/k + σ/ √ k z ij , where z ij is a Gaussian random variable with zero mean and unit variance. We first choose a species i = 0 and denote V 0 the set of species with which it interacts. At equilibrium its abundance N 0 satisfies the equation:

0 = N 0   1 -N 0 - i∈V 0 α 0i N i   (5.6)
We want to characterise the interaction term i∈V 0 α 0i N i . The abundances N i are also assumed to be in equilibrium, but this equilibrium depends on N 0 . However, since N i depends on all species abundances i interacts with, and since the connectivity is large, its dependence on N 0 is assumed to be weak. Therefore, as in the case of fully connected interactions [START_REF] Bunin | Ecological communities with Lotka-Volterra dynamics[END_REF], we write N i = N \0 i -χ i α i0 , where N \0 i is the abundance of species i when species i = 0 is isolated from the community and χ i is the susceptibility of species i, measuring the effect of a small change in its growth rate on its equilibrium abundance.

Here the change comes from the effect of N 0 through the interaction α i01 . With this decomposition, equation (5.6) takes the form:

0 = N 0   1 -N 0 - i∈V 0 α 0i N \0 i + i∈V 0 χ i α 0i α i0 N 0   (5.7)
We will focus on the first sum only as the calculation of the second sum is very similar. Writing

α ij = µ/k + σ/ √ k z ij , the first sum is equal to: i∈V 0 α 0i N \0 i = µ k i∈V 0 N \0 i + σ √ k i∈V 0 z 0i N \0 i (5.8)
Compared to the fully connected case, the sums contain a random number of terms equal to the number of species with which species i = 0 interacts. If k is large, this number is equal to k with fluctuations of order √ k. Thus µ i∈V 0 N \0 i /k is equal to µ⟨N ⟩ V 0 with fluctuations of order 1/ √ k (and thus negligibles), where ⟨N ⟩ V 0 is the mean abundance of species interacting with i = 0. Similarly, the second term

σ i∈V 0 z 0i N \0 i / √ k is a sum of k ± √
k random terms, which can be written as σ ⟨N 2 ⟩ V 0 η, where η is a Gaussian random variable with zero mean and unit variance. If we do the same for the second sum of equation (5.7) and put it all together, we get:

0 = N 0 1 -N 0 -µ⟨N ⟩ V 0 -σ ⟨N 2 ⟩ V 0 η + γσ 2 ⟨χ⟩ V 0 N 0 (5.9)
where η is a Gaussian random variable with zero mean and unit variance, and ⟨χ⟩ V 0 is the average of χ i among the species interacting with i = 0.

Equation (5.9) is similar to equation (1.15) in Chapter 1, obtained in the fully connected case [START_REF] Bunin | Ecological communities with Lotka-Volterra dynamics[END_REF], but instead of averages over the whole community, the averages are over the species interacting with i = 0 (i.e. ⟨N ⟩ V 0 , ⟨N 2 ⟩ V 0 and ⟨χ⟩ V 0 ). However, this gives the same result because the species are statistically equivalent: the species in this set have the same statistics as all the other species. So we get exactly the same result as in the fully connected case.

I point out that we don't need k to be proportional to S, just large enough for the central limit theorem to hold. So we can expect the k ≥ 30 rule of thumb to hold here. Corrections are of the order 1/ √ k. We have seen that at high connectivity, the distribution of abundances at equilibrium is the same as in the fully connected case. However, this result is expected to break down at lower connectivity and non-trivial effects of sparsity should appear. High connectivity is not always a reasonable assumption for ecological communities, so it is important to understand these effects. In the fields of random matrices, localisation and spin glasses, the low connectivity regime is also the most challenging [START_REF] Rogers | Cavity approach to the spectral density of sparse symmetric random matrices[END_REF][START_REF] Fyodorov | Localization in ensemble of sparse random matrices[END_REF] as it deviates from cases where the law of large numbers allows an analytical approach.

Effects of small connectivity on SAD

We will now investigate the effect of low connectivity on the stationary distribution of abundances. In particular, we want to determine the extent to which the well-mixed case is applicable and the regime in which it is not. We compared the abundance distribution obtained in numerical simulations of the sparse model with the abundance distribution in the fully connected case, with the effective parameters defined in equation (5.5). To quantify the discrepancy, we use the Kullback-Leibler divergence, a measure of how a probability distribution p differs from a second, reference probability distribution q:

D KL (p||q) = ∞ -∞ p(x) log p(x) q(x) dx (5.10)
A large value of D KL (p||q) indicates that p is quite different from q, while a small value means that p is quite similar to q. In our case, for a given set of parameters (k, µ π , σ π , γ π ), we can compute the effective parameters µ, σ and γ from equation (5.5) and obtain the stationary abundance distribution q(N ), which is the solution of the cavity equation (5.9) (or equation (1.15) in Chapter 1). Numerical simulations of a sparse community with interactions from the probability distribution equation (5.3) with parameters (k, µ π , σ π , γ π ) with large S allow us to compute the empirical distribution p(N ). See Figure 5.2 for an example of these two distributions plotted together. We then compute the Kullback-Leibler divergence D KL (k, µ π , σ π , γ π ) = D KL (p||q) between these two distributions (for sufficiently large S it doesn't depend on S).

Figure 5.3 represents the map of D KL (k, µ π , σ π , γ π ) in the space (µ π , σ π ) for γ π = 0 and γ π = 1. One thing we notice is that the two SADs are very similar in the region of Figure 5.2: Difference between the SAD of a sparse and a fully connected community. In blue is the stationary SAD of a LV community with S = 300 species and random interactions as defined by equation (5.3) with parameters k = 10, µ π = 1.2, σ π = 0.2 and γ π = 0. In green in the theoretical SAD of a fully connected LV community, with parameters µ, σ and γ derived from k, µ π , σ π and γ π using equation (5.5). From these two distributions, it is possible to compute the Kullback-Leibler divergence D KL (k, µ π , σ π , γ π ). low µ and σ. As µ increases, there is a continuous but steep2 transition after which the two distributions are very different, so that the effects of sparsity become non-negligible. The direction of the level lines of D KL (µ, σ) seems to depend on γ π . The regions where D KL is not defined are because the effective parameters landed in the unbounded growth phase where there is no SAD.

Even at low connectivity there is a region of the parameters (µ π , σ π and γ π ) where the distribution of abundances is well approximated by the fully connected case. This region is characterised by low values of µ π and, to a lesser extent, low values of σ π . This region also becomes larger as k increases, as one would expect. The region where the two distributions are very different is relatively small because the effective parameters (µ, σ and γ) are quickly pushed in the unbounded growth phase.

An interesting feature observed in Figure 5.3 is that at low σ π the transition from good to poor agreement between the two distributions seems to start approximately at the transition found in Marcus et al. [START_REF] Marcus | Local and collective transitions in sparsely-interacting ecological communities[END_REF]. In their model, all non-zero interactions are equal to µ/k (i.e. σ π = 0) and each species interacts with exactly k species, corresponding to a k regular graph. They found that the community transitions from a single equilibrium where all species abundances are equal when µ π is small, to multiple equilibria with some species extinct and different abundances. The transition occurs at µ c = k 2 √ k-1 (represented by a red dot in the figure 5.3) when the first equilibrium becomes unstable because competition is too strong. This value increases with k, which explains why the region where the two models agree becomes larger as the connectivity increases.

Before the transition (i.e. µ < µ c ) all species abundances are equal, so it is not surprising that the additional heterogeneities in interaction and sparsity only spread the abundances in a Gaussian pattern, explaining the good agreement with the fully connected case, which is also Gaussian. However, after the transition (i.e. µ > µ c ) the abundance distribution has two peaks at N = 0 and N = 1 and smaller peaks at intermediate values. Such a distribution is very different from a Gaussian distribution and explains the poor agreement with the fully connected case. Marcus et al. [START_REF] Marcus | Local and collective transitions in sparsely-interacting ecological communities[END_REF] also show that the main effect of adding a small heterogeneity in interactions (i.e. small σ π ) and in the number of species interacting with any given species (by considering Erdös-Rényi graphs) is to smoothen the transition. This result can explain the gradual but rapid increase of log(D KL ) in Figure 5.3. However, it does not explain the differences at higher σ π , nor the differences between γ π = 0 and γ π = 1.

One approach we have explored to better understand the small connectivity effects is to compute the SAD of the sparse community using the replica method. This method proved very useful to understand the properties of the random Lotka-Volterra model in the fully connected case [START_REF] Biroli | Marginally stable equilibria in critical ecosystems[END_REF][START_REF] Altieri | Properties of Equilibria and Glassy Phases of the Random Lotka-Volterra Model with Demographic Noise[END_REF]. An example of replica computation in this case is presented in appendix B. Its extension to systems with finite connectivity requires additional techniques and approximations [START_REF] Monasson | Some remarks on hierarchical replica symmetry breaking in finiteconnectivity systems[END_REF][START_REF] Biroli | A single defect approximation for localized states on random lattices[END_REF][START_REF] Semerjian | Sparse random matrices: The eigenvalue spectrum revisited[END_REF]. The application of the replica method is limited to symmetric interactions, so we focused only on the γ π = 1 case.

Using these techniques we were able to write a self-consistent equation for the distribution of abundance across different replicates a = 1, . . . , n of the community c

(N) = 1 S i a δ(N a i -N a ). c(N) = λ exp -βV (N) + k d n M c(M)K(N, M) (5.11)
where λ is chosen so that d n N c(N) = 1 and β is an inverse temperature that should be sent to +∞ get the equilibrium. The 'potential' is:

V (N) = - a N a - (N a ) 2 2
(5.12)

and the 'interaction' term is:

K(N, M) = exp    -β µ k a N a M a + β 2 σ 2 2k a N a M a 2    (5.13)
Unfortunately, we have not been able to find a good ansatz for the form of c(N) to solve the self-consistent equation (5.11), or even just to better understand the deformation of the SAD due to sparsity. I think it might be possible by using variational methods on c(N).

Discussion

Sparsity is definitely one of the most important structures that can be taken into account in disordered models, because of its ubiquity in natural communities and because of its potentially strong effect on the stationary and dynamic ecological patterns [START_REF] Thébault | Stability of Ecological Communities and the Architecture of Mutualistic and Trophic Networks[END_REF][START_REF] Guimarães | The Structure of Ecological Networks Across Levels of Organization[END_REF].

I presented a natural model to account for sparsity in random Lotka-Volterra equations and identified its effect on the statistics of interactions. Hopefully we have seen that in this model sparsity has no significant effect on ecological patterns when connectivity is large, as is usually the case when dealing with random matrices. However, it can have a significant effect when one species interacts with a limited number of species, depending on the strength and heterogeneity of the interactions. To understand whether or not these effects are negligible with respect to the equilibrium species abundance distribution, I numerically computed the Kullback-Leibler divergence between the abundance distribution of a sparse community and a fully connected community with the same interaction statistics.

We have shown that there is a non-negligible region of parameters where there are no significant differences between the two cases. This region becomes larger as the connectivity of the community increases. We were able to link the transition from good to bad agreement at low σ π to an equilibrium stability transition found in Marcus et al. [START_REF] Marcus | Local and collective transitions in sparsely-interacting ecological communities[END_REF].

To better understand the species abundance distribution at higher σ π and in the case of γ = 1, we derived a self-consistent equation (5.11) using the replica technique. This equation may be solvable by variational methods. In a very recent paper, Azaele and Maritan [START_REF] Azaele | Large system population dynamics with non-Gaussian interactions[END_REF] were able to derive a dynamical mean field theory (see Chapter 4) for the random Lotka-Volterra model with non-Gaussian interactions. This method can be applied to the case of sparse interactions and I expect it to give an equation similar to (5.11), but for the full dynamics and for any γ.

CHAPTER 6 Conclusion

This thesis has been about modelling the ecology and evolution of complex communities as disordered systems. As we saw in Chapter 1, mathematical models are important for understanding the complex dynamics of abundances resulting from ecological interactions between species. However, when communities are composed of many species, as is the case with microbial communities, even the simplest mathematical models become too complicated to analyse. The number of parameters increases with the number of species, and we don't have a precise idea of the value of these parameters in natural communities. To deal with this problem, the general approach of disordered systems is to replace complexity with randomness. This greatly simplifies the models while retaining some heterogeneity. However, the introduction of randomness washes out any structure except the one we impose by hand. This imposed structure reflects our knowledge of the community, but it is usually very limited.

One contribution of this thesis is to understand how such a structure could emerge from evolution. Indeed, in Chapter 2 we saw that artificial selection at the level of the community leads to the emergence of a low-rank structure in the interactions. This structure allows the community to perform well the function for which it was selected. In Chapter 3 we studied the evolution of species competing for resources. We saw that the existence of a metabolic trade-off can allow more species than resources to coexist in a state where each resource is equally available. When this state was not feasible, we saw that evolution drove the community towards the feasibility of this state. So evolution has also changed the structure of the community, although the nature of the structure is very different in the two chapters.

The next two chapters were not about evolution, but were also related to the idea of structure. In Chapter 4 we studied neutral models where each species is similar and the main drivers of differences are demographic and environmental fluctuations. I showed how the absence of structure in the random Lotka-Volterra models can lead to apparent 109 neutrality. In Chapter 5 we studied the effect of sparsity on the species abundance distribution of communities modelled by a random Lotka-Volterra model.

I think there is a lot of work to be done to better understand the effects of different types of structure on ecological patterns, and how they interact with evolution.

From a more personal point of view, I've been very excited to work on these topics and I feel that I come out of this PhD with infinitely more questions than when I started. In this thesis I have tried to emphasise the ecological motivations of my work, but it must have been clear throughout the thesis that another important motivation is simply the mathematical beauty of these models. I think this is the case for most physicists working in theoretical ecology, and that this is one of the reasons why discussions with ecologists can be difficult. I feel that we can sometimes become obsessed with the beauty of the mathematical appeal or the elegance of some sophisticated techniques and forget the ecological object that was the original motivation. On the other hand, I have the impression that biologists can be too sceptical about the usefulness of theoretical models, especially the simplistic toy models we have studied. This may be a matter of taste, but it leads to a lack of communication, with physicists publishing in journals that ecologists never read, whereas I really think that both have a lot to learn from each other. These communication difficulties, due to differences in practice but also due to cognitive barriers and institutional obstacles, are common to most interdisciplinary sciences [START_REF] Macleod | What makes interdisciplinarity difficult? Some consequences of domain specificity in interdisciplinary practice[END_REF]. Because of this difficult communication, I really admire the few researchers who manage to bridge physics and ecology, mainly by working with experimentalists and confronting our models with data [START_REF] Barbier | Fingerprints of High-Dimensional Coexistence in Complex Ecosystems[END_REF][START_REF] Hu | Emergent phases of ecological diversity and dynamics mapped in microcosms[END_REF][START_REF] Goldford | Emergent simplicity in microbial community assembly[END_REF][START_REF] Grilli | Macroecological laws describe variation and diversity in microbial communities[END_REF].

However, I am not sure that better communication between physicists and ecologists will be enough to address the great challenge facing ecology today, the biodiversity crisis. Indeed, the global rate of contemporary extinction is 100 times higher than the background rate (i.e. the pre-human extinction rate) [START_REF] Lamkin | On the Challenge of Comparing Contemporary and Deep-Time Biological-Extinction Rates[END_REF]. This decline, being driven by habitat destruction (due to the expansion of agriculture and industry), pollution and climate change, may be the start of the sixth mass extinction: "Denying the crisis, simply accepting it and doing nothing, or even embracing it for the ostensible benefit of humanity, are not appropriate options and pave the way for the Earth to continue on its sad trajectory towards a Sixth Mass Extinction" [START_REF] Cowie | The Sixth Mass Extinction: Fact, fiction or speculation?[END_REF]. As with climate change, it may not be enough to keep writing academic papers.

• Evolution is the change in the phenotypes of a population over successive generations. It occurs when there is some phenotypic variability in a population, and that these phenotypes are heritable.

• Environmental noise is the variation in abundance that results from fluctuations in the environment. This environment can be the different resources that species consume, the weather, or even other species such as predators.

• The Generalised Lotka-Volterra model is a set of differential equations that describe the dynamics of the abundance of species interacting in a community. It has as parameters the intrinsic growth rates and carrying capacities of each species, and the pairwise interaction between two species.

• The Growth rate of a species is the proportion of the current population that is gained or lost per unit of time, i.e. the birth rate minus the death rate. This growth rate can depend on the abundance of the species (because of limiting effects) as well as on the abundance of other species because of interactions. We call intrinsic growth rate the value of this growth rate when the species is isolated and at low abundance (i.e. during its exponential growth phase).

• Interactions are the effects of one species on the growth of another species. This effect can be either beneficial or detrimental. We call interactions between members of the same species intraspecific, and interactions between different species interspecific.

• The Jacobian Matrix of a vector-valued function is the matrix of all its first-order partial derivatives.

• The Kullback-Leibler Divergence is a measure of how a probability distribution p differs from a second, reference probability distribution q. It is usually written as D KL (p||q). This is not a distance, because it is not symmetric: D KL (p||q) ̸ = D KL (q||p) in general.

• The Mac Arthur model is an ecological model that describes the ecological dynamics of species competing for resources.

• Natural selection is the phenomenon by which the relative ecological growth of some traits can make them more or less abundant in the population.

• Neutral models are ecological models in which each species is functionally equivalent. The main processes involved are demographic and environmental noise.

• The Phenotype is the set of observable characteristics or traits of an organism.

• A Random matrix is a matrix whose entries are random variables.

• The Replica Method is a method for calculating the average free energy of systems with a random Hamiltonian (i.e. disordered systems). It can also be used to calculate the average of observables. See Appendix B for an example of the application of this method to the random Lotka-Volterra model with symmetric interactions.

• A Species is a group of organisms that are very similar to each other and are usually capable of producing fertile offspring. A bacterial species is defined as a group of strains that frequently exchange or could exchange core genes, but are relatively restricted in such exchanges with other groups.

• The Species Abundance Distribution describes the relationship between the number of species observed and their observed abundance. It is the histogram of species abundances.

• Stochastic differential equations are differential equations in which some of the terms are stochastic processes. The solution is also a stochastic process.

• A Strain is a genetic variant, a subtype or a culture within a biological species.

• The Susceptibility describe the proportional response of a quantity to an applied field.

This derivative is strictly negative, except at equilibrium when none of the abundances change, in which case it is zero. Therefore, H(N) can only decrease along an ecological trajectory, and the fixed-points of the dynamics are local minima of the function H.

To compute these minima, we define the Boltzmann-Gibbs distribution associated to this distribution: and the free energy of the system is F = -ln(Z) β . The minima of the Hamiltonian can be found by looking at the zero temperature limit of the Boltzmann-Gibbs distribution. It can also be shown that at finite temperature this distribution corresponds to the distribution of abundances if we add a demographic noise of temperature T to the equation (B.1) [START_REF] Altieri | Properties of Equilibria and Glassy Phases of the Random Lotka-Volterra Model with Demographic Noise[END_REF].

In the following, for any function X of N, we will denote the average over the thermal noise ⟨X⟩ = Z -1 dN X(N) exp(-βH(N)) and X the average over the randomness of α.

We introduce the overlap q between two configuration N and N ′ :

q(N, N ′ ) = 1 S i N i N ′ i (B.7)
and the mean population m of a configuration N:

m(N) = 1 S i N i (B.8)
We also denote the non-random part of the Hamiltonian

H 0 (N i ) = ( N 2 i 2 -N i ) (B.9) such that H(N) = i H 0 (N i ) + i<j α i,j N i N j (B.10)
At fixed N, because of the randomness of α, H(N) is a Gaussian variable of mean:

H(N) = i H 0 (N i ) + µ S i<j N i N j (B.11)
and of variance:

H(N) -H(N) 2 = σ 2 S i<j N 2 i N 2 j (B.
12)

The covariance between H(N ) and H(N ′ ) is:

Cov[H(N), H(N ′ )] = σ 2 S i<j N i N ′ i N j N ′ j (B.13)
For large S we can neglect the diagonal terms in the sum over i < j such that:

H(N) = i H 0 (N i ) + Sµ 2 m(N)

Replica trick

For a fixed interaction matrix α, the statistics of the abundances is described by the Boltzmann-Gibbs distribution associated with the Hamiltonian H(N). We want to compute this distribution for typical realisations of α in the large S limit. To do this, we need to take some averages over the probability distribution of α. We can't just replace H(N ) with H(N), because that would just wash out all the heterogeneity, but need to compute P BG (N ), which is much harder.

Actually, all we need to do is calculate the average free energy F , called the quenched free energy. The free energy is the good quantity to calculate because it is self-averaging, in the sense that F → F when S → ∞. When this quantity is computed, an effective Hamiltonian for the abundances appears which describes the typical statistics of the abundances in the large S limit.

To compute the quenched free energy we will use the replica trick. We first use the identity: ln(Z) = ln(Z n ) n = ln(1+Z n -1) n that is true for any n. We then take the n → 0 limit and Taylor expand the logarithm ln(1+Z n -1) n ∼ 1-Z n n . So that we have:

ln(Z) = lim n→0 1 -Z n n (B.16)
Taking the average and multiplying by -1/β, we have:

F = lim n→0 Z n -1 βn (B. 17
)
And now for the trick: we will calculate Z n for n integer and then take the n → 0 limit to get the quenched free energy. The advantage of having n integer is that we can write Z n as a partition function over n independent replicate of the system: As H(N a ) are Gaussian variables, we use the following identity for X i Gaussian variables:

Z n =
E exp i b i X i = exp   i b i E(X i ) + 1 2 i,j b i b j Cov[X i , X j ]   (B.20)
Applying this identity to Z n , we get:

Z n = n a=1 dN a exp   -β a,i H 0 (N a i ) -β Sµ 2 a m(N a ) 2 + β 2 σ 2 S 4 a,b q(N a , N b ) 2  
(B.21) Because q is symmetric we wan write it in the more explicit way:

Z n = n a=1 dN a exp   -β a,i H 0 (N a i ) -β Sµ 2 a m(N a ) 2   × exp   β 2 σ 2 S 2 a<b q(N a , N b ) 2 + β 2 σ 2 S 4 a q(N a , N a ) 2   (B.22)
We now replace q(N a , N b ) and m(N a ) by new variables q a,b and m a , that we will integrate over after multiplying our expression by δ(q a,b -q(N a , N b )) and δ(m a -m(N a )): The conjugate fields qa,b and ma are purely imaginary here, but we will relax this condition when computing the saddle point. We will also drop the denominators because they don't affect the extensive part of the free energy. with F eff the free energy associated to H eff . We finally have written Z n as the integral of an action A:

Z n =
Z n = a,b

Saddle point

In the S → ∞ limit we can reduce this integral to the saddle point of A, where all the partial derivative of A are equal to zero. For this, we first compute the derivative with respect to q a,b , q a,a and m a :

∂A ∂q a,a = β 2 σ 2 2 q a,a -β qa,a In this subspace: This effective Hamiltonian describes the statistics of the abundances over multiple replicates, while the first part of the action here is just to ensure that m a and q ab are the averages and overlaps of the abundances. We can already see how these parameters are self-consistently defined.

A[q a,b , m a ] = β µ 2 a m 2 a -β 2 σ 2 2 a<b q 2 a,b -β 2 σ 2
To compute the derivative of A with respect to q a,b and m a , we first recall a key property of the free energy: for any parameter of the system h, if F is the free energy associated to an Hamiltonian H, we have:

∂F ∂h = ⟨ ∂H ∂h ⟩ H (B.36)
where the average is over the Boltzmann-Gibbs distribution. We thus have This quite logical result implies that the statistics of the abundances are described by the effective Hamiltonian H eff .

∂F eff ∂m a = µ⟨N a ⟩ eff ∂F eff ∂q a,a = -β σ 2 2 ⟨N a N a ⟩ eff

Replica symmetric solution

We now need to take the n → 0 limit. Since we are integrating on an overlap matrix q a,b of size n(n + 1)/2 and a vector m a of size n, we first have to parametrise these objects by making ansatz on them structures to make n appear explicitly. The simplest is the replica symmetry ansatz, which holds when there is only one equilibrium: ∀a m a = m ∀a q a,a = q D ∀a ̸ = b q a,b = q 0 (B.40)

The action then take the form:

A[m, q D , q 0 ] = β µ 2 n m 2 -β 2 σ 2 n(n -1) 4 q 2 0 -β 2 σ 2 4 n q 2 D -βF eff [m, q D , q 0 ] (B.41

)
where F eff [m, q D , q 0 ] is the free energy associated with the Hamiltonian: such that q D = E z ⟨N 2 ⟩ RS .

H eff ((N a ) a≤n ) = a H 0 (N a ) -β σ 2 2 q 0 ( a N a ) 2 -β σ 2 2 (q D -q 0 ) a (N a ) 2 +
For q 0 , we first have:

∂A ∂q 0 = -β 2 σ 2 n(n -1) 2 q 0 + 1 Z eff ∂Z eff ∂q 0 ∼ β 2 σ
q 0 = E z ⟨N ⟩ 2 RS (B.55)
In summary the saddle point is given by:

m = E z [⟨N ⟩ RS ] q D = E z ⟨N 2 ⟩ RS q 0 = E z ⟨N ⟩ 2 RS (B.56)
where H RS [N, z] = H 0 (N ) + (µm -σ √ q 0 z)N -β σ 2 2 (q D -q 0 )N 2 (B.57

)
and z is a Gaussian random variable. This is the cavity solution with demographic noise in the replica-symmetric phase. The abundances are statistically distributed according to H RS , reflecting the thermal stochasticity, with a different random value of z for each species, reflecting the random disorder. The parameters m, q D and q 0 are self-consistently defined.

Zero-temperature limit

In the zero temperature limit there is no more thermal stochasticity, so the abundances are at the minimum of H RS for fixed z. The only remaining randomness is in z. For this reason we can replace ⟨N ⟩ RS by N , the positive minimum of H RS .

A detail is that q D → q 0 when T → 0, but β(q D -q 0 ) → χ ̸ = 0. Calculating the expansion of q D -q 0 for small T , we can see that χ is a susceptibility with respect to an external field h: χ = E z ∂N ∂h where h is added to H RS and sent to zero. Putting it all together, we have:

N = max 0, 1 -µm -σ √ qz + h 1 -σ 2 χ (B.58)

1 Figure 1 :

 11 Figure 1 : Schéma du modèle de sélection artificielle de communautés. Chaque communauté d'un groupe de n = 4 communautés est représentée par un cercle et est composée d'un ensemble d'individus (représentés par les jetons) appartenant à différentes espèces (représentées par la couleur).Dans une première phase de croissance, l'abondance des espèces évolue en fonction de la dynamique écologique. Les m = 2 communautés ayant la meilleure fonction à la fin de cette phase (ici l'abondance totale la plus élevée) sont sélectionnées pour la reproduction. Les nouvelles communautés de la génération suivante sont générées à partir de ces m communautés les plus performantes, en les copiant. Les interactions entre les espèces sont ensuite modifiées par des mutations. Ces changements sont représentés par les différentes formes des jetons.

3 C 3 , 4 C 3 , 3 C 3 , 2 C 3 , 1

 334333231

Figure 3 :

 3 Figure3: Schéma d'une communauté de trois espèces avec compromis métabolique. L'utilisation des ressources par chaque espèce est représentée par une jauge, remplie de différentes couleurs représentant les préférences de l'espèce. Le budget total est différent entre les espèces, mais les seuils métaboliques m i sont ajustés en conséquence.

Figure 1 . 1 :

 11 Figure 1.1: Logistic growth vs exponential growth. Starting from a small value N 0 , the abundance initially increases similarly in both models, but soon saturates at the carrying capacity K in the logistic model, whereas it accelerates steadily in the exponential case.

Figure 1 . 2 :

 12 Figure 1.2: A typical solution of the predator-prey differential equation. The black line represents the abundance of prey fish and the grey line represents the abundance of predator fish. The y axis has arbitrary units. When the predators are very abundant, the prey population declines rapidly, which in turn leads to a decline in the predator population. If the predators are less abundant, the prey can thrive again, so the predator gets more food and both populations increase.

Figure 1 . 3 :

 13 Figure 1.3: Sketch of a community consisting of two resources (A and B) and three species (1, 2 and 3). Species 1 and 2 both consume the resource A, so they interact through competition. Species 2 and 3 also interact by competing for resource B, but species 1 and 3 do not interact.

Figure 1 . 4 :

 14 Figure 1.4: Circular law. The eigenvalue of a random matrix S × S whose entries are iid random variables of mean 0 and variance 1/S where S = 400 are represented in the complex plane, as well as the unit circle. The eigenvalues are uniformly distributed inside the circle, with some outliers because S is finite.

Figure 1 . 6 :

 16 Figure 1.6: Phase diagram of the dynamics of the Lotka-Volterra equations, superposed with the contour plot of the log of the mean abundance, in the space(µ, σ) with γ = 0, all carrying capacities equal to one and in the limit S → ∞.

Figure 1 . 7 :

 17 Figure 1.7: Dynamics of a Lotka-Volterra community in the three different phases. Numerical simulations of the abundances N i (t) as a function of time, with dynamics according to equation (1.12) and random interactions according to equation (1.13), with S = 100 species and γ = 0. The values of µ and σ differ in each panel so that it is in one of the three phases shown in figure 1.6: from top to bottom, unique equilibrium, chaotic and unbounded growth phase.

Figure 1 . 8 :

 18 Figure 1.8: Common protocol for artificial selection of communities. We incubate a number of similar microbial ecosystems in parallel, allowing populations of different species (each species represented by a different colour) to grow for some time, ranking them according to a desired function (trait value), and then selecting the best communities to seed new ecosystems in a new round of selection. Figure from Arias-Sánchez et al. [17].

1 Figure 2 . 1 :

 121 Figure 2.1: Structure of the model for the artificial selection of community function.Each community in a population of n (here n = 4) communities is represented by a circle and is composed of a set of individuals (represented by the tokens) belonging to different species (represented by the colour). In a first growth phase, the abundance of species changes according to the ecological dynamics. The m = 2 communities with the best function at the end of this phase (here the highest total abundance) are selected for reproduction. New communities of the next generation are generated from these best performing communities, but the parameters of the interactions between species are mutated. These changes in interactions, which are different for each newborn community, are represented by the different shapes of the tokens. This leads to a change in community composition within the current generation of communities, at the end of which selection is again applied to the function of the adult community. The same selection-reproduction-ecological growth scheme is repeated in each generation.

Figure 2 . 2 :

 22 Figure 2.2: Evolution of the empirical µ (top panel), σ (middle panel) with generations τ in the absence of selection. There are n = 20 communities composed of S = 200 species. The initial interactions are random with parameters µ = 3, σ = 0.5 and γ = 0. The mutation strength is ε = 0.02. The blue lines are the means across communities. The lower panel shows the evolution of the communities in (µ, σ) space. We observe that µ and σ diffuse without bias (at least in the first order). The expansion in σ is smaller than the expansion in µ, in agreement with what was found analytically.

Figure 2 . 3 :Figure 2 . 4 :

 2324 Figure 2.3: Changes of species abundance along an evolutionary trajectory.Selection for increased total abundance leads to an increase in the abundances of most species (grey lines), and, as a consequence, of the average abundance N T /S (blue line)

Figure 2 . 5 :

 25 Figure 2.5: The direction for increased total abundance is towards low µ and high σ Map of the mean abundance in space (µ, σ) for a random matrix defined by equation (2.2). The orange arrow represents what the direction of evolution might be if it followed the gradient of total abundance.

Figure 2 . 6 :

 26 Figure 2.6: Purely random interactions cannot explain the evolution of total community abundance. Variation of the interaction moments µ(τ ), σ(τ ), and of the total abundance log(N T (τ )) (red line) along an evolutionary trajectory. The abundance of a random interaction matrix (equation (2.2)) with moments µ, σ (surface) is plotted for comparison. The white line is the predicted total abundance if the matrix of moments µ(τ ), σ(τ ) was completely random, indicating that along the trajectory the matrix becomes progressively structured.

Figure 2 . 7 :

 27 Figure 2.7: Changes of the eigenvalues of the interaction matrix along an evolutionary trajectory.The structure of the interaction matrix α of the best community evolves, which is manifested in the spectrum of its eigenvalues. The dynamics of their real part over community generations (top panel) reveals the appearance of an isolated negative real eigenvalue (green), as well as the decrease of the eigenvalue associated to µ (blue). A zoom of the spectrum in the complex plane (bottom panel) at generation τ = 1900 (represented by the dotted line in (top panel)) shows that, apart from the emergence of this mutualistic collective mode, the matrix retains its initial random structure, characterised by a circular eigenvalue distribution.

Figure 2 . 8 :

 28 Figure 2.8: The right eigenvector associated with the outlier eigenvalue correlates with the abundances. This represents, at generation τ = 2000, the abundances of the existing species at equilibrium in descending order (blue), together with the real part of the coefficients of the right eigenvector associated with the outlier eigenvalue (green). Both are highly correlated.

Figure 2 . 9 :

 29 Figure 2.9: Evolution of the interaction matrix. Coefficients of the interaction matrix α with rows and columns sorted by decreasing carrying capacities at generations 1 (left) and 2000 (right) for the same simulation as Figure 2.3. Only the species that have positive abundance at generation 2000 are shown.

Figure 2 . 11 :

 211 Figure 2.11: Statistics of the maximum value among n Gaussian random variables. The left panel shows the distribution of M n for different values of n. The right panel shows the evolution of the expected value of this distribution with n (in blue), with an approximation by 0.5 -2 log(n) in dashed green. This dependence in n provides the scaling of the evolutionary change in a single collective generation with the number of communities in the meta-community.

Figure 3 . 2 :

 32 Figure 3.2: Cartoon of a three species community with the trade-off presented in[START_REF] Tikhonov | Collective Phase in Resource Competition in a Highly Diverse Ecosystem[END_REF]. In this version of metabolic trade-off, the total budget is different between species, but the metabolic thresholds m i are adjusted accordingly. Note that when each m i = m, this model reduces to that represented in Figure3.1, with E = m/α.

Figure 3 . 3 :

 33 Figure 3.3: Conic hull of the preference vectors of two species for M = 2. The neutral set is feasible if and only if the vector k ⋆ lies in the blue region, which is the conic hull of the preference vectors c i .

Figure 3 . 4 :

 34 Figure 3.4: Ecological dynamics when the neutral state is not feasible. There are M = 50 resources and S = 50 species, with preferences c iµ = x 2iµ , where all x iµ are independent and identically distributed from a normal distribution of mean zero and variance 1. The metabolic thresholds are imposed by the trade-off: m i = α µ c iµ with α = 1. Resource availability satisfies the equation R µ = ϕ/(1 + i c iµ N i ) with inflow ϕ = 10. Species whose abundance falls below a threshold N min = 10 -6 are considered extinct. The equilibrium is not the neutral state because it is not feasible, so resource availabilities are not all equal and some species go extinct.

Figure 3 . 5 :

 35 Figure 3.5: Ecological dynamics when the neutral state is feasible. The parameters are the same as in Figure 3.4 but with three times more species than resources (S = 150 and M = 50). The equilibrium is the neutral state where all resources are equally available and all species survive.

Figure 3 . 7 :

 37 Figure 3.7: Evolution of the number of species during the eco-evolutionary dynamics. The top panel shows the evolution of the total number of species S and the number of extant species S ⋆ for the simulation shown in Figure 3.6. The number of species increases almost linearly with time and only stops when we switch off evolution.The bottom panel is the same as the top panel, but for a simulation where we have selected only those mutants that invade the community in time less than τ = 300. Because of this selection, the number of species increases more slowly and eventually stabilises.

Figure 4 . 1 :

 41 Figure 4.1: Stochastic dynamics and stationary distribution for logistic growth with white demographic noise. The left panel represent in grey different independent simulations of the SDE (4.16) with r = 1, K = 1, λ = 10 -5 and σ d = 0.1. In blue is the average abundance over 1000 realisations. The right panel shows the distribution of abundances at the end of the simulation, together with the distribution of equation (4.18).

Figure 4 . 2 :

 42 Figure 4.2: Stochastic dynamics and stationary distribution for logistic growth with moderate white environmental noise. The left panel represent in grey different independent simulations of the SDE (4.19) with r = 1, K = 1 and σ e = 0.5. In blue is the average abundance over 1000 realisations. The right panel shows the distribution of abundances at the end of the simulation, together with the distribution predicted by equation (4.20). This distribution shows a peak at intermediate abundances because the noise is not too strong σ 2 e < r.

Figure 4 . 3 :

 43 Figure 4.3: Stochastic dynamics and stationary distribution for logistic growth with strong white environmental noise.The left panel represent in grey different independent simulations of the SDE (4.19) with r = 1, K = 1 and σ e = 1. In blue is the average abundance over 1000 realisations. The right panel shows the distribution of abundances at the end of the simulation, together with the distribution predicted by equation (4.20). Because the noise is stronger than in Figure 4.2 (we have σ 2 e = r), the peak of the distribution is at low abundances.

Figure 4 .

 4 4 shows that equation (4.24) has a good agreement with simulated solutions of equation (4.22), even for intermediate values of τ .

Figure 4 . 4 :

 44 Figure 4.4: Stochastic dynamics and stationary distribution for logistic growth with coloured environmental noise. The left panel represent in grey different independent simulations of the SDE (4.19) with r = 1, K = 1, σ e = 1.6 and τ = 5. In blue is the average abundance over 1000 realisations. The right panel shows the distribution of abundances at the end of the simulation, together with the distribution predicted by equation (4.24).

Figure 5 . 1 :

 51 Figure 5.1: Interaction graphs of two communities of S = 6 species.In both graphs, each node corresponds to a species, labelled from 1 to 6, and the nodes are connected by edges when the species interact. The graph on the left corresponds to a fully connected community, where all species interact. On the right, some pairs of species don't interact (e.g. species 1 and 4). The resulting structure is reminiscent of a trophic network.

Figure 5 . 3 :

 53 Figure 5.3: Differences in abundance distribution due to sparsity depend on µ π and σ π . Both panels are a map of log(D KL (k, µ π , σ π , γ π )) for k = 10, S = 300 in the plane (µ, σ). The top panel is for γ π = 0 and the bottom panel is for γ π = 1. The regions with no values for log(D KL ) are because the parameters (µ, σ and γ) are such that the fully connected case community is the unbounded growth phase. The red dot indicates the interaction value at which the transition from single to multiple equilibrium occurs in the model Marcus et al. [81].

  P BG (N) = Z -1 exp(-βH(N)) (B.5) with β = 1 k B T the inverse temperature, Z the partition function. The partition function Z ensure the normalization of the probability: Z = dN exp(-βH(N)) (B.6)

  a = 1, . . . , n are the different replicas. Its average over the disorder is simply:

  dq a,b δ(q a,b -q(N a , N b )) a dm a δ(m a -m(N a )) the exponential expression of the delta Dirac function:δ(q a,b -q(N a , N b )) = 1 2πβS dq a,b exp -βS qa,b (q a,b -q(N a , N b )) δ(m a -m(N a )) = 1 2πβSd ma exp(βS ma (m a -m(N a ))) (B.24)

  Sβ a≤b qa,b q(N a , N b ) -Sβ a ma m(N a )As there is no dependence on i, this can be expressed as the following partition function Z eff , to the power S:Z eff [( ma ) a , (q a,b ) a,b ] = a dN a exp(-βH eff ((N a ) a≤n )) (B.27)with the effective Hamiltonian:H eff ((N a ) a≤n ) = a H 0 (N a ) -a≤b qa,b N a N b + a ma N a (B.28)Here, N a is as a real number, and (N a ) a≤n is a vector of size n.Then we can express:Z eff [( ma ) a , (q a,b ) a,b ] S = exp(-SβF eff [( ma ) a , (q a,b ) a,b ]) (B.29)

µ 2 a m 2 a + β a ma m a + β 2 σ 2 2 a<b q 2 a,b + β 2 σ 2 4 a q 2 a

 22 dq a,b dq a,b a dm a d ma exp(SA[q a,b , qa,b , m a , ma ]) (B.30) with the action A[q a,b , qa,b , m a , ma ] = -β ,a -β a≤b qa,b q a,b -βF eff [( ma ), (q a,b )] (B.31)

∂A ∂q a,b = β 2 σ

 2 2 q a,b -β qa,b (a ̸ = b) ∂A ∂m a = -βµm a + β ma (B.32)So the saddle point lies in the subspace:qa,a = β σ 2 2 q a,a qa,b = βσ 2 q a,b (a ̸ = b) ma = µm a (B.33)

4 a q 2 a

 2 ,a -βF eff [(m a ), (q a,b )] (B.[START_REF] Vellend | Conceptual Synthesis in Community Ecology[END_REF] where F eff [(m a ), (q a,b )] is the free energy associated with the effective Hamiltonian:H eff ((N a ) a≤n ) = a H 0 (N a ) -βσ 2 a<b q a,b N a N b -β σ 2 2 a q a,a (N a ) 2 + µ a m a N a (B.35)

  ∂F eff ∂q a,b = -βσ 2 ⟨N a N b ⟩ eff (a ̸ = b) (B.37)where the average is over all replica with the effective Hamiltonian H eff .Using theses expressions we can compute the partial derivative of A[q a,b , m a ]:∂A ∂m a = βµm a -βµ⟨N a ⟩ eff ∂A ∂q a,a = -β 2 σ 2 2 q a,a + β 2 σ 2 2 ⟨N a N a ⟩ eff ∂A ∂q a,b = -β 2 σ 2 q a,b + β 2 σ 2 ⟨N a N b ⟩ eff (a ̸ = b) (B.38)That gives at the saddle point:m a = ⟨N a ⟩ eff q a,b = ⟨N a N b ⟩ eff (B.39)

  We now want to decouple the replica in the calculation of this partition function. The annoying term is exp β 2 σ 2 2 q 0 ( a N a ) 2 because of the square, so we use the following transform: RS [z] the associated partition function at fixed z.We will denote by E z [. . . ] the mean with respect to the Gaussian variable z, such thatZ eff = E z [(Z RS [z]) n ] and ⟨. . .⟩ RS the mean with respect to H RS at fixed z.We now need to compute the new saddle point of A in the n → 0 limit. Starting with m, we have:Using lim n→0 Z eff = 1 we get m = E z [⟨N ⟩ RS ].The computation is almost the same for q D :

	We thus have:		Z eff =		dz √ 2π	exp -	z 2 2	(Z RS [z]) n	(B.45)
	with	H RS [N, z] = H 0 (N ) + (µm -σ	√ q 0 z)N -β	σ 2 2	(q D -q 0 )N 2	(B.46)
	and Z ∂A ∂m	= βµn m +	1 Z eff	∂Z eff ∂m	(B.47)
	where				∂Z eff ∂m	= nE z	∂Z RS [z] ∂m	Z RS [z] n-1
						∂A ∂q D	= -nβ 2 σ 2 2	q D +	1 Z eff	∂Z eff ∂q D	(B.49)
	where				∂Z eff ∂q D	= -nβE z ⟨ 2 E z ⟨N 2 ⟩ RS ∂H RS [z] ∂q D = nβ 2 σ 2	⟩ RS	(n → 0)	(B.50)
				exp	x 2 2	=	dz √ 2π	exp -	z 2 2	+ xz	(B.43)
	that gives:
	exp β 2 σ 2 2	q 0 (	a	N a ) 2 =	dz √ 2π	exp -	z 2 2	+ βσ	√ q 0 z	a	N a	(B.44)

µm a N a (B.42) = -nβE z ⟨ ∂H RS [z] ∂m ⟩ RS Z RS [z] n = -nβE z ⟨ ∂H RS [z] ∂m ⟩ RS (n → 0) = -nβµE z [⟨N ⟩ RS ] (B.

[START_REF] Gibbs | Can higher-order interactions resolve the species coexistence paradox?[END_REF]

  To compute the second term, we use the Gaussian property:E z [zF (z)] = E z z 2 E z E z [z⟨N ⟩ RS ] = E z ∂⟨N ⟩ RS ∂z = -βE z ⟨N ∂H RS ∂z ⟩ RS + βE z ⟨N ⟩ RS ⟨ ∂H RS ∂z ⟩ RS = βσ √ q 0 E z ⟨N 2 ⟩ RS -βσ √ q 0 E z ⟨N ⟩ 2

							123
							∂F (z) ∂z	.
	This gives:
							(B.53)
						RS
	such that:	∂Z eff ∂q 0	= -nβ 2 σ 2 2	E z ⟨N ⟩ 2 RS		(B.54)
	and finally:
							2 n 2	q 0 +	1 Z eff	∂Z eff ∂q 0	(B.51)
	where	∂Z eff ∂q 0	= -nβE z ⟨ = -nβ 2 σ 2 2 E z ⟨N 2 ⟩ RS + nβ ∂H RS [z] ⟩ RS ∂q 0	2	(n → 0) √ q 0 E z [z⟨N ⟩ RS ] σ	(B.52)

In fact, because the ηij are Gaussian, we don't need the central limit theorem, but this would be true for different distributions with mean zero and variance one.

In the case of γ ̸ = 0, the location of this eigenvalue also depends on σ: it is equal to µ + γσ 2 /µ[START_REF] Baron | Breakdown of Random-Matrix Universality in Persistent Lotka-Volterra Communities[END_REF].

The dependency on the carrying capacities is mediated by the equilibrium abundances.

Formally, the space of C and m such that equation (3.4) admits a solution has a null measure in the space of all possible C and m.

This is characterised by a negative partial derivative of L with respect to the abundance of species that can invade.

It is even possible to have only one species that satisfy this condition, but its vector of preferences should be exactly proportional to k ⋆ .

When considering evolution, it is relevant to consider stable distributions such as a Normal distribution.

[START_REF] Karkman | The ecology of human microbiota: Dynamics and diversity in health and disease[END_REF] This is a direct consequence of Wendel's theorem[START_REF] Wendel | A Problem in Geometric Probability[END_REF]

].[START_REF] Guimarães | The Structure of Ecological Networks Across Levels of Organization[END_REF] With probability exponentially small in M .

In their paper, the neutral state is referred to as the "shielded" phase, while when the neutral state is not feasible, the community is said to be in the "vulnerable" phase.

As in the fully connected case, the effect on Ni of the change in the growth rate of other species j due to αj0N0 is negligible.

It appears mild in Figure 5.3 because of the logarithm.

Acknowledgments

Glossary

In this appendix I briefly define some of the technical terms used in the thesis. The definitions are in alphabetical order.

• Artificial selection is an evolutionary process in which humans deliberately select some characteristics in organisms -for example, by choosing which individuals to save seeds from or breed from one generation to the next.

• The Carrying Capacity of a species is the abundance at which its growth rate becomes negative because of limitation effects.

• The Cavity Method is a technique from statistical physics to solve mean field type models [START_REF] Mezard | Spin Glass Theory And Beyond: An Introduction To The Replica Method And Its Applications[END_REF], closely related to the belief propagation algorithm [START_REF] Yedidia | Constructing Free-Energy Approximations and Generalized Belief Propagation Algorithms[END_REF]. In the case of the Lotka-Volterra model, the general idea is to choose a species (i = 0) and calculate the effect of the community on its growth: j α 0j N j . This effect depends on the abundances of the other species (N j ), which in turn depend on the abundance of the species i = 0. However, because the community has a large number of species, the effect of the species i = 0 on the abundances of the other species is small. So we can write these abundances as their value when the species i = 0 is isolated, plus a small perturbation proportional to N 0 . With this decomposition it becomes possible to use the central limit theorem to calculate the resulting sums. The resulting equation for N 0 contains self-consistent parameters.

• The Connectivity is the average number of species interacting with a species in a community.

• Demographic noise is the fluctuation in abundance that results from the randomness of births and deaths.

• Disordered systems are models with parameters that are random variables.

APPENDIX B

Replica method

In this appendix I explain how the replica method can be used to compute the stationary abundance distribution of a Lotka-Volterra community with random symmetric interactions. This is absolutely not a new result, I only present it for pedagogical purposes.

Definitions

We start from the Lotka-Volterra equations with all r i = 1 and

where α a symmetric interaction matrix of mean µ/S and variance σ 2 /S. Because the interactions are symmetric, we can define an Hamiltonian:

This function is the equivalent of the function L defined in Chapter 3 for the Mac-Arthur model. It also evolves along an ecological trajectory according to:

This is the cavity solution presented in Chapter 1.

While these calculations may seem far too complicated to produce this result compared to the cavity method, it has the advantage of being applicable at any temperature. At higher temperatures, however, the replica-symmetric ansatz is no longer valid, so we need a more complicated ansatz: in short, we break the symmetry of the replicates.

Another advantage of this method is that even if the calculations are long, it is quite automatic, whereas with the cavity method we have to find the terms that can be neglected and this is not always obvious.

APPENDIX C

Numerical integration

Here we present an integration method for the generalised Lotka-Volterra (gLV) equations:

with K i the carrying capacities, r i the bare growth rates and α the interaction matrix. An recurrent problem with the numerical integration of this system of differential equations is that we can sometimes obtain a negative abundance if the time-step is not small enough. This usually completely destabilise the system and quickly lead to a divergence.

The method we present has the advantage of avoiding these negative abundances and remaining quite accurate even at intermediate time steps, allowing larger simulations to be run in a shorter time. If there is only one equilibrium, it is also possible to find it quickly at large time steps, even if the dynamics are not exactly the same.

This method takes advantage of the shape of the gLV equations. Unlike the Euler method, which assumes that the derivative is constant over a short time interval dt, we assume that only the interaction terms j̸ =i α ij N j are constant. This is equivalent to assuming that the abundances of the other species (N j (t)) j̸ =i are constants. During this time interval [t, t + dt], the equations are reduced to uncoupled logistic equations of effective carrying capacities

These logistic equations can be solved analytically in the interval [t, t + dt], giving the recursive formula:

We obtain a logistic-by-part curve that avoids the abundances becoming negative. We can show by Taylor expansion that we get back the first order Euler method in dt. The fixed points of this recursive equation are also the fixed points of the gLV equation.

We have numerically verified that this method is more stable than other methods for intermediate time steps. However, a proper comparison would require more detailed analysis.

MOTS CLÉS Ecologie, Evolution et Physique Statistique

RÉSUMÉ

Les communautés écologiques, et les communautés microbiennes en particulier, peuvent être constituées de centaines ou de milliers d'espèces interagissant dans un réseau complexe. Cette complexité est la source de dynamiques très riches. Récemment, des progrès ont été réalisés dans la compréhension de cette dynamique en utilisant des outils issus de la physique statistique des systèmes désordonnés. L'idée générale est de remplacer la complexité des interactions par de l'aléatoire. Bien que cette approche se soit avérée utile pour comprendre les phénomènes écologiques, il lui manque une composante importante : l'évolution. Dans cette thèse, nous étudions l'interaction entre l'écologie et l'évolution. En particulier, nous montrons que l'évolution des communautés par sélection artificielle affecte les interactions entre les espèces de telle sorte qu'une certaine structure émerge. Nous étudions également l'évolution des espèces qui interagissent par le biais de la compétition pour des ressources avec un compromis métabolique, et nous montrons que cela peut conduire la communauté vers un état où toutes les ressources sont également disponibles et où un grand nombre d'espèces peuvent coexister.

ABSTRACT

Ecological communities, and microbial communities in particular, can consist of hundreds to thousands of species interacting in a complex network. This complexity is the source of very complicated dynamics. Recently, progress has been made in understanding these dynamics using tools from the statistical physics of disordered systems. The general idea is to replace the complexity of the interactions with randomness. While this approach has proven useful for understanding ecological phenomena, it lacks an important component: evolution. In this thesis, we investigate the interplay between ecology and evolution. In particular, we show that the evolution of communities through artificial selection affects the interactions between species in such a way that some structure emerges. We also study the evolution of species that interact through competition for resources with a metabolic trade-off, and show that this can drive the community towards a state where every resources are equally available and a large number of species can coexist.

KEYWORDS Ecology, Evolution and Statistical Physics