Modeling pluralism and self-regulation explains the emergence of cooperation in networked societies

Understanding the dynamics of cooperative behavior of individuals in complex societies represents a fundamental research question which puzzles scientists working in heterogeneous fields. Many studies have been developed using the unitary agent assumption, which embeds the idea that when making decisions, individuals share the same socio-cultural parameters. In this paper, we propose the ECHO-EGN model, based on Evolutionary Game Theory, which relaxes this strong assumption by considering the heterogeneity of three fundamental socio-cultural aspects ruling the behavior of groups of people: the propensity to be more cooperative with members of the same group (Endogamic cooperation), the propensity to cooperate with the public domain (Civicness) and the propensity to prefer connections with members of the same group (Homophily). The ECHO-EGN model is shown to have high performance in describing real world behavior of interacting individuals living in complex environments. Extensive numerical experiments allowing the comparison of real data and model simulations confirmed that the introduction of the above mechanisms enhances the realism in the modelling of cooperation dynamics. Additionally, theoretical findings allow us to conclude that endogamic cooperation may limit significantly the emergence of cooperation.

Endogamic cooperation. Here we use this concept in the broad sense, to denote the propensity to be more cooperative with members of one's group than with members of other groups. Cultural segments differ as to the degree of endogamic cooperation. Familist cultures 33 as well as cultures fostering identity motives 34 tend to increase the member's endogamic cooperation, namely to make them more inclined to cooperate with ingroup members than with out-group members. In contrast, universalist values make adherents cooperate with in-group and out-group similarly 35 .

Civicness. Any social interaction is embedded in a web of institutions-formal and informal norms and
underpinning meanings that make individual actions interconnected. As used here, Civicness consists of the valorisation of such embeddedness 34,36 . Accordingly, Civicness can be conceived of as the extension of the propensity to cooperate to the public domain-namely, to the relation with what is extraneous ( 17 , chapter 9): it consists of the actors' capacity of self-regulation, by reason of the rules of the collective game underlying the production of common goods 37 .

