Documentation

CslibFrontier.GameTheory.Bimatrix.SymmetricLemkeHowson

Single-polytope symmetric Lemke–Howson algorithm #

For a symmetric two-player bimatrix game G : BimatrixGame M M (G.B = G.Aᵀ) whose payoff matrix A = G.A has nonnegative entries and no all-zero column, [Pap07], Section 2.3.2 (pp. 34–36) gives a single-polytope presentation of the Lemke–Howson algorithm on the polytope P = {z : M → ℝ | z ≥ 0 ∧ A *ᵥ z ≤ 1} — which coincides with G.matP *ᵥ z ≤ rhsP M M from CslibFrontier.GameTheory.Bimatrix.BestResponsePolytope.

A strategy i : M is represented at z (SymRepresented G z i) if either z i = 0 (.inl i ∈ tightRows G.matP (rhsP M M) z) or (A *ᵥ z) i = 1 (.inr i ∈ tightRows G.matP (rhsP M M) z). A point z is completely represented (SymCompletelyLabeled G z) if every strategy i : M is represented at z. Under nondegeneracy of P, the nonzero completely represented vertices of P are in bijection with the symmetric Nash equilibria of G via z ↦ (∑ i, z i)⁻¹ • z (IsSymmetric.setOf_symCompletelyLabeled_eq).

Fixing a dropped strategy k : M, the nodes of the single-polytope symmetric Lemke–Howson graph (symLHGraph G k) are the vertices of P at which every strategy i ≠ k is represented (SymLHNode G k). Two nodes p, q are adjacent iff they are adjacent vertices of P whose shared tight rows (tightRows p.z ∩ tightRows q.z, the constraints defining the connecting edge of P) already represent every strategy i ≠ k. Equivalently, under nondegeneracy and boundedness, q is obtained from p by pivoting off a tight row belonging either to k or to a doubly represented strategy (symLHGraph_adj_iff). Every completely represented node (including the origin 0) has degree 1 (ncard_neighborSet_of_symCompletelyLabeled), while every other node has a unique doubly represented strategy and degree 2 (ncard_neighborSet_of_not_symCompletelyLabeled).

Consequently:

Main definitions #

Main results #

References #

Single polytope P = {z ≥ 0 | A z ≤ 1} for symmetric bimatrix games #

For a symmetric bimatrix game G (G.B = G.Aᵀ), z ᵥ* G.B = G.A *ᵥ z.

theorem Cslib.GameTheory.BimatrixGame.IsSymmetric.payoff₁_pos_of_isSymmetricNash {M : Type u_1} [Fintype M] {G : BimatrixGame M M} (hG : G.IsSymmetric) (hnn : ∀ (i j : M), 0 ≤ G.A i j) (hcol : ∀ (j : M), ∃ (i : M), 0 < G.A i j) {x : M → ℝ} (hx : G.IsSymmetricNash x) :
0 < G.payoff₁ x x

In a symmetric game with nonnegative payoffs and no all-zero column, every symmetric Nash equilibrium yields strictly positive equilibrium payoff.

noncomputable def Cslib.GameTheory.BimatrixGame.symToPolytope {M : Type u_1} [Fintype M] (G : BimatrixGame M M) (x : M → ℝ) :
M → ℝ

Map sending a symmetric Nash equilibrium x to its corresponding point (payoff₁ x x)⁻¹ • x in the single polytope P = {z ≥ 0 | A z ≤ 1}.

theorem Cslib.GameTheory.BimatrixGame.IsSymmetric.inv_sum_smul_symToPolytope {M : Type u_1} [Fintype M] {G : BimatrixGame M M} (hG : G.IsSymmetric) (hnn : ∀ (i j : M), 0 ≤ G.A i j) (hcol : ∀ (j : M), ∃ (i : M), 0 < G.A i j) {x : M → ℝ} (hx : G.IsSymmetricNash x) :
(∑ i : M, G.symToPolytope x i)⁻¹ • G.symToPolytope x = x

Normalization recovers x from G.symToPolytope x.

