pith. machine review for the scientific record. sign in

IndisputableMonolith.GameTheory.CooperationFromSigma

IndisputableMonolith/GameTheory/CooperationFromSigma.lean · 265 lines · 20 declarations

show as:
view math explainer →

open module explainer GitHub source

Explainer status: ready · generated 2026-05-15 00:55:24.454547+00:00

   1import Mathlib
   2import IndisputableMonolith.Constants
   3import IndisputableMonolith.Cost
   4
   5/-!
   6# Cooperation From σ-Conservation
   7
   8## Element 84 (Domain: Game Theory)
   9
  10Game-theoretic equilibria are J-cost minima on the multi-agent
  11ledger.  RS predicts:
  12
  131. **Nash equilibria as J-cost local minima.** Any Nash equilibrium
  14   is a stationary point of the joint J-cost functional on the
  15   strategy product space; conversely, every smooth interior
  16   J-cost minimum is a Nash equilibrium.
  17
  182. **Cooperation from σ-conservation.** A two-player game is
  19   cooperative (positive-sum) iff the joint σ is conserved across
  20   moves; defect-defect is the unique σ-non-conservative outcome
  21   in the prisoner's dilemma normal form.  This explains why
  22   reciprocal-altruism strategies (tit-for-tat, generous TFT)
  23   dominate in iterated play: they preserve σ.
  24
  253. **Coordination dividend.** A coalition of `n` players
  26   cooperating yields total payoff `n · π_coop = (n + 1/φ) · π_def`,
  27   strictly larger than `n · π_def` for `n ≥ 1`.  The factor
  28   `1/φ ≈ 0.618` is the canonical RS coordination bonus.
  29
  30## Falsifiers
  31
  321. A confirmed Nash equilibrium that is not a J-cost stationary
  33   point (under any RS-natural cost-of-strategy assignment).
  342. A two-player iterated game in which σ-non-conserving strategies
  35   strictly outperform σ-conserving ones over long horizons.
  363. A coalition cooperation bonus measured outside the band
  37   `[1/φ - ε, 1/φ + ε]` for ε small, in any controlled-payoff
  38   game.
  39
  40## Lean status: 0 sorry, 0 axiom
  41-/
  42
  43namespace IndisputableMonolith
  44namespace GameTheory
  45namespace CooperationFromSigma
  46
  47open Constants
  48open Cost
  49
  50noncomputable section
  51
  52/-! ## §1. Two-player normal form
  53
  54We work with the canonical 2x2 prisoner's dilemma encoding:
  55each player chooses C (cooperate) or D (defect); the joint
  56payoff matrix has the standard ordering T > R > P > S where
  57R = mutual reward, P = mutual punishment, S = sucker, T = temptation.
  58-/
  59
  60/-- Player choice: cooperate or defect. -/
  61inductive Choice where
  62  | cooperate
  63  | defect
  64  deriving DecidableEq, Inhabited
  65
  66/-- A 2-player joint outcome. -/
  67structure JointOutcome where
  68  p1 : Choice
  69  p2 : Choice
  70  deriving DecidableEq
  71
  72/-- The σ-charge of a joint outcome: `+1` for mutual cooperation
  73    (creating coordinated value), `0` for mixed, `-1` for mutual
  74    defection (destroying coordinated value).  This is the σ-Noether
  75    charge of the multi-agent move. -/
  76def jointSigma (o : JointOutcome) : ℝ :=
  77  match o.p1, o.p2 with
  78  | .cooperate, .cooperate => 1
  79  | .cooperate, .defect => 0
  80  | .defect, .cooperate => 0
  81  | .defect, .defect => -1
  82
  83/-- The mutual-cooperation outcome has positive σ. -/
  84theorem CC_sigma_pos :
  85    jointSigma ⟨.cooperate, .cooperate⟩ = 1 := rfl
  86
  87/-- The mutual-defection outcome has negative σ. -/
  88theorem DD_sigma_neg :
  89    jointSigma ⟨.defect, .defect⟩ = -1 := rfl
  90
  91/-- Mixed outcomes have σ = 0. -/
  92theorem CD_sigma_zero :
  93    jointSigma ⟨.cooperate, .defect⟩ = 0 := rfl
  94
  95theorem DC_sigma_zero :
  96    jointSigma ⟨.defect, .cooperate⟩ = 0 := rfl
  97
  98/-! ## §2. σ-conservation predicate
  99
 100A joint outcome is σ-conservative iff its σ ≥ 0; it preserves or
 101creates coordinated value.  Mutual defection is the unique
 102σ-violator in the four-outcome space.
 103-/
 104
 105/-- σ-conservative outcomes: mutual cooperation or mixed. -/
 106def isSigmaConservative (o : JointOutcome) : Prop :=
 107  jointSigma o ≥ 0
 108
 109/-- Mutual defection is not σ-conservative. -/
 110theorem DD_not_sigma_conservative :
 111    ¬ isSigmaConservative ⟨.defect, .defect⟩ := by
 112  unfold isSigmaConservative
 113  rw [DD_sigma_neg]
 114  push_neg
 115  norm_num
 116
 117/-- All other outcomes are σ-conservative. -/
 118theorem nonDD_sigma_conservative (o : JointOutcome)
 119    (h : ¬ (o.p1 = .defect ∧ o.p2 = .defect)) :
 120    isSigmaConservative o := by
 121  rcases o with ⟨p1, p2⟩
 122  cases p1 <;> cases p2
 123  · -- C, C
 124    show jointSigma _ ≥ 0
 125    rw [CC_sigma_pos]; norm_num
 126  · -- C, D
 127    show jointSigma _ ≥ 0
 128    rw [CD_sigma_zero]
 129  · -- D, C
 130    show jointSigma _ ≥ 0
 131    rw [DC_sigma_zero]
 132  · -- D, D contradicts h
 133    exfalso
 134    apply h
 135    exact ⟨rfl, rfl⟩
 136
 137/-- The σ-conservative outcomes are exactly the non-DD outcomes. -/
 138theorem sigma_conservative_iff (o : JointOutcome) :
 139    isSigmaConservative o ↔ ¬ (o.p1 = .defect ∧ o.p2 = .defect) := by
 140  refine ⟨?_, fun h => nonDD_sigma_conservative o h⟩
 141  intro h_pos h_DD
 142  apply DD_not_sigma_conservative
 143  obtain ⟨h1, h2⟩ := h_DD
 144  -- Rewrite o to ⟨defect, defect⟩
 145  have ho : o = ⟨.defect, .defect⟩ := by
 146    cases o with | mk a b => simp_all
 147  rw [← ho]
 148  exact h_pos
 149
 150/-! ## §3. The φ-rational cooperation dividend
 151
 152A coalition of `n` cooperators yields total payoff with the
 153canonical `1/φ` bonus over defection, baked into the σ-Noether
 154charge.
 155-/
 156
 157/-- The cooperation dividend per agent: `1/φ ≈ 0.618`. -/
 158def cooperationDividend : ℝ := 1 / phi
 159
 160/-- Numerical: cooperation dividend in `(0.617, 0.622)`. -/
 161theorem cooperationDividend_band :
 162    0.617 < cooperationDividend ∧ cooperationDividend < 0.622 := by
 163  unfold cooperationDividend
 164  have h1 : phi < 1.62 := phi_lt_onePointSixTwo
 165  have h2 : 1.61 < phi := phi_gt_onePointSixOne
 166  refine ⟨?_, ?_⟩
 167  · rw [lt_div_iff₀ phi_pos]; linarith
 168  · rw [div_lt_iff₀ phi_pos]; linarith
 169
 170/-- The dividend is positive. -/
 171theorem cooperationDividend_pos : 0 < cooperationDividend := by
 172  unfold cooperationDividend
 173  exact div_pos (by norm_num) phi_pos
 174
 175/-- The dividend is strictly less than 1 (cooperation provides a
 176    strict surplus, but does not double the per-agent payoff). -/
 177theorem cooperationDividend_lt_one : cooperationDividend < 1 := by
 178  have ⟨_, h⟩ := cooperationDividend_band
 179  linarith
 180
 181/-! ## §4. Coalition payoff scaling
 182
 183For a coalition of `n` agents, the total cooperative payoff is
 184`n + 1/φ` times the per-agent defection baseline.  We prove the
 185strict inequality `n · π_def < (n + 1/φ) · π_def` for any positive
 186defection baseline.
 187-/
 188
 189/-- Coalition cooperation payoff (in defection-baseline units). -/
 190def coalitionPayoff (n : ℕ) (π_def : ℝ) : ℝ :=
 191  ((n : ℝ) + cooperationDividend) * π_def
 192
 193/-- Coalition payoff strictly exceeds n-fold defection payoff. -/
 194theorem coalition_strictly_better
 195    (n : ℕ) (π_def : ℝ) (hπ : 0 < π_def) :
 196    (n : ℝ) * π_def < coalitionPayoff n π_def := by
 197  unfold coalitionPayoff
 198  have hd_pos := cooperationDividend_pos
 199  nlinarith
 200
 201/-! ## §5. Master certificate -/
 202
 203/-- **GAME THEORY MASTER CERTIFICATE (element 84).**
 204
 205    1. Mutual cooperation has σ = +1.
 206    2. Mutual defection has σ = -1.
 207    3. Mutual defection is not σ-conservative.
 208    4. All non-DD outcomes are σ-conservative.
 209    5. Cooperation dividend = `1/φ ∈ (0.617, 0.622)`.
 210    6. Cooperation dividend is positive but strictly less than 1.
 211    7. Coalition cooperation strictly outperforms n-fold defection. -/
 212structure GameTheoryCert where
 213  CC_sigma : jointSigma ⟨.cooperate, .cooperate⟩ = 1
 214  DD_sigma : jointSigma ⟨.defect, .defect⟩ = -1
 215  DD_violates : ¬ isSigmaConservative ⟨.defect, .defect⟩
 216  nonDD_conservative :
 217    ∀ o : JointOutcome, ¬ (o.p1 = .defect ∧ o.p2 = .defect) →
 218      isSigmaConservative o
 219  dividend_band :
 220    0.617 < cooperationDividend ∧ cooperationDividend < 0.622
 221  dividend_strict_unit : 0 < cooperationDividend ∧ cooperationDividend < 1
 222  coalition_strict :
 223    ∀ (n : ℕ) (π_def : ℝ), 0 < π_def →
 224      (n : ℝ) * π_def < coalitionPayoff n π_def
 225
 226/-- The master certificate is inhabited. -/
 227def gameTheoryCert : GameTheoryCert where
 228  CC_sigma := CC_sigma_pos
 229  DD_sigma := DD_sigma_neg
 230  DD_violates := DD_not_sigma_conservative
 231  nonDD_conservative := nonDD_sigma_conservative
 232  dividend_band := cooperationDividend_band
 233  dividend_strict_unit := ⟨cooperationDividend_pos, cooperationDividend_lt_one⟩
 234  coalition_strict := coalition_strictly_better
 235
 236/-! ## §6. One-statement summary -/
 237
 238/-- **GAME THEORY: ONE-STATEMENT THEOREM (element 84).**
 239
 240    In the multi-agent ledger:
 241    (1) mutual cooperation has positive σ-charge,
 242    (2) mutual defection has negative σ-charge (the unique
 243        σ-violator in the 2x2 normal form),
 244    (3) the cooperation dividend is `1/φ ∈ (0.617, 0.622)`, and
 245    (4) any n-agent cooperative coalition strictly outperforms
 246        the n-fold defection baseline. -/
 247theorem game_theory_one_statement :
 248    -- (1) CC has σ = 1
 249    (jointSigma ⟨.cooperate, .cooperate⟩ = 1) ∧
 250    -- (2) DD has σ = -1
 251    (jointSigma ⟨.defect, .defect⟩ = -1) ∧
 252    -- (3) Dividend band
 253    (0.617 < cooperationDividend ∧ cooperationDividend < 0.622) ∧
 254    -- (4) Coalition payoff strictly larger
 255    (∀ (n : ℕ) (π_def : ℝ), 0 < π_def →
 256      (n : ℝ) * π_def < coalitionPayoff n π_def) :=
 257  ⟨CC_sigma_pos, DD_sigma_neg,
 258   cooperationDividend_band, coalition_strictly_better⟩
 259
 260end
 261
 262end CooperationFromSigma
 263end GameTheory
 264end IndisputableMonolith
 265

source mirrored from github.com/jonwashburn/shape-of-logic