Documentation

CslibFrontier.GameTheory.Evolutionary.RoutingDynamics

Evolutionary dynamics applied to selfish routing #

This module formalizes [Sur07], Section 29.3 (pp. 723–728) and Exercise 29.6 (p. 736), analyzing imitative (replicator) evolutionary dynamics on single-commodity nonatomic selfish routing games.

We reuse Cslib.GameTheory.NonatomicCongestionGame Unit P E with unit traffic rate G.rate () = 1. In this setting:

Under the pairwise imitative dynamics of Equation (29.1), agents on path p switch to a randomly sampled lower-latency path q at rate proportional to lam x * (l_p(x) - l_q(x)). For any flow summing to 1, this pairwise drift equals the replicator drift lam x * x p * (l̄(x) - l_p(x)) of Equation (29.2) (imitativeDrift_eq_replicatorDrift).

With the relative rate lam x = (G.cost x)⁻¹ ([Sur07], p. 725), nonnegative nondecreasing Lipschitz latencies on [0, 1], and positive minimum feasible average latency 0 < lStar, a global trajectory on [0, ∞) exists uniquely from every feasible initial flow (exists_relativeReplicatorTrajectory, eqOn_of_isRelativeReplicatorTrajectory), remains feasible for all t ≥ 0 (Exercise 29.6), decreases the shifted Beckmann potential G.potential of Equation (29.3) monotonically (hasDerivWithinAt_potential, antitoneOn_potential), and reaches an ε-approximate equilibrium (Definition 29.11) within time 2 / ε ^ 3 * Real.log (2 * lMax / lStar) = O(ε⁻³ ln(l_max / l*)) ([Sur07], Theorem 29.12).

Main definitions #

Main results #

References #

noncomputable def Cslib.GameTheory.NonatomicCongestionGame.imitativeDrift {P : Type u_1} {E : Type u_2} [Fintype P] [DecidableEq E] (G : NonatomicCongestionGame Unit P E) (lam : (P → ℝ) → ℝ) (x : P → ℝ) (p : P) :

The pairwise imitative drift on path p ([Sur07], Equation 29.1, p. 724): agents on p switch to lower-latency paths q and agents on higher-latency paths q switch to p, each at rate proportional to lam x times the latency difference.

def Cslib.GameTheory.NonatomicCongestionGame.replicatorDrift {P : Type u_1} {E : Type u_2} [Fintype P] [DecidableEq E] (G : NonatomicCongestionGame Unit P E) (lam : (P → ℝ) → ℝ) (x : P → ℝ) (p : P) :

The replicator drift on path p ([Sur07], Equation 29.2, p. 724): lam x * x p * (G.cost x - G.pathLatency x p).

def Cslib.GameTheory.NonatomicCongestionGame.IsReplicatorTrajectory {P : Type u_1} {E : Type u_2} [Fintype P] [DecidableEq E] (G : NonatomicCongestionGame Unit P E) (lam : (P → ℝ) → ℝ) (x : ℝ → P → ℝ) :

A trajectory x : ℝ → P → ℝ follows the replicator dynamics with rate lam on [0, ∞) ([Suri2007], Equation 29.2, pp. 724–725) when every path coordinate t ↦ x t p has derivative within [0, ∞) equal to G.replicatorDrift lam (x t) p at every t ≥ 0.

noncomputable def Cslib.GameTheory.NonatomicCongestionGame.IsApproxEquilibrium {P : Type u_1} {E : Type u_2} [Fintype P] [DecidableEq E] (G : NonatomicCongestionGame Unit P E) (ε : ℝ) (x : P → ℝ) :

A feasible flow x is an ε-approximate equilibrium ([Sur07], Definition 29.11, p. 726) if at most an ε fraction of flow uses paths whose latency is at least (1 + ε) * G.cost x.

Note: because Definition 29.11 uses the non-strict inequality l_p(x) ≥ (1 + ε) l̄(x), a zero-cost flow (G.cost x = 0) places every nonnegative-latency path in P_ε, giving total weight 1, so even a Wardrop equilibrium fails IsApproxEquilibrium when G.cost x = 0 and 0 < ε < 1.

noncomputable def Cslib.GameTheory.NonatomicCongestionGame.potential {P : Type u_1} {E : Type u_2} [Fintype P] [DecidableEq E] (G : NonatomicCongestionGame Unit P E) [Fintype E] (lStar : ℝ) (x : P → ℝ) :

