Documentation

CslibFrontier.GameTheory.Strategic.Nash

Mixed Nash equilibria and Nash's theorem #

A mixed Nash equilibrium of a finite cost-minimization game is a profile p of mixed strategies p i : S i → ℝ under which no player can lower its expected cost by deviating to a pure strategy ([Rou13], Lecture 13, Definition 3.2). The expected cost expectedCost G p i = E_{s ∼ p}[cost i s] is taken over the product distribution of the p i, and the cost of the deviation to a is deviationCost G p i a from CslibFrontier.GameTheory.Strategic.Mixed.

Nash's theorem ([Nas51], Theorem 1) says that every finite game has a mixed Nash equilibrium. Nash's proof applies Brouwer's fixed-point theorem to the map that shifts each mixed strategy towards the pure strategies that would lower the player's cost: with nashGain G p i a = max 0 (expectedCost G p i - deviationCost G p i a), nashMap G p i a = (p i a + nashGain G p i a) / (1 + ∑ b, nashGain G p i b). It maps the product of simplices continuously into itself (continuous_nashMap, isMixedStrategy_nashMap), and its fixed points are exactly the mixed Nash equilibria (isFixedPt_nashMap_iff). Brouwer's theorem for products of simplices is Cslib.Brouwer.exists_isFixedPt_pi_simplex.

Pure Nash equilibria are exactly the mixed Nash equilibria in which every player uses a point mass (isMixedNash_single_iff). Deviations to mixed strategies gain nothing either (IsMixedNash.expectedCost_le_update), and the product distribution of a mixed Nash equilibrium is a coarse correlated equilibrium (IsMixedNash.isCoarseCorrelatedEquilibrium).

Main definitions #

Main results #

References #

def Cslib.GameTheory.CostGame.expectedCost {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] (G : CostGame ι S) (p : (i : ι) → S i → ℝ) (i : ι) :

The expected cost E_{s ∼ p}[cost i s] of player i when every player j samples its strategy independently from p j.

theorem Cslib.GameTheory.CostGame.expectedCost_def {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] (G : CostGame ι S) (p : (i : ι) → S i → ℝ) (i : ι) :
G.expectedCost p i = ∑ s : (i : ι) → S i, productWeight p s * G.cost i s

Unfolding equation for expectedCost, whose body is not exposed.

theorem Cslib.GameTheory.CostGame.sum_mul_deviationCost_eq_expectedCost {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] (G : CostGame ι S) (p : (i : ι) → S i → ℝ) {i : ι} (hp : ∑ a : S i, p i a = 1) :
∑ a : S i, p i a * G.deviationCost p i a = G.expectedCost p i

Averaging the expected cost vector of player i against its own mixed strategy gives its expected cost.

def Cslib.GameTheory.CostGame.IsMixedNash {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] (G : CostGame ι S) (p : (i : ι) → S i → ℝ) :

A mixed Nash equilibrium ([Rou13], Lecture 13, Definition 3.2): every player uses a mixed strategy, and no player can lower its expected cost by deviating to a pure strategy while the others keep theirs.

noncomputable def Cslib.GameTheory.CostGame.nashGain {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] (G : CostGame ι S) (p : (i : ι) → S i → ℝ) (i : ι) (a : S i) :

The gain max 0 (E_p[cost i] - E_p[cost i | i plays a]) of player i from deviating to the pure strategy a.

noncomputable def Cslib.GameTheory.CostGame.nashMap {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] (G : CostGame ι S) (p : (i : ι) → S i → ℝ) (i : ι) (a : S i) :

Nash's map ([Nas51], proof of Theorem 1): each player moves probability towards the pure strategies that would lower its cost, in proportion to the gain, and renormalizes.

theorem Cslib.GameTheory.CostGame.nashMap_apply {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] (G : CostGame ι S) (p : (i : ι) → S i → ℝ) (i : ι) (a : S i) :
G.nashMap p i a = (p i a + max 0 (G.expectedCost p i - G.deviationCost p i a)) / (1 + ∑ b : S i, max 0 (G.expectedCost p i - G.deviationCost p i b))

Nash's map in closed form; the bodies of nashMap and nashGain are not exposed.

theorem Cslib.GameTheory.CostGame.continuous_nashMap {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] (G : CostGame ι S) :

Nash's map is continuous.

theorem Cslib.GameTheory.CostGame.isMixedStrategy_nashMap {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] (G : CostGame ι S) {p : (i : ι) → S i → ℝ} (hp : ∀ (i : ι), IsMixedStrategy (p i)) (i : ι) :

