On the Spatial Diffusion of Cooperation with Endogenous Matching Institutions

This paper studies the spatial joint evolution of cooperative behavior and a partially assortative matching institution that protects cooperators. We consider cooperation as characterized by a cultural trait transmitted via an endogenous socialization mechanism and we assume that such trait can diffuse randomly in space due to some spatial noise in the socialization mechanism. Using mathematical techniques from reaction-diffusion equations theory, we show that, under some conditions, an initially localized domain of preferences for cooperation can invade the whole population and characterize the asymptotic speed of diffusion. We consider first the case with exogenous assortativeness, and then endogeneize the degree of social segmentation in matching, assuming that it is collectively set at each point of time and space by the local community. We show how relatively low cost segmenting institutions can appear in new places thanks to the spatial random diffusion of cooperation, helping a localized cultural cluster of cooperation to invade the whole population. The endogenous assortative matching institution follows a life cycle process: appearing, growing and then disappearing once a culture of cooperation is sufficiently established in the local population.


Introduction
The emergence and persistence of cooperation is a classical issue in natural and social sciences.This question is often analyzed in game theoretical situations like the Prisoner's Dilemma or the Public Good provision game, reflecting the conflict between individual interest, collective rationality and altruism.The biological, economic and game theoretical literatures highlight various routes to sustain cooperation in communities.A first perspective takes an evolutionary viewpoint and considers the evolution of altruistic traits or cooperative preferences subject to some genetic or cultural selection forces (Alger and Weibull (2012), Weibull (1998)).A second approach assumes the existence of specific institutions or social mechanisms, such as reputation building in repeated relationships or segregation in social interactions (assortative matching), that incentivize or protect cooperation in a community (Alger and Weibull (2013), Bergstrom (2003), Bowles and Gintis (1998)).Another strand of the literature highlights the importance of space and the diffusion process of cultural dimensions that help sustain modes of cooperation in various social contexts (see for instance Eshel, Samuelson and Shaked (1998), and more recently Langer, Nowak and Hauert (2008) and Helbing (2009)).Interesting historical examples related to this perspective are the spatial neolithic transition from hunting-gathering into farming and stockbreeding in Europe with its emphasis both on demic diffusion and cultural diffusion1 (see Ammerman and Cavalli-Sforza (1971), Ammerman and Cavalli-Sforza (2014)), the rise and decline of merchant guilds as organizations promoting exchanges and cooperation among traders in different parts of medieval Europe (see Dessí and Ogilvie (2003), Greif, Milgrom and Weingast (1994), Greif (2006), Mauro (1990), Gelderblom and Grafe (2010)), or recently, the diffusion of a "sharing culture" through which local communities come up with creative initiatives, based on sharing and collaboration, to serve their daily needs with economic alternatives to traditional service provision (private or public) (Katrini (2018)).
The purpose of this paper is to contribute to this line of research by analyzing how preferences evolution and institution building can jointly evolve and interact to sustain cooperation in a spatial context.Specifically, we consider the spatial transmission and diffusion of a cultural trait for cooperation in a context where a local institution of social segregation (assortative matching) can be endogenously decided by some political collective decision making mechanism.To do this, we develop a continuous space framework in which preferences are locally transmitted across generations through a cultural transmission process à la Bisin-Verdier (Bisin andVerdier 2001, Bisin, Topa andVerdier (2004)), and also diffuse randomly in space due to some spatial noise in socialization.Additionally, following Bowles and Gintis (1998) and Alger and Weibull (2013), we introduce the presence of an assortative matching institution by which cooperators can partially segregate themselves for their social interactions.In contrast to the previous literature however, we assume that the degree of assortativeness of the matching institution is endogenous, costly to implement, and decided collectively at the local community level.
In such a context, we analyse the spatial co-evolution of the cultural trait of cooperation and the local institution of assortative matching that facilitates the expression of this culture.Specifically, the questions we address are the followings: should a culture of cooperation be initially spread everywhere (i.e.homogeneously distributed) in order to persist spatially?Can cooperative preferences located initially in a limited region be able to diffuse and successfully invade the whole population in space?Under which conditions will this phenomenon happen and not the opposite?What is the equilibrium spatial and time pattern of the co-evolution of a culture of cooperation and the (endogenous) local institutions that promote such culture?
The paper provides the following contributions.First on the technical side, and in contrast to agent-based simulations models analyzing cooperative behaviors in discrete spatial environments such as lattice or networks frameworks (Langer, Nowak and Hauert (2008) and others), we approach the problem of spatial diffusion of cooperation in a continuum space, applying for this purpose mathematical techniques and results from partial differential reaction-diffusion equations theory.This perspective, relatively new to economists and social scientists, is useful as it allows the derivation of specific analytical results on the spatial evolution of cooperation and the assortative matching institutions that interact with these cultural patterns.
Starting with the benchmark case of exogenous assortative matching institutions as described in Bowles and Gintis (1998), or Alger and Weibull (2013) in a non spatial context, we show that for a degree of institutional assortativeness above a certain threshold, the existence of a spatially localized cultural cluster of cooperators may allow the diffusion of a culture of cooperation to the whole spatial population on an infinite domain.More precisely, we are able to provide analytical conditions for the existence of a positive traveling wave of a culture of cooperation that invades the whole population.In this case, we characterize the asymptotic speed of diffusion, and show that it is increasing in some crucial fundamentals of the problem: the degree of institutional assortativeness and the intensity of the taste for cooperation in the preference structure.
We then extend the framework to the case of endogenous and costly assortative institutions implemented at the local community level, and we analyze the interaction between cultural transmission and the emergence of these matching institutions along the spatial process of diffusion of a culture of cooperation.We show how relatively low cost assortative matching institutions can appear in new places thanks to the spatial random diffusion of cooperation, and in turn facilitate a localized cluster of cooperative preferences to invade the whole population.Again, we provide conditions for the existence of a traveling wave of a culture of cooperation.We also study the resulting spatial pattern of institutional evolution.We show that the equilibrium degree of assortativeness follows a non monotonic path along the diffusion process in space.Places with initially no cooperators and no local institution of social segmentation, thanks to the diffusion process, will be the locus of emergence of an assortative matching mechanism, first growing and then disappearing once cooperators have reached a sufficient proportion of the population inside the local community.This highlights an interesting example in which culture and institutions act initially as dynamic complements and then as dynamic substitutes along the diffusion process.
Finally, while our analytical results are provided for diffusion processes on infinite domains, we provide numerical simulations to show that the main qualitative insights derived analytically persist on finite domains.
Our paper connects directly to the large literature of the spatial evolution of cooperation on a discrete space structure, i.e. lattice or network (Eshel, Samuelson andShaked (1998), Tarnita et al. (2009) or Langer, Nowak and Hauert (2008))2 .The main result in that literature is that a structured population with interactions limited to neighbors often sustains the long run existence of local clusters of cooperation (and even invasion over the full structure) under conditions where, without space, one would not expect cooperation to survive from an evolutionary perspective.Our approach differs from the previous ones along two dimensions.First, while in the previous models cooperators' movement was directed and purposeful, we assume here that cultural traits diffuse locally with some random direction in space due to a spatial random component in the socialization mechanism associated to cultural transmission.Second, as already mentioned, we consider a continuum spatial structure that allows us to obtain more general analytic results.
The mathematical biology literature has also applied some spatial models with a continuum space to economic games of cooperation (see for instance Ferriere and Michod (1999) and Helbing (2009)).However, our paper differs from these in two ways.First, we consider cultural evolution based on intergenerational socialization instead of biological evolution based on fitness.Second and more importantly, we study the interaction between cultural diffusion and social institutional building, by allowing for the possibility of the emergence of an endogenous assortative matching institution set at the local level, according to the proportion of cooperators and defectors weighted by their "political power " in the community.The analysis then exhibits the existence of dynamic complementarities and substituabilities between preferences and institutions spatially, and it generates an example of the endogenous "rise-and-fall" of "cooperation supporting" institutions following a diffusion "wave"pattern over time and space.
The paper is organized as follows.Section 2 presents the main structure of the model and the interaction game between cooperators and defectors.Section 3 introduces the cultural transmission mechanism and contains the basic dynamic model.Section 4 adds the spatial structure and shows analytically when there exists a traveling wave of a culture of cooperation on an infinite domain.Section 5 studies the case of endogenous assortative matching institutions.Section 6 shows the main results on finite spatial domains using numerical simulations.Finally, Section 7 provides a short conclusion.All the proofs are relegated to the appendix.

