## Abstract

Species live and interact in patchy landscapes where environmental conditions vary both in time and space. In the face of this spatial-temporal heterogeneity, species may co-evolve how they select habitat patches. Under equilibrium conditions, coevolution of patch-selection is predicted to give rise to ideal-free distributions of all species: their per-capita growth rates are zero in occupied patches and negative in unoccupied patches. While ideal-free distributions explain observed empirical patterns including enemy-free space and the ghost of competition past, they do not explain why some species occupy sink patches, why competitors have overlapping spatial ranges, or why predators avoid highly productive patches. To understand these patterns, we analyze stochastic Lotka-Volterra models accounting for spatial heterogeneity, environmental stochasticity, and any number of interacting species. We derive an analytically tractable characterization of coevolutionarily stable strategies (coESS) for patch-selection and introduce a numerical algorithm for solving for a coESS. The analytic characterization shows whenever there is selection for a species to occupy multiple patches, their local stochastic growth rates will be negative in the occupied patches i.e. all populations are sink populations. Applying our methods to models of antagonistic interactions reveals that environmental stochasticity can partially exorcize the ghost of competition past, select for new forms of enemy-free and victimless space, and generate hydra effects over evolutionary time scales. To provide additional perspective on our results, we discuss how they relate to the Modern Portfolio Theory of economics. Importantly, our results highlight how environmental stochasticity can reverse or amplify selective forces due to species interactions and spatial heterogeneity.

## Introduction

Evolution of habitat choice plays a key role in shaping the distribution and abundance of species. An evolutionary driver of this choice is spatial heterogeneity in environmental conditions. When individuals can freely disperse across a patchy landscape, ideal-free theory (Fretwell and Lucas, 1969) predicts that the per-capita growth rates of individuals in all occupied habitat patches are equal and use of unoccupied habitat patches would lower the per-capita growth rates of individuals. This simple prediction has empirical support from a variety of species including fishes (Milinski, 1979; Godin and Keenleyside, 1984; Oksanen et al., 1995; Haugen et al., 2006), birds (Harper, 1982; Doncaster et al., 1997), and mammals (Tattersall et al., 2004). Moreover, under equilibrium conditions, the ideal-free distribution defines an evolutionarily stable strategy (Cantrell et al., 2007; Křivan et al., 2008; Cantrell et al., 2017), or a coevolutionarily stable strategy for coevolving species (Connell, 1980; van Baalen and Sabelis, 1993; Schreiber et al., 2000; Schreiber and Vejdani, 2006; Cantrell et al., 2007).

Two classical concepts, enemy-free space and the ghost of competition past, follow from the multi-species ideal-free theory. Jeffries and Lawton (1984) defined enemy-free space as “ways of living that reduce or eliminate a species’ vulnerability to one or more species of natural enemies.” In a spatial context, enemy-free space corresponds to a species living in habitat patches where there are fewer or no natural enemies, a phenomena that has been observed in several empirical systems (Denno et al., 1990; Fox and Eisenbach, 1992; Berdegue et al., 1996; Murphy, 2004; Cole et al., 2005; Heisswolf et al., 2005; Kaminski et al., 2010; Roy et al., 2011; Murphy et al., 2014; Greeney et al., 2015). Ideal-free habitat choice of predators and their prey yield enemy-free space when patches of lower quality for the prey are also lower quality for the predator (Schreiber et al., 2000; Schreiber and Vejdani, 2006). Consistent with these theoretical predictions, Fox and Eisenbach (1992) found that diamondback moth (*Plutella xylostella*) preferentially laid eggs on collards and red cabbage grown on low-fertilized soils while its main parasitoid, an ichneumonid wasp (*Diadegma insulare*), preferentially searched for hosts on collards grown on high-fertilized soils. These contrary choices occurred despite diamond back moth larvae having higher survival rates and growing to larger sizes on host plants from high-fertilized soils.

Ideal-free theory also predicts spatial segregation of competing species: under equilibrium conditions, each species only uses patches in which it is competitively superior (Lawlor and Maynard Smith, 1976). Intuitively, this form of spatial segregation results in per-capita growth rate of zero for each competitor in their occupied patches and negative per-capita growth rates in the other patches due to the presence of the competitively superior species. Selection for this form of spatial segregation has been called “the ghost of competition past” (Connell, 1980). Such a haunting may explain the spatial distribution of two *Crateroscelis* warblers species in New Guinea (Diamond, 1973, 1978). These species are spatially segregated by altitude; one species abruptly replacing the other at an altitude of 1, 643 meters. Despite this sharp transition in warblers, shifts in abundance of competing species typically are more gradual with substantive regions of overlap (Noon, 1981; Chettri and Acharya, 2010; Campos-Cerqueira et al., 2017; Burner et al., 2019). Along these regions of overlap, each competitor may shift from living in source patches (e.g. where it is competitively dominant) to living in sink patches (e.g. where it is competitively inferior) (Amarasekare and Nisbet, 2001).

Under equilibrium conditions, ideal-free theory predicts birth rates and death rates are equal in occupied patches. Consequently, there can be no sink populations – local populations whose mortality rates exceed their birth rates (Holt, 1985; Pulliam, 1988; Pulliam and Danielson, 1991). None the less, sink populations have been observed in many taxonomic groups including birds (Dias et al., 1996; Vierling, 2000; Keagy et al., 2005; Tittler et al., 2006), plants (Kadmon and Tielbörger, 1999) mammals (Kreuzer and Huntly, 2003; Robinson et al., 2008; Monson et al., 2011), reptiles (Manier and Arnold, 2005), amphibians (Rowe et al., 2001) and fishes (Hänfling and Weetman, 2006; Barson et al., 2009; McDowall, 2010). Indeed, a meta-analysis of 90 source-sink assessments found that 60% of the studied populations were identified as sink populations (Furrer and Pasinelli, 2016). These sink populations can be either unconditional or conditional sink populations (Loreau et al., 2013). Unconditional sink populations have negative per-capita growth rates in the absence of conspecific and antagonistic interactions. Alternatively, conditional sink populations have negative per-capita growth rates due to high densities of conspecifics (Watkinson and Sutherland, 1995), heterospecific competitors (Amarasekare and Nisbet, 2001) or predators (Holt, 1977).

Patch selection theory for single species models suggest that unconditional sink populations may evolve in temporally variable environments (Holt, 1997; Jansen and Yoshimura, 1998; Schmidt et al., 2000; Jonzén et al., 2004; Schreiber, 2012). Intuitively, when environmental conditions fluctuate in an on-average, high-quality habitat patches, making use of low-quality, sink patches can serve as a bet-hedging strategy (Cohen, 1966; Holt, 1997; Jansen and Yoshimura, 1998; Kisdi, 2002; Schreiber, 2012). However, whether this evolutionary explanation also extends to sink populations in a community context remains largely unexplored. A notable exception is the work of Schmidt et al. (2000) who studied the evolution of patch choice for two competing species. Under the assumption of perfectly correlated, fluctuating carrying capacities, Schmidt et al. (2000) found that these fluctuations can select for species occupying patches in which they are competitively inferior. However, to what extent these conclusions apply to other forms of species interactions or other forms of environmental stochasticity (e.g. uncorrelated fluctuations in space or between species) or complex landscapes is unknown.

