Documentation

CslibFrontier.GameTheory.Strategic.ApproxNash

Approximate Nash equilibria and equilibria with small support #

An ε-approximate Nash equilibrium is a profile of mixed strategies from which no player can gain more than an additive ε by deviating ([Pap07], Section 2.6.6, p. 45; [Kea07], Section 7.2, p. 162). This module defines the notion for strategic cost games (CostGame.IsApproxMixedNash) and for bimatrix games (BimatrixGame.IsApproxNash), relates the two (BimatrixGame.isApproxNash_iff_isApproxMixedNash), and proves two existence results for bimatrix games with payoffs in [0, 1]. Both are statements about the existence and the support of approximate equilibria; no running time is claimed.

Main definitions #

Main results #

References #

Approximate mixed Nash equilibria in CostGame #

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

An ε-approximate mixed Nash equilibrium of a cost-minimization game ([Pap07], Section 2.6.6, p. 45; [Kea07], Section 7.2, p. 162): every player uses a mixed strategy, and no player can lower its expected cost by more than ε by deviating to a pure strategy.

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

At ε = 0, an approximate mixed Nash equilibrium is an exact mixed Nash equilibrium.

theorem Cslib.GameTheory.CostGame.IsMixedNash.isApproxMixedNash {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] {G : CostGame ι S} {p : (i : ι) → S i → ℝ} (h : G.IsMixedNash p) {ε : ℝ} (hε : 0 ≤ ε) :
theorem Cslib.GameTheory.CostGame.IsApproxMixedNash.mono {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] {G : CostGame ι S} {ε ε' : ℝ} {p : (i : ι) → S i → ℝ} (h : G.IsApproxMixedNash ε p) (hle : ε ≤ ε') :
theorem Cslib.GameTheory.CostGame.IsApproxMixedNash.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.IsApproxMixedNash ε p) (i : ι) {q : S i → ℝ} (hq : IsMixedStrategy q) :

In an ε-approximate mixed Nash equilibrium, mixed-strategy deviations cannot lower expected cost by more than ε either.

Uniform-multiset mixed strategies #

noncomputable def Cslib.GameTheory.uniformMultiset {α : Type u_1} [DecidableEq α] (m : Multiset α) (a : α) :

The mixed strategy that chooses uniformly at random from a multiset m : Multiset α ([TV07a], Exercise 1.6, p. 27; [LMM03]): pure strategy a receives probability (m.count a : ℝ) / m.card.

@[simp]
theorem Cslib.GameTheory.uniformMultiset_apply {α : Type u_1} [DecidableEq α] (m : Multiset α) (a : α) :

For any nonempty multiset m, uniformMultiset m is a valid mixed strategy.

The support of uniformMultiset m has size at most m.card.

Approximate Nash equilibria in bimatrix games, DMP 1/2-Nash, and small-support ε-Nash #

def Cslib.GameTheory.BimatrixGame.IsApproxBestResponse₁ {M : Type u_1} {N : Type u_2} [Fintype M] [Fintype N] (G : BimatrixGame M N) (ε : ℝ) (x : M → ℝ) (y : N → ℝ) :

x is an ε-approximate best response of player 1 to y: a mixed strategy achieving within ε of the maximum possible expected payoff against y.

def Cslib.GameTheory.BimatrixGame.IsApproxBestResponse₂ {M : Type u_1} {N : Type u_2} [Fintype M] [Fintype N] (G : BimatrixGame M N) (ε : ℝ) (y : N → ℝ) (x : M → ℝ) :

y is an ε-approximate best response of player 2 to x: a mixed strategy achieving within ε of the maximum possible expected payoff against x.

def Cslib.GameTheory.BimatrixGame.IsApproxNash {M : Type u_1} {N : Type u_2} [Fintype M] [Fintype N] (G : BimatrixGame M N) (ε : ℝ) (x : M → ℝ) (y : N → ℝ) :

(x, y) is an ε-approximate Nash equilibrium of the bimatrix game G ([Pap07], Section 2.6.6, p. 45): each player's strategy is an ε-approximate best response to the other's.