Nash's map sends profiles of mixed strategies to profiles of mixed strategies.

theorem Cslib.GameTheory.CostGame.isFixedPt_nashMap_iff {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] (G : CostGame ι S) {p : (i : ι) → S i → ℝ} (hp : ∀ (i : ι), IsMixedStrategy (p i)) :

The fixed points of Nash's map are exactly the mixed Nash equilibria.

theorem Cslib.GameTheory.CostGame.exists_isMixedNash {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] (G : CostGame ι S) [∀ (i : ι), Nonempty (S i)] :
∃ (p : (i : ι) → S i → ℝ), G.IsMixedNash p

Nash's theorem ([Nas51], Theorem 1; [Rou13], Lecture 13, §3.3): every finite game has a mixed Nash equilibrium.

theorem Cslib.GameTheory.CostGame.expectedCost_single {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] (G : CostGame ι S) [(i : ι) → DecidableEq (S i)] (s : (i : ι) → S i) (i : ι) :
G.expectedCost (fun (j : ι) => Pi.single (s j) 1) i = G.cost i s

The expected cost under the point masses at the coordinates of s is the cost at s.

theorem Cslib.GameTheory.CostGame.deviationCost_single {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] (G : CostGame ι S) [(i : ι) → DecidableEq (S i)] (s : (i : ι) → S i) (i : ι) (a : S i) :
G.deviationCost (fun (j : ι) => Pi.single (s j) 1) i a = G.cost i (Function.update s i a)

The expected cost vector under the point masses at the coordinates of s is the vector of costs of unilateral deviations from s.

theorem Cslib.GameTheory.CostGame.isMixedNash_single_iff {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] (G : CostGame ι S) [(i : ι) → DecidableEq (S i)] (s : (i : ι) → S i) :
(G.IsMixedNash fun (i : ι) => Pi.single (s i) 1) ↔ G.IsPureNash s

Pure Nash equilibria are exactly the mixed Nash equilibria in which every player uses a point mass.

theorem Cslib.GameTheory.CostGame.IsPureNash.isMixedNash {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] {G : CostGame ι S} [(i : ι) → DecidableEq (S i)] {s : (i : ι) → S i} (h : G.IsPureNash s) :
G.IsMixedNash fun (i : ι) => Pi.single (s i) 1

A pure Nash equilibrium, played as point masses, is a mixed Nash equilibrium.

theorem Cslib.GameTheory.CostGame.IsMixedNash.expectedCost_le_update {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] {G : CostGame ι S} {p : (i : ι) → S i → ℝ} (h : G.IsMixedNash p) (i : ι) {q : S i → ℝ} (hq : IsMixedStrategy q) :

In a mixed Nash equilibrium, deviations to mixed strategies do not lower the expected cost either.

theorem Cslib.GameTheory.CostGame.IsMixedNash.deviationCost_eq_of_pos {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] {G : CostGame ι S} {p : (i : ι) → S i → ℝ} (h : G.IsMixedNash p) (i : ι) {a : S i} (ha : 0 < p i a) :

In a mixed Nash equilibrium, every pure strategy that a player uses with positive probability attains its expected cost.

def Cslib.GameTheory.CostGame.IsTotallyMixedNash {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] (G : CostGame ι S) (p : (i : ι) → S i → ℝ) :

A totally mixed Nash equilibrium: a mixed Nash equilibrium in which every pure strategy is played with positive probability ([Dat03], §1).

theorem Cslib.GameTheory.CostGame.isTotallyMixedNash_iff {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] (G : CostGame ι S) {p : (i : ι) → S i → ℝ} :
G.IsTotallyMixedNash p ↔ (∀ (i : ι) (a : S i), 0 < p i a) ∧ (∀ (i : ι), ∑ a : S i, p i a = 1) ∧ ∀ (i : ι) (a b : S i), G.deviationCost p i a = G.deviationCost p i b

Equation (1) of [Dat03]: a profile is a totally mixed Nash equilibrium iff it is positive, each player's weights sum to 1, and each player's pure strategies all have the same expected cost against the other players' strategies.

theorem Cslib.GameTheory.CostGame.IsMixedNash.isCoarseCorrelatedEquilibrium {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] {G : CostGame ι S} {p : (i : ι) → S i → ℝ} (h : G.IsMixedNash p) :

The product distribution of a mixed Nash equilibrium is a coarse correlated equilibrium.