Here, we introduce a framework for analyzing the coevolution of patch-selection for multi-species communities in spatially and temporally heterogeneous environments. The framework involves stochastic counterparts of the generalized Lotka–Volterra models that have been a main-stay of theoretical work in community ecology (May, 1975; Holt, 1977; Polis and Holt, 1992; Law and Morton, 1996; Chesson and Kuang, 2008; Edwards and Schreiber, 2010; Rohr et al., 2016; Schreiber et al., 2018). For these models, we derive an analytically tractable characterization of the coevolutionarily stable strategies (coESS) for patch-selection–a stochastic, multispecies analog of (co)evolutionary stable strategies for deterministic models (Maynard Smith and Price, 1973; Maynard Smith, 1982; Rand et al., 1994; McGill and Brown, 2007). Moreover, we introduce a deterministic numerical algorithm for calculating these coevolutionarily stable strategies.

Using our analytic and numerical approaches, we examine several general questions and then focus on antagonistic species interactions. Specifically, is there a general characterization of coevolutionarily stable patch-selection strategies? Under what conditions, does this characterization coincide with the classical ideal free characterization i.e. local per-capita growth rates equal in all occupied patches? When does evolution of patch-select buffer against environmental fluctuations? Under what conditions is there selection for sink populations? After answering these broader questions, we focus on questions involving antagonistic interactions: When is there selection for antagonist-free space i.e. patches without competitors or predators or prey? In particular, when does selection result in enemy-free space or exorcise the ghost of competition? How do antagonistic interactions influence the evolution of sink populations. In particular, when do prey make use of marginal patches to escape predation? When do species occupy patches in which they are competitively inferior?

## Models and Methods

We model a community of *n* species with overlapping generations living in an environment with *k* patches. These patches may represent distinct habitats, patches of the same habitat type, or combinations thereof. The within-patch dynamics are modeled by stochastic Lotka–Volterra differential equations (May, 1973, 1975; Turelli, 1977, 1978; Turelli and Gillespie, 1980; Turelli, 1986; Lande et al., 2003; Schreiber et al., 2011; Evans et al., 2013, 2015; Nolting and Abbott, 2016; Hening and Nguyen, 2018*c*, *b*; Hening et al., 2021). To couple these local dynamics, we assume that each species has a fixed fraction of its population in each of these patches. The resulting models are a multispecies version of the models introduced in (Schreiber, 2012; Evans et al., 2015; Hening et al., 2018).

To study the coevolution of these patch-selection strategies, we introduce a definition of coevolutionary stable strategies (coESS) of patch-selection. Our definition is the stochastic analog of the concept of evolutionarily stable attractors defined by Rand et al. (1994). Roughly, coevolutionary stability requires that any small population of any species playing a different strategy goes extinct. To identify the coESS, we use the invasion growth rates of mutant strategies. We show that these invasion growth rates correspond to solutions of systems of linear equations and introduce a numerical algorithm for computing the coESS.

### The Models

#### The within-patch dynamics

Consider one patch in the landscape, say patch 𝓁. To model the dynamics of species *i* within this patch, let denote its density at time *t*, its intrinsic per-capita growth rate in the absence of other species, and its per-capita interaction rate with species *j*. These quantities determine the deterministic forces acting on species *i*. Specifically, the change in the density of species *i* over a small time step Δ*t* satisfies
where is the community state in patch 𝓁 at time *t*, and 𝔼[*X*|*Y*] denotes the conditional expectation of a random variable *X* with respect to the random variable *Y*. Thus, the expected instantaneous change of the species density is given by a Lotka-Volterra model.

To capture the role of stochastic forces, we assume that the variance in the growth of species *i* in patch 𝓁 over a time interval Δ*t* satisfies
where Var[*X* |*Y*] denotes the conditional variance of *X* with respect to *Y*. Taking the limit as Δ*t* gets infinitesimally small, the spatially uncoupled local population dynamics are given by the Itô stochastic differential equations (Gardiner, 2009; Oksendal, 2013)
where is a Brownian motion with mean 0 and variance .

#### The regional dynamics

The dynamics across *k* patches are coupled by the patch-selection strategies of each species and the spatial correlations in the environmental fluctuations. For the patch allocations, let denote the fraction of species *i* selecting patch 𝓁 Specifically, if is the regional density of species *i*, then the density of species *i* in patch 𝓁 equals Let denote the denote the regional densities for all of the species, denote the patch allocation of species *i*, and denote the patch allocation strategies for all of the species.

To account for the coupling of environmental fluctuations between patches, we assume that the per-capita growth rates of the species *i* in patches 𝓁 and *m* over a time interval of length Δ*t* satisfies
where Cov[*X, Y*| *Z, W*] denotes the covariance between random variables *X* and *Y* given the random variables *Z* and *W*. The covariance matrix for species *i* captures the spatial dependence between the temporal fluctuations in patches.

Under these assumptions, the community dynamics of the *n* species interacting in the *k* patches are given by the system of Itô stochastic differential equations

### Methods

To study coevolution of patch-selection strategies, we introduce several new methods. First, we characterize the mean densities of the species at stationary distributions for the community. Second, we introduce a definition of a coevolutionary stable strategy that is the stochastic analog for evolutionarily stable attractors for deterministic systems (Rand et al., 1994). Finally, we introduce a numerical method for solving for these coevolutionarily stable strategies.

#### Stationary distributions and stochastic growth rates

In order to describe the coevolution of patch allocation strategies, we need to identify when species coexist. Criteria for determining coexistence for these stochastic Lotka-Volterra model were developed by Hening and Nguyen (2018*a*); Hening et al. (2021), complementing earlier work for discrete-time models and continuous-time replicator equations (Schreiber et al., 2011). These criteria are described in Appendix A. Importantly, these invasion based criteria ensure that the species coexist about a unique stationary distribution (depending on ) with mean densities for all the species.

At this stationary distribution, *the local stochastic growth rate of species i in patch 𝓁* equals the difference between its average, local per-capita growth rate and one-half of the environmental variance experienced in patch 𝓁:
where
This local stochastic growth rate can be viewed as the continuous-time analog of the geometric mean of fitness, a standard metric of long-term population growth in temporally variable environments (Stearns, 2000). This local stochastic growth rate characterizes the rate of growth for a subpopulation of species *i* permanently restricted to patch 𝓁. If this local stochastic growth rate is negative, such a subpopulation of such individuals would exponentially decline to extinction. Whenever this occurs, the population in patch 𝓁 is a sink population. Alternatively, if this local stochastic growth rate is positive, then the local population of species *i* in this patch is a source population.