theorem Cslib.GameTheory.BimatrixGame.isApproxBestResponse₁_iff_pure {M : Type u_1} {N : Type u_2} [Fintype M] [Fintype N] {G : BimatrixGame M N} {x : M → ℝ} {y : N → ℝ} {ε : ℝ} :
G.IsApproxBestResponse₁ ε x y ↔ IsMixedStrategy x ∧ ∀ (i : M), G.A.mulVec y i ≤ G.payoff₁ x y + ε

Pure-row characterization of IsApproxBestResponse₁: x is an ε-approximate best response to y iff x is a mixed strategy and no pure row beats G.payoff₁ x y by more than ε.

theorem Cslib.GameTheory.BimatrixGame.isApproxBestResponse₂_iff_pure {M : Type u_1} {N : Type u_2} [Fintype M] [Fintype N] {G : BimatrixGame M N} {x : M → ℝ} {y : N → ℝ} {ε : ℝ} :

Pure-column characterization of IsApproxBestResponse₂.

theorem Cslib.GameTheory.BimatrixGame.isApproxNash_iff_pure {M : Type u_1} {N : Type u_2} [Fintype M] [Fintype N] {G : BimatrixGame M N} {x : M → ℝ} {y : N → ℝ} {ε : ℝ} :
G.IsApproxNash ε x y ↔ (IsMixedStrategy x ∧ ∀ (i : M), G.A.mulVec y i ≤ G.payoff₁ x y + ε) ∧ IsMixedStrategy y ∧ ∀ (j : N), Matrix.vecMul x G.B j ≤ G.payoff₂ x y + ε

Pure-deviation characterization of IsApproxNash.

@[simp]
@[simp]
@[simp]
theorem Cslib.GameTheory.BimatrixGame.isApproxNash_zero_iff {M : Type u_1} {N : Type u_2} [Fintype M] [Fintype N] {G : BimatrixGame M N} {x : M → ℝ} {y : N → ℝ} :
G.IsApproxNash 0 x y ↔ G.IsNash x y

At ε = 0, an approximate Nash equilibrium of a bimatrix game is an exact Nash equilibrium.

theorem Cslib.GameTheory.BimatrixGame.IsApproxNash.mono {M : Type u_1} {N : Type u_2} [Fintype M] [Fintype N] {G : BimatrixGame M N} {x : M → ℝ} {y : N → ℝ} {ε ε' : ℝ} (h : G.IsApproxNash ε x y) (hle : ε ≤ ε') :
G.IsApproxNash ε' x y
theorem Cslib.GameTheory.BimatrixGame.IsNash.isApproxNash {M : Type u_1} {N : Type u_2} [Fintype M] [Fintype N] {G : BimatrixGame M N} {x : M → ℝ} {y : N → ℝ} {ε : ℝ} (h : G.IsNash x y) (hε : 0 ≤ ε) :
G.IsApproxNash ε x y
theorem Cslib.GameTheory.BimatrixGame.IsApproxNash.smul {M : Type u_1} {N : Type u_2} [Fintype M] [Fintype N] {G : BimatrixGame M N} {x : M → ℝ} {y : N → ℝ} {ε c : ℝ} (hc : 0 ≤ c) (h : G.IsApproxNash ε x y) :
{ A := c • G.A, B := c • G.B }.IsApproxNash (c * ε) x y

Scaling both payoff matrices of a bimatrix game by c ≥ 0 scales the approximation error of an ε-approximate Nash equilibrium by c.

theorem Cslib.GameTheory.BimatrixGame.isApproxNash_iff_isApproxMixedNash {M : Type u_1} {N : Type u_2} [Fintype M] [Fintype N] {G : BimatrixGame M N} {x : M → ℝ} {y : N → ℝ} {ε : ℝ} :

An ε-approximate Nash equilibrium of a bimatrix game G is equivalently an ε-approximate mixed Nash equilibrium of G.toCostGame.

Daskalakis–Mehta–Papadimitriou 1/2-approximate Nash equilibrium #

