Documentation

CslibFrontier.GameTheory.P2P.Generosity

Peer-to-peer generosity equilibria, penalties, and welfare tradeoffs #

This module formalizes the equilibrium and welfare analysis of peer-to-peer sharing under free riding and service differentiation from [BCF07] (NRTV Chapter 23, Section 23.3, pp. 596–600, and Exercise 23.1, p. 610), together with a reduced-demand model motivated by Exercise 23.2 (p. 610; Exercise 23.2's type-based peer exclusion and stable equilibrium remain open in #7789):

References #

Minimalist generosity model (Section 23.3.1, pp. 597–599) #

A positive equilibrium contribution fraction x ∈ (0, 1] under generosity tail distribution tail (fraction of peers willing to bear net cost at least t): x = tail (1 / x).

Per-capita net welfare in the minimalist sharing model with per-service benefit α and contributing fraction x: expected service benefit α * x minus total normalized request cost 1.

noncomputable def Cslib.GameTheory.P2P.uniformTail (θ_m t : ℝ) :

Survival (tail) function P(θ ≥ t) of the uniform generosity distribution on [0, θ_m].

@[simp]
theorem Cslib.GameTheory.P2P.uniformTail_of_le_zero {θ_m t : ℝ} (ht : t ≤ 0) :
uniformTail θ_m t = 1
theorem Cslib.GameTheory.P2P.uniformTail_nonneg {θ_m : ℝ} (hθ : 0 < θ_m) (t : ℝ) :
0 ≤ uniformTail θ_m t
theorem Cslib.GameTheory.P2P.uniformTail_le_one {θ_m : ℝ} (hθ : 0 < θ_m) (t : ℝ) :
uniformTail θ_m t ≤ 1
theorem Cslib.GameTheory.P2P.uniformTail_of_pos_le {θ_m t : ℝ} (ht0 : 0 < t) (htθ : t ≤ θ_m) :
uniformTail θ_m t = 1 - t / θ_m
theorem Cslib.GameTheory.P2P.uniformTail_of_gt {θ_m t : ℝ} (ht0 : 0 < t) (htθ : θ_m < t) :
uniformTail θ_m t = 0
noncomputable def Cslib.GameTheory.P2P.unifHighRoot (θ_m : ℝ) :

Upper positive equilibrium contribution root (θ_m + √(θ_m (θ_m - 4))) / (2 θ_m) of the uniform generosity model ([BCF07], Section 23.3.1, p. 598; Claim 23.1, p. 599).

theorem Cslib.GameTheory.P2P.unifHighRoot_eq (θ_m : ℝ) :
unifHighRoot θ_m = (θ_m + √(θ_m * (θ_m - 4))) / (2 * θ_m)
noncomputable def Cslib.GameTheory.P2P.unifLowRoot (θ_m : ℝ) :

Lower positive equilibrium contribution root (θ_m - √(θ_m (θ_m - 4))) / (2 θ_m) of the uniform generosity model ([BCF07], Section 23.3.1, p. 598; Claim 23.1, p. 599).

theorem Cslib.GameTheory.P2P.unifLowRoot_eq (θ_m : ℝ) :
unifLowRoot θ_m = (θ_m - √(θ_m * (θ_m - 4))) / (2 * θ_m)
theorem Cslib.GameTheory.P2P.unifRoot_props {θ_m : ℝ} (hθ : 4 ≤ θ_m) :

Root identities and bounds for unifLowRoot and unifHighRoot when 4 ≤ θ_m.

theorem Cslib.GameTheory.P2P.uniformEquilibrium_iff {θ_m x : ℝ} (hθ : 0 < θ_m) :

Minimalist equilibrium characterization ([BCF07], Section 23.3.1, p. 598; Claim 23.1, p. 599): for a uniform generosity distribution on [0, θ_m] (θ_m > 0), positive equilibrium contribution fractions exist iff θ_m ≥ 4, and coincide with {unifLowRoot θ_m, unifHighRoot θ_m}.

theorem Cslib.GameTheory.P2P.uniform_at_four_and_collapse :
(unifLowRoot 4 = 1 / 2 ∧ unifHighRoot 4 = 1 / 2) ∧ ∀ {θ_m : ℝ}, 0 < θ_m → θ_m < 4 → ¬∃ (x : ℝ), generosityEquilibrium (uniformTail θ_m) x

Critical point at θ_m = 4: the two equilibrium roots coalesce at 1 / 2, and strictly below θ_m = 4 positive generosity collapses completely ([BCF07], Claim 23.1, p. 599).

theorem Cslib.GameTheory.P2P.uniform_stability {θ_m : ℝ} (hθ4 : 4 ≤ θ_m) {x : ℝ} (hx₀ : 0 < x) :
(unifLowRoot θ_m < x → x < unifHighRoot θ_m → x < uniformTail θ_m (1 / x)) ∧ (x < unifLowRoot θ_m ∨ unifHighRoot θ_m < x → uniformTail θ_m (1 / x) < x)

Best-response drift signs around unifLowRoot and unifHighRoot ([BCF07], Section 23.3.1, p. 598; Claim 23.1, p. 599): for 4 ≤ θ_m, uniformTail θ_m (1 / x) > x strictly on (unifLowRoot θ_m, unifHighRoot θ_m), and uniformTail θ_m (1 / x) < x strictly on (0, unifLowRoot θ_m) and (unifHighRoot θ_m, ∞). For θ_m > 4, this gives local two-sided stability of unifHighRoot θ_m and instability of unifLowRoot θ_m; at θ_m = 4, the two roots coincide at 1 / 2 with attraction from above and downward drift below.

theorem Cslib.GameTheory.P2P.unifHighRoot_strictMono {θ₁ θ₂ : ℝ} (hθ₁ : 4 ≤ θ₁) (hlt : θ₁ < θ₂) :

The stable equilibrium contribution fraction unifHighRoot θ_m is strictly increasing in θ_m on [4, ∞) ([BabaioffChuangFeldman2007], Claim 23.1, p. 599).

theorem Cslib.GameTheory.P2P.unifHighRoot_tendsto_one (ε : ℝ) :
0 < ε → ∃ (Θ : ℝ), ∀ (θ_m : ℝ), Θ ≤ θ_m → 1 - ε < unifHighRoot θ_m ∧ unifHighRoot θ_m < 1

As the generosity range θ_m → ∞, the stable equilibrium unifHighRoot θ_m approaches 1 ([BCF07], Claim 23.1, p. 599).

Mixture generosity distributions (Exercise 23.1, p. 610) #

noncomputable def Cslib.GameTheory.P2P.mixtureTail (θ_m φ t : ℝ) :

Mixture generosity survival function combining fraction φ of uniform [0, θ_m] peers, (1 - φ) / 2 completely selfish peers (θ = 0), and (1 - φ) / 2 maximal-generosity peers (θ = θ_m).

theorem Cslib.GameTheory.P2P.mixtureTail_of_pos_le {θ_m φ t : ℝ} (ht₀ : 0 < t) (htθ : t ≤ θ_m) :
mixtureTail θ_m φ t = (1 + φ) / 2 - φ * t / θ_m
theorem Cslib.GameTheory.P2P.mixtureTail_of_gt {θ_m φ t : ℝ} (hθ : 0 < θ_m) (ht : θ_m < t) :
mixtureTail θ_m φ t = 0
noncomputable def Cslib.GameTheory.P2P.mixLowRoot (θ_m φ : ℝ) :

Lower root (((1 + φ) / 2) θ_m - √((((1 + φ) / 2) θ_m)^2 - 4 θ_m φ)) / (2 θ_m) of the interior quadratic fixed-point equation for mixtureTail θ_m φ ([BCF07], Exercise 23.1, p. 610).

theorem Cslib.GameTheory.P2P.mixLowRoot_eq (θ_m φ : ℝ) :
mixLowRoot θ_m φ = ((1 + φ) / 2 * θ_m - √(((1 + φ) / 2 * θ_m) ^ 2 - 4 * θ_m * φ)) / (2 * θ_m)
noncomputable def Cslib.GameTheory.P2P.mixHighRoot (θ_m φ : ℝ) :

Upper root (((1 + φ) / 2) θ_m + √((((1 + φ) / 2) θ_m)^2 - 4 θ_m φ)) / (2 θ_m) of the interior quadratic fixed-point equation for mixtureTail θ_m φ ([BCF07], Exercise 23.1, p. 610).

theorem Cslib.GameTheory.P2P.mixHighRoot_eq (θ_m φ : ℝ) :
mixHighRoot θ_m φ = ((1 + φ) / 2 * θ_m + √(((1 + φ) / 2 * θ_m) ^ 2 - 4 * θ_m * φ)) / (2 * θ_m)
theorem Cslib.GameTheory.P2P.mixRoot_props {θ_m φ : ℝ} (hθ : 0 < θ_m) (hφ₀ : 0 < φ) (hφ₁ : φ ≤ 1) (hthr : 16 * φ / (1 + φ) ^ 2 ≤ θ_m) :
0 < mixLowRoot θ_m φ ∧ mixLowRoot θ_m φ ≤ mixHighRoot θ_m φ ∧ mixHighRoot θ_m φ < (1 + φ) / 2 ∧ mixHighRoot θ_m φ < 1

Positivity and ordering bounds for mixLowRoot and mixHighRoot when the interior quadratic discriminant is nonnegative (16 * φ / (1 + φ) ^ 2 ≤ θ_m).

theorem Cslib.GameTheory.P2P.mixture_upper_bound {θ_m φ x : ℝ} (hθ : 0 < θ_m) (hφ₀ : 0 ≤ φ) (hφ₁ : φ ≤ 1) (heq : generosityEquilibrium (mixtureTail θ_m φ) x) :
x ≤ (1 + φ) / 2

Upper bound x ≤ (1 + φ) / 2 for any positive equilibrium under mixtureTail θ_m φ (0 ≤ φ ≤ 1, θ_m > 0), strictly capping equilibrium participation below 1 whenever φ < 1 ([BCF07], Exercise 23.1, p. 610).

theorem Cslib.GameTheory.P2P.mixtureEquilibrium_iff {θ_m φ x : ℝ} (hθ : 0 < θ_m) (hφ₀ : 0 < φ) (hφ₁ : φ ≤ 1) :
generosityEquilibrium (mixtureTail θ_m φ) x ↔ 16 * φ / (1 + φ) ^ 2 ≤ θ_m ∧ 1 / x ≤ θ_m ∧ (x = mixLowRoot θ_m φ ∨ x = mixHighRoot θ_m φ)

Mixture equilibrium characterization ([BCF07], Exercise 23.1, p. 610): for 0 < θ_m and 0 < φ ≤ 1, a fraction x is a positive generosity equilibrium under mixtureTail θ_m φ iff 16 * φ / (1 + φ) ^ 2 ≤ θ_m, the active cost 1 / x lies in [0, θ_m] (1 / x ≤ θ_m), and x is one of {mixLowRoot θ_m φ, mixHighRoot θ_m φ}.

theorem Cslib.GameTheory.P2P.exists_mixtureEquilibrium_iff {θ_m φ : ℝ} (hθ : 0 < θ_m) (hφ₀ : 0 < φ) (hφ₁ : φ ≤ 1) :
(∃ (x : ℝ), generosityEquilibrium (mixtureTail θ_m φ) x) ↔ 1 / 3 ≤ φ ∧ 16 * φ / (1 + φ) ^ 2 ≤ θ_m ∨ φ < 1 / 3 ∧ 2 / (1 - φ) ≤ θ_m

Two-regime positive-equilibrium threshold for mixture generosity ([BCF07], Exercise 23.1, p. 610): for 0 < θ_m and 0 < φ ≤ 1, a positive generosity equilibrium exists under mixtureTail θ_m φ iff either 1 / 3 ≤ φ and 16 * φ / (1 + φ) ^ 2 ≤ θ_m, or φ < 1 / 3 and 2 / (1 - φ) ≤ θ_m (where 16 * φ / (1 + φ) ^ 2 alone does not suffice because both quadratic roots lie below 1 / θ_m whenever θ_m < 2 / (1 - φ)).

theorem Cslib.GameTheory.P2P.mixture_threshold_le_four {φ : ℝ} (hφ₀ : 0 ≤ φ) :
16 * φ / (1 + φ) ^ 2 ≤ 4

Service differentiation (§23.3.2, pp. 599–600) and reduced-demand model #

Aggregate request load per peer when contributors share x and free-rider requests suffer dropping probability p: R(x, p) = 1 - (1 - x) * p.

Effective per-peer service rate x * R(x, p) when contributors serve at rate x on admitted load R(x, p).

noncomputable def Cslib.GameTheory.P2P.penaltyThreshold (α x p : ℝ) :

Net cost threshold T(α, x, p) = R(x, p) / x - α * p * x separating contributors from free riders under penalty p ∈ [0, 1] and sharing benefit α ([BCF07], Section 23.3.2, p. 599).

Equilibrium condition under service differentiation penalty p: x ∈ (0, 1] and x = tail (penaltyThreshold α x p).

Per-capita utilitarian social welfare α * serviceRate x p - requestLoad x p under penalty p, reducing to minimalistWelfare α x at p = 0.

theorem Cslib.GameTheory.P2P.fullCooperation_penalty_threshold {tail : ℝ → ℝ} (htail : ∀ t ≤ 0, tail t = 1) {α p : ℝ} (hα : 0 < α) (hp : 1 / α ≤ p) :

Full cooperation under penalties ([BCF07], Claim 23.2, p. 600): for ANY generosity distribution with nonnegative support (∀ t ≤ 0, tail t = 1), any benefit α > 0, and any penalty p with 1 / α ≤ p, x = 1 (100% contribution) is an equilibrium.

Reduced-demand equilibrium model (not Exercise 23.2's type-based peer exclusion in [BCF07], p. 610, which removes peers by generosity type and remains open in #7789): multiplying incoming demand by 1 - z (z ∈ [0, 1)) while keeping the original generosity tail tail lowers per-contributor cost to (1 - z) / x, yielding fixed-point equation x = tail ((1 - z) / x) for 0 < x ≤ 1 and scaled welfare (1 - z) * (α * x - 1).

noncomputable def Cslib.GameTheory.P2P.exclHighRoot (θ_m z : ℝ) :

Upper positive equilibrium root in the reduced-demand model with parameter z: (θ_m + √(θ_m (θ_m - 4 (1 - z)))) / (2 θ_m).

theorem Cslib.GameTheory.P2P.exclHighRoot_eq (θ_m z : ℝ) :
exclHighRoot θ_m z = (θ_m + √(θ_m * (θ_m - 4 * (1 - z)))) / (2 * θ_m)

Scaled social welfare in the reduced-demand model with parameter z: (1 - z) * (α * x - 1).

theorem Cslib.GameTheory.P2P.exclWelfare_eq (α x z : ℝ) :
exclWelfare α x z = (1 - z) * (α * x - 1)
theorem Cslib.GameTheory.P2P.exclHighRoot_equilibrium {θ_m z : ℝ} (hθ_pos : 0 < θ_m) (hz₁ : z < 1) (hthr : 4 * (1 - z) ≤ θ_m) :

In the reduced-demand model with z < 1 (multiplying demand by 1 - z while keeping the original uniformTail θ_m), the critical generosity threshold drops from 4 to 4 * (1 - z), and exclHighRoot θ_m z satisfies exclEquilibrium whenever 4 * (1 - z) ≤ θ_m. Exercise 23.2 of [BCF07] (p. 610), which removes peers by generosity type, remains open in #7789.

Demand reduction rescues subcritical sharing (reduced-demand model; Exercise 23.2's type-based peer exclusion in [BCF07], p. 610, remains open in #7789): at θ_m = 3 < 4 and α = 3, no positive equilibrium exists at z = 0, whereas scaling demand by 1 - z = 1 / 2 while keeping uniformTail 3 sustains a positive equilibrium exclHighRoot 3 (1 / 2) > 1 / 2 with strictly positive scaled welfare.

Demand reduction can reduce scaled welfare (reduced-demand model; Exercise 23.2's type-based peer exclusion in [BCF07], p. 610, remains open in #7789): at θ_m = 5 and α = 2, the system already sustains high cooperation at z = 0, and scaling demand by 1 - z = 1 / 2 strictly lowers scaled welfare: exclWelfare 2 (exclHighRoot 5 (1 / 2)) (1 / 2) < minimalistWelfare 2 (unifHighRoot 5).