At the regional scale, *the regional stochastic growth rate of species i* at the stationary distribution equals zero. As this regional growth rate is given by the difference between the mean growth rate and one-half of the regional environmental variance experienced by species *i*, we have
where
Importantly, equation (5) is a system of linear equations that allows one to easily solve for the mean species densities . See Appendix A for a proof of (5).

#### Coevolutionary Stable Strategies and their characterization

To define a coevolutionarily stable strategy (coESS) of patch-selection, we consider a resident community of coexisting species playing patch-selection strategy . For one of these species, say species *i*′, a mutation arises leading to patch-selection strategy . If *y* is the regional population density of the mutant, then the resident-mutant community dynamics become
When mutant population density is low and the resident community coexist about a stationary distribution, the low-density growth rate (the *invasion growth rate*) of the mutant population against the resident community is
If , then the mutant is very likely to go asymptotically extinct. In particular, the probability of the mutant going asymptotically extinct is arbitrarily close to one when its initial density is arbitrarily small (see Appendix B for a precise statement and proof).

We define to be a *coevolutionary stable strategy (coESS)* if for any species 1≤ *i*′ ≤ *n* and non-resident strategy (see Appendix B). Namely, any subpopulation of any species playing a mutant strategy tends toward extinction with high probability. This definition is the stochastic analog of evolutionarily stable attractors for deterministic systems given by Rand et al. (1994). When the covariance matrices Σ_{i} are non-degenerate, we show in Appendix B that it suffices to check the weaker condition: for all *i*′ and . Hence, unlike in the deterministic models (see, e.g., Rand et al. (1994); Cressman et al. (2004); Křivan et al. (2008)), verifying this Nash equilibrium condition is sufficient to ensure is a coESS.

#### Analytical and numerical approaches for the coESS

Our Nash equilibrium condition for the coESS and the explicit analytical expressions for the invasion rates can be used in conjunction with the method of Lagrange multipliers to identify a necessary condition for the coESS. This result and its implications are presented in the results section.

To solve for the coESS numerically, we derived (see Appendix C) an evolutionary dynamic on the strategy space for all of the species in which small mutations occurring at a rate *ν* randomly shuffle the “infinitesimal” weights of our species’ patch selection strategy. This results in a replicator-type equation
Equation (8) is a multispecies version of the trait dynamics derived in (Schreiber, 2012). In Appendix C, we show that equilibria of (8) satisfy the derivative conditions for a coESS. We simulate (8) using the deSolve package from R (Soetaert et al., 2010). In all cases, these simulations converged to an equilibrium that satisfied the necessary conditions for a coESS.

## Results

We begin by presenting a characterization of the coESS and its implications for any number of species. This characterization provides answers to the questions: Under what conditions, as for the classical ideal-free theory, are the local per-capita growth rates equal in all occupied patches for a given species within the community? More generally, what can be said about the local per-capita growth rates in the occupied patches? Under what conditions is there selection for sink populations? After answering these questions, we focus on models of antagonistic interactions.

### Characterization of the coESS and General Implications

#### The coESS balances local contributions to the regional stochastic growth rates

To characterize the coESS, recall that the regional stochastic growth rate of species *i* equals the difference between its mean regional growth rate and one-half of its regional environmental variance . The mean regional growth rate is the weighted combination of the local mean growth rates i.e., . The variance *V*_{i} can be expressed as a weighted sum of covariance terms. Let be the covariance between the environmental fluctuations experienced by species *i* in patch 𝓁 and the environmental fluctuations experienced by a randomly chosen individual of species *i* i.e. the regional environmental fluctuations experienced by species *i*. This covariance equals
The regional variance *V*_{i} equal s the weighted sum of these covariances,
For each species playing the coESS, we show that the difference between the local contributions to the mean regional growth rate and the regional variance are equal in all occupied patches (Appendix D). Moreover, the common value of these differences equals the difference between the regional growth rate *M*_{i} and the regional variance *V*_{i}. Mathematically,
Equation (9) implies that occupied patches with higher mean growth rates contribute more to the regional environmental variance. Intuitively, if there were a patch that contributed relatively more to the mean growth rate than the regional environmental variance, then a mutant subpopulation allocating more individuals to this patch would increase their regional mean growth rate and decrease their regional environmental variance. Thus, this mutant could invade. For the unoccupied patches, inequality (9) is strict whenever Σ_{i} is non-degenerate, e.g. the environmental fluctuations for species *i* are positive in all patches and no pair of patches has perfectly correlated environmental fluctuations.

Using the coESS conditions (9), we can answer three questions about patch selection: When is there selection for an ideal-free distribution? When is there selection for spatial buffering? When is there selection for sink populations?

#### When is there an ideal-free distribution?

For deterministic environments, the ideal-free distribution for a species implies that the per-capita growth rates are equal in all occupied patches and lower in unoccupied patches. In fluctuating environments, we can ask: when are the local stochastic growth rates equal in all occupied patches? As the non-local quantities in coESS conditions (9) need not equal the local stochastic rates , this property of the ideal-free distribution is generally not satisfied. One important exception occurs when the environmental fluctuations are perfectly correlated and have the same magnitude across all patches, i.e. are equal for all 𝓁, *m*. In this case, the covariances , the local variances , and the regional variance *V*_{i} are all equal. Consequently, the coESS condition (9) implies that the local stochastic growth rates equal zero in all of the occupied patches.

#### When is there spatial buffering?

The regional variance experienced the by the population is reduced when there are negative covariances between the environmental fluctuations within a patch and the environmental fluctuations experienced by a randomly chosen individual of the population. The coESS condition (9) provides some insights into when such buffering occurs. As the regional stochastic growth rate *M*_{i} − *V*_{i}*/*2 equals zero, the difference *M*_{i} − *V*_{i} equals a negative quantity −*V*_{i}*/*2. Hence, in patches acting as buffers (i.e. ) for a species playing the coESS, the local mean population growth rate must be negative (i.e. and implies that ). In contrast, patches for which the mean growth rate is positive do not act as buffers (i.e. and implies that ).

#### When are there sink populations?

When the covariance matrix Σ_{i} for species *i* is non-degenerate, there is a fundamental dichotomy exhibited by the coESS for species *i* (Proposition D.1 in Appendix D): either (i) only one patch is occupied, or (ii) more than one patch is occupied and the local stochastic growth rates are negative in the occupied patches. Thus, if species *i* occupies multiple patches at the coESS, then all of its populations are sink populations despite it persisting regionally. This occurs as species playing the coESS exhibits a form of spatial bet-hedging that results in the regional stochastic growth rate being greater, specifically zero, than the local stochastic growth rates.