Evolutionary games for culturally plural social groups: the ECHO-EGN Model
The ECHO-EGN Model is a development of a previous model. In its first version-the Evolutionary Game on Network equation (EGN), it was designed to account for specific characteristics of individuals, beyond the assumption of the unitary agent. EGN described the dynamical evolution of the cooperation of each player, located inside a network of connections, which is engaged in several 2-player games with neighbors over time. Thus, EGN introduced a variable distribution of connections in the mathematical modelling of social networks (cf. 38,39 ). A further element able to foster the presence of differences among individuals was introduced in subsequent papers, where self-regulation mechanisms were considered in the framework of the prisoner's dilemma 40 .
Specifically, the self-regulation mechanisms act as fundamental drivers able to promote cooperation at the local and global levels 41 .
The extended version of the original model (called SR-EGN) 41 considers a population of N individuals, v ∈ {1, . . . , N} = V arranged on an undirected graph of connections, defined by the symmetric adjacency matrix A = {a v,w } ∈ {0, 1} N×N . When a v,w = 1 , then v and w are neighbors, while a v,w = 0 means that v and w are not connected. We will refer to the number of neighbors of a generic player v as its degree, then k v = N v=1 a v,w . The topology of the connection network among individuals is assumed to be random with a scale-free distribution and average degree k 3,42,43 . Of note, the random distribution makes agents differ as to their connectivity; this is consistent with the assumption that connectivity is distributed heterogeneously over the social group, as a result of cultural norms-(e.g. 31,32 ). Moreover, assumption of a power-law distribution of connections (scale-free network) is grounded on well-established findings on real world communities 42 . This fact has been also confirmed in other studies, when heterogeneous groups are present within the social network 46 .
Each member of the population plays 2-player games with all its neighbors continuously over time. The games played are assumed to be Prisoner's dilemmas, where the payoff earned by player v against w is described by the matrix: where R v,w is the reward for mutual cooperation, T v,w is the temptation to defect when the opponent cooperates, S v,w is the sucker's payoff earned by a cooperative player when the opponent is a free rider, and P v,w is the punishment for mutual defection. A Prisoner's dilemma game is characterized by the relation T v,w > R v,w > P v,w > S v,w . In this work, we assume that R v,w = 1 , P v,w = 0 , T v,w > 1 and S v,w < 0 . Moreover, we assume that the temptation to defect is stronger than the fear of being betrayed, i.e. T v,w − 1 > −S v,w .
According to 41 , each player plays also a game against itself, which acts as a self-regulatory term. Indeed, it is known that in human societies and animal groups, self-mechanisms are recognized able to contrast selfish behaviors, thus making possible the pursuit of cooperation resulting from personal awareness and culture 44,45 . Using self-games is a simple way to embed into the mathematical model internal evaluations, such as "what kind of reward would I earn if I use a given strategy against myself?". We denote with B v,v the payoff matrix related to this game, and with β v the strength of the self game. Notice that the self-game can be different with respect to the standard game 41 .
Thus, taken as a whole, the level of cooperation of a generic player v is denoted by x v ∈ [0, 1] , and its dynamics is ruled by the following equation: In a nutshell, this equation states that the steady state level of cooperation is one among full defection, full cooperation and intermediate values of cooperation/defection. The effective level of cooperation is then reached according to a selection mechanism ensuring the maximization of the population reward, together with the satisfaction of self-regulation mechanisms depending on parameter β v . Thus, the latter acts as an inertial factor able to counteract the natural tendency of individuals towards defection.
The ECHO-EGN group-specific features of cultural variability. In order to represent the cultural variability of the social network-i.e. the culturally driven heterogeneous distributions of Homophily, Endogamic cooperation, and Civicness among agents-the ECHO-EGN model adopts a grouped population design.
The population V is assumed to be subdivided into M groups, namely G 1 , . . . , G M , such that M g=1 G g = V, and G g ∩ G j = ∅ , for all g = j. The size of group G g is N g . Hence, the share of population belonging to group G g is δ g = N g N ∈ (0, 1) . Each group is assumed to have a scale-free distribution of the degrees, with average equal to k g . When playing a game, the individual distinguishes between members of the same (affine) and of different (non affine) groups. From now on, the corresponding quantities will be indicated by the superscript A for affine players, and N for non affine players. For example, k A v and k N v are the number of links of player v with affine and non-affine players, respectively, i.e. k A v = w∈G g a v,w and k In the following subsections, the ECHO-EGN model specifications of Homophily, Endogamic cooperation, and Civicness will be introduced.
Homophily. As stated above, Homophily is the propensity of an individual to prefer connections with members of the same group. In order to account for this property, a rewiring process has been carried out to modify the initial network of connections, according to a given probability, specific for each group, and denoted by the Homophily factor h g ∈ [0, 1] . All details on the algorithm used for the rewiring phase are given in Appendix A.
Endogamic cooperation. As stated above, Endogamic cooperation is the tendency of individuals to be more cooperative with members of the same group (affine players). The parameter e g affects the structure of the payoff matrix played in games with affine individuals. Specifically, given v ∈ G g and w ∈ V with a v,w = 1 , we define: Civicness. An important assumption of the present model is that different groups show different levels of Civicness, named c g . In the SR-EGN model, Civicness is naturally embodied by parameter β v , which maps the selfregulation mechanism constraining the agent's selfish attitude. Moreover, we assume that all members of a given group share the same self-regulation parameter, which depends on the Civicness value c g of the group, according to the following formula: where ρ N = 1−T N S N and k ′ g is the effective average degree of group g. This equation assumes that the Civicness parameters c g determine an increase (when c g > 0.4 ), a reduction (when c g < 0.4 ) or no change (when c g = 0.4 ) in the self-regulation parameters β v with respect to a critical value ρ N k ′ g , introduced by Theorem 5 of 41 . Recalling Theorem 5 of 41 , and assuming that temptation is stronger than the fear being betrayed ( T N − 1 > −S N ), the quantity ρ N k ′ , where ρ N = 1−T N S N > 1 , represents the average threshold for ensuring the global asymptotic stability of the equilibrium x ALLC = [1, . . . , 1] ⊤ (i.e., the steady state where all individuals fully cooperate).
Based on this result, in the ECHO-EGN model with groups, we assume that the self-regulation parameter of a player v in group g depends on the average threshold ρ N k ′ g and on the Civicness value c g as reported in equation (4). www.nature.com/scientificreports/ The meaning of the self-regulation parameters β v is discussed in section "Analytical results". The choice of a quadratic function, reported in blue in Fig. 1, is reasonable since β v exceeds the critical value ρ N k ′ g for higher values of the Civicness parameter with respect to a linear scaling factor ρ N k ′ g (1 + c g ) (see red line in Fig. 1). In this way, since values of β v lower than the critical value do not guarantee the convergence of the highest level of cooperation (i.e. x v = 1 ), using the quadratic function (4) individuals are more free to choose their orientation towards cooperation.
Thus, the label "ECHO-EGN" can be intended both to mean the model's main purpose-the increase of ecological validity-and the reference to the three parameters of cultural variability-Endogamic cooperation, Civicness, and HOmophily.
The ECHO-EGN equation. Using these assumptions, Eq. (1) for player v ∈ G g can be rewritten as follows: where is the affine equivalent opponent of v, and is the non affine equivalent opponent of v. More details are available in Appendix B.
Notice that equation (5) is similar to equation (1), provided that the Endogamic cooperation, Homophily and Civicness parameters have been embedded, as described above.

