Documentation

CslibFrontier.GameTheory.Strategic.ThreePlayerZeroSum

Reduction from general two-player games to three-player zero-sum games #

While two-player zero-sum games reduce to linear programming (CslibFrontier/GameTheory/Bimatrix/ZeroSum.lean), adding a third player restores the full generality of two-player strategic games ([TV07a], Exercise 1.3, p. 26). Given any two-player bimatrix game G = (A, B) on M × N, adjoining a dummy third player with a single pure strategy PUnit.unit and payoff -(A_{ij} + B_{ij}) yields a three-player zero-sum game G.toThreePlayerZeroSum whose costs always sum to 0 (toThreePlayerZeroSum_isZeroSum).

This module establishes both the exact game-theoretic equilibrium correspondence over ℝ and a native multi-tape Turing-machine polynomial-time search reduction on rational payoff encodings:

  1. General zero-sum strategic games (CostGame.IsZeroSum): a strategic game is zero-sum when G.socialCost s = 0 for every pure profile s. For bimatrix games, this agrees with BimatrixGame.IsZeroSum (BimatrixGame.isZeroSum_iff_toCostGame_isZeroSum).
  2. Game-theoretic bijection (BimatrixGame.toThreePlayerZeroSum):
  3. Polynomial-time search reduction (ThreePlayerZeroSumCode):

Main definitions #

Main results #

References #

Section 1: General zero-sum cost games and the three-player lifting #

def Cslib.GameTheory.CostGame.IsZeroSum {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] (G : CostGame ι S) :

A strategic cost game G is zero-sum if the players' costs (equivalently payoffs) sum to 0 at every pure strategy profile ([TV07a], Exercise 1.3, p. 26).

For a two-player bimatrix game, BimatrixGame.IsZeroSum (B = -A) agrees with CostGame.IsZeroSum on G.toCostGame.

@[reducible, inline]
abbrev Cslib.GameTheory.BimatrixGame.ThreePlayerStrategy (M : Type u) (N : Type v) :
Fin 3 → Type (max u v)

Strategy sets of the three-player zero-sum lifting of a bimatrix game on M × N: player 0 has row strategies M, player 1 has column strategies N, and player 2 has a single dummy strategy PUnit.unit.