Our coESS condition (9) (Proposition D.2 in Appendix D) implies that outcome (i) of this dichotomy occurs only if there is a patch 𝓁 such that
Namely, the local stochastic growth rate in each unoccupied patch *m* is sufficiently negative relative to the variance between the environmental fluctuations in this unoccupied patch *m* and the occupied patch 𝓁. To better understand (10), consider the case where the environmental fluctuations for species *i* in all patches have variance *σ*^{2} and spatial correlation *ρ*, i.e. for all patches 𝓁 and for 𝓁 ≠ *m*. Then, condition (10) requires that the local stochastic growth rates in all unoccupied patches *m* are less than −*σ*^{2}(1 −*ρ*). All else being equal, this condition is more likely to hold when the environmental fluctuations across patches are strongly, positively correlated (*ρ* ≈ 1).

### Predator-prey coevolution

Antagonistic interactions, such as the interactions between predators and their prey or between competing species, can result in reciprocal selection pressures. Here, we investigate how this reciprocal evolution can either lessen the antagonism by selecting for divergent choices in patch use, or enhance the antagonism by selecting for convergent choices in patch use.

We begin with a predator-prey system where *x*_{1} and *x*_{2} are the regional densities of the prey and predator, respectively. The intrinsic per-capita growth rate of the prey in patch 𝓁 is *r*^{𝓁}. The predator’s attack rate, conversion efficiency, and per-capita death rates in all patches equal *a, c*, and *d*, respectively. Both species experience weak intraspecific competition with strength *ε*. Under these assumptions, the Lotka-Volterra model takes on the form
In Appendix E, we derive criteria which characterize when the species coexist regionally, and find explicit expressions for the mean densities of the species at stationarity and the invasion growth rates . Here, we focus on two cases: a simple two-patch sink-source system and an environmental gradient for the prey.

#### A two-patch source-sink system

Consider a landscape where the prey has a source habitat (patch 1 with *r*^{1} = *r*_{source} *>* 0) and a sink habitat (patch 2 with *r*^{2} = −*r*_{sink}). The sink habitat is low quality but exhibits minimal environmental fluctuations , while the predator and prey experience environmental fluctuations in the source habitat with variances *v*_{prey} and *v*_{pred}, respectively.

First, we study the effects of environmental stochasticity on the species individually and then collectively. If only the prey experiences environmental stochasticity in the source patch (*v*_{prey} *>* 0 and *v*_{pred} = 0), then the coESS has neither species occupying the sink patch for low values of *v*_{prey}, the prey occupying both patches at intermediate values of *v*_{prey}, both species occupying both patches at higher values of *v*_{prey}, the predator no longer occupying the source patch at even higher values of *v*_{prey} and, finally, extinction of both species when *v*_{prey} is too high (Figure 1A,B).

More specifically, when the environmental variance in the source patch is sufficiently low relative to the rate of loss in the sink patch (*v*_{prey} *<* 2*r*_{sink}), inequality (10) implies the prey only occupies the source patch. As the coESS condition (9) requires that the growth rate of the predator is equal to zero in any patch it occupies, the predator also only occupies the source patch. When the environmental variance in the source patch exceeds 2*r*_{sink}, the coESS conditions (9) imply that the fraction of prey living in the sink patch equals
Equation (12) implies that the fraction of prey in the sink patch increases with the environmental variance *v*_{prey} in the source patch (Figure 1A). As the predator regulates the mean prey density in the source patch to the predator’s break-even point , selection for prey using the sink patch results in higher mean prey densities (Figure 1B, Appendix E). These trends continue with increasing variation in the environmental fluctuations until 50% of the prey make use of the sink patch.

When the environmental stochasticity in the source patch selects for the prey being equally distributed between the patches (i.e 8*r*_{sink} ≤ *v*_{prey} ≤ 8*r*_{source}*/*3 and 3*r*_{sink} ≤ *r*_{source}, Appendix E), the predator evolves to use both patches. The fraction of predator using the sink patch equals
Equation (13) implies the fraction *f*_{pred} of predators in the sink patch increases with the environmental stochasticity *v*_{prey} experienced by the prey. As the predator does not directly experience environmental stochasticity, it regulates the prey density, on average, to its break-even point in both patches. Hence, for this range of environmental variation, the mean regional density of the prey is twice as high as when both species only reside in the source patch (Figure 1B). In contrast, the predator’s mean regional density decreases with increasing variation in the environmental fluctuations (Figure 1B).

When the variation in the environmental fluctuations are sufficiently large but not so large as to cause extinction, the predator evolves to only use the sink patch (i.e. *f*_{pred} = 1) while the prey continues to use both patches. When this occurs, the fraction of prey making use of the sink patch equals (Appendix E)
Equation (14) implies the fraction of prey in the sink patch continues to increase with increasing variation of the environmental fluctuations. In contrast, the mean regional prey density decreases with the environmental variance (Figure 1B, Appendix E). When the environmental fluctuations are sufficiently strong, , both species go extinct.

When only the predator experiences environmental stochasticity in the source patch (*v*_{pred} *>* 0 and *v*_{prey} = 0), the coESS condition (9) implies that the prey’s growth rate is zero in all occupied patches. Consequently, prey playing the coESS only occupy the source patch. Despite a victimless sink patch, there is selection for the predator to occupy the sink patch whenever the environmental variance in the source patch is at least two-fold greater than the predator’s per-capita death rate i.e. *v*_{pred} *>* 2*d*. Under these circumstances, the fraction of predators using the sink patch equals
Equation (15) implies greater environmental variation in the source patch selects for greater use of the sink patch (Figure 1C). When the predator makes use of the sink patch, the mean regional density of both species playing the coESS increases with the environmental variance in the source patch (Figure 1D, Appendix E). Intuitively, as the environmental fluctuations increase, the predator has a higher break-even prey density in the source patch that determines the mean prey density. These higher prey densities, in turn, lead to higher mean predator densities.

Figure 2 illustrates the effects of simultaneous environmental variation on both species on the coESS. Consistent with the predictions from varying environmental stochasticity for only one species, high environmental variation for the predator selects for victim-less sinks when variation for the prey is sufficiently low, and selects for both species using both patches when this variation is sufficiently high. In contrast, low environmental variation for the predator selects for enemy-free sinks, both species using the sink patch, and enemy-free sources with increasing levels of environmental variation for the prey.

#### Patch-selection along an environmental gradient

Using our numerical algorithm, we examined patch-selection along a gradient of environmental fluctuations. Along this gradient, the environmental variance experienced by both species decays in a Gaussian manner (Figure 3A). In the center of the landscape where environmental fluctuations are strongest, the patches are sinks (patches between dashed vertical lines in Figure 3. When the environmental fluctuations are spatially uncorrelated, all patches are occupied by both species but the species exhibit contrary choices (Figure 3B). Spatial correlations in the environmental fluctuations selects for both species exhibiting reduced preferences and lower densities in the most central patches (Figure 3C,D). When these spatial correlations are sufficiently strong, neither species occupies the central patches consistent with the general prediction of approaching an ideal free distribution (Figure 3D). For intermediate spatial correlations, only the predator avoids the central patches creating enemy-free sinks (Figure 3C).

### Exorcising the ghost of competition past

To understand how spatial-temporal heterogeneity selects for spatial distributions of competing species, we examine a model of two species competing in *k* patches. The intrinsic rate of growth of species *i* in patch 𝓁 is given by . We assume that the average per-capita growth rates decrease linearly with the local density of both competitors. Namely, the average percapita growth rate of species *i* in patch 𝓁 equals . Thus, the regional dynamics are
For this model, the species, in general, can not coexist locally: the species with the larger intrinsic stochastic growth rate in patch 𝓁 excludes the other species in the absence of immigration. Regional coexistence, however, is possible in a multi-patch landscape. In Appendix F, we derive criteria which characterize when the species coexist regionally, the mean equilibrium densities of the species at the associated stationary distribution, and explicit expressions for the invasion rates of mutant strategies against resident strategies. Here, we focus on two cases: two species in a spatially symmetric landscape and three species living along an environmental gradient.

#### Competition along a symmetric landscape

Imagine a symmetric landscape with an even number of patches where each species has the competitive advantage in half of the landscape. The average per-capita growth rate for the species *i* in the patches where it is competitively superior equals and equals in the patches where it is competitively inferior. Each species experiences spatially uncorrelated, environmental fluctuations with local variance *v*.

By symmetry, any coESS for the competing species satisfies that a fraction *f* of individuals use the patches where they have competitive disadvantage (sink patches), and the complementary fraction 1 − *f* use the patches where they have a competitive advantage (source patches). At the coESS (see Appendix F for details), each species only uses the source patches (i.e. *f* = 0) if
Equation (17) implies that if the environmental variance *v* is too low relative to the number of patches, or the fitness difference Δ*r* is too large, then evolution selects for the competitors to be spatially segregated i.e. the ghost of competition past prevails (left-hand and right-hand sides of Fig. 4A,C, respectively).

When environmental fluctuations are sufficiently large (i.e. inequality (17) is reversed), evolution selects for both species to use both patch types with
i.e. the ghost of competition past is partially exorcised. Equation (18) implies that the majority of individuals (i.e. 1 −*f >* 1*/*2) occupy their source patches. However, for smaller fitness differences Δ*r* or higher levels of environmental variation *v*, evolution selects for both species to be spread more equally across the patches (i.e. right-hand and left-hand sides of Fig. 4A,C, respectively).