theorem Cslib.GameTheory.BimatrixGame.IsSymmetric.matP_mulVec_le_iff {M : Type u_1} [Fintype M] [DecidableEq M] {G : BimatrixGame M M} (hG : G.IsSymmetric) {z : M → ℝ} :
G.matP.mulVec z ≤ rhsP M M ↔ (∀ (i : M), 0 ≤ z i) ∧ ∀ (i : M), G.A.mulVec z i ≤ 1

Feasibility on G.matP *ᵥ z ≤ rhsP M M for a symmetric game G: z ≥ 0 and G.A *ᵥ z ≤ 1.

theorem Cslib.GameTheory.BimatrixGame.IsSymmetric.inr_mem_tightRows_matP {M : Type u_1} [Fintype M] [DecidableEq M] {G : BimatrixGame M M} (hG : G.IsSymmetric) {z : M → ℝ} {i : M} :
Sum.inr i ∈ G.matP.tightRows (rhsP M M) z ↔ G.A.mulVec z i = 1

Tightness of .inr i on G.matP for a symmetric game G: (G.A *ᵥ z) i = 1.

theorem Cslib.GameTheory.BimatrixGame.IsSymmetric.eq_zero_of_matP_mulVec_nonpos {M : Type u_1} [Fintype M] [DecidableEq M] {G : BimatrixGame M M} (hG : G.IsSymmetric) (hnn : ∀ (i j : M), 0 ≤ G.A i j) (hcol : ∀ (j : M), ∃ (i : M), 0 < G.A i j) {v : M → ℝ} (hv : G.matP.mulVec v ≤ 0) :
v = 0

Boundedness of the symmetric polytope P ([Pap07], Section 2.3.2, p. 34): if G is symmetric with nonnegative payoffs and no all-zero column (∀ j, ∃ i, 0 < G.A i j), then the recession cone of G.matP *ᵥ z ≤ rhsP M M is trivial ({0}).

Strategy representation and bijection with symmetric Nash equilibria #

def Cslib.GameTheory.BimatrixGame.SymRepresented {M : Type u_1} [Fintype M] [DecidableEq M] (G : BimatrixGame M M) (z : M → ℝ) (i : M) :

Strategy i : M is represented at z in the single polytope P ([Pap07], Section 2.3.2, p. 34) if at least one of the two inequalities associated with i (z i = 0 or (G.Bᵀ *ᵥ z) i = 1, i.e., (G.A *ᵥ z) i = 1 when G.IsSymmetric) is tight at z.

z is completely represented (all strategies represented) in the single polytope P ([Pap07], Section 2.3.2, pp. 34–35).

theorem Cslib.GameTheory.BimatrixGame.symRepresented_iff_of_isSymmetric {M : Type u_1} [Fintype M] [DecidableEq M] {G : BimatrixGame M M} (hG : G.IsSymmetric) {z : M → ℝ} {i : M} :
G.SymRepresented z i ↔ z i = 0 ∨ G.A.mulVec z i = 1
theorem Cslib.GameTheory.BimatrixGame.IsSymmetric.isSymmetricNash_of_symCompletelyLabeled {M : Type u_1} [Fintype M] [DecidableEq M] {G : BimatrixGame M M} (hG : G.IsSymmetric) {z : M → ℝ} (hz : G.matP.mulVec z ≤ rhsP M M) (hz0 : z ≠ 0) (hcl : G.SymCompletelyLabeled z) :
G.IsSymmetricNash ((∑ i : M, z i)⁻¹ • z)

Every nonzero feasible completely represented point of P normalizes to a symmetric Nash equilibrium ([Pap07], Section 2.3.2, pp. 34–35).

theorem Cslib.GameTheory.BimatrixGame.IsSymmetric.symCompletelyLabeled_symToPolytope {M : Type u_1} [Fintype M] [DecidableEq M] {G : BimatrixGame M M} (hG : G.IsSymmetric) (hnn : ∀ (i j : M), 0 ≤ G.A i j) (hcol : ∀ (j : M), ∃ (i : M), 0 < G.A i j) {x : M → ℝ} (hx : G.IsSymmetricNash x) :

Every symmetric Nash equilibrium maps to a nonzero feasible completely represented point of P ([Pap07], Section 2.3.2, pp. 34–35).

