Documentation

CslibFrontier.GameTheory.Evolutionary.Basic

Evolutionarily stable strategies #

In the classical model of evolutionary game theory ([Sur07], Section 29.1.1) the members of an infinite population are matched uniformly at random to play a fixed symmetric two-player game. An organism playing the mixed strategy s that meets one playing t earns the fitness F(s|t), and its opponent earns F(t|s).

Here the game is a bimatrix game G : BimatrixGame α α on a common set α of pure strategies, and F(s|t) is player 1's expected payoff G.payoff₁ s t. The game is symmetric when G.B = G.Aᵀ; then player 2's payoff G.payoff₂ s t is F(t|s), so a single matrix describes both roles.

A mixed strategy s is evolutionarily stable (BimatrixGame.IsESS) if a population playing s resists invasion by every other strategy t: once the share ε of mutants playing t is small enough, the incumbents' expected fitness (1 - ε) F(s|s) + ε F(s|t) exceeds the mutants' (1 - ε) F(t|s) + ε F(t|t). The definition reads only player 1's payoff matrix; the results that relate it to Nash equilibria assume that the game is symmetric.

Main definitions #

Main results #

References #

def Cslib.GameTheory.BimatrixGame.IsESS {α : Type u_1} [Fintype α] (G : BimatrixGame α α) (s : α → ℝ) :

The mixed strategy s is an evolutionarily stable strategy (ESS) of the game with fitness function F(x|y) = G.payoff₁ x y ([Sur07], Definition 29.1): for every mixed strategy t ≠ s there is a threshold ε₀ > 0 such that for every population share 0 < ε < ε₀ of mutants playing t, the incumbents' expected fitness (1 - ε) F(s|s) + ε F(s|t) is greater than the mutants' (1 - ε) F(t|s) + ε F(t|t).

The threshold may depend on the mutant strategy t, as in the source; the source leaves its positivity implicit. Only player 1's payoffs enter: this is the source's notion when G is symmetric, G.B = G.Aᵀ.

theorem Cslib.GameTheory.BimatrixGame.isESS_iff {α : Type u_1} [Fintype α] {G : BimatrixGame α α} {s : α → ℝ} :
G.IsESS s ↔ IsMixedStrategy s ∧ ∀ (t : α → ℝ), IsMixedStrategy t → t ≠ s → ∃ ε₀ > 0, ∀ (ε : ℝ), 0 < ε → ε < ε₀ → (1 - ε) * G.payoff₁ t s + ε * G.payoff₁ t t < (1 - ε) * G.payoff₁ s s + ε * G.payoff₁ s t

Unfolding characterization of IsESS ([Sur07], Definition 29.1).

theorem Cslib.GameTheory.BimatrixGame.IsESS.isMixedStrategy {α : Type u_1} [Fintype α] {G : BimatrixGame α α} {s : α → ℝ} (h : G.IsESS s) :

An evolutionarily stable strategy is a mixed strategy.

theorem Cslib.GameTheory.BimatrixGame.isESS_iff_forall_lt_or {α : Type u_1} [Fintype α] {G : BimatrixGame α α} {s : α → ℝ} :
G.IsESS s ↔ IsMixedStrategy s ∧ ∀ (t : α → ℝ), IsMixedStrategy t → t ≠ s → G.payoff₁ t s < G.payoff₁ s s ∨ G.payoff₁ t s = G.payoff₁ s s ∧ G.payoff₁ t t < G.payoff₁ s t

The two-condition form of evolutionary stability ([Sur07], Section 29.1.1, p. 719, the reformulation of Definition 29.1 from which the source derives Theorem 29.2): s is evolutionarily stable iff every mixed strategy t ≠ s satisfies F(t|s) < F(s|s), or F(t|s) = F(s|s) and F(t|t) < F(s|t).

theorem Cslib.GameTheory.BimatrixGame.isESS_iff_isNash_and_forall_lt {α : Type u_1} [Fintype α] {G : BimatrixGame α α} {s : α → ℝ} (hG : G.B = G.A.transpose) :
G.IsESS s ↔ G.IsNash s s ∧ ∀ (t : α → ℝ), G.IsBestResponse₁ t s → t ≠ s → G.payoff₁ t t < G.payoff₁ s t

