Documentation

CslibFrontier.GameTheory.Reputation.Sybilproof

Transitive Trust Graphs and Sybilproof Reputation Mechanisms #

Formalizes transitive trust graphs, contraction-based Sybil strategies, symmetric impossibility theorems, and the value- and rank-sybilproofness properties of capacity-constrained maximum-flow and shortest-path (Pathrank) reputation mechanisms from Section 27.5 (Definitions 27.2–27.4 and 27.6, Theorems 27.5 and 27.7–27.9, Figure 27.2, and Exercise 27.8, pp. 689–693, 697) of Eric Friedman, Paul Resnick, and Rahul Sami, "Manipulation-Resistant Reputation Systems", Chapter 27 of Algorithmic Game Theory [FRS07], following Alice Cheng and Eric Friedman, "Sybilproof Reputation Mechanisms" [CF05].

Model and source mapping #

Main definitions #

Main results #

References #

Trust graphs and functorial contraction #

Loop-free directed trust graph with nonnegative real edge weights [FriedmanResnickSami2007, §27.5, p. 689; ChengFriedman2005, §3, p. 129].

  • weight : V → V → ℝ

    Nonnegative trust weight weight u v assigned by u to v (0 when absent).

  • weight_nonneg (u v : V) : 0 ≤ self.weight u v

    All trust weights are nonnegative.

  • weight_diag (v : V) : self.weight v v = 0

    Self-loops carry zero weight (weight v v = 0).

theorem Cslib.GameTheory.Reputation.TrustGraph.ext {V : Type u_1} {x y : TrustGraph V} (weight : x.weight = y.weight) :
x = y

Empty trust graph with zero trust on all pairs.

@[simp]
def Cslib.GameTheory.Reputation.TrustGraph.relabel {V : Type u_1} {V' : Type u_2} (e : V ≃ V') (G : TrustGraph V) :

Transport a trust graph along a bijection e : V ≃ V'.