The model
We outline in this section a standard model of cooperation without the spatial dimension which will be added in the next section of the paper.

An interaction game
Consider a classical social interactions model of cooperation where at each point of time t the total population N is composed of individuals endowed with a preference for cooperation (i.e.cooperators denoted as C) and individuals with a preference for defection (i.e.defectors denoted as N C).Let q(t) denote the normalized proportion of cooperators and 1 − q(t) the normalized proportion of defectors.
There are overlapping generations of agents living first as children, and then as adults/parents.Individuals get socialized to a specific preference pattern when they are children and then interact socially when they are adults.More specifically, at each time t, adult individuals who already possess the trait C or N C, get matched by pairs and play a perfect information interaction game structured as follows.

Payoff matrix
where G > 0 is the payoff gain from cooperation when this is played by both players, −L < 0 is the payoff loss cooperation entails facing non cooperation, B is the gain from defection in front of cooperation.Finally, δ i reflects an "intrinsic" utility gain an individual i has in choosing the action "cooperation".We assume that this characteristic is dichotomous and can take two values depending on the cultural trait of the individual.More precisely for any player i: We assume the following restrictions on the payoff matrix: where the first part of H1 ensures that the intrinsic taste for cooperation δ of type C individuals is large enough to induce them to act as unconditional cooperators (i.e. to always prefer to cooperate).The second part of H1 simply assumes that the social interaction game between two N C individuals has the classical prisoner's dilemma structure.Defection (i.e.play N C) is a dominant strategy for such individuals.Finally the third part of H1 says that total surplus maximization is obtained by full cooperation (i.e. both players playing C).
In this context, it is well known that cooperation can evolve when there is some degree of social "segmentation" in the matching process between individuals and cooperators are able to interact more frequently with members of their own group than with a randomly selected individual.More specifically, following Bowles and Gintis (1998) and Bergstrom (2003), and defining ρ ∈ (0, 1) as the degree of assortative matching in the population4 , the probability that a cooperator meets another fellow cooperator is ρ + (1 − ρ)q.For the moment we take ρ as exogenous.Later on we will endogenize the level of institutional segmentation at the community level.

