Documentation

CslibFrontier.GameTheory.Extensive.SubgamePerfect

Subgames, subgame-perfect equilibria, and Algorithm 3.9 for imperfect-information extensive games #

This module develops subgame perfection for general finite extensive-form games with imperfect information and chance nodes ([vS07], Section 3.8, pp. 68–69):

Main definitions #

Main results #

References #

def Cslib.GameTheory.Extensive.Node.subtree {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} {T : ExtensiveTree ι H Act} :
Node T → ExtensiveTree ι H Act

The subtree of T rooted at node v.

@[simp]
theorem Cslib.GameTheory.Extensive.Node.subtree_here {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} (T : ExtensiveTree ι H Act) :
@[simp]
theorem Cslib.GameTheory.Extensive.Node.subtree_chance {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} {C : Type} {instF : Fintype C} {prob : C → ℝ} {hprob : IsMixedStrategy prob} {next : C → ExtensiveTree ι H Act} (c : C) (sub : Node (next c)) :
(chance c sub).subtree = sub.subtree
@[simp]
theorem Cslib.GameTheory.Extensive.Node.subtree_decision {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} {i : ι} {h : H i} {next : Act i h → ExtensiveTree ι H Act} (a : Act i h) (sub : Node (next a)) :
def Cslib.GameTheory.Extensive.Node.append {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} {T : ExtensiveTree ι H Act} (v : Node T) :
Node v.subtree → Node T

Append a node u inside v.subtree onto v to obtain a node of T.

@[simp]
theorem Cslib.GameTheory.Extensive.Node.append_here_left {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} {T : ExtensiveTree ι H Act} (u : Node T) :
@[simp]
theorem Cslib.GameTheory.Extensive.Node.append_chance {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} {C : Type} {instF : Fintype C} {prob : C → ℝ} {hprob : IsMixedStrategy prob} {next : C → ExtensiveTree ι H Act} (c : C) (sub : Node (next c)) (u : Node sub.subtree) :
(chance c sub).append u = chance c (sub.append u)
@[simp]
theorem Cslib.GameTheory.Extensive.Node.append_decision {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} {i : ι} {h : H i} {next : Act i h → ExtensiveTree ι H Act} (a : Act i h) (sub : Node (next a)) (u : Node sub.subtree) :
(decision a sub).append u = decision a (sub.append u)
@[simp]
theorem Cslib.GameTheory.Extensive.Node.append_here_right {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} {T : ExtensiveTree ι H Act} (v : Node T) :
theorem Cslib.GameTheory.Extensive.Node.append_ne_here {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} {T : ExtensiveTree ι H Act} {v : Node T} :
v ≠ here → ∀ (u : Node v.subtree), v.append u ≠ here
@[simp]
theorem Cslib.GameTheory.Extensive.Node.subtree_append {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} {T : ExtensiveTree ι H Act} (v : Node T) (u : Node v.subtree) :
theorem Cslib.GameTheory.Extensive.Node.append_injective {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} {T : ExtensiveTree ι H Act} (v : Node T) :
theorem Cslib.GameTheory.Extensive.Node.isDecisionOf_append {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} (i : ι) (h : H i) {T : ExtensiveTree ι H Act} (v : Node T) (u : Node v.subtree) :
theorem Cslib.GameTheory.Extensive.Node.playerSeq_append {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} [DecidableEq ι] (i : ι) {T : ExtensiveTree ι H Act} (v : Node T) (u : Node v.subtree) :
theorem Cslib.GameTheory.Extensive.Node.exists_append_append {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} {T : ExtensiveTree ι H Act} (v : Node T) (u : Node v.subtree) (w : Node T) :
(∃ (z : Node (v.append u).subtree), (v.append u).append z = w) ↔ ∃ (z : Node u.subtree), v.append (u.append z) = w
theorem Cslib.GameTheory.Extensive.Node.occursInfoSet_of_subtree {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} {T : ExtensiveTree ι H Act} (v : Node T) {i : ι} {h : H i} (hh : v.subtree.OccursInfoSet i h) :
theorem Cslib.GameTheory.Extensive.ExtensiveTree.PerfectRecall.subtree {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} [DecidableEq ι] {T : ExtensiveTree ι H Act} {i : ι} (hpr : T.PerfectRecall i) (v : Node T) :

Any subtree of a game tree with perfect recall for player i inherits perfect recall.

def Cslib.GameTheory.Extensive.Node.IsSubgameRoot {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} {T : ExtensiveTree ι H Act} (v : Node T) :

Node v : Node T is the root of a subgame of T ([vS07], Section 3.8, p. 68) iff every information set containing a decision node in v.subtree has all of its decision nodes inside v.subtree.

