Documentation

CslibFrontier.GameTheory.Strategic.Hedge

Hedge dynamics in finite games #

In multiplicative-update dynamics ([Rou13], Lecture 17, §3) every player i of a finite cost-minimization game keeps one weight per strategy, starting at 1. In round t it plays its weights normalized to a mixed strategy (mwuProb). It then observes its expected cost vector deviationCost G (mwuProb φ t) i against the product of everyone's current mixed strategies and multiplies the weight of each strategy a by φ i (deviationCost G (mwuProb φ t) i a) (mwuWeight).

The players' losses are coupled: the cost vector of player i in round t depends on the other players' current mixed strategies. These depend on their past cost vectors, and so on the past play of i. This is an adaptive adversary ([Rou13], Lecture 17, Remark 3.2). The dynamics are deterministic, though, so each player faces one fixed loss sequence mwuLoss G φ i, and its mixed strategies are exactly those of the single-learner multiplicative update against that sequence (prob_mwuLoss). So the regret bounds of CslibFrontier.MachineLearning.OnlineLearning apply to every player.

Hedge dynamics (hedgeProb) use the factor exp (-η_i x / M), that is, Hedge on the costs scaled by a bound M on their absolute values, with the tuned learning rate η_i = √(ln |S i| / T) for a known horizon T. Every player then has regret at most 2 M √(T ln |S i|) against every fixed strategy (hedge_regret_le, from Experts.hedge_regret_le_sqrt; [AHK12], Theorem 2.3). [Rou13] assumes costs in [0, 1] and notes bounded costs as an extension (Lecture 17, footnote 1).

