Documentation

CslibFrontier.GameTheory.Evolutionary.GraphESS

Evolutionary game theory over graphs #

This module formalizes [Sur07], Section 29.4 (pp. 728–733, originating in Kearns and Suri 2006) and Exercise 29.7 (p. 736): evolutionary stability when organisms interact only with their neighbors in an infinite family of finite undirected graphs G : ∀ n, SimpleGraph (Fin n).

Model and definitions #

In a finite simple graph G : SimpleGraph V (loopless, matching [Sur07], p. 729, Γ(u) = {v ∈ V : (u, v) ∈ E}), if each vertex u plays a mixed strategy strat u : α → ℝ in a two-player game F : BimatrixGame α α, the neighborhood fitness of u is F.graphFitness G strat u = (∑ v ∈ G.neighborFinset u, F.payoff₁ (strat u) (strat v)) / |Γ(u)| (taking value 0 when u is isolated).

Main results #

References #

Neighborhood fitness and graphical ESS definitions #

noncomputable def Cslib.GameTheory.BimatrixGame.graphFitness {α : Type u_1} [Fintype α] {V : Type u_2} [Fintype V] (F : BimatrixGame α α) (G : SimpleGraph V) (strat : V → α → ℝ) (u : V) :

The neighborhood fitness of vertex u in a simple graph G when vertices play strategies strat : V → α → ℝ in game F ([Sur07], Section 29.4, p. 729): F(u) = (∑ v ∈ Γ(u), F(s_u | s_v)) / |Γ(u)|, taking value 0 when u is isolated.

theorem Cslib.GameTheory.BimatrixGame.graphFitness_eq {α : Type u_1} [Fintype α] {V : Type u_2} [Fintype V] (F : BimatrixGame α α) (G : SimpleGraph V) (strat : V → α → ℝ) (u : V) [Fintype ↑(G.neighborSet u)] :
F.graphFitness G strat u = (∑ v ∈ G.neighborFinset u, F.payoff₁ (strat u) (strat v)) / ↑(G.neighborFinset u).card

Evaluation formula for graphFitness with any Fintype (G.neighborSet u) instance.

theorem Cslib.GameTheory.BimatrixGame.graphFitness_eq_zero_of_isIsolated {α : Type u_1} [Fintype α] {V : Type u_2} [Fintype V] (F : BimatrixGame α α) (G : SimpleGraph V) (strat : V → α → ℝ) {u : V} (hu : G.IsIsolated u) :
F.graphFitness G strat u = 0

An isolated vertex has neighborhood fitness 0 (by 0 / 0 = 0).

noncomputable def Cslib.GameTheory.BimatrixGame.survivingMutants {α : Type u_1} [Fintype α] {V : Type u_2} [Fintype V] (F : BimatrixGame α α) (G : SimpleGraph V) (M : Finset V) (s t : α → ℝ) :

The mutants in M that survive against all of their incumbent neighbors: j ∈ M has no incumbent neighbor i ∉ M with strictly higher fitness.

theorem Cslib.GameTheory.BimatrixGame.mem_survivingMutants_iff {α : Type u_1} [Fintype α] {V : Type u_2} [Fintype V] [DecidableEq V] (F : BimatrixGame α α) (G : SimpleGraph V) (M : Finset V) (s t : α → ℝ) {j : V} :
j ∈ F.survivingMutants G M s t ↔ j ∈ M ∧ ¬∃ i ∉ M, G.Adj j i ∧ F.graphFitness G (fun (u : V) => if u ∈ M then t else s) j < F.graphFitness G (fun (u : V) => if u ∈ M then t else s) i

Membership characterization of survivingMutants: a mutant survives iff it has no incumbent neighbor of strictly higher fitness.

def Cslib.GameTheory.BimatrixGame.Contracts {α : Type u_1} [Fintype α] (F : BimatrixGame α α) (G : (n : ℕ) → SimpleGraph (Fin n)) (M : (n : ℕ) → Finset (Fin n)) (s t : α → ℝ) :