theorem Cslib.GameTheory.Extensive.Node.isSubgameRoot_here {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} (T : ExtensiveTree ι H Act) :
theorem Cslib.GameTheory.Extensive.Node.isSubgameRoot_of_leaf {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} {T : ExtensiveTree ι H Act} {v : Node T} {w : ι → ℝ} (hv : v.subtree = ExtensiveTree.leaf w) :
theorem Cslib.GameTheory.Extensive.Node.IsSubgameRoot.of_append {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} {T : ExtensiveTree ι H Act} {v : Node T} {u : Node v.subtree} (hvu : (v.append u).IsSubgameRoot) :
theorem Cslib.GameTheory.Extensive.Node.IsSubgameRoot.append {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} {T : ExtensiveTree ι H Act} {v : Node T} {u : Node v.subtree} (hv : v.IsSubgameRoot) (hu : u.IsSubgameRoot) :
def Cslib.GameTheory.Extensive.ExtensiveTree.IsBehaviorSPE {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} [DecidableEq ι] [(i : ι) → (h : H i) → Fintype (Act i h)] (T : ExtensiveTree ι H Act) (β : (i : ι) → (h : H i) → Act i h → ℝ) :

A behavioral strategy profile β is a subgame-perfect equilibrium (SPE) of T ([vS07], Section 3.8, p. 68) iff it induces a behavioral Nash equilibrium in every subgame of T.

theorem Cslib.GameTheory.Extensive.ExtensiveTree.IsBehaviorSPE.isBehaviorNash {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} [DecidableEq ι] [(i : ι) → (h : H i) → Fintype (Act i h)] {T : ExtensiveTree ι H Act} {β : (i : ι) → (h : H i) → Act i h → ℝ} (hspe : T.IsBehaviorSPE β) :
theorem Cslib.GameTheory.Extensive.ExtensiveTree.IsBehaviorSPE.subtree {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} [DecidableEq ι] [(i : ι) → (h : H i) → Fintype (Act i h)] {T : ExtensiveTree ι H Act} {β : (i : ι) → (h : H i) → Act i h → ℝ} (hspe : T.IsBehaviorSPE β) {v : Node T} (hv : v.IsSubgameRoot) :
theorem Cslib.GameTheory.Extensive.ExtensiveTree.isBehaviorNash_leaf {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} [DecidableEq ι] [(i : ι) → (h : H i) → Fintype (Act i h)] (w : ι → ℝ) {β : (i : ι) → (h : H i) → Act i h → ℝ} (hbeh : ∀ (i : ι), IsBehaviorStrategy (β i)) :
theorem Cslib.GameTheory.Extensive.ExtensiveTree.evalBehavior_congr_occursInfoSet {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} [(i : ι) → (h : H i) → Fintype (Act i h)] (T : ExtensiveTree ι H Act) {β₁ β₂ : (i : ι) → (h : H i) → Act i h → ℝ} :
(∀ (i : ι) (h : H i), T.OccursInfoSet i h → β₁ i h = β₂ i h) → evalBehavior β₁ T = evalBehavior β₂ T

Behavioral evaluation depends only on the strategies at information sets occurring in T.

theorem Cslib.GameTheory.Extensive.ExtensiveTree.isBehaviorNash_congr_occursInfoSet {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} [DecidableEq ι] [(i : ι) → (h : H i) → Fintype (Act i h)] {T : ExtensiveTree ι H Act} {β₁ β₂ : (i : ι) → (h : H i) → Act i h → ℝ} (hbeh₂ : ∀ (i : ι), IsBehaviorStrategy (β₂ i)) (hcongr : ∀ (i : ι) (h : H i), T.OccursInfoSet i h → β₁ i h = β₂ i h) (hnash₁ : T.IsBehaviorNash β₁) :

Congruence of IsBehaviorNash for valid behavior profiles agreeing on all occurring information sets of T.

noncomputable def Cslib.GameTheory.Extensive.ExtensiveTree.replaceSubtree {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} {T : ExtensiveTree ι H Act} :
Node T → (ι → ℝ) → ExtensiveTree ι H Act

Replace the subtree rooted at node v of T by a terminal leaf with payoff vector pay ([vS07], Algorithm 3.9, p. 68).

def Cslib.GameTheory.Extensive.Node.reachProbBehavior {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} (β : (i : ι) → (h : H i) → Act i h → ℝ) {T : ExtensiveTree ι H Act} :
Node T → ℝ

Probability of reaching node v from the root under behavior strategy profile β.

