Documentation

CslibFrontier.GameTheory.Reputation.RepeatedPD

Infinitely Repeated Prisoner's Dilemma, Reputations, and Whitewashing #

Formalizes the infinitely repeated Prisoner's Dilemma, reputational trigger strategies, and the cheap-pseudonym whitewashing / Pay-Your-Dues (PYD) model from Sections 27.2–27.3 and Exercises 27.1–27.5 of Eric Friedman, Paul Resnick, and Rahul Sami, "Manipulation-Resistant Reputation Systems", Chapter 27 of Algorithmic Game Theory [FRS07], following [FR01].

Model and source mapping #

Main definitions #

Main results #

References #

Stage Prisoner's Dilemma #

Stage-game action in the Prisoner's Dilemma [FriedmanResnickSami2007, §27.2, p. 680].

Instances For

    Stage payoff to the row player in the Prisoner's Dilemma of [FriedmanResnickSami2007, §27.2, p. 680]: π(C, C) = 1, π(D, D) = 0, π(D, C) = 2, and π(C, D) = -1.

    Sum of both players' stage payoffs [FriedmanResnickSami2007, §27.3, p. 682].

    Normalized discounted average payoffs #

    noncomputable def Cslib.GameTheory.Reputation.discountedPayoff (δ : ℝ) (u : ℕ → ℝ) :

    Normalized discounted average payoff (1 - δ) * ∑_{t=0}^∞ δ^t u_t [FriedmanResnickSami2007, §27.2, p. 681].

    theorem Cslib.GameTheory.Reputation.summable_pow_mul_of_bdd {δ B : ℝ} (hδ₀ : 0 ≤ δ) (hδ₁ : δ < 1) {u : ℕ → ℝ} (hu : ∀ (t : ℕ), |u t| ≤ B) :
    Summable fun (t : ℕ) => δ ^ t * u t
    @[simp]
    theorem Cslib.GameTheory.Reputation.discountedPayoff_const {δ : ℝ} (hδ₀ : 0 ≤ δ) (hδ₁ : δ < 1) (c : ℝ) :
    (discountedPayoff δ fun (x : ℕ) => c) = c

    Exercise 27.1 ([FriedmanResnickSami2007, p. 696]): if the stage payoff is constant c, then the normalized discounted average payoff equals c.

    theorem Cslib.GameTheory.Reputation.discountedPayoff_cons {δ B : ℝ} (hδ₀ : 0 ≤ δ) (hδ₁ : δ < 1) {u : ℕ → ℝ} (hu : ∀ (t : ℕ), |u t| ≤ B) :
    discountedPayoff δ u = (1 - δ) * u 0 + δ * discountedPayoff δ fun (t : ℕ) => u (t + 1)

    One-step Bellman decomposition of discountedPayoff on bounded streams.

    theorem Cslib.GameTheory.Reputation.discountedPayoff_le_of_forall_le {δ B : ℝ} (hδ₀ : 0 ≤ δ) (hδ₁ : δ < 1) {u v : ℕ → ℝ} (hu : ∀ (t : ℕ), |u t| ≤ B) (hv : ∀ (t : ℕ), |v t| ≤ B) (huv : ∀ (t : ℕ), u t ≤ v t) :
    theorem Cslib.GameTheory.Reputation.abs_discountedPayoff_le {δ B : ℝ} (hδ₀ : 0 ≤ δ) (hδ₁ : δ < 1) {u : ℕ → ℝ} (hu : ∀ (t : ℕ), |u t| ≤ B) :

    Public histories, continuation payoffs, and the one-shot deviation principle #

    Outcome of a single round of the repeated Prisoner's Dilemma.

    • act₁ : PDAction

      Action played by player 1.

    • act₂ : PDAction

      Action played by player 2.

    Instances For

      Swap the two players' coordinates of a stage outcome.

      @[reducible, inline]

      Finite public history of past stage outcomes, in chronological order.

      @[reducible, inline]

      Pure public-history strategy in the infinitely repeated Prisoner's Dilemma.

      Public history after t additional rounds of play from h under (σ₁, σ₂).

      Stage outcome t rounds after h under (σ₁, σ₂).

      @[simp]
      theorem Cslib.GameTheory.Reputation.historyAfter_zero (σ₁ σ₂ : PDStrategy) (h : PDHistory) :
      historyAfter σ₁ σ₂ h 0 = h
      @[simp]
      theorem Cslib.GameTheory.Reputation.roundAt_zero (σ₁ σ₂ : PDStrategy) (h : PDHistory) :
      roundAt σ₁ σ₂ h 0 = { act₁ := σ₁ h, act₂ := σ₂ h }
      @[simp]
      theorem Cslib.GameTheory.Reputation.roundAt_succ (σ₁ σ₂ : PDStrategy) (h : PDHistory) (t : ℕ) :
      roundAt σ₁ σ₂ h (t + 1) = roundAt σ₁ σ₂ (h ++ [{ act₁ := σ₁ h, act₂ := σ₂ h }]) t
      noncomputable def Cslib.GameTheory.Reputation.contPayoff₁ (δ : ℝ) (σ₁ σ₂ : PDStrategy) (h : PDHistory) :

      Player 1's normalized discounted continuation payoff from public history h.

      noncomputable def Cslib.GameTheory.Reputation.contPayoff₂ (δ : ℝ) (σ₁ σ₂ : PDStrategy) (h : PDHistory) :

      Player 2's normalized discounted continuation payoff from public history h.

      theorem Cslib.GameTheory.Reputation.contPayoff₁_bellman {δ : ℝ} (hδ₀ : 0 ≤ δ) (hδ₁ : δ < 1) (σ₁ σ₂ : PDStrategy) (h : PDHistory) :
      contPayoff₁ δ σ₁ σ₂ h = (1 - δ) * pdPayoff (σ₁ h) (σ₂ h) + δ * contPayoff₁ δ σ₁ σ₂ (h ++ [{ act₁ := σ₁ h, act₂ := σ₂ h }])
      theorem Cslib.GameTheory.Reputation.contPayoff₂_bellman {δ : ℝ} (hδ₀ : 0 ≤ δ) (hδ₁ : δ < 1) (σ₁ σ₂ : PDStrategy) (h : PDHistory) :
      contPayoff₂ δ σ₁ σ₂ h = (1 - δ) * pdPayoff (σ₂ h) (σ₁ h) + δ * contPayoff₂ δ σ₁ σ₂ (h ++ [{ act₁ := σ₁ h, act₂ := σ₂ h }])
      theorem Cslib.GameTheory.Reputation.abs_contPayoff₁_le_two {δ : ℝ} (hδ₀ : 0 ≤ δ) (hδ₁ : δ < 1) (σ₁ σ₂ : PDStrategy) (h : PDHistory) :
      |contPayoff₁ δ σ₁ σ₂ h| ≤ 2
      theorem Cslib.GameTheory.Reputation.abs_contPayoff₂_le_two {δ : ℝ} (hδ₀ : 0 ≤ δ) (hδ₁ : δ < 1) (σ₁ σ₂ : PDStrategy) (h : PDHistory) :
      |contPayoff₂ δ σ₁ σ₂ h| ≤ 2

      Strategy pair (σ₁, σ₂) is a subgame-perfect Nash equilibrium (SPNE) at discount factor δ if neither player can strictly increase their continuation payoff after any finite public history h [FriedmanResnickSami2007, §27.2, p. 681].

      Absence of profitable one-shot deviations for both players at every finite public history h [FriedmanResnickSami2007, §27.2, p. 681].

      theorem Cslib.GameTheory.Reputation.isSPNE_iff_noOneShotDev {δ : ℝ} (hδ₀ : 0 ≤ δ) (hδ₁ : δ < 1) (σ₁ σ₂ : PDStrategy) :
      IsSPNE δ σ₁ σ₂ ↔ NoOneShotDev δ σ₁ σ₂

      One-shot deviation principle for the infinitely repeated Prisoner's Dilemma ([FriedmanResnickSami2007, §27.2, p. 681]): for 0 ≤ δ < 1, (σ₁, σ₂) is an SPNE if and only if neither player has a profitable one-shot deviation after any finite history.

      Grim trigger, Naive Grim, and Tit-for-Tat #

      Whether every round in history h was mutual cooperation (C, C).

      Grim trigger strategy: cooperate unless any player has defected in a previous round [FriedmanResnickSami2007, §27.2, p. 681].

      theorem Cslib.GameTheory.Reputation.contPayoff₁_grim {δ : ℝ} (hδ₀ : 0 ≤ δ) (hδ₁ : δ < 1) (h : PDHistory) :
      theorem Cslib.GameTheory.Reputation.contPayoff₂_grim {δ : ℝ} (hδ₀ : 0 ≤ δ) (hδ₁ : δ < 1) (h : PDHistory) :
      theorem Cslib.GameTheory.Reputation.isSPNE_grim_iff {δ : ℝ} (hδ₀ : 0 ≤ δ) (hδ₁ : δ < 1) :
      IsSPNE δ grim grim ↔ 1 / 2 ≤ δ

      Grim trigger SPNE characterization ([FriedmanResnickSami2007, §27.2, p. 681]): for 0 ≤ δ < 1, (grim, grim) is a subgame-perfect Nash equilibrium if and only if 1 / 2 ≤ δ.

      Naive Grim for player 1: cooperate unless player 2 has defected in a previous round [FriedmanResnickSami2007, Exercise 27.3, p. 696].

      Naive Grim for player 2: cooperate unless player 1 has defected in a previous round [FriedmanResnickSami2007, Exercise 27.3, p. 696].

      Exercise 27.3 ([FriedmanResnickSami2007, p. 696]): defining Grim as "cooperate unless the other player has defected" fails subgame perfection for every 0 ≤ δ < 1, because after the off-path history [⟨D, C⟩] player 1 is required to cooperate once against player 2's permanent defection (-1 instead of 0).

      Tit-for-Tat for player 1: cooperate initially, then copy player 2's last action [FriedmanResnickSami2007, Exercise 27.2, p. 696].

      Tit-for-Tat for player 2: cooperate initially, then copy player 1's last action [FriedmanResnickSami2007, Exercise 27.2, p. 696].

      theorem Cslib.GameTheory.Reputation.isSPNE_titForTat_iff {δ : ℝ} (hδ₀ : 0 ≤ δ) (hδ₁ : δ < 1) :

      Tit-for-Tat SPNE characterization ([FriedmanResnickSami2007, Exercise 27.2, p. 696]): under NRTV's stage payoffs (1, 2, 0, -1), (titForTat₁, titForTat₂) is an SPNE if and only if δ = 1 / 2. For δ < 1 / 2, player 1 profitably defects at []; for 1 / 2 < δ < 1, player 2 profitably forgives (plays C) after [⟨D, C⟩] to restore (C, C) instead of alternating.

      theorem Cslib.GameTheory.Reputation.not_isSPNE_titForTat_of_ne {δ : ℝ} (hδ₀ : 0 ≤ δ) (hδ₁ : δ < 1) (hne : δ ≠ 1 / 2) :

      Personalized-Grim under random matching (§27.2 & Exercise 27.5) #

      Expected normalized discounted payoff from defecting once against a current partner under personalized-Grim in a population of N + 1 players (N potential partners, matched uniformly with probability 1 / N in each subsequent period): immediate payoff 2, followed by expected stage payoff (N - 1) / N in every future period [FriedmanResnickSami2007, §27.2, p. 681; Exercise 27.5, p. 697].

      theorem Cslib.GameTheory.Reputation.personalizedGrim_incentive_iff {δ : ℝ} (hδ₀ : 0 ≤ δ) (hδ₁ : δ < 1) {N : ℕ} (hN : 1 ≤ N) :
      personalizedGrimDevPayoff δ N ≤ 1 ↔ ↑N / (↑N + 1) ≤ δ

      Exercise 27.5 ([FriedmanResnickSami2007, §27.2, p. 681 & p. 697]): in the closed-form expected stream personalizedGrimDevPayoff δ N for N ≥ 1 potential partners under uniform 1 / N matching, Personalized-Grim deters a one-shot defection (personalizedGrimDevPayoff δ N ≤ 1) if and only if (N : ℝ) / (N + 1) ≤ δ.

      Whitewashing entry fees and Pay-Your-Dues (§27.3 & Exercise 27.4) #

      Normalized discounted payoff of paying upfront registration fee f once at t = 0 and cooperating forever under Reputational-Grim [FriedmanResnickSami2007, §27.3, p. 682].

      Normalized discounted payoff of paying f at t = 0, defecting in round 0 for 2 - f, paying f again at t = 1 to whitewash, and cooperating thereafter [FriedmanResnickSami2007, §27.3, p. 682].

      Normalized discounted payoff of defecting and whitewashing in every period (2 - f per round) [FriedmanResnickSami2007, §27.3, p. 682].

      theorem Cslib.GameTheory.Reputation.honestEntryPayoff_eq {δ : ℝ} (hδ₀ : 0 ≤ δ) (hδ₁ : δ < 1) (f : ℝ) :
      honestEntryPayoff δ f = 1 - (1 - δ) * f
      theorem Cslib.GameTheory.Reputation.oneShotWhitewashPayoff_eq {δ : ℝ} (hδ₀ : 0 ≤ δ) (hδ₁ : δ < 1) (f : ℝ) :
      oneShotWhitewashPayoff δ f = 1 + (1 - δ) * (1 - (1 + δ) * f)
      theorem Cslib.GameTheory.Reputation.entryFee_deters_whitewashing_iff {δ f : ℝ} (hδ₀ : 0 < δ) (hδ₁ : δ < 1) :

      Entry-fee deterrence of whitewashing ([FriedmanResnickSami2007, §27.3, p. 682]; [FR01]): for 0 < δ < 1, in the closed-form discounted streams above, upfront registration fee f deters one-shot whitewashing (oneShotWhitewashPayoff δ f ≤ honestEntryPayoff δ f) if and only if 1 / δ ≤ f.

      In the closed-form discounted stream perpetualWhitewashPayoff, perpetual defect-and-whitewash is deterred by the exact same registration threshold 1 / δ ≤ f [FriedmanResnickSami2007, §27.3, p. 682].

      Reputation standing of a pseudonym in the Pay-Your-Dues (PYD) norm [FriedmanResnickSami2007, §27.3, p. 682].

      Instances For

        Pay-Your-Dues (PYD) action rule [FriedmanResnickSami2007, §27.3, p. 682]: cooperate with goodVeterans, defect against badVeterans, and against a newcomer cooperate only if one is also a newcomer (veterans defect against newcomers).

        def Cslib.GameTheory.Reputation.pydNextStanding (selfStanding partnerStanding : ReputationStanding) (act : PDAction) (whitewash : Bool) :

        Next-period standing under PYD, allowing optional free whitewashing (whitewash = true resets the pseudonym to .newcomer) [FriedmanResnickSami2007, §27.3, p. 682].

        Continuation value against a community of goodVeteran partners when playing PYD (with badVeteran whitewashing to newcomer when 1 / 2 ≤ δ, or max 0 (2 * δ - 1) in general) [FriedmanResnickSami2007, §27.3, p. 682; Exercise 27.4, p. 697].

        theorem Cslib.GameTheory.Reputation.pyd_incentive_iff {δ : ℝ} (hδ₀ : 0 ≤ δ) (hδ₁ : δ < 1) :
        (∀ s ∈ {ReputationStanding.newcomer, ReputationStanding.goodVeteran}, ∀ (partner : ReputationStanding) (a : PDAction) (w : Bool), (1 - δ) * pdPayoff a (pydAction partner s) + δ * pydContValue δ (pydNextStanding s partner a w) ≤ (1 - δ) * pdPayoff (pydAction s partner) (pydAction partner s) + δ * pydContValue δ (pydNextStanding s partner (pydAction s partner) false)) ↔ 1 / 2 ≤ δ

        Pay-Your-Dues one-step Bellman threshold ([FriedmanResnickSami2007, §27.3, p. 682 & Exercise 27.4, p. 697]; [FR01]): for 0 ≤ δ < 1, under the closed-form continuation values pydContValue δ, following pydAction without whitewashing at .newcomer and .goodVeteran weakly dominates every stage action a : PDAction and whitewashing choice w : Bool across all partner standings partner : ReputationStanding if and only if 1 / 2 ≤ δ.

        Strict optimality of PYD cooperation in Exercise 27.4 ([FriedmanResnickSami2007, p. 697]): when 1 / 2 < δ < 1, defecting instead of cooperating as a goodVeteran or newcomer is strictly unprofitable under any subsequent whitewashing choice w : Bool.