Model setup and validation
In this section we present the empirical analyses developed for testing ECHO-EGN's ecological validity, namely its capacity to represent natural social networks. To this end, we adopted a simulation design-we set a cluster of ECHO-EGN models up, in order to make each of them simulate a natural social network corresponding to a European regional area; then, we compare the level and distribution of cooperation of the actual social networks with those of the corresponding ECHO-EGN simulations. Moreover, in order to test that the efficacy of the ECHO-EGN simulation was due to the parameters embedding the cultural variability (i.e. Endogamic cooperation, Civicness and Homophily), the performance of the ECHO-EGN simulations was compared with a control condition-namely, a corresponding simulation carried out by a model approximating the unitary agent assumption. In what follows details, of the method and findings are reported.
The set-up of ECHO-EGN. The first step for setting up the parameters of the ECHO-EGN equation consists of the generation of the network of connections among agents. The network is generated in two steps. Initially, for each group g, a scale-free random network of size N g and average degree k g is generated. Secondly, a rewiring process is implemented for embedding the Homophily property. Further details of this procedure are reported in Appendix A.
In order to avoid any a priori bias in the group connectivity other than the diversity due to the natural degree distribution of scale-free networks, we assume that all groups share the same average degree, specifically k g = k = 4 . This can be done without loss of generality using the theoretical findings of 41 , for which the thresholds for full cooperation are scalable with respect to the average degree k.
We assume that individuals play Prisoner's dilemma games. In particular, the base payoff parameters have been set to T N = 4 and S N = −1 . The values of T A g and S A g for each group, incorporating the Endogamic cooperation parameters, are reported in Table 3.
The set-up of cultural parameters. The three cultural parameters (Homophily, Endogamic cooperation, and Civicness) of the ECHO-EGN models were estimated in accordance to the recent cultural map of European societies carried out by Salvatore and colleagues 28 . They surveyed national representative samples of a set of European countries.The investigation led to the identification of five basic worldviews-defined "symbolic universes"-each of them characterizing a cultural group of the population. Moreover, the study provided the distribution of the symbolic universes in each NUTS2 region (see Table 1). The distribution is given in terms of the size of the segments of population, each of them defined by individuals characterized by one of five symbolic universes described below.
1. Ordered universe group ( G 1 ). The world is a nice place to live; The positive view concerns every aspect: institutions, services, future, perceived as trustworthy. Endorsement of transcendent values (e.g., justice, solidarity).
(5) Institutions are responsive to individual needs. They support people in accomplishing their projects. 4. Niche of belongingness group ( G 4 ). The world is a threatening place. The primary network is the shelter from it. Belongingness is the way to survive. 5. Others' world ( G 5 ). Generalized distrust, hopelessness, lack of agency, anomy. The world belongs to others, who have power. People have to accept this situation in order to avoid suffering even more.
Symbolic universes are more than beliefs-each of them defines a mode of being-in-the-world that shapes the actor's way of feeling, thinking, and acting-in the final analysis, his/her social identity 28 . Several studies have highlighted the role played by symbolic universes in motivating and channelling social and political behaviour. They proved to orient voting behavior both in Italy 47 and at the Brexit referendum 48 ; again, they proved to be associated with the way relevant topics (immigration, Islam, homosexuality, health, participation and democracy, subjectivity) are represented in newspapers 29 as well as with the attitude towards vaccination 49 . Moreover, symbolic universes show different levels of trust in institutions, preference for in-group over out-group members, sense of community, perceived quality of the interpersonal bond, attitudes towards foreigners, adhesion to universalist versus self-centered values 28,50 Taken as a whole, the findings reported above provide convergent support to the conclusion that the map of symbolic universes supplies a reliable way of measuring the three parameters of ECHO-EGN which embed cultural pluralism. For each NUTS2 population, we set the size of the ECHO-EGN groups in accordance to the size of the symbolic universes in that population (see Table 2). Moreover, the levels of Homophily, Endogamic cooperation, and Civicness of each ECHO-EGN cultural group was set in accordance to psycho-social and cultural characteristics of the corresponding symbolic universes, as measured by Salvatore and colleagues 29 (Endogamic cooperation-cf. table 4.10, p. 156), and Mannarini and colleagues 47 (Homophily and Civicness: data not reported by the study, available on request) More particularly, each group's Endogamic cooperation was measured in terms of the corresponding symbolic universe's average level of Positive Attitude Towards Foreigners (PATF). This measure is a 4-item subscale of the Prejudice Scale estimating the self-reported propensity to engage with foreigners in social and work contexts 51 . Accordingly, we adopt it as a proxy of the propensity to cooperate with out-group members. For the purpose of . Thus, the higher the value of e g , the higher the Endogamic cooperation.
Homophily was measured in terms of each symbolic universe's average level on the Ethnic scale (ES). The Ethnic scale is one of the two subscales of the National Identity Scale 52 . It measures the view of identity as based on ethnic and blood linkages, juxtaposed to the universalist view of nationality as based on adhesion to rule of law and citizenship. Accordingly, this index lends itself to be interpreted as a proxy of the preference to relate with the in-group with respect to the out-group (for data supporting this interpretation, see 53 and 54 ). For the purpose of the model, we computed the scores in accordance to the following formula: h g = 1+ES g 2 . Civicness was measured in terms of each symbolic universe's average level on the Civic Involvement Scale(CIS). The Civic Involvement Scale is a measure focused specifically on the estimation of the level of valorization of civic rules. To fit the meaning of the measure, scores were inverted 55 . Table 3 reports the values of Endogamic cooperation e g , Homophily h g and Civicness c g parameters, as well as the the payoff parameters T A g and S A g for each symbolic universe. Moreover, a further measure of groups was used: Individual Propensity to Cooperate (IPC). It was estimated in terms of each symbolic universe's average level of Agreeableness-a self-report measure of the subject's propensity to be trustful, open to cooperation (cf. 29 , p. 155). Agreeableness is one sub-scale of the TIPI questionnaire 56 , a short instrument (10 items) used for assessing the Big Five dimensions of personality. IPC was used for validation purposes, rather than for setting the models' parameters.
Estimation of the symbolic universes' levels of attitudes towards foreigners and Agreeableness were retrieved from Salvatore and colleagues ( 29 , Annex 3, tables 4.3 and 4.10); data concerning the Ethnic Scale and the Civic Involvement Scale were obtained from Mannarini and colleagues 47 , a study performed on an Italian sample. Table 2. Distribution of the Symbolic Universes in each of the sampled 22 regional populations. The reported values are approximated to the second decimal place, and hence some rows may not exactly sum up to 1. r Acronym δ G1,r δ G2 ,r δ G3,r δ G4 ,r δ G5,r  Indexes of population's cooperation. As proxy of the observable level of cooperation, two ad hoc indicators were used: Trust in people and Trust in institutions, according to the European Social Survey (ESS) dataset 57 (cf. Table 2). Hereafter, these two indicators will be referred to as , where each element stands for one of the R regions considered. More specifically, the value Y P r was obtained as the sum of the 3 items concerning the perception of trustworthiness of people-(a) people can be trusted, (b) people try to be fair, (c) people try to be helpful-, in the r-th region, and it ranges in the interval [0, 30], while the value Y I r relative to the r-th region, is the sum of the 7 EES items concerning the level of trust in regional, national and supranational institutions-    Table 3. More particularly, for each region, several numerical experiments were performed by developing 100 numerical solutions of the model. For each solution, the initial condition provided was randomly generated with uniform distribution in the set (0, 1) N . Analogously, in each simulation the random networks were generated according to the procedure described in Appendix A.
Control experiment. The control experiment was developed by assuming a model of social network approximating the unitary agent assumption. To this aim, Endogamic cooperation and Civicness parameters were set equal to the average evaluated over the SUs, thus assuming that all players have the same behavior, independently of the group they belong to. Practically, the Endogamic cooperation and Civicness parameters were set equal to the average of the values reported in Table 3 for all SUs. Finally, in order to enable the control simulation to provide between-regions variability, the Homophily parameter was kept in the control model too. Thus, also in the control model the group differentiation was maintained, but only for setting up the Homophily. In so doing, the control condition enabled a specific estimate to be made of the difference of simulation performance due to two cultural parameters (Endogamic cooperation and Civicness). Moreover, with this design, the control model was able to check the alternative hypothesis that the efficacy of the ECHO-EGN simulation was due to the size of the groups.
For each region, the control outputs were obtained by means of the same procedure used for the ECHO-EGN simulations, i.e. 100 experiments, with randomly generated initial condition.
Results. The average cooperation X V and its standard deviation σ X V obtained for each of the 100 numerical solutions of the ECHO-EGN model were compared with real dataset Y P , Y I , σ P and σ I by means of the Pearson correlation coefficient r. Moreover, the Pearson correlation coefficient was computed as a measure of the association between the level of cooperation (i.e. the values α of IPC, reported in Table 5) of each natural group/symbolic universe over the whole R = 22 sample, and the corresponding level generated by the simulation models. Figure 2 reports, for each region, the corresponding Y P value and the asymptotic simulated cooperation averaged over the whole population. In particular, we report their standardized version, Ŷ P on x-axis and X V on y-axis, where ẑ = z−�z� σ z . Different colors have been used to distinguish among countries: dark blue for Denmark, light blue for Netherlands, green for UK and yellow for Italy. The black line represents the linear regression, and its closeness to data reveal the very strong correlation between real data and model simulations. Indeed, the slope of the regression line, corresponding to the correlation coefficient, is 0.95, while the offset is almost 0. The p-value, indicating the statistical significance of the correlation coefficient, is 1.3 · 10 −11 , while R 2 , representing the quality of the regression line, is 0.99. It is interesting to observe the presence of clusters, clearly identifying each country considered on both real data and model simulations. Denmark and Netherlands exhibit the highest levels of cooperation, UK shows intermediate levels, while the lowest levels is observed for Italy.
In Fig. 3, standardized σ P , ( σ P on x-axis) and standardized σ X V ( σ X V on y-axis) are reported for all regions. The slope of the regression line is 0.82, while the offset is almost 0. The p-value is 3.8 · 10 −6 , while R 2 = 0.97 . Country clusters are present here too; in this case the highest levels of the standard deviation are shown by the measures referring to Italy, denoting a higher heterogeneity of the Y P data and of simulated cooperation. UK presents intermediate values, while Denmark and Netherlands prove to have the smallest ones. www.nature.com/scientificreports/ Similar results were obtained by analyzing Y I data. Figure 4 reports, for each region, the standardized Y I value ( Ŷ I on x-axis) and the standardized X V ( X V on y-axis). The slope of the regression line is 0.9, while the offset is almost 0. The p-value is 9.8 · 10 −9 , while R 2 = 0.99 . The presence of country clusters is observed and again, Denmark and Netherlands exhibit the highest levels of Y I data and the average simulated cooperation, UK shows intermediate levels, while the lowest results are observed in Italy.
In Fig. 5, the standardized value of σ I ( σ I on x-axis) and standardized σ X V ( σ X V on y-axis) are reported for each region. The slope of the regression line is 0.67, while the offset is almost 0. The p-value is 6.6 · 10 −4 , while R 2 = 0.89 . Also in this case, highest levels of the standard deviation are reached by Italy, denoting higher heterogeneity of data and simulations. UK shows intermediate values, while Denmark and Netherlands prove to have the lowest ones. The distribution of the cooperation level of each group and of the whole population observed in these experiments are reported in Fig. 6, where high concentrations of individuals with a given cooperation level are represented by pink shading. Green and blue arrows denote the average and the mode calculated for each group and over the whole population, respectively.
An additional validation was carried out by comparing the average cooperation level recorded for each group of each simulation model and the average Individual Propensity to Cooperate (the variable α of Table 5) of  www.nature.com/scientificreports/ each corresponding natural group. The corresponding estimated probability density function of the correlation r(X G , α) is depicted in Fig. 7. The average correlation is r = 0.69. In order to validate the choice of the parameters, we performed a control experiment as described in section "Control experiment". In this way, we assumed that all players behave in the same way with respect to the external individual (i.e. constant Endogamic cooperation), and with respect to their attitude to self-regulation of defection (i.e. constant Civicness). Figure 8.a reports the estimated probability density function (pdf) of the correlation coefficients r(X V , Y P ) (blue for the base experiment, purple for the control one) and r(X V , Y I ) (red for the base experiment, green for the control one), while Fig. 8.b shows the estimated pdf of the correlation coefficients r(σ X V , σ P ) (blue for the base experiment, purple for the control one) and r(σ X V , σ I ) (red for the base experiment, green for the control one). The average correlation values correspond to the dashed vertical lines. The highest correlations are observed for both the dataset Y P ( r = 0.93 ) and σ P ( r = 0.75 ) in the base experiment (blue), while the control experiment (purple) produces uncorrelated results ( r = −0.22 for Y P and r = −0.15 for σ P ). High significant correlations are also found for the Y I ( r = 0.85 ) and σ I ( r = 0.65 ) datasets, while in the control experiment we observe low values ( r = −0.22 for Y I and r = −0.15 for σ I ). It is clear that in all cases investigated, the performances of the control experiment are much lower than those of the base model, where  Discussion. The output of the simulation study provided convergent support to the ecological validity of ECHO-EGN. The very high correlations between the level of cooperation of the natural groups and the corresponding ECHO-EGN models showed that the latter is able to simulate natural social networks quite effica-  www.nature.com/scientificreports/ ciously. The ECHO-EGN's simulation capacity resulted almost absolute when the trust in people index is used ( r = 0.93 ); it is however very high ( r = 0.85 ) in the case of the trust in institution index. This difference may be due to the fact that in the latter case the index involves institutions that are transversal to the territorial populations (e.g. European Union and United Nations) and therefore could be less reflective of the specificity of each local population. The high correlation between the natural and simulated within-population variability of the cooperation ( r = 0.75 and r = 0.65 , respectively for trust in people and trust in institutions) provides further support to the ECHO-EGN ecological validity-this result highlights that the ECHO-EGN is not only able to simulate the global cooperation level of the natural social networks, but also, more importantly, its distribution within the population. Again, it is worth noticing that the ECHO-EGN model proved able to simulate quite efficaciously the cooperation of the five segments of natural social groups defined by the symbolic universes ( r = 0.69 ) too. This is a further cross-validation of the ECHO-EGN, provided by an indirect source-namely an independent measure (Individual Propensity to Cooperate) which was not involved in the model set-up.
This convergent evidence is still more significant if one considers that no fine tuning of the model parameters was applied; indeed, parameters were set up by means of a priori knowledge only-i.e. the data on the size and psycho-social characteristics of the cultural segments analyzed by Salvatore and colleagues 29 and Mannarini and colleagues 47 . In this the findings of the validation test lead to conclude that the ECHO-EGN embeds significantly the psycho-social processes, which drive the emergence of cooperation in social networks.
Finally, the fact that the control model-i.e. the model which embeds two out of three homogeneous cultural parameters-proves to be unable to simulate natural social networks (correlation between control simulations and actual populations is close to 0 or negative in all comparisons) supports the conclusion that the ECHO-EGN ecological validity is due to the parameters mapping the cultural variability of population.
In sum, the main experiment presents significantly higher correlations, thus showing that the introduction of the symbolic universes and the mechanisms of Endogamic cooperation, Civicness and Homophily in the mathematical model accounts reasonably well for traits which regulate the cooperative behavior in social networks.