Cultural transmission
All adult members, just before dying, have one offspring and transmit to that offspring their trait according to a Bisin-Verdier model of intergenerational cultural transmission (Bisin and Verdier (2001)).More specifically, each offspring is born without defined preferences.This offspring is first exposed to his parent's cultural trait.Direct vertical socialization to the parent's trait, say i ∈ {C, N C}, occurs with some endogenously determined probability τ t i .If a child from a family with trait i is not directly socialized, which occurs with probability 1 − τ t i , she is then subject to outside socialization.In that case, the child is matched to a passive role model randomly chosen in the population so that she adopts trait C with probability q(t) and trait N C with probability 1 − q(t).Now for i, j ∈ {C, N C}, denote by P ij t the probability that a child from a family with trait i is socialized to trait j.By the Law of Large Numbers, P ij t also denotes the fraction of children with a type i parent who have preferences of type j.The socialization mechanism described above can then be characterized by the following transition probabilities: )q(t).Using these probabilities, we have that the cultural dynamics of the cooperators q(t) are then given by: q(t + 1) = q(t)P C,C t At the continuous time limit, we obtain the following simple dynamic replicator equation q(t) = q(t) (2) Essentially one finds back a cultural replicator version of the process by which preferences get selected in the population.In contrast to the standard replicator dynamics in evolutionary game theory involving only the difference between fitness relevant payoffs, in the cultural replicator version of ( 2), what matters for cultural selection is the difference between vertical transmission rates across cooperators' and defectors' families.
Following Bisin and Verdier (2000) and Bisin and Verdier (2001), the vertical transmission rates τ t i are endogenized by assuming that parents are paternalistic and spend resources to transmit their own trait to their offspring. 5Under simple conditions (see the Appendix), for each type i ∈ {C, N C} the vertical transmission rate τ t i is typically obtained as a function τ ∆V i of the "so-called" paternalistic motivation ∆V i of a parent of type i to transmit his trait.It is expressed as ∆V i = V ii − V ij where V ii is the expected payoff obtained by a child that takes the same trait i as his parent, and V ij is the expected payoff obtained by a child taking the other cultural trait j = i , but as perceived through the filter of the preferences of the parent of trait i.Moreover, assuming that the cost of socialization is a quadratic function of the vertical transmission rate, it can easily be shown that for ∆V i ≥ 0 the function τ (.) is just a linear increasing function τ In the context of the previous game, and the assortative matching hypothesis, one can easily compute the utilities payoff V ii and V ij for (i, j) ∈ {C, N C} with j = i and get the expressions of the paternalistic motivation ∆V i of a parent of type i ∈ {C, N C} as , and d small enough to ensure that the transmission rates τ C and τ N C always take values in [0, 1].The evolutionary dynamics of the frequency of cooperators in the population then writes as The following assumption H2 captures the restrictions of assumption H1 and ensures 5 To simplify notations from here onward we omit time superscript whenever there is no risk of confusion.
6 These properties reflect simply the fact that the larger the paternalistic motivation of a parent, the larger his socialization effort, and therefore the larger the vertical transmission rate.Non paternalistic parents, on the contrary, are indifferent to the preference pattern adopted by their offspring and therefore do not spend costly resources to transmit their trait to their child.the result of Proposition 1: where Proposition 1.Under assumption H2, the dynamic equation describing the evolution of cooperation (3) admits three fixed points: The interior equilibrium q * (ρ) is unstable, while the corner equilibria 0 and 1 are stable equilibria with respective basins of attraction [0, q * (ρ)[ and ]q * (ρ), 1].
The conditions of assumption H2 could be interpreted in the following way.In order to have an interior mixed equilibrium q * where both cooperators and defectors are present, the intrinsic gain of cooperation, δ, should be high enough to allow cooperators to act unconditionally, but also not too high since otherwise defectors would never be able to persist with cultural selection.The second condition ensures that the cooperative gains G should take intermediate values for socialization to always be strictly positive for both types of traits (i.e.τ C and τ N C > 0 for all values of q ∈ [0, 1]).Moreover, in order for cooperators to survive in the long run in the population, the assortativeness of the matching process should be high enough (ρ > ρ min ) to allow the cooperators to protect themselves but not too high (ρ max > ρ) otherwise defectors could not survive.
Proposition 1 therefore states that under these assumptions on the parameters of the game, the problem of cooperators and defectors we presented is a "bistable" case where the interior equilibrium q * is repulsive while the two extreme equilibria, q = 0 and q = 1, are attractive.When the initial conditions are such that 0 ≤ q(0) < q * the cultural dynamics converge to the steady state q = 0 and we have the extinction of the cooperative trait.Conversely when q * < q(0) ≤ 1, the system converges to q = 1 and there is extinction of the noncooperative trait.Cooperation gets transmitted to the whole population, when it starts already above the threshold q * .
[Figure 1 about here] 3 Adding the spatial structure Under the previous simple evolutionary model, the cooperative culture has to exceed a given initial threshold q * to invade the whole population.How is such conclusion affected when we add a spatial structure?Should the cooperative trait be present over the full space to survive cultural selection?In this section, we provide conditions such that the culture for cooperation needs to exist only on a relatively small domain in order to invade spatially the full population.
Specifically, assume that after the classic Bisin-Verdier socialization mechanism, there is a spatial noisy component of socialization.Children can be socialized to their neighbors' cultural trait through a random local diffusion of cooperative and defective traits.More precisely, a child at location x on the real line R 7 could be randomly re-socialized with a cultural trait coming from location x − dx or x + dx, meaning that cultural traits can move locally with random direction in space.While the most relevant papers describing spatial cooperators dynamics usually consider a discrete lattice where agents interact with their neighbors and then replace them with a purposeful movement (Langer, Nowak and Hauert (2008)), we differ in three aspects.First, the interaction happens before the movement and is strictly local, it happens at location x with local populations characterized by frequencies q(t, x) and 1 − q(t, x).Second, and more important, we assume that after social interaction, reproduction and cultural transmission happen, the new generation (the socialized children) can be randomly resocialized to his neighbors' trait.More precisely, we assume that cultural traits move with random local direction in space causing a spatial noise in the socialization mechanism.In order to have a tractable model that highlights the spatial dimension of the problem, we assume the local population N at each location to be constant in time and space.Lastly, we consider a continuum spatial structure and an infinite domain (R ) to have analytical and general results.We will then show with some numerical simulations how these results remain generally true in a finite domain.
Using a classical mathematical argument (see the Appendix for a simple onedimensional case and Murray (2002) for a longer version) one can show that assuming cultural traits to move randomly on a localized small domain of size dx and passing to the continuous limit dx → 0, the local random diffusion process can be described through a laplacian operator.The cultural dynamics describing the evolution of the local frequency of cooperators q(t, x) rewrite therefore as a partial differential equation of the following form with initial time condition describing the initial spatial frequency of cooperators on the full domain : q(0, x) = q 0 (x) with q 0 (x) a real function such that 0 ≤ q 0 (x) ≤ 1 for all x ∈ R. Substitution of ∆V C (q) and ∆V N C (q) provides the partial differential equation: (5) 7 The analysis can be extended easily to a multidimensional spatial structure on or R n with n > 1.
A reaction-diffusion equation similar to (5) was firstly introduced by R. Fisher (1937) to describe the wave of advance of an advantageous gene.The Fisher's equation could be considered as a spatial extension of the logistic equation and rapidly spread in mathematical biology to describe a wide range of different phenomena.A less known application of Fisher's equation is the one made by Ammerman (1973)) who applied this particular reaction-diffusion equation in evolutionary anthropology to study the spread of early farming in Europe.It is clear that this mathematical representation simplifies the diffusion process making it continuous in time and space.However, as stated by Ammerman (1973), even when real diffusion is discontinuous, it often operates over short intervals of space and time.A continuous temporal and spatial diffusion theory may then still provide useful insights on the nature of the spatial cultural dynamics.
To describe the diffusion process of the cooperative culture in a spatial context, it is of specific interest to analyze solutions of (5) in the form of a traveling wave.A traveling wave is a particular type of solution on an infinite domain obtained by a change of variables such that it connects the two homogeneous steady states (here 0 and 1) and travels without change of shape.Specifically, if u(x, t) represents a traveling wave, the shape of the solution will be the same for all time and the speed of propagation of this shape is a constant usually denoted by c.If we look at this wave in a traveling frame moving at speed c it will appear stationary.The traveling wave is therefore a tractable theoretical tool to describe how a diffusive phenomenon happens in time and space (see the Mathematical Appendix for the exact definition).
In the case of system (5), we can apply a classical partial differential equations' theorem (see the theorem in the Appendix) that ensures the existence of a unique traveling wave that moves with speed c, where sign(c) = sign( Furthermore, using a classical result (see Keener and Sneyd (1998) page 232) for reaction-diffusion equations of the following form ) we can compute the exact speed and the profile φ(.) of the traveling wave u(x, t) = φ(x + ct).In particular, the speed is given by and the profile is where ξ = x+ct.Because we use ξ = x+ct as the traveling wave coordinate, a solution with c > 0 corresponds to a wave moving from right to left on the spatial domain R.
We could equally well have used x − ct as the traveling wave coordinate, to obtain waves moving from left to right for positive c (this is the choice we have made in the figure below).
In the context of our equation ( 5), defining We can now state the following result.
Proposition 2. Under the hypothesis (4) there exists ρ * = B+L−δ−G B+L+G such that for ρ > ρ * a localized set of cooperators can invade the whole space, i.e. there exists a traveling wave that moves with positive speed c > 0. The diffusion speed c is an increasing function of ρ and δ.
Proposition 2 implies (see Aronson and Weinberger (1978)) that starting from an initial configuration where there are just noncooperative preferences, the appearance of a small cluster of a culture of cooperation with enough assortative matching and whose proportion is larger than q * (ρ), is enough for cooperation to invade the whole space. 8n the simple non spatial model of Section 2, cooperative preferences could only diffuse in the full population if their frequency initially exceeded the threshold q * (ρ).With a local random spatial component of socialization, the requirement for the spatial diffusion of the culture of cooperation is weaker.Cooperative preferences still need to exceed q * (ρ) at some point of space.However, to invade the full population, it is now sufficient to have this condition satisfied on a small localized domain.In other words, even with an initial "average"lower than q * (ρ) in space, cooperative preferences can still take advantage of their local success to take over the whole population (see the numerical simulations on finite domains for an intuitive idea).
Inspection of ( 8) also shows that the speed of propagation is an increasing function of the degree of segregation ρ and of the intensity of preference for cooperation δ.Furthermore, looking at the expression (7) and the value for A 2 , we can easily observe that the higher is G the steeper is the profile of the traveling wave (the "jump "between 0 and 1) while ρ has the opposite effect, the higher the segregation the smoother becomes the profile of the wave.