The shifted Beckmann potential function Φ(x) = lStar + ∑ e, ∫₀^{x_e} l_e(u) du ([Sur07], Equation 29.3, p. 726), where lStar is a lower bound on the average latency of feasible flows (in the source, l* = min_x l̄(x)).

Single-commodity feasibility and drift identities #

theorem Cslib.GameTheory.NonatomicCongestionGame.isFeasible_unit_iff {P : Type u_1} {E : Type u_2} [Fintype P] {G : NonatomicCongestionGame Unit P E} (h1 : G.rate () = 1) {x : P → ℝ} :
G.IsFeasible x ↔ (∀ (p : P), 0 ≤ x p) ∧ ∑ p : P, x p = 1

For a single-commodity game with unit rate G.rate () = 1, feasibility means nonnegative path flows summing to 1.

theorem Cslib.GameTheory.NonatomicCongestionGame.imitativeDrift_eq_replicatorDrift {P : Type u_1} {E : Type u_2} [Fintype P] [DecidableEq E] {G : NonatomicCongestionGame Unit P E} (lam : (P → ℝ) → ℝ) {x : P → ℝ} (hsum : ∑ q : P, x q = 1) (p : P) :
G.imitativeDrift lam x p = G.replicatorDrift lam x p

Equivalence of pairwise imitative dynamics and replicator dynamics ([Sur07], Equations 29.1–29.2, pp. 724–725): whenever ∑ q, x q = 1, the pairwise imitative drift equals the replicator drift lam x * x p * (G.cost x - G.pathLatency x p).

theorem Cslib.GameTheory.NonatomicCongestionGame.sum_replicatorDrift_eq_zero {P : Type u_1} {E : Type u_2} [Fintype P] [DecidableEq E] {G : NonatomicCongestionGame Unit P E} (lam : (P → ℝ) → ℝ) {x : P → ℝ} (hsum : ∑ p : P, x p = 1) :
∑ p : P, G.replicatorDrift lam x p = 0

Zero total drift ([Sur07], Exercise 29.6, first part, p. 736): whenever the path flows sum to 1, the replicator drifts of Equation (29.2) sum to 0.

theorem Cslib.GameTheory.NonatomicCongestionGame.IsWardrop.isApproxEquilibrium {P : Type u_1} {E : Type u_2} [Fintype P] [DecidableEq E] {G : NonatomicCongestionGame Unit P E} (h1 : G.rate () = 1) {x : P → ℝ} (hx : G.IsWardrop x) (hcost : 0 < G.cost x) {ε : ℝ} (hε : 0 < ε) :

Every positive-cost Wardrop equilibrium is an ε-approximate equilibrium for all ε > 0, linking Definition 29.10 (IsWardrop) to Definition 29.11 (IsApproxEquilibrium, [Sur07], pp. 724–726). The hypothesis 0 < G.cost x is necessary when 0 < ε < 1, because a zero-cost flow has l_p(x) ≥ (1 + ε) · 0 on every path.

Exercise 29.6: flow-feasibility and positivity invariance #

theorem Cslib.GameTheory.NonatomicCongestionGame.IsReplicatorTrajectory.pos_of_pos {P : Type u_1} {E : Type u_2} [Fintype P] [DecidableEq E] {G : NonatomicCongestionGame Unit P E} {lam : (P → ℝ) → ℝ} {x : ℝ → P → ℝ} (hx : G.IsReplicatorTrajectory lam x) (hlam : ContinuousOn (fun (t : ℝ) => lam (x t)) (Set.Ici 0)) (hlat : ∀ (e : E), Continuous (G.latency e)) {p : P} (hp : 0 < x 0 p) {t : ℝ} (ht : 0 ≤ t) :
0 < x t p

Strict support preservation along replicator dynamics: any path carrying positive flow at time 0 carries positive flow at every t ≥ 0.

theorem Cslib.GameTheory.NonatomicCongestionGame.IsReplicatorTrajectory.isFeasible {P : Type u_1} {E : Type u_2} [Fintype P] [DecidableEq E] {G : NonatomicCongestionGame Unit P E} (h1 : G.rate () = 1) {lam : (P → ℝ) → ℝ} {x : ℝ → P → ℝ} (hx : G.IsReplicatorTrajectory lam x) (h0 : G.IsFeasible (x 0)) (hlam : ContinuousOn (fun (t : ℝ) => lam (x t)) (Set.Ici 0)) (hlat : ∀ (e : E), Continuous (G.latency e)) (t : ℝ) :
t ≥ 0 → G.IsFeasible (x t)