@[simp]
theorem Cslib.GameTheory.Reputation.TrustGraph.relabel_weight {V : Type u_1} {V' : Type u_2} (e : V ≃ V') (G : TrustGraph V) (u' v' : V') :
(relabel e G).weight u' v' = G.weight (e.symm u') (e.symm v')
def Cslib.GameTheory.Reputation.TrustGraph.disjointUnion {V₁ : Type u_1} {V₂ : Type u_2} (G₁ : TrustGraph V₁) (G₂ : TrustGraph V₂) :
TrustGraph (V₁ ⊕ V₂)

Disjoint union G₁ ⊔ G₂ of two trust graphs on V₁ ⊕ V₂, with zero cross-component edges.

def Cslib.GameTheory.Reputation.TrustGraph.contract {V' : Type u_1} {V : Type u_2} [Fintype V'] [DecidableEq V] (π : V' → V) (G' : TrustGraph V') :

Contract a finite trust graph G' along π : V' → V, summing weights across distinct π-fibers and deleting induced self-loops [FriedmanResnickSami2007, Definition 27.2, p. 691; ChengFriedman2005, Definition 2, p. 129].

@[simp]
theorem Cslib.GameTheory.Reputation.TrustGraph.contract_weight_of_ne {V' : Type u_1} {V : Type u_2} [Fintype V'] [DecidableEq V] (π : V' → V) (G' : TrustGraph V') {u v : V} (huv : u ≠ v) :
(contract π G').weight u v = ∑ x : V' with π x = u, ∑ y : V' with π y = v, G'.weight x y
theorem Cslib.GameTheory.Reputation.TrustGraph.contract_contract {A : Type u_1} {B : Type u_2} {C : Type u_3} [Fintype A] [Fintype B] [DecidableEq B] [DecidableEq C] (f : A → B) (g : B → C) (G : TrustGraph A) :
contract g (contract f G) = contract (g ∘ f) G

Functoriality of trust-graph contraction: contracting along f and then g equals contracting along g ∘ f.

theorem Cslib.GameTheory.Reputation.TrustGraph.cutWeight_pullback_eq_contract {V' : Type u_1} {V : Type u_2} [Fintype V'] [DecidableEq V'] [Fintype V] [DecidableEq V] (π : V' → V) (G' : TrustGraph V') (X : Finset V) :

Pulling a vertex cut X ⊆ V back along π : V' → V preserves cutWeight identically against G'.contract π.

Contraction-based Sybil strategies (Definition 27.2) #

Sybil strategy (G', U') for user v in trust graph G ([FriedmanResnickSami2007, Definition 27.2, p. 691; ChengFriedman2005, Definition 2, p. 129]): an extended finite trust graph graph on Vertex with collapse map collapse : Vertex → V whose fiber over v is nonempty, whose non-v vertices correspond bijectively to honest users w ≠ v, and whose contraction graph.contract collapse recovers G.

The Sybil subset U' ⊆ S.Vertex of identities collapsing onto v.

def Cslib.GameTheory.Reputation.SybilStrategy.honest {V : Type} [Fintype V] [DecidableEq V] {G : TrustGraph V} {v : V} (S : SybilStrategy G v) (w : V) (hw : w ≠ v) :

Image of an honest user w ≠ v in S.Vertex.

@[simp]
theorem Cslib.GameTheory.Reputation.SybilStrategy.collapse_honest {V : Type} [Fintype V] [DecidableEq V] {G : TrustGraph V} {v : V} (S : SybilStrategy G v) (w : V) (hw : w ≠ v) :
S.collapse (S.honest w hw) = w
theorem Cslib.GameTheory.Reputation.SybilStrategy.honest_notMem_sybils {V : Type} [Fintype V] [DecidableEq V] {G : TrustGraph V} {v : V} (S : SybilStrategy G v) (w : V) (hw : w ≠ v) :
S.honest w hw ∉ S.sybils
theorem Cslib.GameTheory.Reputation.SybilStrategy.fiber_honest {V : Type} [Fintype V] [DecidableEq V] {G : TrustGraph V} {v : V} (S : SybilStrategy G v) {w : V} (hw : w ≠ v) :
{x : S.Vertex | S.collapse x = w} = {S.honest w hw}
theorem Cslib.GameTheory.Reputation.SybilStrategy.weight_honest_honest {V : Type} [Fintype V] [DecidableEq V] {G : TrustGraph V} {v : V} (S : SybilStrategy G v) {w₁ w₂ : V} (hw₁ : w₁ ≠ v) (hw₂ : w₂ ≠ v) :
S.graph.weight (S.honest w₁ hw₁) (S.honest w₂ hw₂) = G.weight w₁ w₂
theorem Cslib.GameTheory.Reputation.SybilStrategy.sum_weight_honest_sybils {V : Type} [Fintype V] [DecidableEq V] {G : TrustGraph V} {v : V} (S : SybilStrategy G v) {w : V} (hw : w ≠ v) :
∑ u ∈ S.sybils, S.graph.weight (S.honest w hw) u = G.weight w v
theorem Cslib.GameTheory.Reputation.SybilStrategy.sum_weight_sybils_honest {V : Type} [Fintype V] [DecidableEq V] {G : TrustGraph V} {v : V} (S : SybilStrategy G v) {w : V} (hw : w ≠ v) :
∑ u ∈ S.sybils, S.graph.weight u (S.honest w hw) = G.weight v w

Global reputation functions and symmetric impossibility (Theorems 27.5 & 27.7, §27.5.1) #

@[reducible, inline]

Global cardinal reputation aggregation mechanism F : TrustGraph V → V → ℝ [FriedmanResnickSami2007, §27.5, p. 689; ChengFriedman2005, Definition 1, p. 129].

Isomorphism invariance (symmetry) of a global reputation function [FriedmanResnickSami2007, §27.5, p. 690; ChengFriedman2005, Definition 6, p. 130].

Nontriviality: on at least one finite trust graph, F distinguishes two vertices [FriedmanResnickSami2007, §27.5, p. 689; ChengFriedman2005, §4.1, p. 130].

Value-sybilproofness ([FriedmanResnickSami2007, Definition 27.3, p. 691; ChengFriedman2005, Definition 5, p. 130]): no Sybil identity achieves strictly higher value than v's honest score.

Rank-sybilproofness ([FriedmanResnickSami2007, Definition 27.4, p. 691; ChengFriedman2005, Definition 3, p. 129]): no Sybil identity overtakes or ties an honest user w who strictly outranked v.

K-rank-sybilproofness ([FriedmanResnickSami2007, Definition 27.6, p. 691]): rank-sybilproofness against Sybil strategies creating at most K additional identities (|U'| ≤ K + 1).

Rank-strategyproofness ([FriedmanResnickSami2007, §27.5.1, p. 690]): no user v can improve her weak-order ranking relative to another user w (turning < into ≥ or ≤ into >) by unilaterally altering her outgoing trust ratings.

Theorem 27.7 ([FriedmanResnickSami2007, pp. 691–692]; [ChengFriedman2005, Theorem 2, p. 130]): for every 1 ≤ K, there is no nontrivial symmetric K-rank-sybilproof reputation function.

Theorem 27.5 ([FriedmanResnickSami2007, p. 691]; [ChengFriedman2005, Theorem 1, p. 130]): there is no nontrivial symmetric rank-sybilproof reputation function.

Section 27.5.1 impossibility ([FriedmanResnickSami2007, p. 690]): there is no nontrivial symmetric rank-strategyproof reputation function.

Seeded reputation functions, Max-Flow (Theorem 27.8), and Pathrank (Theorem 27.9) #

@[reducible, inline]

Seeded (rooted) cardinal reputation mechanism F : TrustGraph V → (seed : V) → V → ℝ [FriedmanResnickSami2007, §27.5, p. 690; ChengFriedman2005, §4.2, p. 130].

Value-sybilproofness for a seeded reputation function ([FriedmanResnickSami2007, Definition 27.3 & Theorem 27.8, pp. 691–692; ChengFriedman2005, Definition 5, p. 130]): no non-seed attacker v ≠ s can create a Sybil identity u ∈ S.sybils whose score from the seed exceeds v's honest score.

Rank-sybilproofness for a seeded reputation function ([FriedmanResnickSami2007, Definition 27.4 & Theorem 27.9, pp. 691–692; ChengFriedman2005, Definition 3, p. 129]): no non-seed attacker v ≠ s can create a Sybil identity u ∈ S.sybils that ties or overtakes any honest user w ≠ v who strictly outranked v.

Rank-strategyproofness for a seeded reputation function ([FriedmanResnickSami2007, §27.5.1, p. 690]): no non-seed user v ≠ s can boost her weak-order ranking relative to any w by changing her outgoing trust ratings.

Monotonicity of a seeded reputation function ([FriedmanResnickSami2007, §27.5, p. 690]): increasing the trust weight on an incoming edge (u, v) (u ≠ v) never reduces v's rank relative to any node w.

Maximum-flow reputation (maxFlowRep, Theorem 27.8 & Figure 27.2) #

noncomputable def Cslib.GameTheory.Reputation.maxFlowRep {V : Type} [Fintype V] [DecidableEq V] (G : TrustGraph V) (s v : V) :

Maximum-flow reputation from trusted seed s to v ([FriedmanResnickSami2007, §27.5, pp. 690, 692]): defined as minRealCutBetween G.weight s v, which equals the greatest value of a feasible real s–v flow whenever s ≠ v (isMaxRealFlow_maxFlowRep).

For every non-seed vertex v ≠ s, maxFlowRep G s v is the maximum value of a feasible real s–v flow in G (via isMaxRealFlow_minRealCutBetween).

Theorem 27.8 ([FriedmanResnickSami2007, p. 692]; [ChengFriedman2005, Theorem 4, p. 131]): the maximum-flow reputation mechanism is value-sybilproof.

Honest 3-vertex trust graph of Figure 27.2 ([FriedmanResnickSami2007, p. 692]) on Fin 3 (0 = s, 1 = a, 2 = b): edges s → a of capacity 1, a → b of capacity 7 / 10, and s → b of capacity 1 / 2.

Explicit 1-Sybil strategy for a = 1 in Figure 27.2 ([FriedmanResnickSami2007, p. 692; Exercise 27.8, p. 697]), which also leaves all incoming trust edges to a unmoved.

Failure of rank-sybilproofness for Max-Flow ([FriedmanResnickSami2007, p. 692, Figure 27.2; Exercise 27.8, p. 697]): maxFlowRep is not rank-sybilproof (even against a single extra Sybil with unmoved incoming links).

Pathrank reputation (pathrankDist, pathrankRep, Theorem 27.9 & §27.5.1) #

noncomputable def Cslib.GameTheory.Reputation.invTrustLen {V : Type u_1} (G : TrustGraph V) (u v : V) :

Inverse-trust edge length (ENNReal.ofReal (G.weight u v))⁻¹ : ℝ≥0∞ (⊤ when weight u v = 0) [FriedmanResnickSami2007, §27.5, p. 690].

noncomputable def Cslib.GameTheory.Reputation.walkInvTrustLen {V : Type u_1} (G : TrustGraph V) (p : List V) :

Total inverse-trust length of a walk represented by vertex sequence p : List V [FriedmanResnickSami2007, §27.5, p. 690].

@[simp]
theorem Cslib.GameTheory.Reputation.walkInvTrustLen_cons_cons {V : Type u_1} (G : TrustGraph V) (u v : V) (rest : List V) :
walkInvTrustLen G (u :: v :: rest) = invTrustLen G u v + walkInvTrustLen G (v :: rest)
noncomputable def Cslib.GameTheory.Reputation.pathrankDist {V : Type u_1} (G : TrustGraph V) (s v : V) :

Shortest inverse-trust walk distance from s to v in ℝ≥0∞ (0 at v = s, ⊤ if unreachable) [FriedmanResnickSami2007, §27.5, p. 690].

noncomputable def Cslib.GameTheory.Reputation.pathrankRep {V : Type u_1} (G : TrustGraph V) (s v : V) :

Pathrank reputation ((1 + pathrankDist G s v)⁻¹).toReal ∈ [0, 1] from trusted seed s to v (1 at v = s, 0 when v is unreachable, and strictly antitone in shortest inverse-trust distance pathrankDist G s v) [FriedmanResnickSami2007, §27.5, pp. 690, 692; ChengFriedman2005, §4.2, Theorem 5, p. 131].

@[simp]
@[simp]
theorem Cslib.GameTheory.Reputation.pathrankRep_self {V : Type u_1} (G : TrustGraph V) (s : V) :
pathrankRep G s s = 1
theorem Cslib.GameTheory.Reputation.pathrankRep_lt_iff {V : Type u_1} {W : Type u_2} (G₁ : TrustGraph V) (G₂ : TrustGraph W) (s₁ v₁ : V) (s₂ v₂ : W) :
pathrankRep G₁ s₁ v₁ < pathrankRep G₂ s₂ v₂ ↔ pathrankDist G₂ s₂ v₂ < pathrankDist G₁ s₁ v₁
theorem Cslib.GameTheory.Reputation.pathrankRep_le_iff {V : Type u_1} {W : Type u_2} (G₁ : TrustGraph V) (G₂ : TrustGraph W) (s₁ v₁ : V) (s₂ v₂ : W) :
pathrankRep G₁ s₁ v₁ ≤ pathrankRep G₂ s₂ v₂ ↔ pathrankDist G₂ s₂ v₂ ≤ pathrankDist G₁ s₁ v₁

Theorem 27.9 (value-sybilproofness) ([FriedmanResnickSami2007, p. 692]; [ChengFriedman2005, Theorem 4, p. 131]): pathrankRep is value-sybilproof.

Theorem 27.9 (rank-sybilproofness) ([FriedmanResnickSami2007, p. 692]; [ChengFriedman2005, Theorem 5, p. 131]): pathrankRep is rank-sybilproof.

Section 27.5.1 (rank-strategyproofness of Pathrank) ([FriedmanResnickSami2007, §27.5.1, p. 690]): pathrankRep is rank-strategyproof.

Section 27.5 (monotonicity of Pathrank) ([FriedmanResnickSami2007, §27.5, pp. 690, 692]): pathrankRep is monotonic in incoming edge trust weights.