Diffusion of cooperation and matching institutions
In the previous section we have shown that a high enough degree of social segmentation ρ and a random spatial process of socialization induce a diffusion mechanism that allows the invasion of cooperative preferences in the whole space, even when such preferences are initially localized only in a small domain.In this section, we analyze the interaction of the process of spatial diffusion of preferences with the emergence of assortative matching institutions promoting cooperation at the local level.

Endogenous assortative matching institutions
To do this, we consider the case where the degree of assortativeness ρ is endogenous and chosen by a collective decision mechanism at the local level.The parameter ρ allows cooperators to protect themselves from exploitation by defectors.Clearly since it shapes social interactions inside the community, the choice of ρ can be a source of conflict between cooperators and defectors as it favors the former and penalizes the latter.Presumably, the outcome of such collective decision problem will depend on the relative political strength of the two groups.We highlight these features in the simplest way by assuming that at each point of time, ρ is determined at the community level by the maximization of a social welfare function reflecting the sum of the utilities of the two groups of individuals, weighted by their political power, that we simply assume to be proportional to their population size in the community.
Specifically, we consider first the non spatial case with a given community characterized by a frequency q of cooperators.The community selects the institutional assortativeness parameter ρ by the following social choice maximization program: where ψ(ρ) represents the cost of the endogenous institution that is borne by the whole community9 .We assume that the cost function is increasing and convex, (i.e.ψ > 0, ψ > 0), with the Inada conditions ψ(0) = ψ (0) = 0, and Moreover we assume that ψ ≤ 0 for technical reasons.
Substituting the expressions of V C,C (ρ) and V N C,N C (ρ) in ( 9) and using the hypothesis G + L − B > 0 we find that the optimal degree of assortativeness ρ(q) is given by: Inspection of (10) shows immediately that the optimal degree of assortative matching is a non monotonic function of the frequency q of cooperators in the community.The intuition for this is the following.Cooperators are in favor of social segmentation while defectors are against it.A first effect is associated to the negative intensive margin effect of q on the marginal benefit of segmentation for cooperators.The marginal benefit of segmentation for each cooperator writes indeed as ∂V C,C ∂ρ = (G+L)(1−q) and it declines with the frequency of cooperators q.As the population becomes more homogeneous in terms of cooperative individuals, random matching provides naturally more encounters between cooperators and the payoff benefit for a cooperator to separate himself from defectors gets smaller.
At the same time, there is also a positive extensive effect of q, due to the fact that when the cooperative group increases in size, it has more political influence in the collective choice problem determining the optimal value of segregation.The aggregate effect of q on q ∂V C,C ∂ρ = (G + L)(1 − q)q is therefore non monotonic, increasing for low values of q and decreasing for high values of q.
In a symmetric way, the aggregate marginal cost of segmentation for defectors −(1 − q) ∂V N C,N C ∂ρ = (1 − q)qB is also a non monotonic function of q.Combining both, the aggregate weighted social welfare benefit of segmentation is then simply and it is also non monotonic in q, reflecting the conflicting extensive and intensive margins effects for the two groups.
In a non spatial context, the dynamics of cooperators writes as: or B − δ/2 < G, so that we can study the case in which there exists just one interior equilibrium.Note also that We can prove that indeed ρ < 1/2 (see the Appendix).
Substituting the optimal value of community segregation ρ(q), the dynamics can thus finally be rewritten as The following lemma, whose proof is relegated to the appendix, characterizes the cultural steady states of the non spatial dynamics with endogenous segmentation: we have that q = 0 and q = 1 are two stable equilibria and there exists a unique interior unstable equilibrium q s ∈ (0, 1).
The dynamics are illustrated in figures 3 and 4. On figure 3, we plot in the space (ρ, q) the two curves ρ = ρ(q) and q = q * (ρ); under our assumption B − δ/2 < G, they only cross at one interior point q s ∈ (0, 1).It is easy to see that for all q < q s , we have q < q * (ρ(q)) and therefore q < 0. On the opposite for all q > q s , we have q > q * (ρ(q)) and consequently q > 0. The phase diagram illustrating the cultural dynamics in figure 4 follows immediately.