All-time feasibility invariance ([Sur07], Exercise 29.6, p. 736): if a trajectory of Equation (29.2) with continuous latencies and continuous rate function t ↦ lam (x t) starts from a feasible flow, it remains feasible for all t ≥ 0.

theorem Cslib.GameTheory.NonatomicCongestionGame.IsReplicatorTrajectory.isFeasible_relative {P : Type u_1} {E : Type u_2} [Fintype P] [DecidableEq E] {G : NonatomicCongestionGame Unit P E} (h1 : G.rate () = 1) {lStar : ℝ} (hlStar : 0 < lStar) (hmin : ∀ (y : P → ℝ), G.IsFeasible y → lStar ≤ G.cost y) (hlat : ∀ (e : E), Continuous (G.latency e)) {x : ℝ → P → ℝ} (hx : G.IsReplicatorTrajectory (fun (y : P → ℝ) => (G.cost y)⁻¹) x) (h0 : G.IsFeasible (x 0)) (t : ℝ) :
t ≥ 0 → G.IsFeasible (x t)

All-time feasibility invariance for the relative-rate dynamics λ(x) = l̄(x)⁻¹ ([Sur07], p. 725 and Exercise 29.6, p. 736): when every feasible flow has average latency at least lStar > 0 and latencies are continuous, any relative-rate replicator trajectory starting from a feasible flow remains feasible (and maintains G.cost (x t) ≥ lStar > 0) for all t ≥ 0, without assuming continuity of (G.cost ∘ x)⁻¹ a priori.

Potential function derivative, Lyapunov monotonicity, and bounds #

theorem Cslib.GameTheory.NonatomicCongestionGame.le_potential {P : Type u_1} {E : Type u_2} [Fintype P] [Fintype E] [DecidableEq E] {G : NonatomicCongestionGame Unit P E} (h1 : G.rate () = 1) (hnonneg : ∀ (e : E), ∀ u ∈ Set.Icc 0 1, 0 ≤ G.latency e u) (lStar : ℝ) {x : P → ℝ} (hx : G.IsFeasible x) :
lStar ≤ G.potential lStar x

The shifted Beckmann potential is always at least lStar on feasible flows when latencies are nonnegative on [0, 1].

theorem Cslib.GameTheory.NonatomicCongestionGame.potential_le_two_mul_cost {P : Type u_1} {E : Type u_2} [Fintype P] [Fintype E] [DecidableEq E] {G : NonatomicCongestionGame Unit P E} (h1 : G.rate () = 1) (hmono : ∀ (e : E), MonotoneOn (G.latency e) (Set.Icc 0 1)) (hcont : ∀ (e : E), ContinuousOn (G.latency e) (Set.Icc 0 1)) {lStar : ℝ} {x : P → ℝ} (hx : G.IsFeasible x) (hlStar : lStar ≤ G.cost x) :
G.potential lStar x ≤ 2 * G.cost x

Equation (29.6) and potential upper bound ([Sur07], p. 728): for nondecreasing continuous latencies on [0, 1] and a feasible flow x with lStar ≤ G.cost x, G.potential lStar x ≤ 2 * G.cost x.

theorem Cslib.GameTheory.NonatomicCongestionGame.hasDerivWithinAt_potential {P : Type u_1} {E : Type u_2} [Fintype P] [Fintype E] [DecidableEq E] {G : NonatomicCongestionGame Unit P E} (h1 : G.rate () = 1) {lam : (P → ℝ) → ℝ} {x : ℝ → P → ℝ} (hx : G.IsReplicatorTrajectory lam x) (hfeas : ∀ t ≥ 0, G.IsFeasible (x t)) (hcont : ∀ (e : E), ContinuousOn (G.latency e) (Set.Icc 0 1)) (lStar : ℝ) {t : ℝ} (ht : 0 ≤ t) :
HasDerivWithinAt (fun (s : ℝ) => G.potential lStar (x s)) (lam (x t) * (G.cost (x t) ^ 2 - ∑ p : P, x t p * G.pathLatency (x t) p ^ 2)) (Set.Ici 0) t