Constraints on cooperation.
In this section we report some theoretical results concerning the stability of steady states of the ECHO-EGN equation (5), i.e. constant solutions to which the system dynamics will eventually converge. These states can be found by assuming that ẋ = 0 , and they embed peculiar properties of asymptotic dynamics of individuals and population as well. In our study, we consider the steady states x ALLC and x ALLD of system (5), which represent the situations where all players assume a fully cooperative or fully defective asymptotic behavior, respectively.
then the steady state x ALLC is asymptotically stable.
The Theorem essentially states that Endogamic cooperation restrains cooperation. Indeed, in a social network without Endogamic cooperation, the asymptotic stability of x ALLC requires that the self-regulation parameters β v exceed the degree of the player (see Theorem 3 in 41 ). On the other hand, since η v > k v in accordance to Remark 1, to guarantee the asymptotic stability of the fully cooperative steady state x ALLC in presence of endogamic groups, the members of these groups must have stronger self-regulation parameters, although they show a reduced temptation to defect when playing with the members of the same group ( T A g < T N ).
then the steady state x ALLD is asymptotically stable.
The Theorem essentially states that Endogamic cooperation fosters defection. Indeed, in a social network without Endogamic cooperation, the asymptotic stability of x ALLD requires that the self-regulation parameters β v is below the degree of the player (see Theorem 4 in 41 ). On the other hand, since ζ v > k v in accordance to Remark 2, despite the fact that affine players have less fear of being betrayed by individuals belonging to the same group than all other individuals ( |S A g | < |S N | ), their behavior is still defective for larger values of the self-regulation parameter than when all players use the same payoff matrix B N .
The proofs of Theorems 1 and 2 are reported in Appendix C. www.nature.com/scientificreports/ Theorem interpretation. It is interesting to investigate the relationship between values of parameters β v and the thresholds found in Theorems 1 and 2.
To this end, in Table 6 the self-regulation parameters β v , averaged over the regions and the simulation trials, are reported in column 2 for each group. Moreover, these values are compared to the same averages of threshold η v , found in Theorem 1 (column 3). Additionally, the Theorem 1 satisfaction is indicated in column 4 for each group. We observe that, on the average, all groups except for G 4 and G 5 satisfy Theorem 1. Columns 5 and 6 report similar results on full defection, related to Theorem 2. Notice that in this case, "yes" means that the value of column 2 is lower than the value in column 5, and "no" the opposite, as shown in column 6. Only group G 4 satisfies the requirements of Theorem 2. This means that for this group it is not only more difficult to cooperate, but it is also more easier to defect.
Discussion. The formal analysis of ECHO-EGN leads to a rather counter-intuitive conclusion. The fact that, as Theorem 1 states, Endogamic cooperation reduces the global level of cooperation, means that the in-group identity and therefore in-group solidarity promotes cooperation locally (i.e. among in-group members) but prevents it globally (i.e. at the level of the whole society). On the other hand, Theorem 2 ensures that when Endogamic cooperation is active, the behavior of individuals can be defective even in the case of high selfregulation. These results have a relevant theoretical implication. Indeed, it is consistent with those that criticize the view of in-group bonds (e.g. conceptualized either as sense of community 58 or bonding social capital 26 ) as the lever to increase cooperation and trust in society. In opposition to this rather popular view (e.g. 59,60 ), some authors underline that-when not integrated by universtalist and civic attitudes and values-the involvement in the community/in-group bonds can foster identity motives and closure towards the out-group -therefore, paradoxically, to a global reduction of social cooperation and cohesion 61,62 . Theorems 1 and 2 provide analytical support to this criticism, by showing the role played by the relation with not-affine members and Civicness/selfregulation as strategic resources for cooperation.