Whether sink patches are occupied or not, the mean regional density of each competitor equals
When the competitors are spatially segregated (i.e. *f* = 0), the equilibrium density is a decreasing linear function of the environmental variation (Fig. 4B). Selection for the use of both patch types (i.e. *f >* 0) results in a nonlinear, accelerated, negative response of mean density to increasing environmental variation.

#### Three species competition along an environmental gradient

Using our numerical algorithm, we also explored coevolution of patch selection for three competing species along an environmental gradient (Figure 5). Along this gradient, the species differed in their intrinsic rates of growth and experienced the same amount of environmental stochasticity (Figure 5A). In the absence of environmental fluctuations, the coESS corresponds to an ideal free distribution resulting in each species only occupying the patches in which their intrinsic stochastic growth rates are positive and in which they are competitively superior (Figure 5B). Notably, the species are spatially segregated and occupy no sink patches. In the presence of environmental fluctuations, each patch is occupied by at least two species – the ghost of competition past is partially exorcised (Figure 5C). Moreover at the center and edges of the landscape, all three species co-occur. At the edges, the co-occuring species are sink populations.

## Discussion

Unlike classical ideal-free theory that predicts selection against sink populations under equilibrium conditions (Fretwell and Lucas, 1969; Křivan et al., 2008), we find that coevolution in fluctuating environments often selects for metacommunities consisting entirely of sink populations. The difference stems from what selection equalizes across the occupied landscape under equilibrium versus non-equilibrium conditions. Under equilibrium conditions, the per-capita growth rate of all populations are equal to zero in occupied patches and negative in unoccupied patches. Hence, there are no sink populations. In landscapes with environmental stochasticity, coevolution of patch-selection no longer equalizes the mean per-capita growth rates in occupied patches. Instead, the differences between the means of the local per-capita growth rates and the covariance between the local and regional fluctuations are equalized. Whenever there is selection for occupying multiple patches, equalizing these differences sacrifices higher mean growth rates for lower variances of these growth rates and results in negative stochastic growth rates in all occupied patches. This spatial bet-hedging that can be understood through the lens of the Modern Portfolio Theory (MPT) of economics (Markowitz, 1952, 1991; Rubinstein, 2002; Markowitz, 2010), as we discuss below. The resulting sink populations may be conditional due to the presence of antagonistic interactions, or unconditional. In particular, environmental stochasticity coupled with predator-prey interactions can select for enemy-free sinks and victimless sinks (Jeffries and Lawton, 1984). Alternatively, environmental stochasticity coupled with competitive interactions can select for conditional sink population by partially exorcising the ghost of competition past (Lawlor and Maynard Smith, 1976; Connell, 1980; Schmidt et al., 2000).

### Relation to Modern Portfolio Theory