theorem Cslib.GameTheory.BimatrixGame.isApproxNash_half_dmp {M : Type u_1} {N : Type u_2} [Fintype M] [Fintype N] {G : BimatrixGame M N} [DecidableEq M] [DecidableEq N] (hA : ∀ (i : M) (j : N), G.A i j ∈ Set.Icc 0 1) (hB : ∀ (i : M) (j : N), G.B i j ∈ Set.Icc 0 1) (i₀ : M) {j₀ : N} (hj₀ : ∀ (j : N), G.B i₀ j ≤ G.B i₀ j₀) {i₁ : M} (hi₁ : ∀ (i : M), G.A i j₀ ≤ G.A i₁ j₀) :
G.IsApproxNash (1 / 2) ((1 / 2) • Pi.single i₀ 1 + (1 / 2) • Pi.single i₁ 1) (Pi.single j₀ 1)

Daskalakis–Mehta–Papadimitriou (1/2)-Nash theorem ([DMP06], Section 3, Theorem 1; cited in [Pap07], Section 2.6.6, p. 45): in any bimatrix game with payoffs in [0, 1], if i₀ is any row, j₀ maximizes G.B i₀ · (pure best response of player 2 to i₀), and i₁ maximizes G.A · j₀ (pure best response of player 1 to j₀), then ((1/2) e_{i₀} + (1/2) e_{i₁}, e_{j₀}) is an additive (1/2)-approximate Nash equilibrium. This covers the game-theoretic output guarantee without a machine running-time claim.

theorem Cslib.GameTheory.BimatrixGame.exists_dmp_half_isApproxNash {M : Type u_1} {N : Type u_2} [Fintype M] [Fintype N] [DecidableEq M] [DecidableEq N] [Nonempty M] [Nonempty N] (G : BimatrixGame M N) (hA : ∀ (i : M) (j : N), G.A i j ∈ Set.Icc 0 1) (hB : ∀ (i : M) (j : N), G.B i j ∈ Set.Icc 0 1) :
∃ (i₀ : M) (i₁ : M) (j₀ : N), G.IsApproxNash (1 / 2) ((1 / 2) • Pi.single i₀ 1 + (1 / 2) • Pi.single i₁ 1) (Pi.single j₀ 1)

Existence corollary of isApproxNash_half_dmp: every nonempty finite bimatrix game with payoffs in [0, 1] has a (1/2)-approximate Nash equilibrium in which player 1 mixes evenly over at most two pure strategies and player 2 plays a pure strategy.

Uniform-multiset small-support ε-approximate Nash existence #

noncomputable def Cslib.GameTheory.BimatrixGame.lmmSampleSize (M : Type u_3) (N : Type u_4) [Fintype M] [Fintype N] (ε : ℝ) :

Concrete multiset cardinality k = ⌊2 ln(2(|M| + |N|)) / ε²⌋₊ + 1 = O(ln(|M| + |N|) / ε²) for small-support ε-approximate Nash equilibrium existence ([TV07a], Exercise 1.6, p. 27; empirical-sampling bound after [LMM03], Section 3; see also [Pap07], Section 2.6.6, p. 45).

theorem Cslib.GameTheory.BimatrixGame.lt_lmmSampleSize (M : Type u_3) (N : Type u_4) [Fintype M] [Fintype N] (ε : ℝ) :
2 * Real.log (2 * (↑(Fintype.card M) + ↑(Fintype.card N))) / ε ^ 2 < ↑(lmmSampleSize M N ε)
theorem Cslib.GameTheory.BimatrixGame.lmmSampleSize_le (M : Type u_3) (N : Type u_4) [Fintype M] [Fintype N] [Nonempty M] [Nonempty N] {ε : ℝ} (hε : 0 < ε) :
↑(lmmSampleSize M N ε) ≤ 2 * Real.log (2 * (↑(Fintype.card M) + ↑(Fintype.card N))) / ε ^ 2 + 1
theorem Cslib.GameTheory.BimatrixGame.exists_uniformMultiset_isApproxNash_of_lt {M : Type u_1} {N : Type u_2} [Fintype M] [Fintype N] [DecidableEq M] [DecidableEq N] [Nonempty M] [Nonempty N] (G : BimatrixGame M N) (hA : ∀ (i : M) (j : N), G.A i j ∈ Set.Icc 0 1) (hB : ∀ (i : M) (j : N), G.B i j ∈ Set.Icc 0 1) {ε : ℝ} (hε : 0 < ε) {k : ℕ} (hk : 2 * Real.log (2 * (↑(Fintype.card M) + ↑(Fintype.card N))) / ε ^ 2 < ↑k) :
∃ (m₁ : Multiset M) (m₂ : Multiset N), m₁.card = k ∧ m₂.card = k ∧ G.IsApproxNash ε (uniformMultiset m₁) (uniformMultiset m₂)