Time derivative of the potential function ([Sur07], Equation 29.4, p. 727): along any feasible replicator trajectory with latencies continuous on [0, 1], Φ'(t) = lam (x t) * (G.cost (x t) ^ 2 - ∑ p, x t p * G.pathLatency (x t) p ^ 2).

theorem Cslib.GameTheory.NonatomicCongestionGame.antitoneOn_potential {P : Type u_1} {E : Type u_2} [Fintype P] [Fintype E] [DecidableEq E] {G : NonatomicCongestionGame Unit P E} (h1 : G.rate () = 1) {lam : (P → ℝ) → ℝ} {x : ℝ → P → ℝ} (hx : G.IsReplicatorTrajectory lam x) (hfeas : ∀ t ≥ 0, G.IsFeasible (x t)) (hlam : ∀ t ≥ 0, 0 ≤ lam (x t)) (hcont : ∀ (e : E), ContinuousOn (G.latency e) (Set.Icc 0 1)) (lStar : ℝ) :
AntitoneOn (fun (t : ℝ) => G.potential lStar (x t)) (Set.Ici 0)

Lyapunov monotonicity ([Sur07], Section 29.3.2, p. 726; Section 29.3.3, p. 727): along any feasible replicator trajectory with nonnegative rate lam (x t) ≥ 0 and latencies continuous on [0, 1], the shifted Beckmann potential t ↦ G.potential lStar (x t) is nonincreasing on [0, ∞).

Global existence and uniqueness via Picard–Lindelöf #

theorem Cslib.GameTheory.NonatomicCongestionGame.exists_relativeReplicatorTrajectory {P : Type u_1} {E : Type u_2} [Fintype P] [DecidableEq E] {G : NonatomicCongestionGame Unit P E} (h1 : G.rate () = 1) (hnonneg : ∀ (e : E), ∀ u ∈ Set.Icc 0 1, 0 ≤ G.latency e u) (hlip : ∀ (e : E), ∃ (K : NNReal), LipschitzOnWith K (G.latency e) (Set.Icc 0 1)) {lStar : ℝ} (hlStar : 0 < lStar) (hmin : ∀ (y : P → ℝ), G.IsFeasible y → lStar ≤ G.cost y) {x₀ : P → ℝ} (hx₀ : G.IsFeasible x₀) :
∃ (x : ℝ → P → ℝ), x 0 = x₀ ∧ G.IsReplicatorTrajectory (fun (y : P → ℝ) => (G.cost y)⁻¹) x ∧ ∀ t ≥ 0, G.IsFeasible (x t)

Global existence of relative-rate replicator trajectories on [0, ∞): given nonnegative Lipschitz latency functions on [0, 1], a positive lower bound lStar on feasible average latencies, and a feasible initial flow x₀, there exists a trajectory x : ℝ → P → ℝ with x 0 = x₀ solving Equation (29.2) with relative rate λ(x) = l̄(x)⁻¹ that remains feasible for all t ≥ 0.

theorem Cslib.GameTheory.NonatomicCongestionGame.eqOn_of_isRelativeReplicatorTrajectory {P : Type u_1} {E : Type u_2} [Fintype P] [DecidableEq E] {G : NonatomicCongestionGame Unit P E} (h1 : G.rate () = 1) (hnonneg : ∀ (e : E), ∀ u ∈ Set.Icc 0 1, 0 ≤ G.latency e u) (hlip : ∀ (e : E), ∃ (K : NNReal), LipschitzOnWith K (G.latency e) (Set.Icc 0 1)) {lStar : ℝ} (hlStar : 0 < lStar) (hmin : ∀ (y : P → ℝ), G.IsFeasible y → lStar ≤ G.cost y) {x y : ℝ → P → ℝ} (hx : G.IsReplicatorTrajectory (fun (z : P → ℝ) => (G.cost z)⁻¹) x) (hxfeas : ∀ t ≥ 0, G.IsFeasible (x t)) (hy : G.IsReplicatorTrajectory (fun (z : P → ℝ) => (G.cost z)⁻¹) y) (hyfeas : ∀ t ≥ 0, G.IsFeasible (y t)) (h0 : x 0 = y 0) :

Uniqueness of feasible relative-rate replicator trajectories on [0, ∞): under nonnegative Lipschitz latencies on [0, 1] and positive minimum feasible average latency lStar, any two feasible trajectories of Equation (29.2) with relative rate λ(x) = l̄(x)⁻¹ that agree at t = 0 agree for all t ≥ 0.

