Documentation

CslibFrontier.GameTheory.Strategic.Mixed

Mixed strategies and product distributions #

A mixed strategy of player i in a finite game is a probability vector p i : S i → ℝ. When the players randomize independently, the outcome distribution is the product distribution, with weight productWeight p s = ∏ i, p i (s i) on the profile s (productDist). The expected cost vector of player i assigns to each of its strategies a the expected cost deviationCost G p i a = E_{s ∼ p}[cost i (update s i a)] of playing a while the others play according to p ([Rou13], Lecture 17, §3). The coordinate s i is overwritten, so this expectation depends on p i only through its total mass. For a probability vector p i it is the expectation over the opponents' strategies alone.

The basic identity is sum_mul_deviationCost: averaging the expected cost vector of player i against its own mixed strategy p i gives its expected cost under the product distribution. So a learner that faces the expected cost vectors has the same regret as the player in the game.

Main definitions #

Main results #

References #

def Cslib.GameTheory.productWeight {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] (p : (i : ι) → S i → ℝ) (s : (i : ι) → S i) :

The weight ∏ i, p i (s i) of the profile s under the product of the mixed strategies p i.

theorem Cslib.GameTheory.productWeight_def {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] (p : (i : ι) → S i → ℝ) (s : (i : ι) → S i) :
productWeight p s = ∏ i : ι, p i (s i)

Unfolding equation for productWeight, whose body is not exposed.

theorem Cslib.GameTheory.productWeight_nonneg {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] {p : (i : ι) → S i → ℝ} (hp : ∀ (i : ι) (a : S i), 0 ≤ p i a) (s : (i : ι) → S i) :

Product weights of nonnegative vectors are nonnegative.

theorem Cslib.GameTheory.productWeight_single {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [(i : ι) → DecidableEq (S i)] (s t : (i : ι) → S i) :
productWeight (fun (i : ι) => Pi.single (s i) 1) t = if t = s then 1 else 0

The product of the point masses at the coordinates of a pure profile s is the point mass at s.

theorem Cslib.GameTheory.productWeight_update {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] (p : (i : ι) → S i → ℝ) (s : (i : ι) → S i) (i : ι) (a : S i) :
p i (s i) * productWeight p (Function.update s i a) = p i a * productWeight p s

Changing coordinate i of a profile from s i to a changes its product weight by the factor p i a / p i (s i), written without division.

theorem Cslib.GameTheory.sum_productWeight {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] {p : (i : ι) → S i → ℝ} (hp : ∀ (i : ι), ∑ a : S i, p i a = 1) :
∑ s : (i : ι) → S i, productWeight p s = 1

The product weights of probability vectors sum to 1.

theorem Cslib.GameTheory.sum_productWeight_mul_apply {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] {p : (i : ι) → S i → ℝ} {i : ι} (hp : ∀ (j : ι), j ≠ i → ∑ a : S j, p j a = 1) (g : S i → ℝ) :
∑ s : (i : ι) → S i, productWeight p s * g (s i) = ∑ a : S i, p i a * g a

The expectation of a function of coordinate i under the product weights is its expectation under p i, if the other p j are probability vectors.

noncomputable def Cslib.GameTheory.productDist {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] {p : (i : ι) → S i → ℝ} (hp0 : ∀ (i : ι) (a : S i), 0 ≤ p i a) (hp1 : ∀ (i : ι), ∑ a : S i, p i a = 1) :
Convexity.StdSimplex ℝ ((i : ι) → S i)

The product distribution of the mixed strategies p i, as a finitely supported distribution on profiles.

theorem Cslib.GameTheory.productDist_sum {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] {p : (i : ι) → S i → ℝ} (hp0 : ∀ (i : ι) (a : S i), 0 ≤ p i a) (hp1 : ∀ (i : ι), ∑ a : S i, p i a = 1) (f : ((i : ι) → S i) → ℝ) :
((productDist hp0 hp1).sum fun (s : (i : ι) → S i) (w : ℝ) => w * f s) = ∑ s : (i : ι) → S i, productWeight p s * f s

Expectations under the product distribution are sums over all profiles.

theorem Cslib.GameTheory.sum_mul_sum_productWeight_update {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] (p : (i : ι) → S i → ℝ) {i : ι} (hp : ∑ a : S i, p i a = 1) (f : ((j : ι) → S j) → ℝ) :
∑ a : S i, p i a * ∑ s : (i : ι) → S i, productWeight p s * f (Function.update s i a) = ∑ s : (i : ι) → S i, productWeight p s * f s

Resampling coordinate i from p i preserves the product distribution: if p i has total mass 1, then ∑ a, p i a * E_{s ∼ p}[f (update s i a)] = E_{s ∼ p}[f s]. The proof is the change of variables (a, s) ↦ (s i, update s i a) on S i × ∀ j, S j.

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

The expected cost vector of player i against the mixed strategies p ([Rou13], Lecture 17, §3): the expected cost of strategy a when every player j samples s j from p j and player i then replaces s i by a.

theorem Cslib.GameTheory.CostGame.deviationCost_def {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] (G : CostGame ι S) (p : (i : ι) → S i → ℝ) (i : ι) (a : S i) :
G.deviationCost p i a = ∑ s : (i : ι) → S i, productWeight p s * G.cost i (Function.update s i a)

Unfolding equation for deviationCost, whose body is not exposed.

theorem Cslib.GameTheory.CostGame.sum_mul_deviationCost {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] (G : CostGame ι S) (p : (i : ι) → S i → ℝ) {i : ι} (hp : ∑ a : S i, p i a = 1) :
∑ a : S i, p i a * G.deviationCost p i a = ∑ s : (i : ι) → S i, productWeight p s * G.cost i s

Averaging the expected cost vector of player i against its own mixed strategy gives its expected cost under the product distribution.

theorem Cslib.GameTheory.CostGame.deviationCost_update_self {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] (G : CostGame ι S) (p : (i : ι) → S i → ℝ) {i : ι} {q : S i → ℝ} (hq : ∑ b : S i, q b = ∑ b : S i, p i b) (a : S i) :

The expected cost vector of player i depends on its own mixed strategy only through its total mass: replacing p i by any q of the same total mass does not change it.

theorem Cslib.GameTheory.CostGame.abs_deviationCost_le {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] (G : CostGame ι S) {p : (i : ι) → S i → ℝ} (hp0 : ∀ (j : ι) (b : S j), 0 ≤ p j b) (hp1 : ∀ (j : ι), ∑ b : S j, p j b = 1) {i : ι} {M : ℝ} (hc : ∀ (s : (i : ι) → S i), |G.cost i s| ≤ M) (a : S i) :

If the costs of player i are bounded by M in absolute value, so are its expected costs against mixed strategies.