Documentation

CslibFrontier.GameTheory.Cooperative.ShapleyValue

The Shapley value and the Nash bargaining solution #

This module formalizes the axiomatic characterizations of the Shapley value and the Nash bargaining solution ([TV07a], Example 1.14; [JM07], Section 15.6 and Exercise 15.2; Shapley 1953; Nash 1950):

  1. Shapley value (shapleyValue): both the subset-size weight formula ∑_{S ⊆ A \ {i}} (|S|! (n - 1 - |S|)! / n!) (c(S ∪ {i}) - c(S)) ([JM07], Section 15.6.1, p. 403) and the uniform permutation-average formula permShapleyValue ([TV07a], Example 1.14, p. 22), proved equal (shapleyValue_eq_permShapleyValue).

  2. Example 15.24 (example15_24_nonemptyCore, example15_24_shapleyValue, example15_24_not_inCore): on example15_2, the core is nonempty (Example 15.4, pp. 387–388), while shapleyValue evaluates to (23 / 6, 11 / 6, 7 / 3) and does not lie in the core (25 / 6 > 4 = c({b, c})).

  3. Theorem 15.26 (Shapley's uniqueness theorem) (eq_shapleyValue_of_axioms, existsUnique_shapleyValue): shapleyValue is the unique value operator satisfying Efficiency (∑_i φ_i(c) = c(univ)), Symmetry (or Anonymity, Definition 15.25), Dummy, and Additivity, proved over the 2^n - 1 unanimity-game basis without assuming homogeneity or nonnegativity.

    Source notes on [JM07], Definition 15.25 & Theorem 15.26 (p. 404):

    • Efficiency (∑_i φ_i(c) = c(A)) is assumed implicitly on p. 403–404 ("allocating the cost c(A) among all agents"); without Efficiency, φ = 0 also satisfies Anonymity, Dummy, and Additivity.
    • In the Dummy axiom on p. 404, S ⊂ A \ {i} is a typographical slip for S ⊆ A \ {i} (i.e. i ∉ S); excluding S = A \ {i} would treat an agent whose sole nonzero marginal cost is at the grand coalition as a dummy, contradicting Efficiency.
  4. Exercise 15.2 and Section 15.6.1 (CostSharingGame.IsSubmodular.shapleyScheme_isCrossMonotone, CostSharingGame.IsSubmodular.shapleyValue_inCore): for submodular cost-sharing games, the Shapley cost-sharing scheme shapleyScheme is cross-monotone (Exercise 15.2, p. 410), hence shapleyValue lies in the core (Section 15.6.1, p. 403), and moulinMechanism on shapleyScheme is group-strategyproof and 1-budget-balanced by composing with moulinMechanism_isGroupStrategyproof and moulinMechanism_isBudgetBalanced.

  5. Nash bargaining solution (BargainingProblem, nashBargainingSolution, eq_nashBargainingSolution_of_axioms, existsUnique_nashBargainingSolution, [JM07], Definition 15.27 and Theorem 15.28; Nash 1950): on compact convex 2-player feasible utility sets X ⊆ ℝ × ℝ with disagreement point d ∈ X and at least one strictly individually rational outcome x > d, maximizing (x₁ - d₁)(x₂ - d₂) over {x ∈ X | x ≥ d} is the unique bargaining solution satisfying Pareto optimality, symmetry, positive affine scale invariance, and independence of irrelevant alternatives.

Main definitions #

Main results #

References #

Shapley value: subset-size and permutation-average formulas #

noncomputable def Cslib.GameTheory.shapleyWeight (n s : ℕ) :

Combinatorial weight s! * (n - 1 - s)! / n! of a coalition S ⊆ A \ {i} of size s in a game of n agents ([JM07], Section 15.6.1, p. 403).

noncomputable def Cslib.GameTheory.shapleyValue {A : Type u_1} [Fintype A] [DecidableEq A] (G : CostSharingGame A) (i : A) :

The Shapley value shapleyValue G i of agent i in a TU cost-sharing game G ([JM07], Section 15.6.1, p. 403).

Grouped-by-cardinality formula matching the displayed equation of [JM07], p. 403.

def Cslib.GameTheory.orderPredecessors {A : Type u_1} [Fintype A] (σ : Fin (Fintype.card A) ≃ A) (i : A) :

Set of agents appearing strictly before i under an agent ordering σ : Fin (card A) ≃ A ([TV07a], Example 1.14).

@[simp]
theorem Cslib.GameTheory.mem_orderPredecessors {A : Type u_1} [Fintype A] (σ : Fin (Fintype.card A) ≃ A) (i j : A) :
j ∈ orderPredecessors σ i ↔ σ.symm j < σ.symm i
noncomputable def Cslib.GameTheory.permShapleyValue {A : Type u_1} [Fintype A] [DecidableEq A] (G : CostSharingGame A) (i : A) :

Permutation-average definition of the Shapley value ([TV07a], Example 1.14, p. 22; [JM07], Section 15.6.1, p. 403): average marginal cost of i over all n! orderings σ : Fin (card A) ≃ A.

Equivalence of the subset-size formula shapleyValue ([JM07], Section 15.6.1, p. 403) and the uniform permutation-average formula permShapleyValue ([TV07a], Example 1.14, p. 22).

Example 15.24: Shapley value outside a nonempty core #

Examples 15.4 and 15.24 ([JM07], Section 15.2, pp. 387–388, and Section 15.6.1, p. 403): the 3-agent metric facility location game example15_2 has a nonempty core, witnessed by ![4, 2, 2] (FacilityLocationInstance.example15_2_inCore_four_two_two).

Example 15.24 ([JM07], p. 403): on the 3-agent facility location game example15_2, the Shapley values are (23 / 6, 11 / 6, 7 / 3).

Example 15.24 ([JM07], p. 403): the Shapley value (23 / 6, 11 / 6, 7 / 3) of example15_2 does not lie in the core (φ_b + φ_c = 25 / 6 > 4 = c({b, c})), even though example15_2 has a nonempty core (example15_2_inCore_four_two_two).

Axiomatic characterization of the Shapley value (Theorem 15.26) #

Two agents i, j are symmetric in G if adding either one to any coalition avoiding both incurs the same cost.

Agent i is a dummy agent in G ([JM07], Definition 15.25) if c(S ∪ {i}) = c(S) for every coalition S ⊆ A \ {i}.

Efficiency (budget balance): ∑_i φ_i(G) = G.cost univ.

Anonymity ([JM07], Definition 15.25): permuting agent names permutes their cost shares (φ (G.perm π) (π i) = φ G i).

Symmetry: symmetric agents receive equal cost shares.

Dummy axiom ([JM07], Definition 15.25): dummy agents pay 0.

Additivity ([JM07], Definition 15.25): φ(G₁ + G₂) = φ(G₁) + φ(G₂).

Anonymity implies Symmetry via transposition Equiv.swap i j.

shapleyValue satisfies Efficiency: the marginal costs along each agent ordering σ telescope to G.cost univ - G.cost ∅ = G.cost univ.

Scaled unanimity game unanimityGame T hT w for a nonempty coalition T and real weight w: cost S = w if T ⊆ S and 0 otherwise.

@[simp]
theorem Cslib.GameTheory.unanimityGame_cost {A : Type u_1} [DecidableEq A] (T : Finset A) (hT : T.Nonempty) (w : ℝ) (S : Finset A) :
(unanimityGame T hT w).cost S = if T ⊆ S then w else 0

Möbius basis expansion: every TU cost-sharing game G is the finite sum of scaled unanimity games over all nonempty coalitions T, weighted by the subset Möbius transform (Harsanyi dividend) Cslib.BitString.subsetMobius G.cost T.

theorem Cslib.GameTheory.eq_shapleyValue_of_axioms {A : Type u_1} [Fintype A] [DecidableEq A] {φ : CostSharingGame A → A → ℝ} (heff : IsEfficientValue φ) (hsym : IsSymmetricValue φ) (hdum : SatisfiesDummy φ) (hadd : IsAdditiveValue φ) :

Theorem 15.26 (Shapley's uniqueness theorem, Symmetry form) (Shapley 1953; [JM07], p. 404): any value operator φ satisfying Efficiency, Symmetry, Dummy, and Additivity equals shapleyValue.

Theorem 15.26 (Shapley's uniqueness theorem, Anonymity form) ([JM07], Definition 15.25 & Theorem 15.26, p. 404): shapleyValue is the unique value operator satisfying Efficiency, Anonymity, Dummy, and Additivity.

Note: here φ ranges over all real-valued operators CostSharingGame A → A → ℝ rather than Definition 15.25's ℝ₊^n-valued restriction on monotone cost functions.

Exercise 15.2: Cross-monotonicity of the Shapley value on submodular games #

Coalition-restricted Shapley cost-sharing scheme shapleyScheme G ([JM07], Section 15.6.1 and Exercise 15.2): on serviced coalition T, each i ∈ T pays its Shapley value in the restricted game G.restrict T, and agents outside T pay 0.

@[simp]
theorem Cslib.GameTheory.CostSharingGame.shapleyScheme_share {A : Type u_1} [DecidableEq A] (G : CostSharingGame A) (T : Finset A) (i : A) :
G.shapleyScheme.share T i = if i ∈ T then ∑ S ∈ (T.erase i).powerset, shapleyWeight T.card S.card * (G.cost (insert i S) - G.cost S) else 0

shapleyScheme G is 1-budget-balanced for every cost-sharing game G (by Shapley efficiency on each subcoalition T).

Exercise 15.2 ([JM07], p. 410): for any submodular cost-sharing game G, the Shapley cost-sharing scheme G.shapleyScheme is cross-monotone.

Shapley (1953) ([JM07], Section 15.6.1, p. 403): for any submodular cost-sharing game G, shapleyValue G lies in the core of G (immediate from Exercise 15.2 and Proposition 15.14).

The Nash bargaining solution (Definition 15.27 & Theorem 15.28) #

A 2-player Nash bargaining problem ([JM07], Section 15.6.3, pp. 404–405; Nash 1950): a compact, convex feasible utility set feasible : Set (ℝ × ℝ) containing a disagreement outcome disagreement ∈ feasible and at least one strictly individually rational outcome x with disagreement.1 < x.1 and disagreement.2 < x.2.

Individually rational feasible subset {x ∈ feasible | d₁ ≤ x₁ ∧ d₂ ≤ x₂}.

Nash product (x₁ - d₁) * (x₂ - d₂) ([JM07], Theorem 15.28).

def Cslib.GameTheory.BargainingProblem.mapAffine (B : BargainingProblem) (a₁ a₂ : ℝ) (ha₁ : 0 < a₁) (ha₂ : 0 < a₂) (b₁ b₂ : ℝ) :

Apply an independent positive affine rescaling (x₁, x₂) ↦ (a₁ x₁ + b₁, a₂ x₂ + b₂) (`a₁, a₂

0`) to a bargaining problem ([JM07], Section 15.6.3, pp. 404–405).

@[simp]
theorem Cslib.GameTheory.BargainingProblem.mapAffine_feasible (B : BargainingProblem) (a₁ a₂ : ℝ) (ha₁ : 0 < a₁) (ha₂ : 0 < a₂) (b₁ b₂ : ℝ) :
(B.mapAffine a₁ a₂ ha₁ ha₂ b₁ b₂).feasible = (fun (x : ℝ × ℝ) => (a₁ * x.1 + b₁, a₂ * x.2 + b₂)) '' B.feasible
@[simp]
theorem Cslib.GameTheory.BargainingProblem.mapAffine_disagreement (B : BargainingProblem) (a₁ a₂ : ℝ) (ha₁ : 0 < a₁) (ha₂ : 0 < a₂) (b₁ b₂ : ℝ) :
(B.mapAffine a₁ a₂ ha₁ ha₂ b₁ b₂).disagreement = (a₁ * B.disagreement.1 + b₁, a₂ * B.disagreement.2 + b₂)

A bargaining problem is symmetric ([JM07], Definition 15.27) if d₁ = d₂ and (x₁, x₂) ∈ feasible ↔ (x₂, x₁) ∈ feasible.

The Nash bargaining solution nashBargainingSolution B ([JM07], Theorem 15.28; Nash 1950): the unique point in B.individuallyRational maximizing (x₁ - d₁)(x₂ - d₂).

Strict concavity / AM-GM uniqueness: nashBargainingSolution B is the unique point in B.individuallyRational attaining the maximum Nash product.

A bargaining solution selects a feasible outcome φ B ∈ B.feasible for every bargaining problem B ([JM07], Definition 15.27).

Strong Pareto Optimality: no feasible outcome weakly improves both players and strictly improves at least one.

Weak Pareto Optimality ([JM07], Definition 15.27 verbatim: "there is no point p ∈ X with p > φ(X), coordinate-wise"): no feasible outcome strictly improves both players.

Symmetry ([JM07], Definition 15.27): on a symmetric bargaining problem, both players receive equal utility (φ B).1 = (φ B).2.

Positive Affine Scale Invariance ([JM07], Section 15.6.3, pp. 404–405, combining translation to d = (0, 0) and Definition 15.27 Scale Independence): independently rescaling each player's utility by u_i ↦ a_i u_i + b_i (a_i > 0) transforms the chosen outcome identically.

Independence of Irrelevant Alternatives (IIA) ([JM07], Definition 15.27): if B₁ and B₂ share the same disagreement point, B₁.feasible ⊆ B₂.feasible, and φ B₂ ∈ B₁.feasible, then φ B₁ = φ B₂.

Theorem 15.28 (Nash's bargaining uniqueness theorem) (Nash 1950; [JM07], Definition 15.27 & Theorem 15.28, pp. 404–405): any bargaining solution satisfying Weak Pareto Optimality, Symmetry, Positive Affine Scale Invariance, and Independence of Irrelevant Alternatives equals nashBargainingSolution.

Theorem 15.28 (Nash's bargaining theorem, existence and uniqueness) ([JM07], Definition 15.27 & Theorem 15.28, pp. 404–405): nashBargainingSolution is the unique bargaining solution satisfying Weak Pareto Optimality, Symmetry, Positive Affine Scale Invariance, and Independence of Irrelevant Alternatives (and likewise under Strong Pareto Optimality).