Adding the spatial structure
We now add the spatial structure as we did in the basic model with exogenous assortative matching.The partial differential equation driving the spatial evolution of the culture of cooperation in the domain x ∈ R writes now as: As we saw before, the sign of the speed of the traveling wave is given by the sign of the integral of the reaction term, i.e. the right-hand side of (12).
where we have used the fact that G + L − B > 0.
We obtain the following characterization of a traveling wave with endogenous assortative matching institutions: Proposition 4.There exists B max ∈ (G + δ − L, G + L] such that: there exists a traveling wave for all α ∈ (α, ∞), such that an initially localized cluster of cooperators may invade the full spatial population; • if G + δ − L < B < B max , there exists α ∈ [α, ∞) such that for α ∈ (α, α) there is a traveling wave with positive speed such that a localized cluster of cooperators may invade the full population ; conversely, for α ∈ (α, ∞) there exists a traveling wave such that a localized cluster of defectors may invade the full population; • if B > B max there exists a traveling wave for all α ∈ (α, ∞) such that a localized cluster of defectors may invade the full population.
The proof of the proposition is relegated to the appendix but is mainly based, as in the case of the exogenous institution, on the computation of the sign of the integral that characterizes the sign of the speed of diffusion of a traveling wave solution of (12).
The first part of the previous proposition states that when the gains from cooperation (material payoff, moral payoff or both) are high enough, a localized cluster of cooperators above the threshold may invade the whole population by slowly diffusing 10 Indeed, all q ∈ (0, 1) ρ(q, α) < ρ when max q (ψ (ρ(q, α))) < ψ (ρ), that is when spatially independently of the cost of building an assortative institution that protects locally the cooperators.Importantly this cultural diffusion process is accompanied by a spatial institutional life cycle process.When cooperative preferences diffuse to a new location x, cooperators at this location start to use their "political influence" (as reflected by their local frequency) to promote the building up of an assortative matching institution that protects them from interacting with defectors.Thanks to that, in that location x, the intergenerational incentives to transmit cooperative preferences are further enhanced locally, and the proportion of individuals q = q(x, t) endowed with a culture of cooperation keeps on growing in the community.This in turn supports a steadily increasing equilibrium institutional level of assortativeness ρ(q, α) in the community.This positive interaction between the cultural dynamics of cooperative preferences and the institutional dynamics of assortativeness continues until the frequency of cooperators crosses a certain threshold.At this stage, there are enough cooperators in the local community that it becomes less worth paying the cost of a highly selective social matching institution.Consequently, the equilibrium institutional degree of assortativeness ρ(q, α) starts to decline, while the cultural diffusion of cooperative preferences steadily increases.This process goes on up to the point where the community is fully composed of cooperators and the assortative matching institution is abandoned because of its positive cost.Interestingly, during the diffusion of the culture of cooperation in a local community, the life cycle of the local institution of assortative matching provides an example where the institutional and cultural dynamics exhibit a first phase of dynamic complementarities (with positive feedbacks between the evolution of assortative matching institution and the diffusion of the culture of cooperation), and then a second phase of dynamic substituabilities (where on the contrary the assortative matching institution coevolves negatively with the culture of cooperation).
The second part of the proposition highlights the case where the gains of cooperation take intermediate values, not high enough to always ensure the diffusion of a culture of cooperation and not too low to always induce defectors invasion.In this case, when institutional building is not too costly (associated with low values of α, i.e. α ∈ (α, α)), it can help a localized cluster of cooperators to diffuse in the whole space and invade the whole population.Conversely, the proposition also says that, if the cost to maintain an assortative matching institution is too high (associated with values of α such that α ∈ (α, ∞)), there exists a traveling wave in which now a localized cluster of defectors is able to invade a population of cooperators by diffusing in the whole space.
Lastly, the third part of the proposition states that when the gains of cooperating are too low, a localized cluster of defectors above the threshold may invade a population of cooperators by slowly diffusing spatially independently of the cost of building an assortative institution.