Uniform-multiset small-support ε-approximate Nash existence ([0, 1]-normalized form of [TV07a], Exercise 1.6, p. 27): in any nonempty finite rectangular bimatrix game with payoffs in [0, 1] and ε > 0, for every k : ℕ satisfying 2 ln(2(|M| + |N|)) / ε² < k, there exist multisets m₁ : Multiset M and m₂ : Multiset N of cardinality k whose uniform distributions form an ε-approximate Nash equilibrium. The proof uses the empirical-sampling argument of [LMM03], Section 3 (whose Theorem 1 starts from each specified exact Nash equilibrium and also approximates both of its payoffs; see also [Pap07], Section 2.6.6, p. 45). This states game-theoretic existence and support size without a machine running-time claim.

theorem Cslib.GameTheory.BimatrixGame.exists_uniformMultiset_isApproxNash {M : Type u_1} {N : Type u_2} [Fintype M] [Fintype N] [DecidableEq M] [DecidableEq N] [Nonempty M] [Nonempty N] (G : BimatrixGame M N) (hA : ∀ (i : M) (j : N), G.A i j ∈ Set.Icc 0 1) (hB : ∀ (i : M) (j : N), G.B i j ∈ Set.Icc 0 1) {ε : ℝ} (hε : 0 < ε) :
∃ (m₁ : Multiset M) (m₂ : Multiset N), m₁.card = lmmSampleSize M N ε ∧ m₂.card = lmmSampleSize M N ε ∧ G.IsApproxNash ε (uniformMultiset m₁) (uniformMultiset m₂)

Uniform-multiset small-support ε-approximate Nash existence at explicit sample size ([0, 1]-normalized form of [TV07a], Exercise 1.6, p. 27, proved via the sampling argument of [LMM03], Section 3): in any nonempty finite rectangular bimatrix game with payoffs in [0, 1] and ε > 0, there exist multisets m₁ : Multiset M and m₂ : Multiset N of exact size lmmSampleSize M N ε = ⌊2 ln(2(|M| + |N|)) / ε²⌋₊ + 1 whose uniform empirical distributions form an ε-approximate Nash equilibrium.

theorem Cslib.GameTheory.BimatrixGame.exists_uniformMultiset_isApproxNash_of_nonneg {M : Type u_1} {N : Type u_2} [Fintype M] [Fintype N] [DecidableEq M] [DecidableEq N] [Nonempty M] [Nonempty N] (G : BimatrixGame M N) {K : ℝ} (hK : 0 ≤ K) (hA : ∀ (i : M) (j : N), G.A i j ∈ Set.Icc 0 K) (hB : ∀ (i : M) (j : N), G.B i j ∈ Set.Icc 0 K) {ε : ℝ} (hε : 0 < ε) :
∃ (m₁ : Multiset M) (m₂ : Multiset N), m₁.card = lmmSampleSize M N ε ∧ m₂.card = lmmSampleSize M N ε ∧ G.IsApproxNash (ε * K) (uniformMultiset m₁) (uniformMultiset m₂)

Small-support approximate Nash existence for nonnegative payoffs ([TV07a], Exercise 1.6, p. 27, generalized to rectangular M × N games with explicit sample size via the sampling argument of [LMM03], Section 3): if all payoffs of G lie in [0, K] (0 ≤ K) and ε > 0, then there exist multisets m₁ : Multiset M and m₂ : Multiset N of exact cardinality lmmSampleSize M N ε whose uniform empirical distributions form an (ε * K)-approximate Nash equilibrium.