Conclusion
This paper focused on ECHO-EGN-a model of the evolution of cooperation in social networks designed to go beyond the unitary agent assumption, which greatly weakens the realism of the analysis, reducing the ecological validity of theoretical conclusions and related pragmatic implications.
ECHO-EGN models the variability of agents in terms of three major parameters, each of them mapping a cultural component of the inherent pluralism of natural social networks: Homophily-i.e. preference to relate with in-group members; Endogamic cooperation-i.e. the higher propensity to cooperate with in-group members; the Civicness-i.e. the propensity to cooperate in the public domain. These components have been conceived as cultural because they are fostered by cultural norms and related psycho-social drivers.
The validation test on ECHO-EGN shows that, thanks to these cultural parameters, the model reaches capacity to simulate the level of cooperation of natural social networks-from almost full to very high, accordingly to the index of cooperation adopted. Moreover, ECHO-EGN proves to be able to simulate efficaciously the within-population distribution of cooperation as well as the average level of the cultural segments' propensity to cooperate.
The high performance on the simulation test leads to two complementary conclusions. On the one hand, it supports the validity of the cultural parameters used by ECHO-EGN, legitimizing them as an effective way to map the cultural and psycho-social processes underpinning the dynamics of cooperation. On the other hand, it provides further evidence of the theoretical and methodological soundness of the notion of symbolic universes 28,50 . Indeed, this notion underlies the data used to set up the ECHO-EGN models simulating natural social networks. Therefore, the success of the simulation is an indirect proof of the fact that the conceptual and methodological concept of symbolic universe provides a valid and reliable approach to the cultural analysis of a social group.
The formal analysis of ECHO-EGN provides further food for thought. It shows that cooperation is prevented, rather than fostered, by in-group identity and solidarity. This result is theoretically and practically relevant-it integrates the idea of community as the fundamental resource for promoting social cooperation and development. What the analysis specifically suggests is that valorized community bonds have to be integrated by the restoration of forms of universalism in order to make societies more cohesive and inclusive 34 . Table 6. Relationship between average self-regulation parameters β v and the thresholds of Theorems 1 and 2. Col. 2: the value β v averaged over a given group, over the R = 22 regions and over the 100 trials. Col. 3: the value of threshold η v averaged over a given group, over the R = 22 regions and over the 100 trials. Col. 4: Theorem 1 satisfaction (in average). Col. 5: the value the value ζ v averaged over a given group, over the R = 22 regions and over the 100 trials. η v averaged over a given group, over the R = 22 regions and over the 100 trials. Col. 6: Theorem 2 satisfaction (on average).