theorem Cslib.GameTheory.Extensive.Node.reachProbBehavior_nonneg {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} [(i : ι) → (h : H i) → Fintype (Act i h)] {β : (i : ι) → (h : H i) → Act i h → ℝ} (hβ : ∀ (i : ι), IsBehaviorStrategy (β i)) {T : ExtensiveTree ι H Act} (v : Node T) :
theorem Cslib.GameTheory.Extensive.ExtensiveTree.evalBehavior_sub_replaceSubtree {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} [(i : ι) → (h : H i) → Fintype (Act i h)] (β : (i : ι) → (h : H i) → Act i h → ℝ) (pay : ι → ℝ) (k : ι) {T : ExtensiveTree ι H Act} (v : Node T) :

Exact payoff difference under subtree replacement: replacing v.subtree by .leaf pay shifts player k's expected payoff by v.reachProbBehavior β * (v.subtree.evalBehavior β k - pay k).

theorem Cslib.GameTheory.Extensive.ExtensiveTree.occursInfoSet_of_replaceSubtree {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} {T : ExtensiveTree ι H Act} (v : Node T) (pay : ι → ℝ) {i : ι} {h : H i} (hh : (replaceSubtree v pay).OccursInfoSet i h) :

Every information set occurring in T.replaceSubtree v pay also occurs in T.

theorem Cslib.GameTheory.Extensive.Node.IsSubgameRoot.not_occursInfoSet_replaceSubtree {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} {T : ExtensiveTree ι H Act} {v : Node T} (hv : v.IsSubgameRoot) (pay : ι → ℝ) {i : ι} {h : H i} (hsub : v.subtree.OccursInfoSet i h) :

Information-set disjointness under subgame replacement: if v is a subgame root of T, no information set occurring in v.subtree occurs in T.replaceSubtree v pay.

theorem Cslib.GameTheory.Extensive.ExtensiveTree.PerfectRecall.replaceSubtree {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} [DecidableEq ι] {T : ExtensiveTree ι H Act} {i : ι} (hpr : T.PerfectRecall i) (v : Node T) (pay : ι → ℝ) :

Replacing a subtree preserves perfect recall for every player.

noncomputable def Cslib.GameTheory.Extensive.ExtensiveTree.glueSubgameStrategy {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} {T : ExtensiveTree ι H Act} (v : Node T) (β_sub β_top : (i : ι) → (h : H i) → Act i h → ℝ) (i : ι) (h : H i) :
Act i h → ℝ

Glue a subgame strategy profile β_sub (used at information sets occurring in v.subtree) with a strategy profile β_top for the replaced tree (used everywhere else).

theorem Cslib.GameTheory.Extensive.ExtensiveTree.isBehaviorStrategy_glueSubgameStrategy {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} [(i : ι) → (h : H i) → Fintype (Act i h)] {T : ExtensiveTree ι H Act} (v : Node T) {β_sub β_top : (i : ι) → (h : H i) → Act i h → ℝ} (hsub : ∀ (i : ι), IsBehaviorStrategy (β_sub i)) (htop : ∀ (i : ι), IsBehaviorStrategy (β_top i)) (i : ι) :
theorem Cslib.GameTheory.Extensive.ExtensiveTree.isBehaviorNash_glueSubgameStrategy {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} [DecidableEq ι] [(i : ι) → (h : H i) → Fintype (Act i h)] {T : ExtensiveTree ι H Act} {v : Node T} (hv : v.IsSubgameRoot) {β_sub β_top : (i : ι) → (h : H i) → Act i h → ℝ} (hsub : v.subtree.IsBehaviorNash β_sub) (htop : (replaceSubtree v (evalBehavior β_sub v.subtree)).IsBehaviorNash β_top) :

Nash equilibrium gluing across subgame replacement ([vS07], §3.8, Algorithm 3.9): if v is a subgame root, β_sub is a behavioral Nash equilibrium of v.subtree with payoff vector pay := v.subtree.evalBehavior β_sub, and β_top is a behavioral Nash equilibrium of T.replaceSubtree v pay, then T.glueSubgameStrategy v β_sub β_top is a behavioral Nash equilibrium of T with the same expected payoff as β_top on T.replaceSubtree v pay.

theorem Cslib.GameTheory.Extensive.ExtensiveTree.isBehaviorSPE_glueSubgameStrategy {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} [DecidableEq ι] [(i : ι) → (h : H i) → Fintype (Act i h)] {T : ExtensiveTree ι H Act} {v : Node T} (hv : v.IsSubgameRoot) {β_sub β_top : (i : ι) → (h : H i) → Act i h → ℝ} (hsub : v.subtree.IsBehaviorSPE β_sub) (htop : (replaceSubtree v (evalBehavior β_sub v.subtree)).IsBehaviorSPE β_top) :