Theorem 29.12: convergence time to an ε-approximate equilibrium #

theorem Cslib.GameTheory.NonatomicCongestionGame.IsReplicatorTrajectory.exists_mem_Icc_isApproxEquilibrium {P : Type u_1} {E : Type u_2} [Fintype P] [Fintype E] [DecidableEq E] {G : NonatomicCongestionGame Unit P E} (h1 : G.rate () = 1) (hnonneg : ∀ (e : E), ∀ u ∈ Set.Icc 0 1, 0 ≤ G.latency e u) (hmono : ∀ (e : E), MonotoneOn (G.latency e) (Set.Icc 0 1)) (hcont : ∀ (e : E), ContinuousOn (G.latency e) (Set.Icc 0 1)) {lStar : ℝ} (hlStar : 0 < lStar) (hmin : ∀ (y : P → ℝ), G.IsFeasible y → lStar ≤ G.cost y) {x : ℝ → P → ℝ} (hx : G.IsReplicatorTrajectory (fun (y : P → ℝ) => (G.cost y)⁻¹) x) (hfeas : ∀ t ≥ 0, G.IsFeasible (x t)) {ε : ℝ} (hε : 0 < ε) :
∃ t ∈ Set.Icc 0 (2 / ε ^ 3 * Real.log (G.potential lStar (x 0) / lStar)), G.IsApproxEquilibrium ε (x t)

Theorem 29.12 (trajectory hitting time) ([Sur07], pp. 727–728): along any feasible relative-rate replicator trajectory x with nonnegative, nondecreasing, continuous latencies on [0, 1] and positive minimum feasible average latency lStar, for every ε > 0 there is a time t ∈ [0, (2 / ε ^ 3) * ln(Φ(x 0) / lStar)] at which x t is an ε-approximate equilibrium.

theorem Cslib.GameTheory.NonatomicCongestionGame.exists_relativeReplicatorTrajectory_isApproxEquilibrium {P : Type u_1} {E : Type u_2} [Fintype P] [Finite E] [DecidableEq E] {G : NonatomicCongestionGame Unit P E} (h1 : G.rate () = 1) (hnonneg : ∀ (e : E), ∀ u ∈ Set.Icc 0 1, 0 ≤ G.latency e u) (hmono : ∀ (e : E), MonotoneOn (G.latency e) (Set.Icc 0 1)) (hlip : ∀ (e : E), ∃ (K : NNReal), LipschitzOnWith K (G.latency e) (Set.Icc 0 1)) {lStar lMax : ℝ} (hlStar : 0 < lStar) (hmin : ∀ (y : P → ℝ), G.IsFeasible y → lStar ≤ G.cost y) {x₀ : P → ℝ} (hx₀ : G.IsFeasible x₀) (hlMax : G.cost x₀ ≤ lMax) :
∃ (x : ℝ → P → ℝ), x 0 = x₀ ∧ G.IsReplicatorTrajectory (fun (y : P → ℝ) => (G.cost y)⁻¹) x ∧ (∀ t ≥ 0, G.IsFeasible (x t)) ∧ ∀ ε > 0, ∃ t ∈ Set.Icc 0 (2 / ε ^ 3 * Real.log (2 * lMax / lStar)), G.IsApproxEquilibrium ε (x t)

Theorem 29.12: fast convergence of imitative dynamics to an ε-approximate equilibrium ([Sur07], Section 29.3.3, pp. 727–728).

In a single-commodity nonatomic congestion game with unit flow rate, nonnegative nondecreasing Lipschitz latency functions on [0, 1], positive minimum feasible average latency lStar, and a feasible initial flow x₀ with G.cost x₀ ≤ lMax, there exists a global trajectory x on [0, ∞) starting at x₀ that follows the relative-rate imitative/replicator dynamics x'_p = l̄(x)⁻¹ x_p (l̄(x) - l_p(x)), remains feasible for all t ≥ 0 ([Sur07], Exercise 29.6), and for every ε > 0 reaches an ε-approximate equilibrium ([Sur07], Definition 29.11) at some time t ∈ [0, (2 / ε ^ 3) * ln(2 * lMax / lStar)] (sharpening the constant 4 in [Sur07], p. 728 to 2, and establishing the O(ε⁻³ ln(l_max / l*)) hitting-time bound).