Name
Avg. www.nature.com/scientificreports/ In general, the realism demonstrated by ECHO-EGN has important implications. At the methodological level, it enables a forecast approach, aimed at mapping the impact of the variation of cultural factors on cooperation. Such an approach could have a practical value too-it paves the way for the use of simulation and formal analysis in the design of policies for social cohesion and cooperation. According to this view, ECHO-EGN can be to estimate and/or to model the impact of cultural factors on the natural social networks' level of cooperation, for the sake of identifying critical drivers and/or setting strategic objectives and/or estimating the consequences of interventions.
Before concluding, it is worth highlighting some limitations of the study. First, the simulation test was based on a rather small sample of units of analysis, collected on a convenience criterion. Thus, even if the sample proved to incorporate relevant geographical variability (it comprises territories from a Mediterranean country and Northern-European countries as well), further analyses, based on more comprehensive samples of population are required to support the generalization of the current conclusion. Second, the set-up of some of the cultural parameters (more particularly, Homophily and Endogamic cooperation) were based on indirect indicators, chosen on a criterion of convenience (i.e the availability of data). Thus, further studies are required to test different, more direct estimations of Homophily, Endogamic cooperation. On the other hand, it has to be noted that if the current estimation of these two parameters should be proved to be imprecise, this would mean that ECHO-EGN would have a further chance to empower its ecological validity. Third, the simulation test used only two criteria (trust in people and trust in institutions) to estimate the convergence between simulated and natural social networks. Further studies will be aimed at analyzing the ECHO-EGN's ecological validity through other indicators of cooperation-this will be done both to corroborate its realism and to identify the specific aspects of cooperation the model is sensitive to. Finally, we are aware that other components of cultural pluralism need to be taken into account, in order to enhance the ECHO-EGN ecological validity-e.g. the heterogeneous propensity to socialize, further sources of the inherent differences in the agents' propensity to cooperate, the different temporality agents adopt as the frame of their decisions. The current findings of our work encourage us to see these elements as sources of potential developments of ECHO-EGN, with the prospect of building a mathematical model of the cultural dynamics of cooperation.

