Documentation

CslibFrontier.GameTheory.Congestion.CostSharing

Fair cost sharing and the price of stability H_k #

In a fair cost-sharing game (a network cost-sharing or Shapley network design game) every resource e has a fixed cost c e ≥ 0, which is split equally among the players that use it: when k ≥ 1 players use e, each pays c e / k. This is the atomic congestion game with latencies latency e k = c e / k ([TW07], Section 19.3.2; [Rou13], Lecture #15, Section 2). The social cost is the total cost ∑ c e of the resources in use, the cost of the formed network. As in Cslib.GameTheory.CongestionGame, the s_i–t_i paths of a network are abstracted to finite sets of resources.

Rosenthal's potential of a fair cost-sharing game is ∑ e, c e * H (load s e), where H is the harmonic number ([TW07], Section 19.3.1). Since 1 ≤ H n ≤ H k for a resource with 1 ≤ n ≤ k users, socialCost s ≤ Φ s ≤ H k * socialCost s with k players ([TW07], Lemma 19.8), and the potential function method gives the theorem of Anshelevich, Dasgupta, Kleinberg, Tardos, Wexler and Roughgarden [ADK+08]: the price of stability of a k-player fair cost-sharing game is at most H k ([TW07], Theorem 19.10; [Rou13], Lecture #15, Theorem 2.1).

The bound is tight ([Rou13], Lecture #15, Section 1.4 and Figure 2; [RT07], Example 17.3). In the opt-out game optOut k ε, player i either opts out on a private resource of cost 1 / (i + 1) or meets the other players on a shared resource of cost 1 + ε. For ε > 0 the unique pure Nash equilibrium is that every player opts out, of social cost H k, while everyone sharing costs 1 + ε. The source's network has, in addition, zero-cost feeder arcs from each source to the meeting point; they change no player's cost and are omitted here (retaining them gives Cslib.GameTheory.broadcastNetwork in CslibFrontier/GameTheory/NetworkFormation/Witnesses.lean).

Main definitions #

Main results #

References #

noncomputable def Cslib.GameTheory.CongestionGame.fairCostSharing {ι : Type u_1} {S : ι → Type u_2} {E : Type u_3} (resources : (i : ι) → S i → Finset E) (c : E → ℝ) :

The fair cost-sharing game (Shapley network design game) with resource sets resources and resource costs c: the cost c e of a resource used by k ≥ 1 players is split equally, so each pays c e / k ([TW07], Section 19.3.1; [Rou13], Lecture #15, (1)). The latency at load 0 is c e / 0 = 0, which no player ever pays. The costs are meant to be nonnegative; the theorems that need it assume 0 ≤ c e.

@[simp]
theorem Cslib.GameTheory.CongestionGame.fairCostSharing_resources {ι : Type u_1} {S : ι → Type u_2} {E : Type u_3} (resources : (i : ι) → S i → Finset E) (c : E → ℝ) :
(fairCostSharing resources c).resources = resources
@[simp]
theorem Cslib.GameTheory.CongestionGame.fairCostSharing_latency {ι : Type u_1} {S : ι → Type u_2} {E : Type u_3} (resources : (i : ι) → S i → Finset E) (c : E → ℝ) (e : E) (k : ℕ) :
(fairCostSharing resources c).latency e k = c e / ↑k
theorem Cslib.GameTheory.CongestionGame.antitoneOn_latency_fairCostSharing {ι : Type u_1} {S : ι → Type u_2} {E : Type u_3} (resources : (i : ι) → S i → Finset E) {c : E → ℝ} (hc : ∀ (e : E), 0 ≤ c e) (e : E) :

The latencies c e / n of a fair cost-sharing game with nonnegative costs are nonincreasing in the load n ≥ 1: more users means a smaller share.

theorem Cslib.GameTheory.CongestionGame.socialCost_fairCostSharing_biUnion {ι : Type u_1} {S : ι → Type u_2} {E : Type u_3} [Fintype ι] [DecidableEq E] (resources : (i : ι) → S i → Finset E) (c : E → ℝ) (s : (i : ι) → S i) :
(fairCostSharing resources c).toCostGame.socialCost s = ∑ e ∈ Finset.univ.biUnion fun (i : ι) => resources i (s i), c e

The social cost of a fair cost-sharing game is the total cost of the union of players' used resource sets, ∑ e ∈ Finset.univ.biUnion fun i => resources i (s i), c e, without requiring [Fintype E].

theorem Cslib.GameTheory.CongestionGame.socialCost_fairCostSharing {ι : Type u_1} {S : ι → Type u_2} {E : Type u_3} [Fintype ι] [DecidableEq E] (resources : (i : ι) → S i → Finset E) (c : E → ℝ) [Fintype E] (s : (i : ι) → S i) :
(fairCostSharing resources c).toCostGame.socialCost s = ∑ e : E with 0 < (fairCostSharing resources c).load s e, c e

The social cost of a fair cost-sharing game is the total cost of the resources in use, ∑ e with load s e ≥ 1, c e ([Rou13], Lecture #15, (2)).

theorem Cslib.GameTheory.CongestionGame.rosenthalPotential_fairCostSharing {ι : Type u_1} {S : ι → Type u_2} {E : Type u_3} [Fintype ι] [DecidableEq E] (resources : (i : ι) → S i → Finset E) (c : E → ℝ) [Fintype E] (s : (i : ι) → S i) :
(fairCostSharing resources c).rosenthalPotential s = ∑ e : E, c e * ↑(harmonic ((fairCostSharing resources c).load s e))

Rosenthal's potential of a fair cost-sharing game is ∑ e, c e * H (load s e) ([TW07], Section 19.3.1; [Rou13], Lecture #15, (3)).

theorem Cslib.GameTheory.CongestionGame.socialCost_le_rosenthalPotential_fairCostSharing {ι : Type u_1} {S : ι → Type u_2} {E : Type u_3} [Fintype ι] [DecidableEq E] (resources : (i : ι) → S i → Finset E) (c : E → ℝ) [Fintype E] (hc : ∀ (e : E), 0 ≤ c e) (s : (i : ι) → S i) :

The potential bounds the social cost from above ([TW07], Lemma 19.8, first inequality): with nonnegative costs, every resource in use is counted at least once.

theorem Cslib.GameTheory.CongestionGame.rosenthalPotential_fairCostSharing_le_harmonic_mul {ι : Type u_1} {S : ι → Type u_2} {E : Type u_3} [Fintype ι] [DecidableEq E] (resources : (i : ι) → S i → Finset E) (c : E → ℝ) [Fintype E] (hc : ∀ (e : E), 0 ≤ c e) (s : (i : ι) → S i) :

The potential overestimates the social cost by at most H k ([TW07], Lemma 19.8, second inequality): with nonnegative costs and k = Fintype.card ι players, no resource has more than k users.

theorem Cslib.GameTheory.CongestionGame.sum_le_socialCost_fairCostSharing {ι : Type u_1} {S : ι → Type u_2} {E : Type u_3} [Fintype ι] [DecidableEq E] (resources : (i : ι) → S i → Finset E) (c : E → ℝ) [Finite E] (hc : ∀ (e : E), 0 ≤ c e) (s : (i : ι) → S i) (j : ι) :
∑ e ∈ resources j (s j), c e ≤ (fairCostSharing resources c).toCostGame.socialCost s

In a fair cost-sharing game with nonnegative costs, the social cost is at least the cost of any single player's resource set: those resources are all in use.

theorem Cslib.GameTheory.CongestionGame.sum_div_card_le_cost_fairCostSharing {ι : Type u_1} {S : ι → Type u_2} {E : Type u_3} [Fintype ι] [DecidableEq E] (resources : (i : ι) → S i → Finset E) (c : E → ℝ) (hc : ∀ (e : E), 0 ≤ c e) (s : (i : ι) → S i) (i : ι) :
(∑ e ∈ resources i (s i), c e) / ↑(Fintype.card ι) ≤ (fairCostSharing resources c).toCostGame.cost i s

In a fair cost-sharing game with nonnegative costs and k = Fintype.card ι players, every player pays at least a 1 / k share of the cost of its resources: no resource has more than k users.

theorem Cslib.GameTheory.CongestionGame.cost_fairCostSharing_update_le {ι : Type u_1} {S : ι → Type u_2} {E : Type u_3} [Fintype ι] [DecidableEq E] (resources : (i : ι) → S i → Finset E) (c : E → ℝ) [DecidableEq ι] (hc : ∀ (e : E), 0 ≤ c e) (s : (i : ι) → S i) (i : ι) (a : S i) :
(fairCostSharing resources c).toCostGame.cost i (Function.update s i a) ≤ ∑ e ∈ resources i a, c e

In a fair cost-sharing game with nonnegative costs, a player deviating to a pays at most the standalone cost ∑ e ∈ resources i a, c e of its chosen resources: every resource in resources i a has load at least 1 after the deviation.

theorem Cslib.GameTheory.CongestionGame.isSmooth_fairCostSharing {ι : Type u_1} {S : ι → Type u_2} {E : Type u_3} [Fintype ι] [DecidableEq E] (resources : (i : ι) → S i → Finset E) (c : E → ℝ) [DecidableEq ι] [Finite E] (hc : ∀ (e : E), 0 ≤ c e) :

Fair cost-sharing games are (k, 0)-smooth ([Rou15b], Definition 2.1; [TW07], Section 19.3): with k = Fintype.card ι players and nonnegative resource costs, switching player i to s' i costs i at most the standalone cost of resources i (s' i), which is at most socialCost s'.

theorem Cslib.GameTheory.CongestionGame.socialCost_fairCostSharing_le_card_mul_of_isPureNash {ι : Type u_1} {S : ι → Type u_2} {E : Type u_3} [Fintype ι] [DecidableEq E] (resources : (i : ι) → S i → Finset E) (c : E → ℝ) [DecidableEq ι] [Finite E] (hc : ∀ (e : E), 0 ≤ c e) {s : (i : ι) → S i} (hs : (fairCostSharing resources c).toCostGame.IsPureNash s) (s' : (i : ι) → S i) :

The price of anarchy of fair cost-sharing games is at most k ([Rou15b], Theorem 3.2; [TW07], Section 19.3): in a fair cost-sharing game with k = Fintype.card ι players and nonnegative resource costs, every pure Nash equilibrium s satisfies socialCost s ≤ k * socialCost s' for every profile s'.

theorem Cslib.GameTheory.CongestionGame.expected_socialCost_fairCostSharing_le_card_mul {ι : Type u_1} {S : ι → Type u_2} {E : Type u_3} [Fintype ι] [DecidableEq E] (resources : (i : ι) → S i → Finset E) (c : E → ℝ) [DecidableEq ι] [Finite E] (hc : ∀ (e : E), 0 ≤ c e) {σ : Convexity.StdSimplex ℝ ((i : ι) → S i)} (hσ : (fairCostSharing resources c).toCostGame.IsCoarseCorrelatedEquilibrium σ) (s' : (i : ι) → S i) :
(σ.sum fun (s : (i : ι) → S i) (w : ℝ) => w * (fairCostSharing resources c).toCostGame.socialCost s) ≤ ↑(Fintype.card ι) * (fairCostSharing resources c).toCostGame.socialCost s'

The robust price of anarchy of fair cost-sharing games is at most k ([Rou15b], Theorem 3.2): in a fair cost-sharing game with k = Fintype.card ι players and nonnegative resource costs, the expected social cost of every coarse correlated equilibrium σ is at most k * socialCost s' for every profile s'.

theorem Cslib.GameTheory.CongestionGame.cost_fairCostSharing_const {ι : Type u_1} {E : Type u_3} [Fintype ι] [DecidableEq E] (c : E → ℝ) {P : Type u_4} {R : P → Finset E} (p : P) (i : ι) :
((fairCostSharing (fun (x : ι) => R) c).toCostGame.cost i fun (x : ι) => p) = (∑ e ∈ R p, c e) / ↑(Fintype.card ι)

When all players have the strategy set P and the resource map R and all play the same strategy p, each pays the share (∑ e ∈ R p, c e) / k of the cost of R p, where k = Fintype.card ι.

theorem Cslib.GameTheory.CongestionGame.socialCost_fairCostSharing_const {ι : Type u_1} {E : Type u_3} [Fintype ι] [DecidableEq E] (c : E → ℝ) {P : Type u_4} {R : P → Finset E} [Nonempty ι] (p : P) :
((fairCostSharing (fun (x : ι) => R) c).toCostGame.socialCost fun (x : ι) => p) = ∑ e ∈ R p, c e

When all players have the strategy set P and the resource map R and all play the same strategy p, the social cost is the cost of R p (with at least one player).

theorem Cslib.GameTheory.CongestionGame.exists_isPureNash_fairCostSharing_socialCost_le_harmonic_mul {ι : Type u_1} {S : ι → Type u_2} {E : Type u_3} [Fintype ι] [DecidableEq E] (resources : (i : ι) → S i → Finset E) (c : E → ℝ) [DecidableEq ι] [Finite E] [∀ (i : ι), Finite (S i)] [∀ (i : ι), Nonempty (S i)] (hc : ∀ (e : E), 0 ≤ c e) :
∃ (s : (i : ι) → S i), (fairCostSharing resources c).toCostGame.IsPureNash s ∧ ∀ (s' : (i : ι) → S i), (fairCostSharing resources c).toCostGame.socialCost s ≤ ↑(harmonic (Fintype.card ι)) * (fairCostSharing resources c).toCostGame.socialCost s'

The price of stability of fair cost-sharing games is at most H k [ADK+08] ([TW07], Theorem 19.10; [Rou13], Lecture #15, Theorem 2.1): a fair cost-sharing game with k = Fintype.card ι players, nonnegative resource costs, finitely many resources and finitely many (and at least one) strategies per player has a pure Nash equilibrium s with socialCost s ≤ H k * socialCost s' for every profile s'. The equilibrium is a global minimizer of Rosenthal's potential. exists_forall_isPureNash_optOut_mul_lt shows that H k cannot be lowered.

theorem Cslib.GameTheory.CongestionGame.exists_reflTransGen_isPureNash_fairCostSharing_socialCost_le_harmonic_mul {ι : Type u_1} {S : ι → Type u_2} {E : Type u_3} [Fintype ι] [DecidableEq E] (resources : (i : ι) → S i → Finset E) (c : E → ℝ) [DecidableEq ι] [Finite E] [∀ (i : ι), Finite (S i)] (hc : ∀ (e : E), 0 ≤ c e) (s₀ : (i : ι) → S i) :
∃ (t : (i : ι) → S i), Relation.ReflTransGen (flip (fairCostSharing resources c).toCostGame.Improves) s₀ t ∧ (fairCostSharing resources c).toCostGame.IsPureNash t ∧ (fairCostSharing resources c).toCostGame.socialCost t ≤ ↑(harmonic (Fintype.card ι)) * (fairCostSharing resources c).toCostGame.socialCost s₀

Better-response dynamics from any profile reach a good equilibrium in fair cost-sharing games: from every profile s₀, a finite sequence of improving unilateral deviations reaches a pure Nash equilibrium t with socialCost t ≤ H k * socialCost s₀, where k = Fintype.card ι. Started at a socially optimal profile, this reaches an equilibrium within the price-of-stability bound.

The resources of the opt-out game: player i either opts out (true) on its private resource some i or meets the others (false) on the shared resource none.

noncomputable def Cslib.GameTheory.CongestionGame.optOutCost (k : ℕ) (ε : ℝ) :
Option (Fin k) → ℝ

The resource costs of the opt-out game: the private resource of player i costs 1 / (i + 1) and the shared resource costs 1 + ε.

noncomputable def Cslib.GameTheory.CongestionGame.optOut (k : ℕ) (ε : ℝ) :
CongestionGame (Fin k) (fun (x : Fin k) => Bool) (Option (Fin k))

The opt-out game with k players ([Rou13], Lecture #15, Section 1.4 and Figure 2; [RT07], Example 17.3): the fair cost-sharing game in which player i (numbered from 0) chooses between its private resource of cost 1 / (i + 1) (strategy true) and a shared resource of cost 1 + ε (strategy false). The source's zero-cost edges from each source to the meeting point change no player's cost and are omitted.

The opt-out game is the fair cost-sharing game with resources optOutResources k and costs optOutCost k ε.

theorem Cslib.GameTheory.CongestionGame.optOutCost_nonneg {k : ℕ} {ε : ℝ} (hε : 0 ≤ ε) (e : Option (Fin k)) :
0 ≤ optOutCost k ε e

For ε ≥ 0 the resource costs of the opt-out game are nonnegative, the hypothesis of the H k bounds for fair cost-sharing games.

theorem Cslib.GameTheory.CongestionGame.optOut_cost {k : ℕ} {ε : ℝ} (s : Fin k → Bool) (i : Fin k) :
(optOut k ε).toCostGame.cost i s = if s i = true then 1 / (↑↑i + 1) else (1 + ε) / ↑{j : Fin k | s j = false}.card

The cost of player i in the opt-out game: 1 / (i + 1) if it opts out, and the share (1 + ε) / m of the shared resource if m players (including i) do not opt out.

theorem Cslib.GameTheory.CongestionGame.exists_one_div_lt_cost_optOut {k : ℕ} {ε : ℝ} (hε : 0 < ε) {s : Fin k → Bool} (hs : s ≠ fun (x : Fin k) => true) :
∃ (j : Fin k), s j = false ∧ 1 / (↑↑j + 1) < (optOut k ε).toCostGame.cost j s

Some sharing player pays more than its private cost: for ε > 0, if not every player opts out, then among the players that share, the one with the largest index j pays at least (1 + ε) / (j + 1), more than its private cost 1 / (j + 1) ([Rou13], Lecture #15, Section 1.4).

theorem Cslib.GameTheory.CongestionGame.isPureNash_optOut_iff {k : ℕ} {ε : ℝ} (hε : 0 < ε) (s : Fin k → Bool) :
(optOut k ε).toCostGame.IsPureNash s ↔ s = fun (x : Fin k) => true

The opt-out game has a unique pure Nash equilibrium for ε > 0: every player opts out ([Rou13], Lecture #15, Section 1.4). If some players share, the one among them with the largest index j pays more than its private cost 1 / (j + 1) (exists_one_div_lt_cost_optOut).

In the opt-out game, the profile in which every player opts out has social cost H k.

theorem Cslib.GameTheory.CongestionGame.socialCost_optOut_false {k : ℕ} {ε : ℝ} (hk : k ≠ 0) :
((optOut k ε).toCostGame.socialCost fun (x : Fin k) => false) = 1 + ε

In the opt-out game with k ≥ 1 players, the profile in which every player shares has social cost 1 + ε.

theorem Cslib.GameTheory.CongestionGame.exists_forall_isPureNash_optOut_mul_lt {k : ℕ} (hk : k ≠ 0) {r : ℝ} (hr : r < ↑(harmonic k)) :
∃ ε > 0, ∀ (s : Fin k → Bool), (optOut k ε).toCostGame.IsPureNash s → (r * (optOut k ε).toCostGame.socialCost fun (x : Fin k) => false) < (optOut k ε).toCostGame.socialCost s

The bound H k is tight ([Rou13], Lecture #15, Section 2, the remark after Theorem 2.1 that the opt-out example rules out any smaller factor): for k ≥ 1 players and every r < H k there is ε > 0 such that every pure Nash equilibrium s of the opt-out game optOut k ε has socialCost s > r * socialCost s' for the profile s' in which every player shares. So exists_isPureNash_fairCostSharing_socialCost_le_harmonic_mul fails with r in place of H k.