A family of mutant sets M contracts in the graph family G under incumbent strategy s and mutant strategy t ([Sur07], Definition 29.13, p. 729) when all but o(n) mutants have an incumbent neighbor of strictly higher fitness, i.e., |survivingMutants| / n → 0. The source applies this predicate to families with |M_n| ≥ ε n, as enforced by IsEpsLinear in Definition 29.15.

theorem Cslib.GameTheory.BimatrixGame.contracts_iff {α : Type u_1} [Fintype α] (F : BimatrixGame α α) (G : (n : ℕ) → SimpleGraph (Fin n)) (M : (n : ℕ) → Finset (Fin n)) (s t : α → ℝ) :
F.Contracts G M s t ↔ Filter.Tendsto (fun (n : ℕ) => ↑(F.survivingMutants (G n) (M n) s t).card / ↑n) Filter.atTop (nhds 0)

A family of mutant sets M is ε'-linear ([Sur07], Definition 29.14, p. 730) if there exists 0 < ε < ε' such that ε n < |M_n| < ε' n for all sufficiently large n.

theorem Cslib.GameTheory.BimatrixGame.isEpsLinear_iff (ε' : ℝ) (M : (n : ℕ) → Finset (Fin n)) :
IsEpsLinear ε' M ↔ ∃ (ε : ℝ), 0 < ε ∧ ε < ε' ∧ ∀ᶠ (n : ℕ) in Filter.atTop, ε * ↑n < ↑(M n).card ∧ ↑(M n).card < ε' * ↑n
def Cslib.GameTheory.BimatrixGame.IsGraphESS {α : Type u_1} [Fintype α] (F : BimatrixGame α α) (G : (n : ℕ) → SimpleGraph (Fin n)) (s : α → ℝ) :

A mixed strategy s is an evolutionarily stable strategy with respect to F and G ([Sur07], Definition 29.15, p. 730) if for every other mixed strategy t ≠ s there exists ε_t > 0 such that every ε_t-linear mutant family M playing t contracts.

theorem Cslib.GameTheory.BimatrixGame.isGraphESS_iff {α : Type u_1} [Fintype α] (F : BimatrixGame α α) (G : (n : ℕ) → SimpleGraph (Fin n)) (s : α → ℝ) :
F.IsGraphESS G s ↔ IsMixedStrategy s ∧ ∀ (t : α → ℝ), IsMixedStrategy t → t ≠ s → ∃ εt > 0, ∀ (M : (n : ℕ) → Finset (Fin n)), IsEpsLinear εt M → F.Contracts G M s t
theorem Cslib.GameTheory.BimatrixGame.IsGraphESS.isMixedStrategy {α : Type u_1} [Fintype α] {F : BimatrixGame α α} {G : (n : ℕ) → SimpleGraph (Fin n)} {s : α → ℝ} (h : F.IsGraphESS G s) :

Two-strategy neighborhood fitness formulas #

Complete-graph characterization and converse analysis #

theorem Cslib.GameTheory.BimatrixGame.isGraphESS_complete_iff {α : Type u_1} [Fintype α] (F : BimatrixGame α α) (s : α → ℝ) :
F.IsGraphESS (fun (x : ℕ) => ⊤) s ↔ IsMixedStrategy s ∧ ∀ (t : α → ℝ), IsMixedStrategy t → t ≠ s → F.payoff₁ t s < F.payoff₁ s s ∨ F.payoff₁ t s = F.payoff₁ s s ∧ (F.payoff₁ t t < F.payoff₁ s t ∨ F.payoff₁ t t = F.payoff₁ s t ∧ F.payoff₁ s s < F.payoff₁ s t)

Exact characterization of IsGraphESS on the loopless complete-graph family {K_n} ([Sur07], pp. 730, 732–733): a mixed strategy s is a graph ESS on fun _ => ⊤ iff for every mixed strategy t ≠ s, either F(t|s) < F(s|s), or F(t|s) = F(s|s) and F(t|t) < F(s|t), or F(t|s) = F(s|s), F(t|t) = F(s|t), and F(s|s) < F(s|t).

The third branch is an artifact of loopless K_n: when F(t|s) = F(s|s) and F(t|t) = F(s|t), each mutant has one fewer mutant neighbor than each incumbent, shifting its fitness below each incumbent's by (F(s|t) - F(s|s)) / (n - 1).

Complete-graph corollaries and counterexample to unguarded converse #

theorem Cslib.GameTheory.BimatrixGame.IsESS.isGraphESS_complete {α : Type u_1} [Fintype α] {F : BimatrixGame α α} {s : α → ℝ} (hs : F.IsESS s) :
F.IsGraphESS (fun (x : ℕ) => ⊤) s

Every classical ESS is a graph ESS on the complete-graph family {K_n} ([Sur07], Section 29.4, p. 730).

theorem Cslib.GameTheory.BimatrixGame.IsGraphESS.isNash_of_complete {α : Type u_1} [Fintype α] {F : BimatrixGame α α} (hF : F.B = F.A.transpose) {s : α → ℝ} (hs : F.IsGraphESS (fun (x : ℕ) => ⊤) s) :
F.IsNash s s

Every graph ESS on the complete-graph family {K_n} is a symmetric Nash equilibrium of any symmetric game F.

theorem Cslib.GameTheory.BimatrixGame.IsGraphESS.isESS_of_complete {α : Type u_1} [Fintype α] {F : BimatrixGame α α} {s : α → ℝ} (hs : F.IsGraphESS (fun (x : ℕ) => ⊤) s) (hnotie : ∀ (t : α → ℝ), IsMixedStrategy t → t ≠ s → F.payoff₁ t s = F.payoff₁ s s → F.payoff₁ t t = F.payoff₁ s t → F.payoff₁ s t ≤ F.payoff₁ s s) :
F.IsESS s

Conditional converse to Theorem 29.16 on loopless {K_n} ([Sur07], pp. 732–733): a graph ESS on {K_n} is a classical ESS whenever no mutant t ≠ s ties both F(t|s) = F(s|s) and F(t|t) = F(s|t) with F(s|s) < F(s|t).

Counterexample to the unguarded loopless converse on {K_n}: in the symmetric 2 × 2 constant-column game !![0, 1; 0, 1], pure strategy ![1, 0] is a graph ESS on {K_n} under Definition 29.15 (because excluding self-loops lowers every mutant's fitness by q / (n - 1) below every incumbent's), yet is not a classical ESS (indeed the game has no classical ESS).

theorem Cslib.GameTheory.BimatrixGame.IsESS.eventually_forall_graphFitness_lt_complete {α : Type u_1} [Fintype α] {F : BimatrixGame α α} {s : α → ℝ} (hs : F.IsESS s) {t : α → ℝ} (ht : IsMixedStrategy t) (hne : t ≠ s) :
∃ εt > 0, ∀ (M : (n : ℕ) → Finset (Fin n)), IsEpsLinear εt M → ∀ᶠ (n : ℕ) in Filter.atTop, ∀ j ∈ M n, ∀ i ∉ M n, F.graphFitness ⊤ (fun (u : Fin n) => if u ∈ M n then t else s) j < F.graphFitness ⊤ (fun (u : Fin n) => if u ∈ M n then t else s) i

Complete-graph obstruction for Exercise 29.7 at p ≡ 1 (K_n): for any classical ESS s and mutant strategy t ≠ s, there is a threshold εt > 0 such that for every εt-linear mutant family M, eventually every mutant in K_n has strictly lower fitness than every incumbent.

Asymptotics and Borel–Cantelli helpers for p n = Ω(1 / n ^ c) #

Unconditional Lemma 29.17 (additive and multiplicative forms) #

theorem Cslib.GameTheory.BimatrixGame.tendsto_binomialRandom_real_forall_abnormalFitness_additive_le {α : Type u_1} [Fintype α] {p : ℕ → ↑unitInterval} {c : ℝ} (hc1 : c < 1) (hp : ∃ a > 0, ∀ᶠ (n : ℕ) in Filter.atTop, a / ↑n ^ c ≤ ↑(p n)) (F : BimatrixGame α α) (s t : α → ℝ) {ε₀ η : ℝ} (hε₀ : 0 < ε₀) (hη0 : 0 < η) (hη1 : η ≤ 1 / 2) :
Filter.Tendsto (fun (n : ℕ) => (SimpleGraph.binomialRandom (Fin n) (p n)).real {G : SimpleGraph (Fin n) | ∀ (M : Finset (Fin n)), ε₀ * ↑n ≤ ↑M.card → ε₀ * ↑n ≤ ↑Mᶜ.card → {u : Fin n | if u ∈ M then η * |F.payoff₁ t t - F.payoff₁ t s| < |F.graphFitness G (fun (v : Fin n) => if v ∈ M then t else s) u - ((1 - ↑M.card / ↑n) * F.payoff₁ t s + ↑M.card / ↑n * F.payoff₁ t t)| else η * |F.payoff₁ s t - F.payoff₁ s s| < |F.graphFitness G (fun (v : Fin n) => if v ∈ M then t else s) u - ((1 - ↑M.card / ↑n) * F.payoff₁ s s + ↑M.card / ↑n * F.payoff₁ s t)|}.ncard ≤ 4 * ⌈Real.log ↑n / ↑(p n)⌉₊}) Filter.atTop (nhds 1)

Unconditional uniform additive fitness concentration (generalizing [Sur07], Lemma 29.17, p. 731, to arbitrary real payoff matrices without positivity assumptions, simultaneously over all adversarial mutant sets M): when p n = Ω(1 / n ^ c) (0 ≤ c < 1), for any 0 < ε₀, 0 < η ≤ 1 / 2, any game F, and any strategies s, t, with probability tending to 1 in G(Fin n, p n), for every mutant set M with ε₀ n ≤ |M|, |Mᶜ|, all but at most 4 * ⌈log n / p n⌉₊ vertices have fitness within η * |F(s|t) - F(s|s)| (for incumbents) or η * |F(t|t) - F(t|s)| (for mutants) of the classical expected fitness at share |M| / n.

theorem Cslib.GameTheory.BimatrixGame.tendsto_binomialRandom_real_forall_abnormalFitness_mul_le {α : Type u_1} [Fintype α] {p : ℕ → ↑unitInterval} {c : ℝ} (hc1 : c < 1) (hp : ∃ a > 0, ∀ᶠ (n : ℕ) in Filter.atTop, a / ↑n ^ c ≤ ↑(p n)) (F : BimatrixGame α α) (hA : ∀ (i j : α), 0 < F.A i j) {s t : α → ℝ} (hs : IsMixedStrategy s) (ht : IsMixedStrategy t) {ε τ : ℝ} (hε0 : 0 < ε) (hε1 : ε < 1) (hτ0 : 0 < τ) (hτ1 : τ < 1 / 6) :
Filter.Tendsto (fun (n : ℕ) => (SimpleGraph.binomialRandom (Fin n) (p n)).real {G : SimpleGraph (Fin n) | ∀ (M : Finset (Fin n)), min ε (1 - ε) * ↑n ≤ ↑M.card → min ε (1 - ε) * ↑n ≤ ↑Mᶜ.card → ↑{u : Fin n | u ∉ M ∧ ¬((1 - τ) * ((1 - ↑M.card / ↑n) * F.payoff₁ s s + ↑M.card / ↑n * F.payoff₁ s t) ≤ F.graphFitness G (fun (v : Fin n) => if v ∈ M then t else s) u ∧ F.graphFitness G (fun (v : Fin n) => if v ∈ M then t else s) u ≤ (1 + τ) * ((1 - ↑M.card / ↑n) * F.payoff₁ s s + ↑M.card / ↑n * F.payoff₁ s t))}.ncard ≤ 24 * Real.log ↑n / (τ ^ 2 * ↑(p n)) ∧ ↑{u : Fin n | u ∈ M ∧ ¬((1 - τ) * ((1 - ↑M.card / ↑n) * F.payoff₁ t s + ↑M.card / ↑n * F.payoff₁ t t) ≤ F.graphFitness G (fun (v : Fin n) => if v ∈ M then t else s) u ∧ F.graphFitness G (fun (v : Fin n) => if v ∈ M then t else s) u ≤ (1 + τ) * ((1 - ↑M.card / ↑n) * F.payoff₁ t s + ↑M.card / ↑n * F.payoff₁ t t))}.ncard ≤ 24 * Real.log ↑n / (τ ^ 2 * ↑(p n))}) Filter.atTop (nhds 1)

Unconditional Lemma 29.17 ([Sur07], Section 29.4.1, p. 731, stated without proof in the source): for a game F with strictly positive payoffs (0 < F.A i j), mixed strategies s, t, constants 0 < ε < 1, 0 < τ < 1 / 6, 0 ≤ c < 1, and p n = Ω(1 / n ^ c), with probability tending to 1 in G(Fin n, p n), simultaneously over all mutant sets M with min ε (1 - ε) * n ≤ |M|, |Mᶜ|, at most 24 * log n / (τ ^ 2 * p n) incumbents lie outside (1 ± τ) [(1 - ε_M) F(s|s) + ε_M F(s|t)] and at most 24 * log n / (τ ^ 2 * p n) mutants lie outside (1 ± τ) [(1 - ε_M) F(t|s) + ε_M F(t|t)] (where ε_M = |M| / n, specializing to ε when |M| = ε n).

Strict positivity 0 < F.A i j ensures that the target fitnesses are positive, which is required for a multiplicative (1 ± τ) range.

Unconditional Theorem 29.16 #

theorem Cslib.GameTheory.BimatrixGame.binomialRandom_infinitePi_isGraphESS {α : Type u_1} [Fintype α] {p : ℕ → ↑unitInterval} {c : ℝ} (hc1 : c < 1) (hp : ∃ a > 0, ∀ᶠ (n : ℕ) in Filter.atTop, a / ↑n ^ c ≤ ↑(p n)) (F : BimatrixGame α α) {s : α → ℝ} (hs : F.IsESS s) :

Unconditional Theorem 29.16 ([Sur07], Section 29.4.1, pp. 731–732; Kearns and Suri 2006): for any finite two-player bimatrix game F (arbitrary real payoffs) and any classical evolutionarily stable strategy s (F.IsESS s), if an infinite graph family G is drawn independently from G(Fin n, p n) with p n = Ω(1 / n ^ c) and c < 1 (note p n ≤ 1 automatically forces 0 ≤ c), then almost surely (∀ᵐ) under Measure.infinitePi (fun n => G(Fin n, p n)), s is a graph ESS with respect to F and G (for all mixed mutant strategies t ≠ s and all adversarial ε_t-linear mutant families simultaneously).

Both Lemma 29.17 and Theorem 29.18 are proved unconditionally inside the library rather than assumed. As in BimatrixGame.IsESS, only F.A enters through F.payoff₁ (the symmetric game's fitness function when F.B = F.Aᵀ).

Exercise 29.7: adversarial mutant beating all incumbent neighbors #

A symmetric 2 × 2 positive-payoff witness game for [Sur07], Exercise 29.7 (p. 736): A = !![3, 2; 3, 1], B = Aᵀ. Pure strategy ![1, 0] is a classical ESS (A 1 0 = A 0 0 = 3 and A 1 1 = 1 < 2 = A 0 1), while under mutant strategy ![0, 1], an incumbent has fitness 3 - ρ_i and a mutant has fitness 3 - 2 * ρ_j. Hence any non-isolated mutant j with no mutant neighbors achieves fitness 3, strictly exceeding every neighbor i (which has ρ_i > 0).

theorem Cslib.GameTheory.BimatrixGame.exists_game_adversarial_linear_mutant_beats_all_incumbent_neighbors :
∃ (F : BimatrixGame (Fin 2) (Fin 2)) (s : Fin 2 → ℝ) (t : Fin 2 → ℝ), F.B = F.A.transpose ∧ F.IsESS s ∧ IsMixedStrategy t ∧ t ≠ s ∧ ∀ {p : ℕ → ↑unitInterval} {c : ℝ}, c < 1 → (∃ a > 0, ∀ᶠ (n : ℕ) in Filter.atTop, a / ↑n ^ c ≤ ↑(p n)) → (∃ q < 1, ∀ᶠ (n : ℕ) in Filter.atTop, ↑(p n) ≤ q) → ∀ᵐ (G : (i : ℕ) → SimpleGraph (Fin i)) ∂MeasureTheory.Measure.infinitePi fun (n : ℕ) => SimpleGraph.binomialRandom (Fin n) (p n), ∀ ε' > 0, ∃ (M : (n : ℕ) → Finset (Fin n)), IsEpsLinear ε' M ∧ ∀ᶠ (n : ℕ) in Filter.atTop, ∃ j ∈ M n, (∃ i ∉ M n, (G n).Adj j i) ∧ ∀ i ∉ M n, (G n).Adj j i → F.graphFitness (G n) (fun (u : Fin n) => if u ∈ M n then t else s) i < F.graphFitness (G n) (fun (u : Fin n) => if u ∈ M n then t else s) j

Exercise 29.7 (linear-size adversary, p bounded away from 1) ([Sur07], p. 736): there exists a symmetric 2 × 2 game F (survivorWitnessGame), a classical ESS s (![1, 0]), and a mutant mixed strategy t ≠ s (![0, 1]) such that for every p n = Ω(1 / n ^ c) (c < 1) bounded away from 1 (∃ q < 1, ∀ᶠ n, p n ≤ q), almost surely (∀ᵐ) under Measure.infinitePi (fun n => G(Fin n, p n)), for every ε' > 0 an adversary can construct an ε'-linear mutant family M such that eventually in n there is a mutant j ∈ M n that has at least one incumbent neighbor and strictly higher fitness than every incumbent neighbor.

IsESS.eventually_forall_graphFitness_lt_complete gives the complete-graph (p ≡ 1, K_n) obstruction when M is required to be ε'-linear: at p ≡ 1, G_n = K_n and every mutant in any ε_t-linear mutant family eventually has strictly lower fitness than every incumbent (ruling out the stated strengthening at p ≡ 1, without establishing necessity of a uniform gap from 1 for arbitrary sequences p n → 1).

theorem Cslib.GameTheory.BimatrixGame.exists_game_adversarial_mutant_beats_all_incumbent_neighbors :
∃ (F : BimatrixGame (Fin 2) (Fin 2)) (s : Fin 2 → ℝ) (t : Fin 2 → ℝ), F.B = F.A.transpose ∧ F.IsESS s ∧ IsMixedStrategy t ∧ t ≠ s ∧ ∀ {p : ℕ → ↑unitInterval} {c : ℝ}, c < 1 → (∃ a > 0, ∀ᶠ (n : ℕ) in Filter.atTop, a / ↑n ^ c ≤ ↑(p n)) → Filter.Tendsto (fun (n : ℕ) => (SimpleGraph.binomialRandom (Fin n) (p n)).real {G : SimpleGraph (Fin n) | ∃ (M : Finset (Fin n)), ∃ j ∈ M, (∃ i ∉ M, G.Adj j i) ∧ ∀ i ∉ M, G.Adj j i → F.graphFitness G (fun (u : Fin n) => if u ∈ M then t else s) i < F.graphFitness G (fun (u : Fin n) => if u ∈ M then t else s) j}) Filter.atTop (nhds 1)

Exercise 29.7 (unconstrained mutant set size, all p n = Ω(1 / n ^ c) including p = 1) ([Sur07], p. 736; cf. Vickery 1987, p. 734): for survivorWitnessGame with classical ESS ![1, 0] and mutant ![0, 1], for every p n = Ω(1 / n ^ c) (0 ≤ c < 1), with probability tending to 1 in G(Fin n, p n), the singleton mutant set {0} contains a mutant with an incumbent neighbor and strictly higher fitness than all of its incumbent neighbors.