Appendix A: Network generation for grouped populations
Given the region r in the set of R = 22 populations considered in this study, we generated M = 5 scale-free networks, each of size N g = δ r,g N according to Table 2. The scale-free structure is obtained by employing preferential attachment methods. In a nutshell, given the desired average degree k g , an initial fully connected network of m = k g 2 is generated. Then, further nodes are added to the network, by connecting it via m links to the already existing nodes. The probability that a new node is connected to one of the existing ones is proportional to the current degree of those nodes. This procedure is repeated until the number of nodes in the networks is equal to N g .
The networks obtained are not cross connected. In order to create inter-group links and to embed the Homophily property, a rewiring process is implemented. Specifically, for each couple of connected players v and w, where v belongs to group g, the link is removed with probability 1 − h g , and replaced by a new link between v and a random player of a group different from g. Since the Homophily h g denotes the probability of one player being connected to an affine one, then the probability of changing an affine link with a non affine one is 1 − h g . It can therefore be seen that, due to the stochasticity of this process, k A v = h g k v and k N v = (1 − h g )k v on the average. Due to the stochasticity of the network, the effective average degree k ′ g of a group g is in general slightly different than the average k g . To distinguish the two cases, we introduce the effective parameters k ′ g and k ′ as According to the assumption discussed in section "Homophily", for which the topology of the connection network is random with a scale-free distribution, we notice that the network obtained by the above procedure is still scale-free. Indeed: where δ g is the share of group g in the considered population and k = M g=1 δ g k g 2 is the average degree of the resulting complete network. www.nature.com/scientificreports/ Since in this paper we assume that k g = 4 , then k = 4 M g=1 δ g = 4.