Diffusion of the endogenous institution
As already noted, when cooperators are able to invade the whole population, the endogenous assortative matching institution that supports such diffusion of a culture of cooperation follows a life cycle process as described in figure 5.As cooperative preferences start to appear in sufficient frequency in a given place x , the institution of assortative matching emerges as well at x, and increasingly helps cooperator individuals to segregate.This promotes further a local cultural change biased towards preferences for cooperation.When the local frequency of cooperators passes a threshold, the local institution of assortative matching enters in a declining phase and slowly disappears from location x.
[Figure 5 about here] It is useful to compare the case where the level of the institution is exogenously settled (see Section 4) to the case where the population can decide endogenously the degree of social segmentation associated to the institution.
For this, recall from proposition 2 that for the case of an exogenous institution of assortative matching there is a threshold of assortativeness ρ * = B+L−δ−G B+L+G such that with any given matching institution with assortativeness ρ > ρ * , there exists the possibility of the spatial diffusion of a preference for cooperation (i.e. the existence of a traveling wave of a culture of cooperation).
Recall as well from ( 10) that the highest degree of social segmentation ρ max (α) that can be obtained with an endogenous institution associated with an implementation cost ψ(ρ) = αψ 0 (ρ) is given by the condition Then we have the following proposition: Proposition 5. When G + δ − L < B < B max , for any α ∈ (α, α) such that there is a traveling wave allowing cooperators to invade the full population, the maximum degree of segmentation ρ max (α) generated along that wave by the assortative matching institutions is such that ρ max (α) > ρ * .
This proposition explores the intermediate parameters case G + δ − L < B < B max where both traveling waves for full diffusion of cooperative preferences and diffusion of defector preferences can exist depending on the cost of the institution.It says that along a traveling wave that allows the spatial diffusion of the culture of cooperation with an endogenous assortative matching institution (i.e. when the cost of institutional building is not too high with α ∈ (α, α)), this institution, at its peak, always segments more than the minimum degree of segmentation ρ * necessary to get the same diffusion of cooperative preferences with exogenous assortative matching.This highlights the fact that along its life cycle associated to the diffusion of the preferences for cooperation, the local endogenous matching institutions both start with a low degree of assortativeness and steadily become more separative than what would be necessary to allow the diffusion of cooperation with exogenous assortative matching.These two elements reflect the importance of the joint interaction between institution building and diffusion of preferences that is not taken into account in section 4 with exogenous matching institutions.Peer-reviewed version available at Games 2018, 9, 58; doi:10.3390/g9030058 [Figure 8 about here] 5 Numerical simulations on finite spatial domains with exogenous institution The previous results have been proved analytically for infinite spatial domains since on finite domains the notion of traveling wave has no meaning.However, if the domain is finite but large enough, the solution of the partial differential reaction-diffusion equation ( 12) qualitatively follows for some time the profile of a traveling wave.In this section, we present a Matlab simulation to analyze how the spatial diffusion process will happen on a finite one dimensional domain and how the invasion fronts resemble to the profile of a traveling wave.For matter of simplicity, we run the simulation, after imposing the normalization A 2 = 1.
In the two simulations that we show in this section, we also have set q * = 0, 3. We can easily observe (see the Appendix) that, given an initial datum, the smaller is q * the faster is the invasion.On the contrary when q * approaches the value 0, 5 the initial datum needed for cooperators to invade should have a bigger and bigger support.The two figures below show two numerical simulations for which an initially concentrated cluster of preferences for cooperation (red line) slightly above the fraction q * = 0, 3 (green dashed line) invades the whole space slowly reaching everywhere the quota q = 1.The thin blue lines represent the time-evolution of the process (the pictures are taken every 8 units of time) and the orange arrows show the direction of the invasion.We can easily see how the profile of the solution resembles to the profile of the traveling wave we characterized for an infinite domain.
The first simulation uses as initial conditions the characteristic function of the interval [−2, 2] while the second figure has as an initial datum a two picked cluster of cooperators.In this latter case, we show that even when in a certain interval of the initial cluster's domain cooperators are below the critical non spatial threshold q * they can still invade the whole space.