SPE gluing across subgame replacement ([vS07], §3.8, Algorithm 3.9): if v is a subgame root of T, β_sub is a behavioral SPE of v.subtree with payoff vector pay := v.subtree.evalBehavior β_sub, and β_top is a behavioral SPE of T.replaceSubtree v pay, then T.glueSubgameStrategy v β_sub β_top is a behavioral SPE of T.

def Cslib.GameTheory.Extensive.ExtensiveTree.treeSize {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} [(i : ι) → (h : H i) → Fintype (Act i h)] :
ExtensiveTree ι H Act → ℕ

Total number of nodes (leaves, chance nodes, and decision nodes) in T.

theorem Cslib.GameTheory.Extensive.ExtensiveTree.one_le_treeSize {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} [(i : ι) → (h : H i) → Fintype (Act i h)] (T : ExtensiveTree ι H Act) :
theorem Cslib.GameTheory.Extensive.ExtensiveTree.treeSize_eq_one_iff {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} [(i : ι) → (h : H i) → Fintype (Act i h)] [∀ (i : ι) (h : H i), Nonempty (Act i h)] (T : ExtensiveTree ι H Act) :
T.treeSize = 1 ↔ ∃ (w : ι → ℝ), T = leaf w
theorem Cslib.GameTheory.Extensive.ExtensiveTree.subtree_treeSize_le {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} [(i : ι) → (h : H i) → Fintype (Act i h)] {T : ExtensiveTree ι H Act} (v : Node T) :
theorem Cslib.GameTheory.Extensive.ExtensiveTree.subtree_treeSize_lt {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} [(i : ι) → (h : H i) → Fintype (Act i h)] {T : ExtensiveTree ι H Act} {v : Node T} :
theorem Cslib.GameTheory.Extensive.ExtensiveTree.replaceSubtree_treeSize {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} [(i : ι) → (h : H i) → Fintype (Act i h)] (pay : ι → ℝ) {T : ExtensiveTree ι H Act} (v : Node T) :
noncomputable def Cslib.GameTheory.Extensive.ExtensiveTree.subgamePerfectSolve {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} [DecidableEq ι] [(i : ι) → (h : H i) → Fintype (Act i h)] [∀ (i : ι) (h : H i), Nonempty (Act i h)] (solver : (S : ExtensiveTree ι H Act) → (∀ (i : ι), S.PerfectRecall i) → { β : (i : ι) → (h : H i) → Act i h → ℝ // S.IsBehaviorNash β }) (T : ExtensiveTree ι H Act) (hpr : ∀ (i : ι), T.PerfectRecall i) (i : ι) (h : H i) :
Act i h → ℝ

Algorithm 3.9 ([vS07], Section 3.8, p. 68): given any Nash equilibrium solver for minimal subgames of extensive-form games with perfect recall, bottom-up replacement of minimal subgames by their equilibrium payoffs produces a behavioral subgame-perfect equilibrium.

theorem Cslib.GameTheory.Extensive.ExtensiveTree.isBehaviorSPE_subgamePerfectSolve {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} [DecidableEq ι] [(i : ι) → (h : H i) → Fintype (Act i h)] [∀ (i : ι) (h : H i), Nonempty (Act i h)] (solver : (S : ExtensiveTree ι H Act) → (∀ (i : ι), S.PerfectRecall i) → { β : (i : ι) → (h : H i) → Act i h → ℝ // S.IsBehaviorNash β }) (T : ExtensiveTree ι H Act) (hpr : ∀ (i : ι), T.PerfectRecall i) :

Correctness of Algorithm 3.9 ([vS07], Section 3.8, p. 68): subgamePerfectSolve always returns a behavioral subgame-perfect equilibrium of T.

theorem Cslib.GameTheory.Extensive.ExtensiveTree.exists_isBehaviorSPE {ι : Type u} {H : ι → Type v} {Act : (i : ι) → H i → Type} [Finite ι] [DecidableEq ι] [∀ (i : ι), Finite (H i)] [(i : ι) → (h : H i) → Fintype (Act i h)] [∀ (i : ι) (h : H i), Nonempty (Act i h)] {T : ExtensiveTree ι H Act} (hpr : ∀ (i : ι), T.PerfectRecall i) :
∃ (β : (i : ι) → (h : H i) → Act i h → ℝ), T.IsBehaviorSPE β

Selten's theorem on existence of subgame-perfect equilibria (Selten 1975; [vS07], Section 3.8, Algorithm 3.9, pp. 68–69): every finite extensive-form game with perfect recall admits a behavioral subgame-perfect equilibrium.

Every node of an embedded perfect-information tree is the root of a subgame ([vS07], Section 3.8, p. 69).

General ExtensiveTree.IsBehaviorSPE coincides with PerfectInfoTree.IsBehaviorSPE on every embedded two-player finite perfect-information game tree.