theorem Cslib.GameTheory.BimatrixGame.IsSymmetric.symToPolytope_inv_sum_smul {M : Type u_1} [Fintype M] [DecidableEq M] {G : BimatrixGame M M} (hG : G.IsSymmetric) {z : M → ℝ} (hz : G.matP.mulVec z ≤ rhsP M M) (hz0 : z ≠ 0) (hcl : G.SymCompletelyLabeled z) :
G.symToPolytope ((∑ i : M, z i)⁻¹ • z) = z

G.symToPolytope recovers z from its normalization (∑ i, z i)⁻¹ • z.

theorem Cslib.GameTheory.BimatrixGame.isVertex_of_symCompletelyLabeled {M : Type u_1} [Fintype M] [DecidableEq M] {G : BimatrixGame M M} (hnd : G.matP.IsNondegenerateSystem (rhsP M M)) (hrec : ∀ (v : M → ℝ), G.matP.mulVec v ≤ 0 → v = 0) {z : M → ℝ} (hz : G.matP.mulVec z ≤ rhsP M M) (hcl : G.SymCompletelyLabeled z) :
G.matP.IsVertex (rhsP M M) z

A feasible completely represented point of a bounded nondegenerate polytope P is a vertex.

theorem Cslib.GameTheory.BimatrixGame.IsSymmetric.setOf_symCompletelyLabeled_eq {M : Type u_1} [Fintype M] [DecidableEq M] {G : BimatrixGame M M} (hG : G.IsSymmetric) (hnd : G.matP.IsNondegenerateSystem (rhsP M M)) (hnn : ∀ (i j : M), 0 ≤ G.A i j) (hcol : ∀ (j : M), ∃ (i : M), 0 < G.A i j) :

Exact set of completely represented vertices of P: under nondegeneracy, nonnegativity, and no all-zero column, the completely represented vertices of P are precisely {0} together with the image of the symmetric Nash equilibria under symToPolytope.

The single-polytope symmetric Lemke–Howson graph symLHGraph #

structure Cslib.GameTheory.BimatrixGame.SymLHNode {M : Type u_1} [Fintype M] [DecidableEq M] (G : BimatrixGame M M) (k : M) :
Type u_1

A node of the single-polytope symmetric Lemke–Howson graph for dropped strategy k : M ([Pap07], Section 2.3.2, p. 35): a vertex z of P at which every strategy i ≠ k is represented.

  • z : M → ℝ

    The vertex of P.

  • isVertex : G.matP.IsVertex (rhsP M M) self.z

    z is a vertex of P.

  • almostCompletelyLabeled (i : M) : i ≠ k → G.SymRepresented self.z i

    Every strategy other than k is represented at z.

theorem Cslib.GameTheory.BimatrixGame.SymLHNode.ext {M : Type u_1} [Fintype M] [DecidableEq M] {G : BimatrixGame M M} {k : M} {p q : G.SymLHNode k} (h : p.z = q.z) :
p = q
theorem Cslib.GameTheory.BimatrixGame.SymLHNode.ext_iff {M : Type u_1} [Fintype M] [DecidableEq M] {G : BimatrixGame M M} {k : M} {p q : G.SymLHNode k} :
p = q ↔ p.z = q.z

There are finitely many nodes in SymLHNode G k.

The origin 0 as a node of SymLHNode G k.

@[simp]
theorem Cslib.GameTheory.BimatrixGame.symLHOrigin_z {M : Type u_1} [Fintype M] [DecidableEq M] (G : BimatrixGame M M) (k : M) :
(G.symLHOrigin k).z = 0

The single-polytope symmetric Lemke–Howson graph for dropped strategy k : M ([Pap07], Section 2.3.2, pp. 35–36): two k-almost completely represented vertices of P are adjacent iff they are adjacent vertices of P whose shared tight rows (defining the connecting edge of P) already represent every strategy i ≠ k.