With the results of CslibFrontier.GameTheory.Strategic.NoRegret this gives the headline bound (IsSmooth.timeAverage_hedgeDist_socialCost_le). In a (λ, μ)-smooth game with μ < 1 and costs bounded by M, after T ≥ max_i ln |S i| rounds of Hedge dynamics, the expected social cost under the time average of the outcome distributions is at most (λ socialCost s' + 2 M ∑ i, √(ln |S i| / T)) / (1 - μ) for every profile s'. This bound converges to the robust price of anarchy λ / (1 - μ) at rate O(1 / √T).

Main definitions #

Main results #

References #

Simultaneous multiplicative updates #

noncomputable def Cslib.GameTheory.CostGame.mwuWeight {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] (G : CostGame ι S) (φ : ι → ℝ → ℝ) :
ℕ → (i : ι) → S i → ℝ

The weights under simultaneous multiplicative updates with factors φ i: every weight starts at 1. In round t, player i multiplies the weight of a by φ i of the expected cost of a against everyone's normalized weights.

noncomputable def Cslib.GameTheory.CostGame.mwuProb {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] (G : CostGame ι S) (φ : ι → ℝ → ℝ) (t : ℕ) (i : ι) (a : S i) :

The mixed strategies in round t under simultaneous multiplicative updates: the weights normalized by their sum.

noncomputable def Cslib.GameTheory.CostGame.mwuLoss {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] (G : CostGame ι S) (φ : ι → ℝ → ℝ) (i : ι) (t : ℕ) (a : S i) :

The loss sequence faced by player i: its expected cost vector in each round.

theorem Cslib.GameTheory.CostGame.mwuProb_zero {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] (G : CostGame ι S) (φ : ι → ℝ → ℝ) (i : ι) (a : S i) :
G.mwuProb φ 0 i a = 1 / ↑(Fintype.card (S i))

In the first round every player plays the uniform distribution.

theorem Cslib.GameTheory.CostGame.weight_mwuLoss {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] (G : CostGame ι S) (φ : ι → ℝ → ℝ) (i : ι) (t : ℕ) :
MachineLearning.OnlineLearning.Experts.weight (φ i) (G.mwuLoss φ i) t = fun (a : S i) => G.mwuWeight φ t i a

The single-learner weights against the losses of player i are its weights in the simultaneous dynamics.

theorem Cslib.GameTheory.CostGame.prob_mwuLoss {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] (G : CostGame ι S) (φ : ι → ℝ → ℝ) (i : ι) (t : ℕ) :

Each player runs the single-learner multiplicative update: the mixed strategies of player i are those of the multiplicative update with factor φ i against the loss sequence that the dynamics produce for i.

Hedge dynamics #

noncomputable def Cslib.GameTheory.CostGame.hedgeProb {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] (G : CostGame ι S) (M : ℝ) (T t : ℕ) (i : ι) :
S i → ℝ

Hedge dynamics with cost bound M and horizon T: the mixed strategies in round t when every player i runs Hedge with the tuned learning rate √(ln |S i| / T) on the costs divided by M.

theorem Cslib.GameTheory.CostGame.hedgeProb_zero {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] {G : CostGame ι S} {M : ℝ} {T : ℕ} (i : ι) (a : S i) :
G.hedgeProb M T 0 i a = 1 / ↑(Fintype.card (S i))

In the first round of Hedge dynamics every player plays the uniform distribution.

theorem Cslib.GameTheory.CostGame.hedgeProb_nonneg {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] {G : CostGame ι S} {M : ℝ} {T : ℕ} (t : ℕ) (i : ι) (a : S i) :
0 ≤ G.hedgeProb M T t i a
theorem Cslib.GameTheory.CostGame.sum_hedgeProb {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] {G : CostGame ι S} {M : ℝ} {T : ℕ} [∀ (i : ι), Nonempty (S i)] (t : ℕ) (i : ι) :
∑ a : S i, G.hedgeProb M T t i a = 1
theorem Cslib.GameTheory.CostGame.hedge_regret_le {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] {G : CostGame ι S} {M : ℝ} {T : ℕ} [∀ (i : ι), Nonempty (S i)] (hM : 0 < M) (hc : ∀ (i : ι) (s : (i : ι) → S i), |G.cost i s| ≤ M) {i : ι} (hT : Real.log ↑(Fintype.card (S i)) ≤ ↑T) (a : S i) :
∑ t ∈ Finset.range T, ∑ b : S i, G.hedgeProb M T t i b * G.deviationCost (G.hedgeProb M T t) i b ≤ ∑ t ∈ Finset.range T, G.deviationCost (G.hedgeProb M T t) i a + 2 * M * √(↑T * Real.log ↑(Fintype.card (S i)))

Regret of Hedge dynamics: if the costs are bounded by M > 0 in absolute value and ln |S i| ≤ T, then under Hedge dynamics with horizon T, the total expected cost of player i over the first T rounds exceeds that of every fixed strategy a by at most 2 M √(T ln |S i|).

noncomputable def Cslib.GameTheory.CostGame.hedgeDist {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] [∀ (i : ι), Nonempty (S i)] (G : CostGame ι S) (M : ℝ) (T t : ℕ) :
Convexity.StdSimplex ℝ ((i : ι) → S i)

The outcome distribution in round t of Hedge dynamics: the product of the players' mixed strategies.

theorem Cslib.GameTheory.CostGame.hedgeDist_regret {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] {G : CostGame ι S} {M : ℝ} {T : ℕ} [∀ (i : ι), Nonempty (S i)] (hM : 0 < M) (hc : ∀ (i : ι) (s : (i : ι) → S i), |G.cost i s| ≤ M) (hT : ∀ (i : ι), Real.log ↑(Fintype.card (S i)) ≤ ↑T) (i : ι) (a : S i) :
(∑ t ∈ Finset.range T, (G.hedgeDist M T t).sum fun (s : (i : ι) → S i) (w : ℝ) => w * G.cost i s) ≤ (∑ t ∈ Finset.range T, (G.hedgeDist M T t).sum fun (s : (i : ι) → S i) (w : ℝ) => w * G.cost i (Function.update s i a)) + 2 * M * √(↑T * Real.log ↑(Fintype.card (S i)))

Regret of Hedge dynamics in terms of the outcome distributions: with costs bounded by M > 0 and ln |S j| ≤ T for every player j, player i has regret at most 2 M √(T ln |S i|) against every fixed strategy a.

theorem Cslib.GameTheory.CostGame.timeAverage_hedgeDist_le_add {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] {G : CostGame ι S} {M : ℝ} {T : ℕ} [∀ (i : ι), Nonempty (S i)] (hM : 0 < M) (hc : ∀ (i : ι) (s : (i : ι) → S i), |G.cost i s| ≤ M) (hT0 : 0 < T) (hT : ∀ (i : ι), Real.log ↑(Fintype.card (S i)) ≤ ↑T) (i : ι) (a : S i) :
((timeAverage (G.hedgeDist M T) T hT0).sum fun (s : (i : ι) → S i) (w : ℝ) => w * G.cost i s) ≤ ((timeAverage (G.hedgeDist M T) T hT0).sum fun (s : (i : ι) → S i) (w : ℝ) => w * G.cost i (Function.update s i a)) + 2 * M * √(Real.log ↑(Fintype.card (S i)) / ↑T)

Hedge dynamics yield approximate coarse correlated equilibria: with costs bounded by M > 0 and ln |S j| ≤ T for every player j, the time average of the first T > 0 outcome distributions of Hedge dynamics satisfies the coarse correlated equilibrium inequalities up to the slack 2 M √(ln |S i| / T) for player i.

theorem Cslib.GameTheory.CostGame.IsSmooth.sum_hedgeDist_socialCost_le {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] {G : CostGame ι S} {M : ℝ} {T : ℕ} [∀ (i : ι), Nonempty (S i)] {lam μ : ℝ} (hG : G.IsSmooth lam μ) (hμ : μ < 1) (hM : 0 < M) (hc : ∀ (i : ι) (s : (i : ι) → S i), |G.cost i s| ≤ M) (hT : ∀ (i : ι), Real.log ↑(Fintype.card (S i)) ≤ ↑T) (s' : (i : ι) → S i) :
(∑ t ∈ Finset.range T, (G.hedgeDist M T t).sum fun (s : (i : ι) → S i) (w : ℝ) => w * G.socialCost s) ≤ (↑T * lam * G.socialCost s' + 2 * M * ∑ i : ι, √(↑T * Real.log ↑(Fintype.card (S i)))) / (1 - μ)

The price of anarchy of Hedge dynamics, total form: if G is (λ, μ)-smooth with μ < 1, its costs are bounded by M > 0 and ln |S i| ≤ T for every player i, then the total expected social cost of the first T rounds of Hedge dynamics is at most (T λ socialCost s' + 2 M ∑ i, √(T ln |S i|)) / (1 - μ) for every profile s'.

theorem Cslib.GameTheory.CostGame.IsSmooth.timeAverage_hedgeDist_socialCost_le {ι : Type u_1} {S : ι → Type u_2} [Fintype ι] [DecidableEq ι] [(i : ι) → Fintype (S i)] {G : CostGame ι S} {M : ℝ} {T : ℕ} [∀ (i : ι), Nonempty (S i)] {lam μ : ℝ} (hG : G.IsSmooth lam μ) (hμ : μ < 1) (hM : 0 < M) (hc : ∀ (i : ι) (s : (i : ι) → S i), |G.cost i s| ≤ M) (hT0 : 0 < T) (hT : ∀ (i : ι), Real.log ↑(Fintype.card (S i)) ≤ ↑T) (s' : (i : ι) → S i) :
((timeAverage (G.hedgeDist M T) T hT0).sum fun (s : (i : ι) → S i) (w : ℝ) => w * G.socialCost s) ≤ (lam * G.socialCost s' + 2 * M * ∑ i : ι, √(Real.log ↑(Fintype.card (S i)) / ↑T)) / (1 - μ)

The price of anarchy of Hedge dynamics ([Rou13], Lecture 17, Corollary 3.3, with Hedge as the no-regret algorithm): if G is (λ, μ)-smooth with μ < 1, its costs are bounded by M > 0 and ln |S i| ≤ T for every player i, then the expected social cost under the time average of the first T > 0 outcome distributions of Hedge dynamics is at most (λ socialCost s' + 2 M ∑ i, √(ln |S i| / T)) / (1 - μ) for every profile s'.