Appendix B: Derivation of the ECHO-EGN model
Let's consider a generic player v belonging to group g, and another player w connected to v. We have that: e. each player is affine with itself. Accordingly, equation (1) can be rewritten as follows: The last equality corresponds to the ECHO-EGN model described by Eq. (5).

Appendix C: Proofs of Theorems 1 and 2
In this appendix the proofs of the theoretical results concerning the stability of the steady states x ALLC and x ALLD of the ECHO-EGN Eq. (5), referred to in section "Analytical results", are reported. To this aim, the equations (5) are linearized locally near x ALLC and x ALLD by evaluating the entries of the Jacobian matrix It is useful to rewrite equation (5) as follows: where and In particular, given a player v ∈ G g , the diagonal entries of J(x) are: On the other hand, the off-diagonal entries of J(x) are: From the theory of nonlinear dynamic systems, the stability of a steady state x * depends on the sign of the real part of the eigenvalues of the corresponding Jacobian matrix J(x * ) 43 . For x ALLC and x ALLD , since x v ∈ {0, 1} , www.nature.com/scientificreports/ then the off-diagonal entries reported in (A.8) are identically null. Therefore, the Jacobian matrix has a diagonal structure, and hence its eigenvalues coincide with the expressions reported in (A.7), i.e. v = j v,v (x * ) = ∂ẋ v ∂x v (x * ) . In the following Theorems, we find the sufficient conditions to have negative v ∀v ∈ {1, . . . , N}.
Theorem 1. If β v > η v ∀v ∈ V , where then the steady state x ALLC is asymptotically stable.
Proof Considering a player v ∈ G g , from equation (A.7) we get that: Since T A g > 1 and β v > η v , then v < 0 . This holds for any v. Hence, all eigenvalues are negative, and x ALLC is asymptotically stable.
In accordance to Theorem 3 in 41 , we know that, considering a population which uses only the payoff matrix B N , then x ALLC is asymptotically stable if Comparing the thresholds obtained in Theorem 1 of this paper and in Theorem 3 of 41 , we notice that: Indeed: This corresponds to Remark 1.
Despite the fact that players have lower temptation to defect towards members of their own group than towards all other individuals ( T A g < T N ), they must possess a stronger self-regulation parameter β v with respect to the case where all players use always the same payoff matrix B N to guarantee the asymptotic stability of the fully cooperative steady state x ALLC . Theorem 2. If β v < ζ v ∀v ∈ V , where then the steady state x ALLD is asymptotically stable.
Proof Considering a player v ∈ G g , from equation (A.7) we get that: Since S A < 0 and β v < ζ v , then v < 0 . This holds for any v. Hence, all eigenvalues are negative, and x ALLD is asymptotically stable. .
. www.nature.com/scientificreports/ In accordance to Theorem 4 of 41 , we know that, considering a population which uses only the payoff matrix B N , then x ALLD is asymptotically stable if Comparing the thresholds obtained in Theorem 2 of this paper and in Theorem 4 of 41 , we notice that: Indeed: This corresponds to Remark 2. Hence, even if affine players are less afraid of being betrayed by affine players than all other individuals ( |S A g | < |S N | ), their behavior is defective also for larger values of the self-regulation parameter with respect to the case where all players use the same payoff matrix B N .
Received: 6 July 2021; Accepted: 2 September 2021 www.nature.com/scientificreports/ Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http:// creat iveco mmons. org/ licen ses/ by/4. 0/.