theorem Cslib.GameTheory.BimatrixGame.symLHGraph_adj {M : Type u_1} [Fintype M] [DecidableEq M] {G : BimatrixGame M M} {k : M} {p q : G.SymLHNode k} :
(G.symLHGraph k).Adj p q ↔ G.matP.VertexAdj (rhsP M M) p.z q.z ∧ ∀ (i : M), i ≠ k → Sum.inl i ∈ G.matP.tightRows (rhsP M M) p.z ∩ G.matP.tightRows (rhsP M M) q.z ∨ Sum.inr i ∈ G.matP.tightRows (rhsP M M) p.z ∩ G.matP.tightRows (rhsP M M) q.z
theorem Cslib.GameTheory.BimatrixGame.symLHGraph_adj_iff {M : Type u_1} [Fintype M] [DecidableEq M] {G : BimatrixGame M M} {k : M} (hnd : G.matP.IsNondegenerateSystem (rhsP M M)) (hrec : ∀ (v : M → ℝ), G.matP.mulVec v ≤ 0 → v = 0) {p q : G.SymLHNode k} :
(G.symLHGraph k).Adj p q ↔ ∃ l ∈ G.matP.tightRows (rhsP M M) p.z, (Sum.elim id id l = k ∨ l.swap ∈ G.matP.tightRows (rhsP M M) p.z) ∧ q.z = G.matP.pivotVertex (rhsP M M) p.z l

Pivot characterization of edges in symLHGraph: p and q are adjacent in symLHGraph G k iff q is obtained from p by pivoting off a tight row l whose strategy is either k or doubly represented at p.

theorem Cslib.GameTheory.BimatrixGame.ncard_neighborSet_of_symCompletelyLabeled {M : Type u_1} [Fintype M] [DecidableEq M] {G : BimatrixGame M M} {k : M} (hnd : G.matP.IsNondegenerateSystem (rhsP M M)) (hrec : ∀ (v : M → ℝ), G.matP.mulVec v ≤ 0 → v = 0) (p : G.SymLHNode k) (hcl : G.SymCompletelyLabeled p.z) :

Every completely represented node has degree 1 in symLHGraph G k ([Pap07], Section 2.3.2, pp. 35–36).

theorem Cslib.GameTheory.BimatrixGame.ncard_neighborSet_of_not_symCompletelyLabeled {M : Type u_1} [Fintype M] [DecidableEq M] {G : BimatrixGame M M} {k : M} (hnd : G.matP.IsNondegenerateSystem (rhsP M M)) (hrec : ∀ (v : M → ℝ), G.matP.mulVec v ≤ 0 → v = 0) (p : G.SymLHNode k) (hncl : ¬G.SymCompletelyLabeled p.z) :

Every non-completely-represented node has degree 2 in symLHGraph G k ([Pap07], Section 2.3.2, pp. 35–36).

theorem Cslib.GameTheory.BimatrixGame.even_ncard_symCompletelyLabeled {M : Type u_1} [Fintype M] [DecidableEq M] {G : BimatrixGame M M} (hnd : G.matP.IsNondegenerateSystem (rhsP M M)) (hrec : ∀ (v : M → ℝ), G.matP.mulVec v ≤ 0 → v = 0) [Nonempty M] :

Parity of completely represented vertices of P: in a bounded nondegenerate polytope P with Nonempty M, the number of completely represented vertices is even.

Oddness of symmetric Nash equilibria #

theorem Cslib.GameTheory.BimatrixGame.IsSymmetric.odd_ncard_isSymmetricNash {M : Type u_1} [Fintype M] [DecidableEq M] [Nonempty M] {G : BimatrixGame M M} (hG : G.IsSymmetric) (hnd : G.matP.IsNondegenerateSystem (rhsP M M)) (hnn : ∀ (i j : M), 0 ≤ G.A i j) (hcol : ∀ (j : M), ∃ (i : M), 0 < G.A i j) :

Oddness of symmetric Nash equilibria via single-polytope Lemke–Howson ([Pap07], Section 2.3.2, pp. 34–36): every symmetric bimatrix game with nonnegative payoffs, no all-zero column, and nondegenerate polytope P has an odd (hence positive) number of symmetric Nash equilibria.

Deterministic path-following on symLHGraph (Figure 2.2) #