Evolutionary stability refines symmetric Nash equilibrium ([Sur07], Theorem 29.2): in a symmetric game, s is an evolutionarily stable strategy iff (s, s) is a Nash equilibrium and every best response t ≠ s to s satisfies F(t|t) < F(s|t).

Two pure strategies #

theorem Cslib.GameTheory.BimatrixGame.isESS_fin_two_iff {G : BimatrixGame (Fin 2) (Fin 2)} {s : Fin 2 → ℝ} :
G.IsESS s ↔ IsMixedStrategy s ∧ (s 0 = 1 ∧ (G.A 1 0 < G.A 0 0 ∨ G.A 1 0 = G.A 0 0 ∧ G.A 1 1 < G.A 0 1) ∨ s 0 = 0 ∧ (G.A 0 1 < G.A 1 1 ∨ G.A 0 1 = G.A 1 1 ∧ G.A 0 0 < G.A 1 0) ∨ G.A 0 0 < G.A 1 0 ∧ G.A 1 1 < G.A 0 1 ∧ s 0 = (G.A 0 1 - G.A 1 1) / (G.A 1 0 - G.A 0 0 + (G.A 0 1 - G.A 1 1)))

Evolutionarily stable strategies of a game with two pure strategies (a characterization answering [Sur07], Exercise 29.3). Write a b c d for the payoffs G.A 0 0, G.A 0 1, G.A 1 0, G.A 1 1. A mixed strategy s is evolutionarily stable iff one of the following holds: s is the first pure strategy and c < a, or c = a and d < b; s is the second pure strategy and b < d, or b = d and a < c; or a < c, d < b and s plays the first strategy with probability (b - d) / (c - a + (b - d)).

theorem Cslib.GameTheory.BimatrixGame.exists_isESS_fin_two_iff {G : BimatrixGame (Fin 2) (Fin 2)} :
(∃ (s : Fin 2 → ℝ), G.IsESS s) ↔ G.A 0 0 ≠ G.A 1 0 ∨ G.A 0 1 ≠ G.A 1 1

Existence of an evolutionarily stable strategy with two pure strategies: the game has one iff some column of player 1's payoff matrix is not constant.

[Sur07], Exercise 29.3 asks to conclude that every two-by-two symmetric game has an evolutionarily stable strategy. That conclusion fails exactly for the games with two constant columns, such as the game with all payoffs zero: there every strategy earns the same against every opponent, so no strategy does strictly better than a mutant.

Hawks and Doves #

The game of Hawks and Doves ([Sur07], Section 29.1.1, Figure 29.1, p. 719): two organisms contest a resource worth V, and losing a fight costs C. Strategy 0 is Hawk and strategy 1 is Dove. Two Hawks fight, each winning with probability 1 / 2, for an expected fitness of (V - C) / 2; a Hawk takes the whole resource from a Dove, who gets nothing; two Doves share the resource. The game is symmetric: player 2's payoff matrix is the transpose of player 1's.

@[simp]
theorem Cslib.GameTheory.BimatrixGame.hawkDove_A (V C : ℝ) :
(hawkDove V C).A = !![(V - C) / 2, V; 0, V / 2]

Hawks and Doves is a symmetric game.

theorem Cslib.GameTheory.BimatrixGame.isESS_hawkDove_iff_of_lt {V C : ℝ} (hV : 0 < V) (hCV : C < V) {s : Fin 2 → ℝ} :
(hawkDove V C).IsESS s ↔ s = ![1, 0]

Hawk is evolutionarily stable when the resource is worth more than the cost of a fight ([Sur07], Section 29.1.1, p. 720): in Hawks and Doves with 0 < V and C < V, the pure strategy Hawk is an evolutionarily stable strategy, and it is the only one. The source states that Hawk is evolutionarily stable and leaves 0 < V implicit; uniqueness is added here.

theorem Cslib.GameTheory.BimatrixGame.isESS_hawkDove_iff_of_le {V C : ℝ} (hV : 0 < V) (hVC : V ≤ C) {s : Fin 2 → ℝ} :
(hawkDove V C).IsESS s ↔ s = ![V / C, 1 - V / C]

The mixed evolutionarily stable strategy of Hawks and Doves ([Sur07], Exercise 29.2): in Hawks and Doves with 0 < V ≤ C, playing Hawk with probability V / C is an evolutionarily stable strategy, and it is the only one. The exercise asks for stability; uniqueness is added here, and the source leaves 0 < V implicit. For V = C the strategy is pure Hawk.