Instances For
    @[instance_reducible]

    Three-player zero-sum lifting of a general bimatrix game G = (A, B) ([TV07a], Exercise 1.3, p. 26): players 0 and 1 pay -A_{ij} and -B_{ij}, and dummy player 2 pays A_{ij} + B_{ij} (reward -(A_{ij} + B_{ij})).

    The lifted three-player game is always zero-sum.

    def Cslib.GameTheory.BimatrixGame.threePlayerProfile {M : Type u} {N : Type v} (x : M → ℝ) (y : N → ℝ) (k : Fin 3) :

    Lifting a pair of mixed strategies (x, y) to a three-player profile by assigning weight 1 to player 2's unique strategy.

    @[simp]
    theorem Cslib.GameTheory.BimatrixGame.threePlayerProfile_zero {M : Type u} {N : Type v} (x : M → ℝ) (y : N → ℝ) (i : M) :
    threePlayerProfile x y 0 { down := i } = x i
    @[simp]
    theorem Cslib.GameTheory.BimatrixGame.threePlayerProfile_one {M : Type u} {N : Type v} (x : M → ℝ) (y : N → ℝ) (j : N) :
    threePlayerProfile x y 1 { down := j } = y j
    @[simp]
    theorem Cslib.GameTheory.BimatrixGame.isPureNash_toThreePlayerZeroSum_iff {M : Type u} {N : Type v} (G : BimatrixGame M N) (s : (k : Fin 3) → ThreePlayerStrategy M N k) :
    G.toThreePlayerZeroSum.IsPureNash s ↔ G.toCostGame.IsPureNash fun (x : Bool) => match x with | false => s 0 | true => s 1

    Pure Nash equilibria of G.toThreePlayerZeroSum correspond directly to pure Nash equilibria of G.toCostGame.

    theorem Cslib.GameTheory.BimatrixGame.eq_threePlayerProfile_of_isMixedStrategy {M : Type u} {N : Type v} [Fintype M] [Fintype N] {p : (k : Fin 3) → ThreePlayerStrategy M N k → ℝ} (hp : ∀ (k : Fin 3), IsMixedStrategy (p k)) :
    p = threePlayerProfile (fun (i : M) => p 0 { down := i }) fun (j : N) => p 1 { down := j }

    Any mixed strategy profile p of G.toThreePlayerZeroSum is of the form threePlayerProfile x y.

    theorem Cslib.GameTheory.BimatrixGame.deviationCost_toThreePlayerZeroSum_zero {M : Type u} {N : Type v} [Fintype M] [Fintype N] (G : BimatrixGame M N) {x : M → ℝ} (y : N → ℝ) (hx : ∑ i : M, x i = 1) (i : M) :
    theorem Cslib.GameTheory.BimatrixGame.deviationCost_toThreePlayerZeroSum_one {M : Type u} {N : Type v} [Fintype M] [Fintype N] (G : BimatrixGame M N) (x : M → ℝ) {y : N → ℝ} (hy : ∑ j : N, y j = 1) (j : N) :
    theorem Cslib.GameTheory.BimatrixGame.expectedCost_toThreePlayerZeroSum_zero {M : Type u} {N : Type v} [Fintype M] [Fintype N] (G : BimatrixGame M N) {x : M → ℝ} (y : N → ℝ) (hx : ∑ i : M, x i = 1) :
    theorem Cslib.GameTheory.BimatrixGame.expectedCost_toThreePlayerZeroSum_one {M : Type u} {N : Type v} [Fintype M] [Fintype N] (G : BimatrixGame M N) (x : M → ℝ) {y : N → ℝ} (hy : ∑ j : N, y j = 1) :

    Exact mixed Nash correspondence for toThreePlayerZeroSum ([TV07a], Exercise 1.3, p. 26): (x, y) is a Nash equilibrium of G iff threePlayerProfile x y is a mixed Nash equilibrium of the three-player zero-sum game G.toThreePlayerZeroSum.

    theorem Cslib.GameTheory.BimatrixGame.isMixedNash_toThreePlayerZeroSum_iff {M : Type u} {N : Type v} [Fintype M] [Fintype N] {G : BimatrixGame M N} {p : (k : Fin 3) → ThreePlayerStrategy M N k → ℝ} :
    G.toThreePlayerZeroSum.IsMixedNash p ↔ (G.IsNash (fun (i : M) => p 0 { down := i }) fun (j : N) => p 1 { down := j }) ∧ p 2 PUnit.unit = 1

    Every mixed Nash equilibrium p of G.toThreePlayerZeroSum projects directly to a Nash equilibrium (x, y) of G.

    ε-approximate Nash equilibria (ε ≥ 0) also correspond identically between G and G.toThreePlayerZeroSum.

    Section 2: Encoded three-player zero-sum games and polynomial-time search reduction #

    A rational mixed strategy triple ((x, y), z) for a three-player game, nesting StrategyPair for players 1 and 2 so witness extraction is a direct prefix projection.

    • Players 1 and 2's rational mixed strategy pair.

    • z : List ℚ

      Player 3's rational mixed strategy list.

    Instances For
      theorem Cslib.GameTheory.encThreePlayerWitness_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → StrategyPair} {T0 S0 : γ → ℕ} {x1 : γ → List ℚ} {T1 S1 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn encWitness T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encRat) T1 S1) :
      Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { pair := x0 x, z := x1 x }) encIn encThreePlayerWitness (fun (x : γ) => T0 x + T1 x) fun (x : γ) => S0 x + S1 x

      Canonical binary encoding of a three-player rational strategy triple: framed encWitness pair followed by unframed encList encRat z.

      theorem Cslib.GameTheory.encThreePlayerWitness_pair_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → ThreePlayerStrategyTriple} :
      theorem Cslib.GameTheory.encThreePlayerWitness_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 : γ → StrategyPair} {x1 : γ → List ℚ} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn encWitness budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encRat) budget) :
      Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { pair := x0 x, z := x1 x }) encIn encThreePlayerWitness budget
      @[reducible, inline]

      Encoding of a 3D rational payoff tensor List (List (List ℚ)) via nested encList and encRat.

      An explicitly presented three-player rational payoff game (matA, matB, matC).

      Instances For
        theorem Cslib.GameTheory.ThreePlayerZeroSumCode.ext {x y : ThreePlayerZeroSumCode} (matA : x.matA = y.matA) (matB : x.matB = y.matB) (matC : x.matC = y.matC) :
        x = y
        theorem Cslib.GameTheory.encThreePlayerZeroSum_matC_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → ThreePlayerZeroSumCode} :

        Binary encoding of three-player rational games as (matA, matB, matC) via encRatTensor.

        theorem Cslib.GameTheory.encThreePlayerZeroSum_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → List (List (List ℚ))} {T0 S0 : γ → ℕ} {x1 : γ → List (List (List ℚ))} {T1 S1 : γ → ℕ} {x2 : γ → List (List (List ℚ))} {T2 S2 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn encRatTensor T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn encRatTensor T1 S1) (h2 : Turing.MultiTapeTM.ComputableInO x2 encIn encRatTensor T2 S2) :
        Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { matA := x0 x, matB := x1 x, matC := x2 x }) encIn encThreePlayerZeroSum (fun (x : γ) => T0 x + (T1 x + T2 x)) fun (x : γ) => S0 x + (S1 x + S2 x)
        theorem Cslib.GameTheory.encThreePlayerZeroSum_matA_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → ThreePlayerZeroSumCode} :
        theorem Cslib.GameTheory.encThreePlayerZeroSum_matB_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → ThreePlayerZeroSumCode} :
        theorem Cslib.GameTheory.encThreePlayerZeroSum_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 x1 x2 : γ → List (List (List ℚ))} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn encRatTensor budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn encRatTensor budget) (h2 : Turing.MultiTapeTM.ComputableInSpace x2 encIn encRatTensor budget) :
        Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { matA := x0 x, matB := x1 x, matC := x2 x }) encIn encThreePlayerZeroSum budget

        Number of pure strategies of player 1.

        Number of pure strategies of player 2.

        Number of pure strategies of player 3.

        Entry (i, j, k) of a 3D rational tensor, padded with 0.

        Predicate asserting c encodes nonempty rectangular rows × cols × depth payoff tensors whose three players' payoffs sum to 0 at every pure action profile.

        Exact rational mixed Nash equilibrium condition for a three-player game code c.

        The exact rational Nash equilibrium search problem on three-player zero-sum game codes (with empty witness [] on malformed codes).

        Exact rational Nash equilibrium search problem on BimatrixCode (without an artificial bit length cap; total because BimatrixNash is total).

        Polynomial-time reduction mapping a two-player BimatrixCode (A, B) to an m × n × 1 three-player zero-sum game code (A', B', -(A' + B')) ([TV07a], Exercise 1.3, p. 26). Malformed bimatrix codes map to the malformed empty code ⟨[], [], []⟩.

        Equivalence between rational Nash equilibria of c and rational Nash equilibria of c.toThreePlayerZeroSumCode.

        NRTV Exercise 1.3 (polynomial-time search reduction) ([TV07a], Exercise 1.3, p. 26): finding an exact rational Nash equilibrium in a general two-player bimatrix game reduces in polynomial time (on multi-tape Turing machines) to finding a rational Nash equilibrium in a three-player zero-sum game.