Documentation

CslibFrontier.GameTheory.Congestion.MarginalCostPricing

Marginal cost pricing and Pigouvian taxes in nonatomic routing #

In a nonatomic congestion game G, a socially optimal flow f* (G.IsOptimal f*) minimizes the total latency G.cost f = ∑ e, edgeFlow f e * latency e (edgeFlow f e) over all feasible flows. Whereas selfish agents evaluate each resource e by its latency c_e(x), a social planner evaluates e by the marginal edge cost c*_e(x) = (x * c_e(x))', which equals c_e(x) + x * c'_e(x) (Cslib.GameTheory.marginalCost) whenever c_e itself is differentiable, where the extra term x * c'_e(x) measures the congestion externality imposed on the x units of traffic already using e.

Following Roughgarden [Rou07], Sections 18.3.1 and 18.5.1 (originally due to Pigou, 1920, and Beckmann, McGuire and Winsten, 1956), this module proves:

Main definitions #

Main results #

References #

def Cslib.GameTheory.marginalCost (c c' : ℝ → ℝ) (x : ℝ) :

The marginal cost c*(x) = c(x) + x * c'(x) of an edge with latency c and derivative c' ([Rou07], Section 18.3.1, p. 468).

theorem Cslib.GameTheory.hasDerivWithinAt_mul_marginalCost {c c' : ℝ → ℝ} {s : Set ℝ} {x : ℝ} (hc : HasDerivWithinAt c (c' x) s x) :
HasDerivWithinAt (fun (y : ℝ) => y * c y) (marginalCost c c' x) s x

Product-rule derivative of y ↦ y * c y within a set s.

A flow f is socially optimal for G if it is feasible and minimizes G.cost over all feasible flows ([Rou07], Section 18.2.1, p. 463).

theorem Cslib.GameTheory.NonatomicCongestionGame.exists_isOptimal {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] (G : NonatomicCongestionGame K P E) [DecidableEq K] [Finite E] (hne : {f : P → ℝ | G.IsFeasible f}.Nonempty) (hc : ∀ (e : E), ContinuousOn (G.latency e) (Set.Ici 0)) :
∃ (f : P → ℝ), G.IsOptimal f

If resource latencies are continuous on [0, ∞) and a feasible flow exists, then G admits a socially optimal flow.

The nonatomic congestion game (G, r, c*) obtained by replacing the resource latencies of G by c* ([Rou07], Section 18.3.1, Corollary 18.10).

The nonatomic congestion game (G, r, c*) obtained by replacing each edge latency latency e by its marginal cost marginalCost (latency e) (c' e) ([Rou07], Section 18.3.1).

The taxed nonatomic congestion game (G, r, c + τ) obtained by adding a per-unit edge tax τ e to each resource e ([Rou07], Section 18.5.1).

def Cslib.GameTheory.NonatomicCongestionGame.pigouvianTax {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] (G : NonatomicCongestionGame K P E) (c' : E → ℝ → ℝ) (f : P → ℝ) (e : E) :

The Pigouvian marginal-cost tax τ_e = edgeFlow f e * c' e (edgeFlow f e) associated with a flow f and latency derivatives c' ([Rou07], Section 18.5.1, Theorem 18.27).

@[simp]
theorem Cslib.GameTheory.NonatomicCongestionGame.withLatency_rate {K : Type u_1} {P : Type u_2} {E : Type u_3} (G : NonatomicCongestionGame K P E) (c : E → ℝ → ℝ) :
@[simp]
theorem Cslib.GameTheory.NonatomicCongestionGame.withLatency_isFeasible {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] (G : NonatomicCongestionGame K P E) [DecidableEq K] (c : E → ℝ → ℝ) (f : P → ℝ) :
@[simp]
theorem Cslib.GameTheory.NonatomicCongestionGame.withLatency_edgeFlow {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] (G : NonatomicCongestionGame K P E) (c : E → ℝ → ℝ) (f : P → ℝ) (e : E) :
(G.withLatency c).edgeFlow f e = G.edgeFlow f e
@[simp]
theorem Cslib.GameTheory.NonatomicCongestionGame.withLatency_latency {K : Type u_1} {P : Type u_2} {E : Type u_3} (G : NonatomicCongestionGame K P E) (c : E → ℝ → ℝ) :
theorem Cslib.GameTheory.NonatomicCongestionGame.withMarginalCost_eq_withLatency {K : Type u_1} {P : Type u_2} {E : Type u_3} (G : NonatomicCongestionGame K P E) (c' : E → ℝ → ℝ) :
G.withMarginalCost c' = G.withLatency fun (e : E) => marginalCost (G.latency e) (c' e)

Expresses G.withMarginalCost c' in terms of G.withLatency.

theorem Cslib.GameTheory.NonatomicCongestionGame.withTaxes_eq_withLatency {K : Type u_1} {P : Type u_2} {E : Type u_3} (G : NonatomicCongestionGame K P E) (τ : E → ℝ) :
G.withTaxes τ = G.withLatency fun (e : E) (x : ℝ) => G.latency e x + τ e

Expresses G.withTaxes τ in terms of G.withLatency.

theorem Cslib.GameTheory.NonatomicCongestionGame.withTaxes_pigouvianTax_pathLatency {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] (G : NonatomicCongestionGame K P E) (c' : E → ℝ → ℝ) (f : P → ℝ) (p : P) :

At the flow f that defines the Pigouvian taxes, the taxed network G.withTaxes (G.pigouvianTax c' f) and the marginal-cost network G.withMarginalCost c' assign identical path latencies to every path.

A flow f is a Wardrop equilibrium of G.withTaxes (G.pigouvianTax c' f) if and only if it is a Wardrop equilibrium of G.withMarginalCost c'.

theorem Cslib.GameTheory.NonatomicCongestionGame.IsOptimal.isWardrop_of_hasDerivWithinAt_mul {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] {G : NonatomicCongestionGame K P E} [DecidableEq K] [Finite E] {mc : E → ℝ → ℝ} {f : P → ℝ} (hf : G.IsOptimal f) (hderiv : ∀ (e : E), HasDerivWithinAt (fun (y : ℝ) => y * G.latency e y) (mc e (G.edgeFlow f e)) (Set.Ici 0) (G.edgeFlow f e)) :

First-order necessary condition for social optimality ([Rou07], Proposition 18.9, forward direction): if f is optimal for G and each edge cost contribution y ↦ y * G.latency e y has derivative mc e (edgeFlow f e) within [0, ∞) at edgeFlow f e, then f is a Wardrop equilibrium of G.withLatency mc. Neither convexity of y ↦ y * G.latency e y nor differentiability of G.latency e itself is required.

theorem Cslib.GameTheory.NonatomicCongestionGame.isOptimal_iff_isWardrop_of_hasDerivWithinAt_mul {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] {G : NonatomicCongestionGame K P E} [DecidableEq K] [Finite E] {mc : E → ℝ → ℝ} (hconv : ∀ (e : E), ConvexOn ℝ (Set.Ici 0) fun (x : ℝ) => x * G.latency e x) (hderiv : ∀ (e : E) (x : ℝ), 0 ≤ x → HasDerivWithinAt (fun (y : ℝ) => y * G.latency e y) (mc e x) (Set.Ici 0) x) {f : P → ℝ} :

Characterization of optimal flows and equivalence with marginal-cost Wardrop equilibria ([Rou07], Proposition 18.9 and Corollary 18.10, pp. 468–469): when each edge cost contribution x ↦ x * latency e x is convex on [0, ∞) and has derivative mc e within [0, ∞), a flow f is socially optimal for G if and only if f is a Wardrop equilibrium of G.withLatency mc (equivalently, unfolding IsWardrop, f is feasible and every flow-carrying path minimizes the marginal path cost ∑ e ∈ resources p, mc e (edgeFlow f e) within its commodity).

Because differentiability is assumed only on the product x ↦ x * latency e x (rather than on latency e itself), this admits latencies such as c_e(x) = √x where x * √x = x ^ (3 / 2) is convex and continuously differentiable on [0, ∞) with derivative (3 / 2) * √x even at unused edges (edgeFlow f e = 0).

theorem Cslib.GameTheory.NonatomicCongestionGame.IsOptimal.isWardrop_withMarginalCost_within {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] {G : NonatomicCongestionGame K P E} [DecidableEq K] [Finite E] {c' : E → ℝ → ℝ} {f : P → ℝ} (hf : G.IsOptimal f) (hderiv : ∀ (e : E), HasDerivWithinAt (G.latency e) (c' e (G.edgeFlow f e)) (Set.Ici 0) (G.edgeFlow f e)) :

Product-rule specialization of IsOptimal.isWardrop_of_hasDerivWithinAt_mul: if f is optimal for G and G.latency e has derivative c' e (edgeFlow f e) within [0, ∞) at edgeFlow f e, then f is a Wardrop equilibrium of G.withMarginalCost c'. Notably, no convexity hypothesis is required for this direction.

theorem Cslib.GameTheory.NonatomicCongestionGame.isOptimal_iff_isWardrop_withMarginalCost {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] {G : NonatomicCongestionGame K P E} [DecidableEq K] [Finite E] {c' : E → ℝ → ℝ} (hconv : ∀ (e : E), ConvexOn ℝ (Set.Ici 0) fun (x : ℝ) => x * G.latency e x) (hderiv : ∀ (e : E) (x : ℝ), 0 ≤ x → HasDerivWithinAt (G.latency e) (c' e x) (Set.Ici 0) x) {f : P → ℝ} :

Product-rule specialization of isOptimal_iff_isWardrop_of_hasDerivWithinAt_mul for differentiable latencies ([Rou07], Section 18.3.1, pp. 468–469): when x ↦ x * latency e x is convex on [0, ∞) and latency e itself has derivative c' e within [0, ∞), (x * c_e(x))' = c_e(x) + x * c'_e(x), so a flow f is socially optimal for G if and only if f is a Wardrop equilibrium of G.withMarginalCost c'. For latencies such as c_e(x) = √x whose product x * c_e(x) is differentiable at 0 while c_e itself is not, use isOptimal_iff_isWardrop_of_hasDerivWithinAt_mul directly.

theorem Cslib.GameTheory.NonatomicCongestionGame.isOptimal_of_isWardrop_withMarginalCost_within {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] {G : NonatomicCongestionGame K P E} [DecidableEq K] [Finite E] {c' : E → ℝ → ℝ} (hconv : ∀ (e : E), ConvexOn ℝ (Set.Ici 0) fun (x : ℝ) => x * G.latency e x) (hderiv : ∀ (e : E) (x : ℝ), 0 ≤ x → HasDerivWithinAt (G.latency e) (c' e x) (Set.Ici 0) x) {f : P → ℝ} (hf : (G.withMarginalCost c').IsWardrop f) :

Sufficient condition under convexity for differentiable latencies: if x ↦ x * latency e x is convex on [0, ∞) and f is a Wardrop equilibrium of G.withMarginalCost c', then f is socially optimal for G.

Theorem 18.27: Pigouvian marginal-cost taxes #

theorem Cslib.GameTheory.NonatomicCongestionGame.pigouvianTax_nonneg {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] {G : NonatomicCongestionGame K P E} {c' : E → ℝ → ℝ} {f : P → ℝ} (hf : ∀ (p : P), 0 ≤ f p) (hm : ∀ (e : E), MonotoneOn (G.latency e) (Set.Ici 0)) (hderiv : ∀ (e : E), HasDerivWithinAt (G.latency e) (c' e (G.edgeFlow f e)) (Set.Ici 0) (G.edgeFlow f e)) (e : E) :
0 ≤ G.pigouvianTax c' f e

When resource latencies are nondecreasing on [0, ∞), the Pigouvian marginal-cost tax τ_e = edgeFlow f e * c' e (edgeFlow f e) of any nonnegative flow f is nonnegative.

theorem Cslib.GameTheory.NonatomicCongestionGame.IsOptimal.isWardrop_withTaxes_pigouvianTax {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] {G : NonatomicCongestionGame K P E} [DecidableEq K] [Finite E] {c' : E → ℝ → ℝ} {f : P → ℝ} (hf : G.IsOptimal f) (hderiv : ∀ (e : E), HasDerivWithinAt (G.latency e) (c' e (G.edgeFlow f e)) (Set.Ici 0) (G.edgeFlow f e)) :

Pigouvian marginal-cost taxes induce optimal flows as Wardrop equilibria ([Rou07], Theorem 18.27 and subsequent remark, p. 478): if f* is socially optimal for G and G.latency e has derivative c' e (edgeFlow f* e) within [0, ∞) at edgeFlow f* e, then f* is a Wardrop equilibrium of the taxed network G.withTaxes (G.pigouvianTax c' f*). No convexity assumption on x ↦ x * latency e x is needed.

theorem Cslib.GameTheory.NonatomicCongestionGame.IsOptimal.cost_eq_of_isWardrop_withTaxes {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] {G : NonatomicCongestionGame K P E} [DecidableEq K] [Finite E] {c' : E → ℝ → ℝ} {f g : P → ℝ} (hf : G.IsOptimal f) (hm : ∀ (e : E), MonotoneOn (G.latency e) (Set.Ici 0)) (hderiv : ∀ (e : E), HasDerivWithinAt (G.latency e) (c' e (G.edgeFlow f e)) (Set.Ici 0) (G.edgeFlow f e)) (hg : (G.withTaxes (G.pigouvianTax c' f)).IsWardrop g) :
G.cost g = G.cost f ∧ G.IsOptimal g

When resource latencies are nondecreasing on [0, ∞) and differentiable at edgeFlow f* e, every Wardrop equilibrium g of the Pigouvian-taxed network G.withTaxes (G.pigouvianTax c' f*) has the same total social cost on G as the optimal flow f* and is therefore socially optimal for G (so Pigouvian taxes reduce the price of anarchy on G to 1, including on networks with constant edges such as Pigou's and Braess's examples).