Modern Portfolio Theory (MPT) (Markowitz, 1952, 1991, 2010) is a Nobel prize winning framework for assembling a portfolio of financial investments. In this framework, each investment has a mean return and some level of risk characterized by the variance in the return. In our context, investments correspond to patches, mean returns correspond to mean per-capita growth rates, and risks correspond environmental variances (Figure 6A). A patch-selection strategy (Figure 6B) is analagous to a portfolio of investments i.e. a fixed allocation of assets across the investments. Like the regional mean growth rate *M*_{i} and environmental variance *V*_{i} associated with a patch-selection strategy, a portfolio of investments has a mean return and a variance of its return. Like bet-hedging theory from evolutionary biology (Cohen, 1966; Childs et al., 2010), MPT assumes there is a trade-off between the mean *M* and the variance *V* of an investment: an investor takes on riskier investments only if greater returns are expected and, conversely, takes on investments with lower expected returns only if there is less risk. Markowitz (1952) showed that for a given level of risk *V*, there are portfolios maximizes the mean return *M* for that level of risk. The curve of means and variances determined by these portfolios is the efficient frontier (solid curves in Figure 6C,D). Markowitz (1952) showed that the efficient frontier also corresponds to the portfolios minimizing an investor’s risk for a given mean return. In our context, the coESS patch-selection strategy must be a point on the efficient frontier (white circles in Figure 6C,D). Indeed, if it wasn’t, there would be an alternative patch-selection strategy either providing lower risk for the same mean return or providing a greater mean return for the same amount of risk. In either case, such a patch-selection strategy would have a higher regional stochastic growth rate *M*_{i} − *V*_{i}*/*2 than residents playing the coESS – contradicting the definition of a coESS. By lying on the efficient frontier, the coESS typically sacrifices a higher regional mean growth rate for a lower regional variance (all the local mean growth rates are greater than the mean growth rate of the coESS in Figure 6C,D). Hence, the coESS typically is a bet-hedging strategy (Childs et al., 2010). Moreover, as the regional stochastic growth rate *M* −*V/*2 is zero, the coESS corresponds to the point on the efficient frontier that is tangent to the *M* = *V/*2 line (see white circle and dashed lines in Figures 6C,D) – in economic terms, a tangent portfolio associated with a risk-free, zero return asset. Whenever multiple patches are occupied at the coESS, all the points in the mean-variance plane corresponding to the individual patches (i.e. individual investments) lie below efficient frontier and, consequently, have negative local stochastic growth rates (see shaded circles in Figures 6C,D). Hence, all patches are occupied by local sink populations.

### Ghosts of past and present antagonisms

Patches free of antagonistic interactions may reflect habitat selection in response to past antagonisms within a patch or present antagonisms in other patches. Spatial heterogeneity can select for ghosts of competition past or enemy-free space by creating spatial mosaics of environmental conditions favoring one species over another (Lawlor and Maynard Smith, 1976; Rosenzweig, 1981, 1987; Schreiber et al., 2000; Schreiber and Vejdani, 2006). Our results demonstrate that environmental stochasticity can reverse or amplify these outcomes.

We find that environmental stochasticity can partially exorcize the ghost of competition past. Under equilibrium conditions, ideal-free competitors only occupy habitat patches in which they are competitively superior (Lawlor and Maynard Smith, 1976; Connell, 1980; Rosenzweig, 1981, 1987). When environmental fluctuations are sufficiently large relative to fitness differences between the competing species, we find that there is selection for competitors occupying patches in which they are competitively inferior – conditional sink populations. Using computer simulations, Schmidt et al. (2000) observed a similar exorcism of the ghost of competition past for discrete-time, two patch models of two competing species. Our results provide an analytical extension of their work to any number of patches and any number of competing species. Moreover, we find that along environmental gradients, environmental stochasticity can select for several competitors occupying sink habitat patches at the edges of these gradients i.e. unconditional sink populations. This simultaneous selection for conditional and unconditional sink populations can result in complex species distributions along an environmental gradient e.g. species disappearing and reappearing along the gradient. Similar complex patterns have been observed along elevational gradients in birds (Noon, 1981; Campos-Cerqueira et al., 2017). For example, on Camel Hump’s Mountain, the hermit thrush (*Catharus guttatus*) is most common at lower (400m) and higher (800m) elevations but is less common at intermediate (600m) elevations (Noon, 1981). Whether or not environmental fluctuations play a role in these empirical patterns remains to be understood.

Our results highlight how environmental fluctuations can select for enemy-free space in two ways. First, environmental fluctuations in higher quality habitat may select for prey using lower quality habitats and, thereby, create unconditional sink populations. If these lower quality habitats only support low prey densities and the predators are less sensitive to the environmental fluctuations, then the predators may evolve to only occupy the higher quality habitat. Thus, the lower-quality habitat becomes enemy-free space. In this case, the spatial bet-hedging by the prey creates the enemy-free space. An alternative pathway to enemy-free space occurs when both species are sensitive to the environmental fluctuations and the intensity of these fluctuations vary across the landscape. This spatial variation can select for contrary choices – prey selecting patches with greater risk and predators selecting patches with lower risk. This form of selection for enemy-free space is a stochastic analog of fixed spatial heterogeneity selecting for contrary choices (Fox and Eisenbach, 1992; Schreiber et al., 2000, 2002; Schreiber and Vejdani, 2006): prey select lower quality patches to lower the reproductive success of their predators and predators selecting high quality patches to maximize their per-capita reproductive success.

### Eco-evolutionary hydra effects

Our results on predator-prey coevolution illustrate how environmental stochasticity drive hydra effects over evolutionary time. Named after the mythological beast who grew two heads to replace a lost head, a hydra effect occurs when a population’s mean density increases in response to an increase in its per-capita mortality rate (Abrams, 2009; Sieber and Hilker, 2012; Cortez and Abrams, 2016). For example, Abrams (2009) found that increasing the per-capita mortality rate of a predator with a type II functional response could increase the predator’s mean density. Similar to increasing per-capita mortality rates, increasing environmental stochasticity (*σ*^{2}) reduces stochastic per-capita growth rates (from *μ* to *μ* − *σ*^{2}*/*2) and, consequently, often has negative impacts on population densities (Lande et al., 2003). For example, for Lotka-Volterra predator-prey dynamics with environmental stochasticity, increasing environmental stochasticity experienced by the predator decreases its mean density (May, 1975) (see, also, the mean density expressions in Appendix E). However, we find that if there are sink patches and the predator’s patch selection strategy evolves, then increasing environmental stochasticity can result in the mean predator density increasing (Figure 1D). Intuitively, sufficiently high environmental stochasticity selects for the predator to hedge its bets by occupying the sink patch. This spatial bet-hedging lowers the predation pressure on the prey in the source habitat resulting in an increase ov the mean prey density and a corresponding increase in the mean predator density. We found similar hydra effects when the prey experiences increasing levels of environmental stochasticity (Figure 1B).

### Caveats and future directions

To simultaneously confront the complexities of species coevolution in a spatially and temporally-variable environment, we made several simplifying assumptions. Relaxing these assumptions provide significant challenges for future research. Most importantly, our framework assumes that species do not assess or respond to temporal changes in habitat quality; they exhibit a fixed spatial distribution. While this assumption is a good first-order approximation frequently made in the theoretical literature (Hassell et al., 1991; van Baalen and Sabelis, 1993; Holt, 1997; Jansen and Yoshimura, 1998; Schmidt et al., 2000; Schreiber et al., 2000; Schreiber and Vejdani, 2006; Schreiber, 2012), spatial distributions typically vary in time in response to environmental fluctuations. Hence, a major challenge for future work is developing methods to study the evolution of dispersal rates in spatially explicit and temporally variable landscapes. While there has been extensive analytical and numerical work on this question for single species (Levin et al., 1984; McPeek and Holt, 1992; Hutson et al., 2001; Ronce, 2007; Cantrell and Cosner, 2018; Cantrell et al., 2021), much less work exists for interacting species (see, however, the numerical work in (Schreiber and Saltzman, 2009)).

As most ecological communities reside in spatially and temporally variable environments, we might expect that many of our qualitative predictions occur in nature. However, as noted by Urban et al. (2020), “to date, few empirical studies completely evaluate eco-evolutionary interactions in space through field manipulations, and even fewer test for underlying mechanisms.” Ideally, to test the theory presented here, one would collect data on spatial and temporal variation in species demographic rates, interaction strengths, and densities over sufficiently long time frames. Alternatively, one could evaluate if key ingredients of conditions and consequences hold for interacting species occur over some environmental gradient or patchy landscape. For example, our results predict that greater environmental fluctuations will select for greater range overlap of competing species. Hence, one could attempt a meta-analysis similar to Urban et al. (2020) to evaluate across multiple competitive metacommunities whether such a correlation exists, ideally controlling for the degree of spatial heterogeneity across the landscape. Such analyses could identify whether or not reciprocal selection among interacting species give rise to some of outcomes predicted by our theory.