noncomputable def Cslib.GameTheory.BimatrixGame.symLHNext {M : Type u_1} [Fintype M] [DecidableEq M] (G : BimatrixGame M M) (k : M) (prev curr : G.SymLHNode k) :

Given a node curr in symLHGraph G k and a previous node prev, selects an adjacent node of curr distinct from prev whenever one exists (unique at degree-2 nodes and at 0 when prev = 0), and returns none when no other neighbor exists (i.e., at a terminal completely represented node curr ≠ 0).

noncomputable def Cslib.GameTheory.BimatrixGame.symLHWalkFrom {M : Type u_1} [Fintype M] [DecidableEq M] (G : BimatrixGame M M) (k : M) :
ℕ → G.SymLHNode k → G.SymLHNode k → List (G.SymLHNode k)

Walks n steps of the single-polytope symmetric Lemke–Howson path starting from (prev, curr), returning the visited node list in chronological order.

noncomputable def Cslib.GameTheory.BimatrixGame.symLHRun {M : Type u_1} [Fintype M] [DecidableEq M] (G : BimatrixGame M M) (k : M) (n : ℕ) :

Runs the single-polytope symmetric Lemke–Howson path starting at v₀ = 0 for up to n pivots ([Pap07], Section 2.3.2, pp. 35–36, Figure 2.2).

theorem Cslib.GameTheory.BimatrixGame.symLHRun_nodup {M : Type u_1} [Fintype M] [DecidableEq M] {G : BimatrixGame M M} {k : M} (hnd : G.matP.IsNondegenerateSystem (rhsP M M)) (hrec : ∀ (v : M → ℝ), G.matP.mulVec v ≤ 0 → v = 0) (n : ℕ) :
(G.symLHRun k n).Nodup

The single-polytope symmetric Lemke–Howson path never repeats a vertex ([Pap07], Section 2.3.2, p. 36, Figure 2.2).

theorem Cslib.GameTheory.BimatrixGame.symLHRun_last_spec {M : Type u_1} [Fintype M] [DecidableEq M] {G : BimatrixGame M M} {k : M} (hnd : G.matP.IsNondegenerateSystem (rhsP M M)) (hrec : ∀ (v : M → ℝ), G.matP.mulVec v ≤ 0 → v = 0) {N : ℕ} (hN : Nat.card (G.SymLHNode k) ≤ N) :
have L := G.symLHRun k N; ∃ (hpos : 0 < L.length), have v := L[L.length - 1]; v.z ≠ 0 ∧ G.SymCompletelyLabeled v.z

Termination of the single-polytope symmetric Lemke–Howson path at a nonzero completely represented vertex ([Pap07], Section 2.3.2, pp. 35–36): running symLHRun G k N for N ≥ Nat.card (SymLHNode G k) steps terminates at a nonzero completely represented vertex of P.

theorem Cslib.GameTheory.BimatrixGame.IsSymmetric.symLHRun_isSymmetricNash {M : Type u_1} [Fintype M] [DecidableEq M] {G : BimatrixGame M M} {k : M} (hG : G.IsSymmetric) (hnd : G.matP.IsNondegenerateSystem (rhsP M M)) (hnn : ∀ (i j : M), 0 ≤ G.A i j) (hcol : ∀ (j : M), ∃ (i : M), 0 < G.A i j) {N : ℕ} (hN : Nat.card (G.SymLHNode k) ≤ N) :
∃ (hpos : 0 < (G.symLHRun k N).length), have z := (G.symLHRun k N)[(G.symLHRun k N).length - 1].z; G.IsSymmetricNash ((∑ i : M, z i)⁻¹ • z)

Correctness of single-polytope symmetric Lemke–Howson ([Pap07], Section 2.3.2, pp. 34–36): for any symmetric bimatrix game with nonnegative payoffs, no all-zero column, and nondegenerate polytope P, normalizing the terminal vertex of symLHRun G k N (for N ≥ Nat.card (SymLHNode G k)) yields a symmetric Nash equilibrium of G.

Every nondegenerate finite symmetric bimatrix game (with arbitrary-sign payoffs) has an odd number of symmetric Nash equilibria ([Pap07], Section 2.3.2, pp. 34–36).