Conclusion
In this paper, we study the dynamic and spatial evolution of cooperative behavior and endogenous assortative matching institutions that protect cooperators.We consider cooperation as a cultural trait transmitted via an endogenous socialization mechanism that includes the usual vertical and oblique channels at the local level as well as a random horizontal spatial component.First, we consider an exogenous assortative matching institution that allows cooperators to partially segment their social interactions with defectors.Considering a continuum space structure and using mathematical techniques and results from reaction-diffusion equation theory, we investigate the conditions for a culture of cooperation to invade the whole spatial population and we characterize the determinants of its asymptotic speed.We then endogeneize the assortative matching institution assuming that it is set at the community level according to the proportion and political power of the cooperators.When the technology of institution building is relatively efficient, a protective institution can appear in new places thanks to the spatial random diffusion of cooperation.Along the spatial diffusion process of the cooperation trait, local assortative matching institutions follow a life-cycle process by which the degree of assortativeness first gradually grows and then declines as the preference for cooperation becomes majority inside the community.
In future research, this model of spatial diffusion of culture and institutions could be extended in various directions.First, our collective decision process for the choice of an assortative matching institution at the community level could be expanded to take into account more realistic political mechanisms reflecting the relative power of the different groups.Additionally, one may think about expanding our analysis of spatial cultural and institutional diffusion to other types of strategic interactions, such as coordination or anti-coordination game structures, rather than the cooperation situation that we describe here.Also, we could introduce the possibility for purposeful directional movement of cooperators and defectors according to some explicit payoff relevant motivation.Finally, our reaction-diffusion framework highlights two important forces that may affect the spatial composition of cultural and institutional structures in a society: cultural replicator mechanisms and random diffusion of (cultural) information at the local level.Introducing cost/benefit margins on cultural transmission motivation and institution building allowed us to relate these two forces to economic fundamentals like returns to cooperation, intrinsic motivation for cooperation or technology features on institution building of screening and segregation.We hope that the ideas and techniques that we developed here in a somewhat abstract framework can be stepping stones for more applications in specific economic and social contexts.
Figures Peer-reviewed version available at Games 2018, 9, 58; doi:10.3390/g9030058 Figure 3: Graphic of ρ(q) and q * (ρ) Figure 4: Under the assumptions of Prop 3 the cooperators' dynamics is again a bistable case . Even if in a certain interval of the initial datum's domain cooperators are below the threshold they can still invade the whole space.

Appendices A Cultural Transmission
We provide here some microfoundations for our cultural replicator in (3).Following Bisin and Verdier (2001), we endogenize the vertical transmission rates τ t i by assuming that parents have a motivation to spend resources to transmit their own trait to their offspring (to simplify notations from here onward we omit time superscript whenever there is no risk of confusion).
More precisely we assume that a parent of type i ∈ {C, N C} is paternalistic and chooses his socialization rate τ i in order to maximize the following utility function: where V ii is the expected payoff obtained by a child that takes the same trait i as his parent, and V ij is the expected payoff obtained by a child taking the other cultural trait j = i in the group, but as perceived through the filter of the preferences of his parent of trait i.Finally, C(τ i ) represents the cost of socialization, i.e. the cost of the resources (time, money etc.) that the parent has to spend to transmit his trait to his child.According to the payoffs of the previous game and our assortative matching hypothesis, the utilities for a cooperator and a defector having a child like themselves will be: The standard Bisin and Verdier (2001) model assumes a cultural substitution mechanism of transmission of the cooperative trait whereby minorities do a greater effort to purposefully socialize their offspring.Such effect always leads to long turn cultural heterogeneity.As we are interested in the diffusion of a cultural trait rather than its long run persistence, we abstract here from such effect by considering a form of socialization costs that neutralizes cultural substituability.Specifically we assume the following socialization cost functions: where the terms 1 − q and q help neutralizing the cultural substitution mechanism that is intrinsic in the socialization mechanism á la Bisin-Verdier.
We have thus shown that the conditions (4) are sufficient to have the existence of the interior equilibriumq * .
We can now easily show that under the same conditions we are in a classical bistable case.The bistable case is characterized by the presence of three equilibria (in our case q = 0, q = 1 and q * ) of which two ( q = 0 and q = 1) are stable, i.e. attractive, and one (the interior one q * ) is unstable, i.e. if we move slightly away from q * we are going to converge either to the state q = 0 or to q = 1.In order to have a bistable case we need that ∂ q f (0) < 0 and ∂ q f (1) < 0. The first condition writes and this is always the case under (4).
The second condition writes as and this is always the case under (4).
We have thus shown that under the hypothesis (4), the problem of cooperators and defectors we presented is a bistable case where the interior equilibrium q * is unstable while the two extreme equilibria, q = 0 and q = 1, are stable.Therefore, if 0 ≤ q(0) < q * we will, in the long run, converge to the state q = 0 and have the extinction of cooperators, while if q * < q(0) ≤ 1 we will converge to the state q = 1 and have the extinction of defectors.

B.2 Proof of Proposition 2
Since [(1 − ρ)(G + L − B)] 1/2 > 0, imposing the condition c > 0 we find that The only thing we need to check is that, under the set of hypothesis (4), ρ * < ρ max .We thus need to show that Developing and simplifying some terms this inequality can be rewritten as that is always verified since we have assumed both δ and G to be positive.