## Appendix A. Stochastic Coexistence

The last two authors developed in Hening and Nguyen (2018*a*); Hening et al. (2021) methods for the study of very general population models of the form
where **E**(*t*) = (*E*_{1}(*t*), …, *E*_{n}(*t*))^{T} = Γ^{⊤}**B**(*t*), Γ is a *n* × *n* matrix such that Γ^{⊤}Γ = Σ = (*σ*_{ij})_{n×n} and **B**(*t*) = (*B*_{1}(*t*), …, *B*_{n}(*t*)) is a vector of independent standard Brownian motions. The long term behavior of the system is described by the invariant probability measures living on the boundary where and .

Let ℳ be the set of ergodic invariant probability measures of supported on the boundary . By the Ergodic Decomposition Theorem the invariant measures of will be exactly the convex combinations of ergodic measures, Conv(ℳ). For every invariant measure *μ* we can define the Lyapunov exponents

According to whether *r*_{i}(*μ*) *>* 0 or *r*_{i}(*μ*) *<* 0, if spends a long time close to the support of *μ*, its *i*th component will get repelled from or attracted towards the face *x*_{i} = 0. Under some natural assumptions, it was shown in Hening and Nguyen (2018*a*) that if every *μ* ∈ Conv(ℳ) is a repeller, i.e. max_{i} *r*_{i}(*μ*) *>* 0 then the species persist in probability (see Hening and Nguyen (2018*c*)): For any *ε >* 0, there exists a compact set such that
Instead, if there exists an *μ* ∈ ℳ which is an attractor i.e. where tells us which indices lie outside the support of *μ* (if *i* is in the support of *μ* then *r*_{i}(*μ*) = 0), then with strictly positive probability we will have the convergence of to *μ* and therefore the extinction of some species.

If has an invariant probability measure on then, by Hening and Nguyen (2018*a*); Hening et al. (2021) we have
In the specific setting from (3), if we set , then (20) implies that these average densities have to satisfy the system
which is equivalent to (5).

## Appendix B. Characterizing the coESS

Coevolutionary Stable Strategies. To characterize a coESS of patch allocation, we consider the situation where mutations arise in a subset, *M* ⊂ {1, 2, …, *n*}, of the species. For these mutant species *i* ∈ *M*, let denote their patch allocation strategy and *y*_{i} their total population density. The dynamics of this augmented community are given by
and let and For an *n* × *n* symmetric matrix *Q*, define (note that the supremum is taken over nonpositive vectors)

*(Boundedness) For any* , *let A*_{p} = (*a*_{ij})_{n×n} *where*
*There exists a diagonal matrix* *with positive diagonal entries such that*

The next result shows that the boundedness assumption is satisfied for the examples we consider in the main text.

*Assumption B.1 holds for the predator-prey model* (28) *and for the competitive model* (16).

*Proof*. In the predator-prey model (28) we have

If we set then
Similarly, since all the interaction coefficients of the competition model (16) are negative, by setting *C*_{p} = diag(1, 1) one can show that

□

*(Persistence) For any invariant probability measure ν on*

*we have*

*where*

If *μ* is an invariant probability measure, define
where . Note that the will be solutions to (5).

*(coESS) For any ergodic invariant probability measure μ of* (3) *on* *we have*
*for any q*_{i} ≠ *p*_{i}.

*Suppose the strategy p satisfies Assumptions B.1 and B.2. Then the system* (3) *is persistent. If, in addition, the strategy p satisfies Assumption B.3, then for any set M* ⊂ {1, …, *n*} *of mutants with* *for i* ∈ *M and ε >* 0, *there exists δ >* 0

*such that if y*

_{i}(0) ≤δ

*for all i, y*

_{i}(0) = 0

*for i with p*

_{i}=

*q*

_{i},

*and x*

_{i}(0)

*>*0

*for all i then with probability greater than*1 −

*ε the mutants go asymptotically extinct, i.e. y*

_{m}(

*t*) → 0

*as t*→ ∞,

*and the residents persist, i.e. x*

_{i}(

*t*) ↛ 0

*as t*→ ∞

*for all i*.

*Proof*. Consider the system (21). Define
and

If ℒ is the generator of the process we have
where . Using Assumption B.1
As a result we can find *K*_{1}, *K*_{2} *>* 0 such that
When **y** = 0, (23) implies that (Hening and Nguyen, 2018*a*, Assumption 1.1) holds. Note that Assumption B.2 is exactly (Hening and Nguyen, 2018*a*, Assumption 1.2). As a result, we can apply (Hening and Nguyen, 2018*a*, Theorem 4.1) in order to get that (3) is persistent.

Next, suppose that Assumption B.3 also holds. Under Assumptions B.2 and B.3, and the arguments from the begining of Section 5 in Hening and Nguyen (2018*a*), we can find sufficiently small constants such that
for any invariant measure *μ* of on . Consider the function
Because of (23), we can show that there is *H >* 0 such that
In view of (24) an d(25) and the arguments from Proposition 5.1 and Theorem 5.1 in Hening and Nguyen (2018*a*), we can show that there exist *δ >* 0, *T >* 0, *θ >* 0 such that for any starting point
where
The proof can be finished by proceeding in the same manner as in (Hening and Nguyen, 2018*a*, Theorem 5.1 and Lemma 5.9).□

*Suppose the covariance matrices* *are non-degenerate. If there exists*

*such that* *for all i and* *then* *is a co-ESS*.

*Proof*. Once we fix *p* the quadratic maximization problem under the constraint Σ*q*_{i} = 1 has a unique maximum because the covariance matrix is positive definite. Since, by assumption , and the unique maximum is at This implies that if Therefore, is a co-ESS.□

## Appendix C.

As getting an explicit tractable form of the coESS is difficult, we introduce a coevolutionary dynamic that can be used to solve for the coESS numerically. The basic idea behind the coevolutionary dynamic is that mutations arise in each species. These mutations randomly reallocate time spent in one patch with time spent in another patch. This reassignment is only “adopted” by species *i* if it increases its invasion growth rate . More formally, if time is discretized into units of length *ϵ >* 0 and *e*^{𝓁} denotes the standard unit vector whose 𝓁-th component is 1 and remaining components are 0, then a mutation from to occurs with probability and establishes with probability
where *x*^{+} = max {0, *x*} denotes the positive part of a real number. The establishment probability is consistent with standard branching process approximations. The mutation probability is a choice of convenience. More general forms of mutation probabilities can be used. More general scalings proportional to *ϵ* simply correspond to rescaling time. Under these assumptions,
Hence, dividng by *ϵ* and taking the limit as *ϵ* → 0 yields
as claimed in the main text. Moreover, as
we have that
which provides explicit expressions for the coevolutionary dynamics.

