Documentation

CslibFrontier.GameTheory.Graphical.TreeNash

Computing Nash equilibria in tree and acyclic graphical games #

This module formalizes the two-pass dynamic programming algorithm TreeNash and its τ-grid approximation ApproximateTreeNash from [Kea07], §7.3 (Figure 7.1, Theorem 7.3, Lemma 7.4, and the equilibrium correctness/completeness step of Theorem 7.5, pp. 164–168), together with the forest extension to arbitrary finite acyclic graphs.

Orientation and subtree semantics #

Given a tree G : SimpleGraph ι (hT : G.IsTree) rooted at r : ι, Kearns's convention places r at the bottom and the leaves at the top ([Kea07], §7.3, p. 164):

Parameterized two-pass dynamic program #

Both exact TreeNash and discretized ApproximateTreeNash are instances of one parameterized two-pass recurrence over (allowed : ∀ i, Set (S i → ℝ)) and additive best-response slack ε : ℝ:

Main results #

References #

Rooted upstream decomposition #

@[reducible, inline]
abbrev Cslib.GameTheory.UpstreamNeighbors {ι : Type u_1} {G : SimpleGraph ι} (hT : G.IsTree) (r v : ι) :
Type u_1

Upstream neighbors ("parents" in Kearns's upside-down tree convention, [Kea07], §7.3, p. 164) of vertex v when the tree G is rooted at r: all non-root vertices u whose step toward r is v.

theorem Cslib.GameTheory.UpstreamNeighbors.parent_eq {ι : Type u_1} {G : SimpleGraph ι} {hT : G.IsTree} {r v : ι} (c : UpstreamNeighbors hT r v) :
hT.parent r ↑c = v

Every upstream neighbor c of v in a tree rooted at r has hT.parent r c.1 = v.

theorem Cslib.GameTheory.upstream_neighbor_iff {ι : Type u_1} {G : SimpleGraph ι} (hT : G.IsTree) (r : ι) {v c : ι} (hv : v ≠ r) :
G.Adj v c ∧ c ≠ hT.parent r v ↔ c ≠ r ∧ hT.parent r c = v

A non-root vertex's neighbors other than its downstream parent hT.parent r v are precisely its upstream neighbors in UpstreamNeighbors hT r v.

theorem Cslib.GameTheory.upstream_unique_of_mem_treeSide {ι : Type u_1} {G : SimpleGraph ι} {hT : G.IsTree} {r v : ι} {c c' : UpstreamNeighbors hT r v} {z : ι} (hz : z ∈ hT.treeSide (↑c) v) (hz' : z ∈ hT.treeSide (↑c') v) :
c = c'

Distinct upstream neighbors of v have disjoint subtrees hT.treeSide c.1 v.

theorem Cslib.GameTheory.UpstreamNeighbors.card_sub_length_pathTo_lt {ι : Type u_1} [Fintype ι] {G : SimpleGraph ι} {hT : G.IsTree} {r v : ι} (c : UpstreamNeighbors hT r v) :
Fintype.card ι - (hT.pathTo r ↑c).length < Fintype.card ι - (hT.pathTo r v).length

Moving from v to an upstream neighbor c strictly decreases Fintype.card ι - (hT.pathTo r ·).length.

theorem Cslib.GameTheory.UpstreamNeighbors.treeSide_subset {ι : Type u_1} {G : SimpleGraph ι} {hT : G.IsTree} {r v : ι} (hv : v ≠ r) (c : UpstreamNeighbors hT r v) :
hT.treeSide (↑c) v ⊆ hT.treeSide v (hT.parent r v)

For a non-root vertex v ≠ r, each upstream neighbor's subtree hT.treeSide c.1 v is contained in hT.treeSide v (hT.parent r v).

theorem Cslib.GameTheory.exists_upstream_mem_treeSide_root {ι : Type u_1} {G : SimpleGraph ι} (hT : G.IsTree) (r : ι) {z : ι} (hzr : z ≠ r) :
∃ (c : UpstreamNeighbors hT r r), z ∈ hT.treeSide (↑c) r

Every non-root vertex z ≠ r lies in the subtree hT.treeSide c.1 r of some upstream neighbor c of the root r.

def Cslib.GameTheory.GraphicalGame.assembleRootNeighbors {ι : Type u_1} {S : ι → Type u_2} {G : SimpleGraph ι} (hT : G.IsTree) (r : ι) (u : (c : UpstreamNeighbors hT r r) → S ↑c → ℝ) (j : ↑(G.neighborSet r)) :
S ↑j → ℝ

Assemble a neighbor mixed-strategy profile at the root r from strategies on UpstreamNeighbors hT r r.

@[simp]
theorem Cslib.GameTheory.GraphicalGame.assembleRootNeighbors_restrict {ι : Type u_1} {S : ι → Type u_2} {G : SimpleGraph ι} (hT : G.IsTree) (r : ι) (p : (i : ι) → S i → ℝ) :
(assembleRootNeighbors hT r fun (c : UpstreamNeighbors hT r r) => p ↑c) = fun (j : ↑(G.neighborSet r)) => p ↑j
noncomputable def Cslib.GameTheory.GraphicalGame.assembleNeighbors {ι : Type u_1} {S : ι → Type u_2} [DecidableEq ι] {G : SimpleGraph ι} (hT : G.IsTree) (r : ι) {v : ι} (_hv : v ≠ r) (xw : S (hT.parent r v) → ℝ) (u : (c : UpstreamNeighbors hT r v) → S ↑c → ℝ) (j : ↑(G.neighborSet v)) :
S ↑j → ℝ

Assemble a neighbor mixed-strategy profile at a non-root vertex v ≠ r from the strategy xw of its unique downstream neighbor hT.parent r v and strategies u of UpstreamNeighbors hT r v.

@[simp]
theorem Cslib.GameTheory.GraphicalGame.assembleNeighbors_restrict {ι : Type u_1} {S : ι → Type u_2} [DecidableEq ι] {G : SimpleGraph ι} (hT : G.IsTree) (r : ι) {v : ι} (hv : v ≠ r) (p : (i : ι) → S i → ℝ) :
(assembleNeighbors hT r hv (p (hT.parent r v)) fun (c : UpstreamNeighbors hT r v) => p ↑c) = fun (j : ↑(G.neighborSet v)) => p ↑j
@[irreducible]
def Cslib.GameTheory.GraphicalGame.treePassTable {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] (M : GraphicalGame ι S) (hT : M.graph.IsTree) (r : ι) (allowed : (i : ι) → Set (S i → ℝ)) (ε : ℝ) (v : ι) (xw : S (hT.parent r v) → ℝ) (xv : S v → ℝ) :

Downstream dynamic-programming table T(w, v) of parameterized TreeNash ([Kea07], Figure 7.1 Step (ii), p. 165) passed from non-root vertex v to its downstream neighbor w = hT.parent r v.

def Cslib.GameTheory.GraphicalGame.IsTreePassWitness {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] (M : GraphicalGame ι S) (hT : M.graph.IsTree) (r : ι) (allowed : (i : ι) → Set (S i → ℝ)) (ε : ℝ) {v : ι} (hv : v ≠ r) (xw : S (hT.parent r v) → ℝ) (xv : S v → ℝ) (u : (c : UpstreamNeighbors hT r v) → S ↑c → ℝ) :

Witness predicate for treePassTable at v ≠ r ([Kea07], Figure 7.1 Step (ii)(d)2, pp. 165–166): u belongs to the witness list of (xw, xv) iff every upstream table entry T(xv, u c) holds and xv is locally an ε-best response to (xw, u).

theorem Cslib.GameTheory.GraphicalGame.treePassTable_iff_exists_witness {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] {M : GraphicalGame ι S} {hT : M.graph.IsTree} {r : ι} {allowed : (i : ι) → Set (S i → ℝ)} {ε : ℝ} {v : ι} (hv : v ≠ r) {xw : S (hT.parent r v) → ℝ} {xv : S v → ℝ} :
M.treePassTable hT r allowed ε v xw xv ↔ ∃ (u : (c : UpstreamNeighbors hT r v) → S ↑c → ℝ), M.IsTreePassWitness hT r allowed ε hv xw xv u
theorem Cslib.GameTheory.GraphicalGame.treePassTable_of_isEmpty {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] {M : GraphicalGame ι S} {hT : M.graph.IsTree} {r : ι} {allowed : (i : ι) → Set (S i → ℝ)} {ε : ℝ} {v : ι} (hv : v ≠ r) [IsEmpty (UpstreamNeighbors hT r v)] {xw : S (hT.parent r v) → ℝ} {xv : S v → ℝ} :
M.treePassTable hT r allowed ε v xw xv ↔ xw ∈ allowed (hT.parent r v) ∧ xv ∈ allowed v ∧ M.IsApproxBestResponse ε v xv (assembleNeighbors hT r hv xw fun (a : UpstreamNeighbors hT r v) => isEmptyElim a)

Leaf base case ([Kea07], Figure 7.1 Step (ii)(c), p. 165): when v ≠ r has no upstream neighbors, treePassTable holds iff xw ∈ allowed (hT.parent r v), xv ∈ allowed v, and xv is locally an ε-best response to xw.

def Cslib.GameTheory.GraphicalGame.IsRootPassWitness {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] (M : GraphicalGame ι S) (hT : M.graph.IsTree) (r : ι) (allowed : (i : ι) → Set (S i → ℝ)) (ε : ℝ) (xr : S r → ℝ) (u : (c : UpstreamNeighbors hT r r) → S ↑c → ℝ) :

Witness predicate at the root r ([Kea07], §7.3, p. 166).

def Cslib.GameTheory.GraphicalGame.rootPassTable {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] (M : GraphicalGame ι S) (hT : M.graph.IsTree) (r : ι) (allowed : (i : ι) → Set (S i → ℝ)) (ε : ℝ) (xr : S r → ℝ) :

One-dimensional root table T(z) at the root r ([Kea07], §7.3, p. 166).

def Cslib.GameTheory.GraphicalGame.IsTreePassOutput {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] (M : GraphicalGame ι S) (hT : M.graph.IsTree) (r : ι) (allowed : (i : ι) → Set (S i → ℝ)) (ε : ℝ) (p : (i : ι) → S i → ℝ) :

Nondeterministic upstream-pass output predicate ([Kea07], Figure 7.1 Step (iii), pp. 165–166): p is produced by choosing a valid root entry p r, a root witness, and valid witnesses at every non-root vertex v ≠ r upstream.

Subtree equilibrium invariant and master two-pass equivalence #

theorem Cslib.GameTheory.GraphicalGame.treePassTable_iff_exists_subtreeEquilibrium {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] {M : GraphicalGame ι S} {hT : M.graph.IsTree} {r : ι} {allowed : (i : ι) → Set (S i → ℝ)} {ε : ℝ} {v : ι} (hv : v ≠ r) {xw : S (hT.parent r v) → ℝ} {xv : S v → ℝ} :
M.treePassTable hT r allowed ε v xw xv ↔ xw ∈ allowed (hT.parent r v) ∧ ∃ (q : (i : ι) → S i → ℝ), q (hT.parent r v) = xw ∧ q v = xv ∧ (∀ z ∈ hT.treeSide v (hT.parent r v), q z ∈ allowed z) ∧ ∀ z ∈ hT.treeSide v (hT.parent r v), M.IsApproxBestResponse ε z (q z) fun (j : ↑(M.graph.neighborSet z)) => q ↑j

Subtree table invariant ([Kea07], §7.3, pp. 164–166): for v ≠ r, treePassTable accepts (xw, xv) if and only if there exists a profile q assigning xw to hT.parent r v, xv to v, strategies from allowed across UP_G(v) = hT.treeSide v (hT.parent r v), and making every vertex z ∈ hT.treeSide v (hT.parent r v) locally an ε-best response to q.

theorem Cslib.GameTheory.GraphicalGame.rootPassTable_iff_exists_isApproxNash {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] {M : GraphicalGame ι S} {hT : M.graph.IsTree} {r : ι} {allowed : (i : ι) → Set (S i → ℝ)} {ε : ℝ} {xr : S r → ℝ} :
M.rootPassTable hT r allowed ε xr ↔ ∃ (q : (i : ι) → S i → ℝ), q r = xr ∧ (∀ (i : ι), q i ∈ allowed i) ∧ M.IsApproxNash ε q

Root table characterization ([Kea07], §7.3, p. 166): rootPassTable accepts xr iff xr extends to an ε-Nash equilibrium q of M with q r = xr and ∀ i, q i ∈ allowed i.

theorem Cslib.GameTheory.GraphicalGame.isTreePassOutput_iff_isApproxNash {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] {M : GraphicalGame ι S} {hT : M.graph.IsTree} {r : ι} {allowed : (i : ι) → Set (S i → ℝ)} {ε : ℝ} {p : (i : ι) → S i → ℝ} :
M.IsTreePassOutput hT r allowed ε p ↔ (∀ (i : ι), p i ∈ allowed i) ∧ M.IsApproxNash ε p

Master two-pass equivalence: a strategy profile p is produced by a nondeterministic upstream pass through treePassTable and rootPassTable if and only if ∀ i, p i ∈ allowed i and M.IsApproxNash ε p.

Constructive upstream pass #

noncomputable def Cslib.GameTheory.GraphicalGame.treePassUpstream {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] {M : GraphicalGame ι S} (hT : M.graph.IsTree) {r : ι} {allowed : (i : ι) → Set (S i → ℝ)} {ε : ℝ} {xr : S r → ℝ} (hroot : M.rootPassTable hT r allowed ε xr) (i : ι) :
S i → ℝ

Constructive upstream pass ([Kea07], Figure 7.1 Step (iii), p. 165): given a valid root entry xr (rootPassTable M hT r allowed ε xr), recursively assigns strategies from r to the leaves using chosen witnesses at each vertex.

@[simp]
theorem Cslib.GameTheory.GraphicalGame.treePassUpstream_root {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] {M : GraphicalGame ι S} (hT : M.graph.IsTree) {r : ι} {allowed : (i : ι) → Set (S i → ℝ)} {ε : ℝ} {xr : S r → ℝ} (hroot : M.rootPassTable hT r allowed ε xr) :
treePassUpstream hT hroot r = xr
theorem Cslib.GameTheory.GraphicalGame.isTreePassOutput_treePassUpstream {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] {M : GraphicalGame ι S} (hT : M.graph.IsTree) {r : ι} {allowed : (i : ι) → Set (S i → ℝ)} {ε : ℝ} {xr : S r → ℝ} (hroot : M.rootPassTable hT r allowed ε xr) :
M.IsTreePassOutput hT r allowed ε (treePassUpstream hT hroot)
theorem Cslib.GameTheory.GraphicalGame.treePassUpstream_isApproxNash {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] {M : GraphicalGame ι S} (hT : M.graph.IsTree) {r : ι} {allowed : (i : ι) → Set (S i → ℝ)} {ε : ℝ} {xr : S r → ℝ} (hroot : M.rootPassTable hT r allowed ε xr) :
(∀ (i : ι), treePassUpstream hT hroot i ∈ allowed i) ∧ M.IsApproxNash ε (treePassUpstream hT hroot)

Exact TreeNash on trees ([Kea07], Theorem 7.3, p. 166) #

def Cslib.GameTheory.GraphicalGame.treeNashRootTable {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] (M : GraphicalGame ι S) (hT : M.graph.IsTree) (r : ι) (xr : S r → ℝ) :

Exact root table T(z) of algorithm TreeNash ([Kea07], §7.3, p. 166).

def Cslib.GameTheory.GraphicalGame.IsTreeNashOutput {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] (M : GraphicalGame ι S) (hT : M.graph.IsTree) (r : ι) (p : (i : ι) → S i → ℝ) :

Nondeterministic output predicate of exact TreeNash ([Kea07], Theorem 7.3, p. 166).

theorem Cslib.GameTheory.GraphicalGame.isTreeNashOutput_iff_isMixedNash {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] {M : GraphicalGame ι S} (hT : M.graph.IsTree) (r : ι) {p : (i : ι) → S i → ℝ} :

TreeNash completeness ([Kea07], Theorem 7.3, second sentence, p. 166): the downstream tables and witness sets of TreeNash represent all mixed Nash equilibria of (G, M).

theorem Cslib.GameTheory.GraphicalGame.exists_treeNashRootTable {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] (M : GraphicalGame ι S) (hT : M.graph.IsTree) (r : ι) [∀ (i : ι), Nonempty (S i)] :
∃ (xr : S r → ℝ), M.treeNashRootTable hT r xr

When every player has a nonempty finite action set, the exact root table treeNashRootTable is nonempty ([Kea07], §7.3, p. 166).

noncomputable def Cslib.GameTheory.GraphicalGame.treeNash {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] (M : GraphicalGame ι S) (hT : M.graph.IsTree) (r : ι) [∀ (i : ι), Nonempty (S i)] (i : ι) :
S i → ℝ

Algorithm TreeNash ([Kea07], Figure 7.1 & Theorem 7.3, pp. 165–166): computes an exact mixed Nash equilibrium of a finite tree graphical game by running the downstream table pass to root r followed by the upstream witness pass.

theorem Cslib.GameTheory.GraphicalGame.treeNash_isTreeNashOutput {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] (M : GraphicalGame ι S) (hT : M.graph.IsTree) (r : ι) [∀ (i : ι), Nonempty (S i)] :
M.IsTreeNashOutput hT r (M.treeNash hT r)

TreeNash soundness ([Kea07], Theorem 7.3, first sentence, p. 166): M.treeNash hT r is a mixed Nash equilibrium of (G, M) (and is produced by TreeNash's tables and witnesses).

theorem Cslib.GameTheory.GraphicalGame.treeNash_isMixedNash {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] (M : GraphicalGame ι S) (hT : M.graph.IsTree) (r : ι) [∀ (i : ι), Nonempty (S i)] :

TreeNash soundness ([Kea07], Theorem 7.3, p. 166): M.treeNash hT r is an exact mixed Nash equilibrium of M.toCostGame.

Forest extension: acyclic graphical games (M.graph.IsAcyclic) #

def Cslib.GameTheory.GraphicalGame.induceSubgame {ι : Type u_1} {S : ι → Type u_2} (M : GraphicalGame ι S) (U : Set ι) (hclosed : ∀ ⦃i j : ι⦄, i ∈ U → M.graph.Adj i j → j ∈ U) :
GraphicalGame ↑U fun (i : ↑U) => S ↑i

Restrict a graphical game M to an adjacency-closed set of players U : Set ι (such as a connected component).

noncomputable def Cslib.GameTheory.GraphicalGame.componentGame {ι : Type u_1} {S : ι → Type u_2} (M : GraphicalGame ι S) (C : M.graph.ConnectedComponent) :
GraphicalGame ↑C.supp fun (i : ↑C.supp) => S ↑i

Restriction of a graphical game M to a connected component C : M.graph.ConnectedComponent.

When M.graph is acyclic, every connected component induces a tree.

theorem Cslib.GameTheory.GraphicalGame.isApproxNash_iff_forall_componentGame {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] {M : GraphicalGame ι S} {ε : ℝ} {p : (i : ι) → S i → ℝ} :
M.IsApproxNash ε p ↔ ∀ (C : M.graph.ConnectedComponent), (M.componentGame C).IsApproxNash ε fun (i : ↑C.supp) => p ↑i

Forest decomposition of ε-Nash equilibria: a profile p is an ε-Nash equilibrium of M if and only if its restriction to every connected component C of M.graph is an ε-Nash equilibrium of M.componentGame C.

theorem Cslib.GameTheory.GraphicalGame.isMixedNash_iff_component_treeNash {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] {M : GraphicalGame ι S} (hA : M.graph.IsAcyclic) (rootOf : (C : M.graph.ConnectedComponent) → ↑C.supp) {p : (i : ι) → S i → ℝ} :
M.toCostGame.IsMixedNash p ↔ ∀ (C : M.graph.ConnectedComponent), (M.componentGame C).IsTreeNashOutput ⋯ (rootOf C) fun (i : ↑C.supp) => p ↑i

On an acyclic graphical game M (hA : M.graph.IsAcyclic), running TreeNash independently on each connected tree component characterizes all mixed Nash equilibria of M.

noncomputable def Cslib.GameTheory.GraphicalGame.acyclicNash {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] (M : GraphicalGame ι S) (hA : M.graph.IsAcyclic) [∀ (i : ι), Nonempty (S i)] (i : ι) :
S i → ℝ

Two-pass TreeNash on acyclic graphical games (forests): runs treeNash independently on every connected tree component of M.graph.

theorem Cslib.GameTheory.GraphicalGame.acyclicNash_isMixedNash {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] (M : GraphicalGame ι S) (hA : M.graph.IsAcyclic) [∀ (i : ι), Nonempty (S i)] :

Soundness of acyclicNash: on any finite acyclic graphical game with nonempty action sets, M.acyclicNash hA is an exact mixed Nash equilibrium of M.toCostGame.

L₁ product perturbation and τ-grid rounding ([Kea07], Lemma 7.4, p. 167) #

theorem Cslib.GameTheory.GraphicalGame.sum_abs_prod_sub_prod_le {α : Type u₁} [Fintype α] [DecidableEq α] {T : α → Type u₂} [(j : α) → Fintype (T j)] {p q : (j : α) → T j → ℝ} (hp_nonneg : ∀ (j : α) (a : T j), 0 ≤ p j a) (hp_sum : ∀ (j : α), ∑ a : T j, p j a = 1) (hq_nonneg : ∀ (j : α) (a : T j), 0 ≤ q j a) (hq_sum : ∀ (j : α), ∑ a : T j, q j a = 1) :
∑ u : (j : α) → T j, |∏ j : α, p j (u j) - ∏ j : α, q j (u j)| ≤ ∑ j : α, ∑ a : T j, |p j a - q j a|

Product-distribution L₁ telescoping bound: the L₁ distance between two finite product probability distributions is bounded by the sum of the coordinatewise L₁ distances.

theorem Cslib.GameTheory.GraphicalGame.isApproxNash_of_l1_le {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] (M : GraphicalGame ι S) [DecidableRel M.graph.Adj] {d : ℕ} {τ : ℝ} {p q : (i : ι) → S i → ℝ} (hpay : ∀ (i : ι) (u : (j : ClosedNeighborhood M.graph i) → S ↑j), 0 ≤ M.localPayoff i u ∧ M.localPayoff i u ≤ 1) (hdeg : ∀ (i : ι), M.graph.degree i ≤ d) (hp : M.toCostGame.IsMixedNash p) (hq : ∀ (i : ι), IsMixedStrategy (q i)) (hl1 : ∀ (i : ι), ∑ a : S i, |p i a - q i a| ≤ τ) (hsupp : ∀ (i : ι) (a : S i), 0 < q i a → 0 < p i a) :
M.IsApproxNash (↑d * τ) q

General L₁ Nash perturbation lemma ([Kea07], Lemma 7.4 over arbitrary finite action sets, p. 167): if M has [0, 1] payoffs and maximum degree at most d, p is an exact mixed Nash equilibrium of M, and q is a mixed strategy profile with ∑ a, |p i a - q i a| ≤ τ and support inclusion 0 < q i a → 0 < p i a for every player i, then q is a (d * τ)-Nash equilibrium of M.

Discretized τ-grid on Bool (τ = 1 / m) #

The discretized τ-grid {0, τ, 2τ, …, 1} (τ = 1 / m) of binary mixed strategies ([Kea07], §7.3.1, p. 167).

Nearest mixed strategy on binaryTauGrid m (in L₁ norm) to x : Bool → ℝ ([Kea07], Lemma 7.4, p. 167), defined explicitly via rounding m * x false to the nearest integer in {0, …, m}.

theorem Cslib.GameTheory.GraphicalGame.l1_nearestGridStrategy_le {m : ℕ} (hm : 1 ≤ m) {x : Bool → ℝ} (hx : IsMixedStrategy x) :
∑ b : Bool, |x b - nearestGridStrategy m x b| ≤ 1 / ↑m

L₁ error bound of nearestGridStrategy: on Bool, rounding to binaryTauGrid m changes each coordinate by at most 1 / (2 * m), hence changes the distribution in L₁ norm by at most 1 / m = τ.

theorem Cslib.GameTheory.GraphicalGame.l1_nearestGridStrategy_le_of_mem {m : ℕ} (hm : 1 ≤ m) {x y : Bool → ℝ} (hx : IsMixedStrategy x) (hy : y ∈ binaryTauGrid m) :
∑ b : Bool, |x b - nearestGridStrategy m x b| ≤ ∑ b : Bool, |x b - y b|

L₁ optimality of nearestGridStrategy ([Kea07], Lemma 7.4, p. 167): nearestGridStrategy m x minimizes the L₁ distance to x over all strategies y in binaryTauGrid m.

theorem Cslib.GameTheory.GraphicalGame.pos_of_nearestGridStrategy_pos {m : ℕ} (hm : 1 ≤ m) {x : Bool → ℝ} (hx : IsMixedStrategy x) {b : Bool} (hb : 0 < nearestGridStrategy m x b) :
0 < x b

Rounding a binary mixed strategy x to binaryTauGrid m (1 ≤ m) never introduces a new action into its support, because pure strategies (0, 1) and (1, 0) already lie on the grid.

theorem Cslib.GameTheory.GraphicalGame.isApproxNash_nearestGridStrategy {ι : Type u_1} [Fintype ι] [DecidableEq ι] (M : GraphicalGame ι fun (x : ι) => Bool) [DecidableRel M.graph.Adj] {d m : ℕ} (hm : 1 ≤ m) (hpay : ∀ (i : ι) (u : ClosedNeighborhood M.graph i → Bool), 0 ≤ M.localPayoff i u ∧ M.localPayoff i u ≤ 1) (hdeg : ∀ (i : ι), M.graph.degree i ≤ d) {p : ι → Bool → ℝ} (hp : M.toCostGame.IsMixedNash p) :
M.IsApproxNash (↑d * (1 / ↑m)) fun (i : ι) => nearestGridStrategy m (p i)

τ-grid Nash perturbation lemma ([Kea07], Lemma 7.4, p. 167): let M be a binary graphical game of maximum degree at most d with payoffs in [0, 1], and let p be an exact mixed Nash equilibrium of M. For any grid resolution 1 ≤ m (τ = 1 / m), the L₁-nearest τ-grid profile fun i => nearestGridStrategy m (p i) is a (d * (1 / m))-Nash equilibrium of M.

Discretized ApproximateTreeNash step ([Kea07], §7.3.1, pp. 167–168) #

def Cslib.GameTheory.GraphicalGame.IsApproxTreeNashOutput {ι : Type u_1} [Fintype ι] [DecidableEq ι] (M : GraphicalGame ι fun (x : ι) => Bool) (hT : M.graph.IsTree) (r : ι) (m : ℕ) (ε : ℝ) (q : ι → Bool → ℝ) :

Nondeterministic output predicate of discretized ApproximateTreeNash ([Kea07], §7.3.1, p. 167) on a binary tree graphical game at grid resolution m (τ = 1 / m) and slack ε.

theorem Cslib.GameTheory.GraphicalGame.exists_approxTreeNashOutput_of_isMixedNash {ι : Type u_1} [Fintype ι] [DecidableEq ι] (M : GraphicalGame ι fun (x : ι) => Bool) [DecidableRel M.graph.Adj] (hT : M.graph.IsTree) (r : ι) {d : ℕ} {ε : ℝ} (hε : 0 < ε) (hpay : ∀ (i : ι) (u : ClosedNeighborhood M.graph i → Bool), 0 ≤ M.localPayoff i u ∧ M.localPayoff i u ≤ 1) (hdeg : ∀ (i : ι), M.graph.degree i ≤ d) {p : ι → Bool → ℝ} (hp : M.toCostGame.IsMixedNash p) :
have m := max 1 ⌈↑d / ε⌉₊; ∃ (q : ι → Bool → ℝ), M.IsApproxTreeNashOutput hT r m ε q ∧ M.IsApproxNash ε q ∧ ∀ (i : ι), ∑ b : Bool, |p i b - q i b| ≤ 1 / ↑m

Equilibrium completeness step, not the full polynomial-time endpoint, for discretized ApproximateTreeNash (a step of [Kea07], Theorem 7.5, pp. 167–168, without the machine running-time bound): with grid resolution m = max 1 ⌈(d : ℝ) / ε⌉₊ (τ = 1 / m ≤ ε / d), for every exact mixed Nash equilibrium p of a degree-d, [0, 1]-payoff binary tree graphical game M, the τ-grid tables and witnesses of ApproximateTreeNash contain an ε-Nash equilibrium q within L₁ distance 1 / m of p.

theorem Cslib.GameTheory.GraphicalGame.exists_approxTreeNashRootTable {ι : Type u_1} [Fintype ι] [DecidableEq ι] (M : GraphicalGame ι fun (x : ι) => Bool) [DecidableRel M.graph.Adj] (hT : M.graph.IsTree) (r : ι) {d : ℕ} {ε : ℝ} (hε : 0 < ε) (hpay : ∀ (i : ι) (u : ClosedNeighborhood M.graph i → Bool), 0 ≤ M.localPayoff i u ∧ M.localPayoff i u ≤ 1) (hdeg : ∀ (i : ι), M.graph.degree i ≤ d) :
∃ (xr : Bool → ℝ), M.rootPassTable hT r (fun (x : ι) => binaryTauGrid (max 1 ⌈↑d / ε⌉₊)) ε xr

Nonemptiness of the discretized ApproximateTreeNash root table at resolution m = max 1 ⌈(d : ℝ) / ε⌉₊.

noncomputable def Cslib.GameTheory.GraphicalGame.approxTreeNash {ι : Type u_1} [Fintype ι] [DecidableEq ι] (M : GraphicalGame ι fun (x : ι) => Bool) [DecidableRel M.graph.Adj] (hT : M.graph.IsTree) (r : ι) {d : ℕ} {ε : ℝ} (hε : 0 < ε) (hpay : ∀ (i : ι) (u : ClosedNeighborhood M.graph i → Bool), 0 ≤ M.localPayoff i u ∧ M.localPayoff i u ≤ 1) (hdeg : ∀ (i : ι), M.graph.degree i ≤ d) :
ι → Bool → ℝ

Discretized algorithm ApproximateTreeNash ([Kea07], §7.3.1, p. 167): runs the two-pass dynamic program restricted to binaryTauGrid (max 1 ⌈(d : ℝ) / ε⌉₊) with ε-best responses.

theorem Cslib.GameTheory.GraphicalGame.approxTreeNash_isApproxNash {ι : Type u_1} [Fintype ι] [DecidableEq ι] (M : GraphicalGame ι fun (x : ι) => Bool) [DecidableRel M.graph.Adj] (hT : M.graph.IsTree) (r : ι) {d : ℕ} {ε : ℝ} (hε : 0 < ε) (hpay : ∀ (i : ι) (u : ClosedNeighborhood M.graph i → Bool), 0 ≤ M.localPayoff i u ∧ M.localPayoff i u ≤ 1) (hdeg : ∀ (i : ι), M.graph.degree i ≤ d) :
(∀ (i : ι), M.approxTreeNash hT r hε hpay hdeg i ∈ binaryTauGrid (max 1 ⌈↑d / ε⌉₊)) ∧ M.IsApproxNash ε (M.approxTreeNash hT r hε hpay hdeg)

Equilibrium correctness step, not the full polynomial-time endpoint, for discretized ApproximateTreeNash (a step of [Kea07], Theorem 7.5, pp. 167–168, without the machine running-time bound): approxTreeNash outputs a τ-grid ε-Nash equilibrium of M.