B.3 Proof of Lemma 3
We now want to find the conditions under which we are in a bistable case as in the exogenous institution section.We define Θ(q) = q − q * (ρ(q)) and observe that Θ(0) = −q * (ρ(0)) = −q * (0) < 0 and Θ(1) = 1 − q * (ρ(1)) = 1 − q * (0) > 0. Note also that We can prove that indeed ρ < 1/2.By contradiction if ρ > 1/2 we should have that G < L − δ < 0 and this is absurd since we have assumed G to be positive.In order to be in a bistable case we need to find conditions that ensure the existence of an unique q s ∈ (0, 1) such that Θ(q s ) = 0 and Θ (q s ) > 0.

B.4 Proof of Proposition 4
We define and we want to compute its sign.
We substitute and integrate by parts and after tedious but straightforward computations we obtain where we have defined, as in the previous exogenous section, can easily see that a sufficient condition for I(α) to be positive is G + δ > B + L and it is equivalent to q 0 < 1/2.We now observe that since > 0 the sign of I(α) is given by the sign of Since for B = G + δ − B we have that I(α) > 0 and ∂ B Ĩ(α) < 0 there exists a

B.5 Proof of Proposition 5
Assume G + δ − L < B < B max .We want to look at the sign of I(α * ) where α * is defined as ρ max (α * ) = ρ * .We have that > α and Since G + δ − L < B < B max we know that it exists α < α * such that ∀ α ∈ (α, α) there exists a positive traveling wave and cooperators may invade.Moreover, ρ max (α) > ρ * , meaning that starting from zero, the institution will grow and reach a higher level than the one required for invasion in the case of an exogenous institution.
C Derivation of the laplacian as the limit of a local random walk in 1 dimension Since here we will limit our attention to the one dimensional case we will indicate with ∆ the time/ spatial increment while the 1 dimensional laplacian will be simply denoted by ∂ 2 ∂x 2 .Let's consider a particle that moves with a random walk and denote p(x, t) the probability that a particle released at x = 0 at time t = 0 reaches location x at time t.At time t − ∆t the particle was at x + ∆x or x − ∆x.Thus if α and β are the probabilities that a particle will move to the right or to the left p(x, t) = αp(x − ∆x, t − ∆t) + βp(x + ∆x, t − ∆t), If there is no bias in the random walk α = β = 1/2.
The random wlak derivation of the laplacian we have done strongly relies on the assumption that the limit (19) exists and is finite.Less restrictive hypothesis could be made to derive the laplacian but the version presented here is the most intuitive one.

D Numerical simulations: varying the value of q *
In this paper we have proven that it is possible even for an initially localized cluster of cooperators to invade the whole population.However, according to the value of the intermediate unstable equilibrium q * , the initial cluster needs to have a bigger or smaller support in order to be able to invade.Here we fix the support of the initial datum at the interval [−2, 2] putting the maximum number of cooperators on this domain (q 0 = 1 on [−2, 2]).We then show that as q * grows from q * = 0, 1 to q * = 0, 375 the wave of advance of the cooperators slows its speed and at a certain point the initial datum we have fixed is not sufficient anymore to invade and cooperators disappear.q* = 0.375 → ← Figure 9: starting from the left up going to the right and then to the following row, the values chosen here are: q * = 0, 1; q * = 0, 2; q * = 0, 3; q * = 0, 35; q * = 0, 3625; q * = 0, 368975; q * = 0, 3725; q * = 0, 375.We can see that for the last simulation, q * = 0, 375, the initial datum we have chosen has not a big enough domain to invade.

E Reaction-diffusion equations, definitions and main theorems
We will here briefly state some classical definitions and results in reaction-diffusion equations that are useful in order to understand the analysis we have made.
Definition E.1.A traveling front (TF) is a solution of the form u(x, t) = v(x − ct) that solves The function f could be classified into three main categories CASE 1: Monostable when f is positive (f (s) > 0 ∀ s ∈ (0, 1)).
We have a particular subcase called KPP type when f is C 1 near 0 and f (s) < f (0)s ∀ s ∈ [0, 1].
In this case the reaction needs a certain threshold to start.
CASE 3: Bistable A classical theorem in reaction diffusion equation regarding the existence of traveling waves is the following Theorem.In cases where f is of the Ignition type or bistable (CASES 2 and 3), there exists a unique speed c for which there exists a solution v of (21).This solution v is unique (up to shifts) and c has the sign of 1 0 f (s)ds.In the monostable case (CASE 1) there exists c * > 0 such that (21) has a solution v if and only if c > c * .For fixed c the solution is unique (up to shifts).In the the KPP case (CASE 1bis) c * = 2 f (0).The proof of this result is not trivial and could be found on classical references as Berestycki and Nirenberg (1992), Aronson and Weinberger (1978), Kolmogorov, Petrovskii and Piskunov (1937).

Figure 2 :
Figure2: Profile of the traveling wave resulting from Proposition 2.Here we have changed the convention, imposing ξ = x − ct to find a traveling wave moving from left to right.The dominant invading state is q = 1, under the previous assumptions on the parameters of the game, cooperators are invading.Here we have made this pictures using A = 5

Figure 5 :Figure 6 :Figure 7 :
Figure 5: Qualitative illustration of the dynamics of the endogenous institution when cooperators are able to invade.The x axis represents the space while the orange arrow gives the direction of the time-evolution

Figure 8 :
Figure 8: This figure compares the case where the level of the institution is exogenously settled at ρ * to the case where the population can decide endogenously the degree of social segmentation associated to the institution, ρ(α).
Expanding the right-hand side of (18) in Taylor series we get