We claim that if for all 𝓁 and , then for all 𝓁 with *t* ≥ 0 and for all *t* ≥ 0. This claim follows from two observations. First, the system of equations is conservative as . Hence, if , then for all *t* ≥ 0. Second, since whenever for *t* provided that .

Finally, consider any equilibrium of the coevolutionary dynamic. If we have a species *i* such that for all 𝓁, then
for all 𝓁. Moreover,
where the final inequality follows from the fact that at the stationary distribution.

## Appendix D.

To derive a necessary condition for a co-ESS, we can use the method of Lagrange multipliers. Due to the constraint , any co-ESS must satisfy
for any *i* and pair of occupied patches 𝓁, 𝓁′ by species *i* i.e. . Computing these derivatives we get
when . Now, if we multiply everything by and sum over 𝓁′ we get, using equation (5), that the coESS must satisfy

*If the covariance matrix for species i is non-degenerate, then the local stochastic growth rates (at the coESS) are negative in all patches* 𝓁 *occupied by species i, as long as more than one patch is occupied:* *when* . *If* *then* . *As a result, all occupied patches are sinks or pseudo-sinks for species i*.

*Proof*. Combine Lemma D.1 below with the first equation from (9).□

*Let* *be a vector in the k dimensional simplex* Δ, *so* , . *Let* 𝓁 ∈ {1, …, *k*}. *Define*
*Then* , *and* *for m* ≠ *ℓ*.

*Proof*. Since constant terms do not change where the maximum of an expression will be, we will drop the term , and look at

Since Σ is positive definite we can write it as Σ = Γ^{t}Γ for Γ invertible. Let *X* be the unit vector in the 𝓁 –th direction i.e. *X*_{𝓁} = 1 and *X*_{m} = 0 for *m* ≠ 𝓁. Then the maximization problem can be written as:
subject to *p* ∈ Δ. Now simplify the expression by defining *Y* := Γ*p*, and *L* := Γ*X*. Since Γ is invertible we rewrite the maximization problem as
subject to the Γ^{−1}*Y* ∈ Δ. Finding the maximizing *Y* is equivalent to finding the maximizing *p* in the previous expression.

Let *Ŷ* = *Y/*‖*Y* ‖be the unit vector in the direction of *Y* and *y* = ‖*Y* ‖. The maximization problem becomes
subject to Γ^{−1}*Y* ∈ Δ. It is clear that *y >* 0. We can therefore see that, given any fixed *y >* 0, the maximum is when *Ŷ* is parallel to *L*. This implies that and *X* are parallel, and from the sum condition, we deduce that in fact .□

*Only one patch is occupied, say patch ℓ, by species i at the coESS if and only if*
*Proof*. Suppose that for the coESS for species *i*. Consider any probability vector such that . Define

Taking the derivative with respect to *ε* and evaluating at *ε* = 0, the coESS must satisfy
where the second line follows from the local stochastic growth rate of species *i* equally zero in patch 𝓁 if that is the only patch being occupied. By linearity, this inequality holds for all choices of with if and only if it holds for all satisfying for *m* ≠ 𝓁.□

*If the covariance matrix is a positive diagonal matrix for species i, then* *for any patch* 𝓁 *not occupied by species i (i.e*. *). In particular, this implies that there are no unoccupied stochastic sinks for species i, i.e. patches where* *and* .

*Proof*. We want to maximize
with the constraint and . Let and We know that the maximum is at . It has to satisfy the conditions

If and using that Σ is diagonal together with (26) and (9) we get that and □

## Appendix E.

The general model for predator-prey interactions considers a predator with regional density *x*_{2} and its prey with regional density *x*_{1}. In each patch, the prey exhibit an intrinsic rate of growth *r*^{𝓁} and intraspecific competition coefficient . The predator, in patch 𝓁, attacks the prey with an attack rate *a*^{𝓁}, experiences a per-capita death rate *d*^{𝓁}, and an intraspecific competition coefficient . Prey captured in patch 𝓁 are converted with efficiency *c*^{𝓁} to predator offspring. The predator-prey dynamics become
The predator-prey model persists if
and
This result follows from Appendix A or from Hening and Nguyen (2018*c*). At stationarity
and
The invasion rate for a mutant prey is
while the invasion rate for a mutant predator becomes
The strategy is a coESS if for all *q* ≠ *p*
and
By the criterion from (27), a necessary condition for *p* to be a coESS is that for *i* = 1, 2
This means that
and
We next look at some specific examples.

Suppose and and if (*m, l*) ≠ (1, 1) . In this setting (29) and (30) become
and

If *v*_{prey} *<* 2*r*_{sink} = 2*r*^{2} then (32) implies that which, combined with (33), implies that .

If *v*_{prey} *<* 2*r*_{sink} = 2*r*^{2} and then (32) leads to . This formula holds true until
When , (31) and (32) become
The above system has solutions satisfying and if and only if
If then (31) implies that . Using (31) again we get that
Meanwhile, decreases as *v*_{prey} increases.

When and and if (*m, l*) ≠ (1, 1) for *b* ∈ {*a, c, d*}, *l* = 1, 2, *r*^{1} = *r*_{source} *>* 0 and *r*^{2} = −*r*_{sink} *<* 0, (29) and (30) become
and

Since *r*^{2} = −*r*_{sink} *<* 0, it follows from (34) that . Then, due to (36) if *v*_{pred} ≥ 2*d*.

## Appendix F.

The two species coexist if the following two conditions hold
At stationarity we get
and
A necessary condition for a coESS is that for all strategies *q* = *p*
We get that a necessary condition for *p* to be a coESS is that for *i* = 1, 2
Now we analyze the symmetric case discussed in the main text. In this case, there is an even number of patches *k* = 2*m* for some *m*. As stated in the main text, the per-capita growth rate for the species with competitive advantage is greater than the per-capita growth rate *r* of the species with competitive disadvantage, for 𝓁 ∈ *S*_{i}, and for 𝓁 ∉ *S*_{i}. We also assume that the covariance matrix for both species is Σ_{i} = *vI* for *i* = 1, 2.

By symmetry, any coESS must satisfy for 𝓁 ∈ *S*_{i} and *f/m* for 𝓁 ∉ *S*_{i}. For any choice of *f*, let us first solve for the mean density of competitors within a patch in which case the regional mean density for species *i* is . This mean density must satisfy
This implies
The invasion rate of a different strategy invading a resident community with strategy *f* equals
Hence,
There are two cases to consider. Either *f* = 0 or 0 *< f <* 1. The first case only occurs if the partial derivative of ℐ_{i} at *f* = 0 is positive. This occurs if
Hence, if the noise is too small, or there are many patches, or the difference in the competitive advantages are too large, then the species remain segregated at the coESS.

Consider the case when . Then the coESS must satisfy that the partial derivative of ℐ_{i} at *f* = 0 equals zero. In this case, the coESS must satisfy
This equation implies that the majority of the individuals are in the patches in which they are competitively superior. However, for smaller differences in competitive ability and higher levels of stochasticity, individuals spread more equally across the patches.