Documentation

CslibFrontier.GameTheory.Security.CensorshipResistance

Red–Blue utility and censorship resistance in peer-to-peer networks #

Danezis and Anderson [DA05] (presented in [AMNO07], §25.4.1–§25.4.2, pp. 640–643, Equations (25.1)–(25.11)) model the trade-off between diversity and solidarity in censorship-resistant peer-to-peer storage networks. Each node i has a preference r_i ∈ [0, 1] for "red" resources (and b_i = 1 - r_i for "blue" resources) and derives quadratic-in-ratio, linear-in-volume utility

U_i(R, B) = -T (R / T - r_i - 1) (R / T - r_i + 1) = T (1 - (R / T - r_i)²)

from holding T = R + B resources (Eq. (25.1)). Under discretionary storage, a node holds its preferred mixture (r_i T, b_i T); under enforced random/DHT storage, it holds the systemwide average mixture (r_s T, b_s T) with r_s = R / (R + B), b_s = B / (R + B) (Eq. (25.2)).

When a censor attempts to impose mixture (r_c, b_c), a node with total capacity T diverts a defense budget t ∈ [0, T] to resist censorship, succeeding with probability P(t) and serving the remaining T - t resources (Eqs. (25.4) and (25.7)). Under the linear survival model P(t) = t / T (Eq. (25.5)), the optimal defense budgets t_d and t_s (Eqs. (25.6) and (25.8), clamped to [0, T]) satisfy t_s ≤ t_d pointwise and ∑ i ∈ S, t_{si} ≤ ∑ i ∈ S, t_{di} in aggregate (Eq. (25.11)), with the same monotonicity holding for every concave strictly increasing survival probability P with P(0) = 0.

Notes on primary-source subtleties #

Main definitions #

Main results #

References #

Red–Blue utility function (Eqs. (25.1)–(25.3)) #

noncomputable def Cslib.GameTheory.redBlueUtility (r R B : ℝ) :

Red–Blue node utility ([AMNO07], §25.4.1, Eq. (25.1), p. 640; [DA05]): utility U_i(R, B) = -(R + B) (R / (R + B) - r - 1) (R / (R + B) - r + 1) for a node with red preference r ∈ [0, 1] holding R red and B blue resources.

theorem Cslib.GameTheory.redBlueUtility_eq_mul_one_sub_sq (r R B : ℝ) :
redBlueUtility r R B = (R + B) * (1 - (R / (R + B) - r) ^ 2)

Quadratic simplification U_i(R, B) = (R + B) (1 - (R / (R + B) - r)²) of Eq. (25.1).

theorem Cslib.GameTheory.redBlueUtility_scale (r p q T : ℝ) (hpq : p + q = 1) :
redBlueUtility r (p * T) (q * T) = T * (1 - (p - r) ^ 2)

Utility of a normalized distribution (p, q) with p + q = 1 scaled by total volume T: U_i(p T, q T) = T (1 - (p - r)²).

theorem Cslib.GameTheory.redBlueUtility_unit (r p q : ℝ) (hpq : p + q = 1) :
redBlueUtility r p q = 1 - (p - r) ^ 2

Unit-volume utility U_i(p, q) = 1 - (p - r)² when p + q = 1.

@[simp]

A node holding one unit of its preferred mixture (r, 1 - r) attains unit utility 1.

theorem Cslib.GameTheory.redBlueUtility_homog (r p q T : ℝ) (hpq : p + q = 1) :
redBlueUtility r (p * T) (q * T) = T * redBlueUtility r p q

Homogeneity of redBlueUtility in total resource volume T for any normalized mixture p + q = 1.

theorem Cslib.GameTheory.redBlueUtility_nonneg {r R B : ℝ} (hr0 : 0 ≤ r) (hr1 : r ≤ 1) (hR : 0 ≤ R) (hB : 0 ≤ B) :

For r ∈ [0, 1] and nonnegative resource counts R, B ≥ 0, redBlueUtility r R B ≥ 0.

theorem Cslib.GameTheory.redBlueUtility_le_total {r R B : ℝ} (hT : 0 ≤ R + B) :
redBlueUtility r R B ≤ R + B

For R + B ≥ 0, redBlueUtility r R B ≤ R + B.

theorem Cslib.GameTheory.redBlueUtility_le_preferred {r p q T : ℝ} (hpq : p + q = 1) (hT : 0 ≤ T) :
redBlueUtility r (p * T) (q * T) ≤ redBlueUtility r (r * T) ((1 - r) * T)

Discretionary vs. arbitrary-mixture utility dominance ([AMNO07], §25.4.1, Eq. (25.3), p. 641; [DA05]): for T ≥ 0 and any mixture p + q = 1, U_i(p T, q T) ≤ U_i(r T, (1 - r) T).

theorem Cslib.GameTheory.redBlueUtility_eq_preferred_iff {r p q T : ℝ} (hpq : p + q = 1) (hT : 0 < T) :
redBlueUtility r (p * T) (q * T) = redBlueUtility r (r * T) ((1 - r) * T) ↔ p = r

Exact equality characterization for Eq. (25.3) ([AMNO07], §25.4.1, p. 641): for positive capacity T > 0 and mixture p + q = 1, a node achieves the same utility under (p T, q T) as under its preferred mixture (r T, (1 - r) T) if and only if p = r.

theorem Cslib.GameTheory.redBlueUtility_system_le_preferred {r R B T : ℝ} (hRB : R + B ≠ 0) (hT : 0 ≤ T) :
redBlueUtility r (R / (R + B) * T) (B / (R + B) * T) ≤ redBlueUtility r (r * T) ((1 - r) * T)

Random/DHT system-average utility inequality ([AMNO07], §25.4.1, Eqs. (25.2)–(25.3), p. 641): with systemwide ratios r_s = R / (R + B) and b_s = B / (R + B) (R + B ≠ 0), every node's random-storage utility is at most its discretionary utility.

General censorship-resistance expected utility and concave comparative statics #

noncomputable def Cslib.GameTheory.censorshipUtility (P : ℝ → ℝ) (T r_i r_keep r_c t : ℝ) :

Expected utility under censorship ([AMNO07], §25.4.2, Eqs. (25.4) and (25.7), pp. 641–642; [DA05]): a node with capacity T and preference r_i diverts defense effort t to resist a censor imposing (r_c, 1 - r_c); with probability P t it retains distribution (r_keep, 1 - r_keep) over the remaining T - t resources, and with probability 1 - P t the censor prevails.

Setting r_keep = r_i gives Eq. (25.4) (discretionary storage); setting r_keep = r_s gives Eq. (25.7) (enforced random/DHT storage).

theorem Cslib.GameTheory.censorshipUtility_eq (P : ℝ → ℝ) (T r_i r_keep r_c t : ℝ) :
censorshipUtility P T r_i r_keep r_c t = (T - t) * (P t * redBlueUtility r_i r_keep (1 - r_keep) + (1 - P t) * redBlueUtility r_i r_c (1 - r_c))

Reduced form of censorshipUtility via homogeneity in remaining capacity T - t.

theorem Cslib.GameTheory.strictConcaveOn_censorshipUtility {P : ℝ → ℝ} {T r_i r_keep r_c : ℝ} (hConc : ConcaveOn ℝ (Set.Icc 0 T) P) (hMono : StrictMonoOn P (Set.Icc 0 T)) (hHarm : redBlueUtility r_i r_c (1 - r_c) < redBlueUtility r_i r_keep (1 - r_keep)) :
StrictConcaveOn ℝ (Set.Icc 0 T) (censorshipUtility P T r_i r_keep r_c)

Strict concavity of expected utility under censorship: whenever censorship strictly harms the node (U_i(r_c, b_c) < U_i(r_keep, b_keep)) and P is concave and strictly increasing on [0, T], censorshipUtility P T r_i r_keep r_c is strictly concave on [0, T] (hence admits at most one optimal defense budget on [0, T]).

theorem Cslib.GameTheory.isMaxOn_censorshipUtility_zero_of_le {P : ℝ → ℝ} {T r_i r_keep r_c : ℝ} (hP0 : P 0 = 0) (hPnn : ∀ t ∈ Set.Icc 0 T, 0 ≤ P t) (huC : 0 ≤ redBlueUtility r_i r_c (1 - r_c)) (hBen : redBlueUtility r_i r_keep (1 - r_keep) ≤ redBlueUtility r_i r_c (1 - r_c)) :
IsMaxOn (censorshipUtility P T r_i r_keep r_c) (Set.Icc 0 T) 0

Pro-censor / indifferent nodes do not resist ([AMNO07], §25.4.2, p. 642): when P 0 = 0, 0 ≤ P t on [0, T], 0 ≤ U_i(r_c, b_c), and censorship does not reduce the node's unit utility (U_i(r_keep, b_keep) ≤ U_i(r_c, b_c)), zero defense effort t = 0 maximizes expected utility on [0, T].

theorem Cslib.GameTheory.defense_le_of_isMaxOn_censorshipUtility {P : ℝ → ℝ} {T r_i r_s r_c t_s t_d : ℝ} (hConc : ConcaveOn ℝ (Set.Icc 0 T) P) (hMono : StrictMonoOn P (Set.Icc 0 T)) (hP0 : P 0 = 0) (huC : 0 ≤ redBlueUtility r_i r_c (1 - r_c)) (hNondeg : 0 < redBlueUtility r_i r_s (1 - r_s) ∨ 0 < redBlueUtility r_i r_c (1 - r_c)) (hts_mem : t_s ∈ Set.Icc 0 T) (htd_mem : t_d ∈ Set.Icc 0 T) (hts_max : IsMaxOn (censorshipUtility P T r_i r_s r_c) (Set.Icc 0 T) t_s) (htd_max : IsMaxOn (censorshipUtility P T r_i r_i r_c) (Set.Icc 0 T) t_d) :
t_s ≤ t_d

General discretionary vs. random defense dominance (original generalization of [AMNO07], §25.4.2, Eq. (25.11), pp. 641–643): for every concave strictly increasing survival curve P on [0, T] with P 0 = 0, if 0 ≤ U_i(r_c, b_c) and the random objective is not identically zero (0 < U_i(r_s, b_s) ∨ 0 < U_i(r_c, b_c)), then any optimal defense effort t_s ∈ [0, T] under random storage (r_s, 1 - r_s) is at most any optimal defense effort t_d ∈ [0, T] under discretionary storage (r_i, 1 - r_i).

Linear survival model and closed-form optimal defense budgets (Eqs. (25.5)–(25.11)) #

noncomputable def Cslib.GameTheory.linearSurvival (T t : ℝ) :

Linear censorship-survival probability ([AMNO07], §25.4.2, Eq. (25.5), p. 642; [DA05]): P(t) = t / T.

noncomputable def Cslib.GameTheory.linearDefenseBudget (T u_keep u_c : ℝ) :

Clamped optimal defense budget under linear survival ([AMNO07], §25.4.2, Eqs. (25.6), (25.8), (25.9), and corrected Eq. (25.10), pp. 642–643): equals (T / 2) * ((2 * u_c - u_keep) / (u_c - u_keep)) when 2 * u_c < u_keep, and 0 otherwise.

noncomputable def Cslib.GameTheory.discretionaryDefenseBudget (T r_i r_c : ℝ) :

Optimal discretionary defense budget t_d ([AMNO07], §25.4.2, Eq. (25.6), p. 642), clamped to [0, T].

noncomputable def Cslib.GameTheory.randomDefenseBudget (T r_i r_s r_c : ℝ) :

Optimal random/DHT defense budget t_s ([AMNO07], §25.4.2, Eq. (25.8), p. 642), clamped to [0, T].

theorem Cslib.GameTheory.linearDefenseBudget_mem_Icc {T u_keep u_c : ℝ} (hT : 0 ≤ T) (huC : 0 ≤ u_c) :
linearDefenseBudget T u_keep u_c ∈ Set.Icc 0 (T / 2)

The optimal linear defense budget always lies in [0, T / 2] (hence in [0, T]) whenever 0 ≤ T and 0 ≤ u_c.

theorem Cslib.GameTheory.linearDefenseBudget_pos_iff {T u_keep u_c : ℝ} (hT : 0 < T) (huC : 0 ≤ u_c) :
0 < linearDefenseBudget T u_keep u_c ↔ 2 * u_c < u_keep

Positivity threshold for defense effort ([AMNO07], §25.4.2, Eq. (25.9) and corrected Eq. (25.10), printed p. 642): for 0 < T and 0 ≤ u_c, the optimal defense budget on [0, T] is strictly positive if and only if 2 * u_c < u_keep.

Note: the published book misprints Eq. (25.10) on p. 642 as 2 U_i(r_c, b_c) < U_i(r_c, b_c) instead of 2 U_i(r_c, b_c) < U_i(r_s, b_s).

theorem Cslib.GameTheory.isMaxOn_censorshipUtility_linear {T r_i r_keep r_c : ℝ} (hT : 0 < T) (huC : 0 ≤ redBlueUtility r_i r_c (1 - r_c)) :
IsMaxOn (censorshipUtility (linearSurvival T) T r_i r_keep r_c) (Set.Icc 0 T) (linearDefenseBudget T (redBlueUtility r_i r_keep (1 - r_keep)) (redBlueUtility r_i r_c (1 - r_c)))

Global optimality of linearDefenseBudget on [0, T] ([AMNO07], §25.4.2, Eqs. (25.5)–(25.8), p. 642): for 0 < T and 0 ≤ U_i(r_c, 1 - r_c), linearDefenseBudget T (U_i(r_keep, 1 - r_keep)) (U_i(r_c, 1 - r_c)) maximizes censorshipUtility (linearSurvival T) T r_i r_keep r_c over [0, T].

theorem Cslib.GameTheory.eq_linearDefenseBudget_of_isMaxOn {T r_i r_keep r_c t : ℝ} (hT : 0 < T) (huC : 0 ≤ redBlueUtility r_i r_c (1 - r_c)) (hNondeg : 0 < redBlueUtility r_i r_keep (1 - r_keep) ∨ 0 < redBlueUtility r_i r_c (1 - r_c)) (ht_mem : t ∈ Set.Icc 0 T) (ht_max : IsMaxOn (censorshipUtility (linearSurvival T) T r_i r_keep r_c) (Set.Icc 0 T) t) :
t = linearDefenseBudget T (redBlueUtility r_i r_keep (1 - r_keep)) (redBlueUtility r_i r_c (1 - r_c))

Uniqueness of the optimal defense budget under linear survival ([AMNO07], §25.4.2, Eqs. (25.6) and (25.8), p. 642): whenever the objective is not identically zero (0 < U_i(r_keep, 1 - r_keep) ∨ 0 < U_i(r_c, 1 - r_c)), linearDefenseBudget is the unique maximizer of censorshipUtility (linearSurvival T) on [0, T].

theorem Cslib.GameTheory.linearDefenseBudget_mono {T u₁ u₂ u_c : ℝ} (hT : 0 ≤ T) (huC : 0 ≤ u_c) (hle : u₁ ≤ u₂) :

Monotonicity of linearDefenseBudget in the retained unit utility u_keep.

theorem Cslib.GameTheory.linearDefenseBudget_lt_iff {T u₁ u₂ u_c : ℝ} (hT : 0 < T) (huC : 0 ≤ u_c) (hu1 : 0 ≤ u₁) (hle : u₁ ≤ u₂) :
linearDefenseBudget T u₁ u_c < linearDefenseBudget T u₂ u_c ↔ 2 * u_c < u₂ ∧ u₁ < u₂ ∧ (0 < u_c ∨ u₁ = 0)

Exact characterization of strict monotonicity of linearDefenseBudget in u_keep: strict inequality holds iff 2 * u_c < u₂, u₁ < u₂, and either 0 < u_c or u₁ = 0.

theorem Cslib.GameTheory.randomDefenseBudget_le_discretionaryDefenseBudget {T r_i r_s r_c : ℝ} (hT : 0 ≤ T) (hr0 : 0 ≤ r_i) (hr1 : r_i ≤ 1) (hc0 : 0 ≤ r_c) (hc1 : r_c ≤ 1) :

Pointwise discretionary vs. random defense inequality ([AMNO07], §25.4.2, p. 643): for every node i with r_i, r_c ∈ [0, 1] and capacity T ≥ 0, discretionary storage induces at least as large an optimal defense budget as random storage at any r_s.

theorem Cslib.GameTheory.randomDefenseBudget_lt_discretionaryDefenseBudget_iff {T r_i r_s r_c : ℝ} (hT : 0 < T) (hr0 : 0 ≤ r_i) (hr1 : r_i ≤ 1) (hs0 : 0 ≤ r_s) (hs1 : r_s ≤ 1) (hc0 : 0 ≤ r_c) (hc1 : r_c ≤ 1) :
randomDefenseBudget T r_i r_s r_c < discretionaryDefenseBudget T r_i r_c ↔ 2 * redBlueUtility r_i r_c (1 - r_c) < 1 ∧ r_s ≠ r_i ∧ (0 < redBlueUtility r_i r_c (1 - r_c) ∨ redBlueUtility r_i r_s (1 - r_s) = 0)

Exact strictness characterization for t_s < t_d (refining the homogeneity remark after Eq. (25.11) in [AMNO07], §25.4.2, p. 643): for 0 < T and r_i, r_s, r_c ∈ [0, 1], randomDefenseBudget T r_i r_s r_c < discretionaryDefenseBudget T r_i r_c holds if and only if 2 U_i(r_c, 1 - r_c) < 1, r_s ≠ r_i, and either 0 < U_i(r_c, 1 - r_c) or U_i(r_s, 1 - r_s) = 0.

theorem Cslib.GameTheory.sum_randomDefenseBudget_le_sum_discretionaryDefenseBudget {ι : Type u_1} (S : Finset ι) (T r : ι → ℝ) (r_s r_c : ℝ) (hT : ∀ i ∈ S, 0 ≤ T i) (hr0 : ∀ i ∈ S, 0 ≤ r i) (hr1 : ∀ i ∈ S, r i ≤ 1) (hc0 : 0 ≤ r_c) (hc1 : r_c ≤ 1) :
∑ i ∈ S, randomDefenseBudget (T i) (r i) r_s r_c ≤ ∑ i ∈ S, discretionaryDefenseBudget (T i) (r i) r_c

Aggregate censorship-cost dominance (Eq. (25.11)) ([AMNO07], §25.4.2, Eq. (25.11), p. 643; [DA05]): for any target node subset S : Finset ι, the aggregate defense budget (censorship cost) under discretionary storage is at least that under enforced random storage.

theorem Cslib.GameTheory.sum_randomDefenseBudget_lt_sum_discretionaryDefenseBudget {ι : Type u_1} (S : Finset ι) (T r : ι → ℝ) (r_s r_c : ℝ) (hT : ∀ i ∈ S, 0 ≤ T i) (hr0 : ∀ i ∈ S, 0 ≤ r i) (hr1 : ∀ i ∈ S, r i ≤ 1) (hs0 : 0 ≤ r_s) (hs1 : r_s ≤ 1) (hc0 : 0 ≤ r_c) (hc1 : r_c ≤ 1) {i₀ : ι} (hi₀ : i₀ ∈ S) (hTi₀ : 0 < T i₀) (hne : r_s ≠ r i₀) (hActive : 2 * redBlueUtility (r i₀) r_c (1 - r_c) < 1) (hNondeg : 0 < redBlueUtility (r i₀) r_c (1 - r_c) ∨ redBlueUtility (r i₀) r_s (1 - r_s) = 0) :
∑ i ∈ S, randomDefenseBudget (T i) (r i) r_s r_c < ∑ i ∈ S, discretionaryDefenseBudget (T i) (r i) r_c

Strict aggregate censorship-cost advantage: if at least one targeted node i₀ ∈ S has positive capacity T i₀ > 0, disagrees with the system ratio (r i₀ ≠ r_s), and faces an active non-degenerate censor (2 U_{i₀}(r_c, 1 - r_c) < 1 and 0 < U_{i₀}(r_c, 1 - r_c) ∨ U_{i₀}(r_s, 1 - r_s) = 0), then discretionary storage strictly increases aggregate censorship cost over random storage.

theorem Cslib.GameTheory.sum_randomDefenseBudget_eq_of_homogeneous {ι : Type u_1} (S : Finset ι) (T r : ι → ℝ) (r_s r_c : ℝ) (hHom : ∀ i ∈ S, r i = r_s) :
∑ i ∈ S, randomDefenseBudget (T i) (r i) r_s r_c = ∑ i ∈ S, discretionaryDefenseBudget (T i) (r i) r_c

Homogeneous-preference equality ([AMNO07], §25.4.2, p. 643): when every node in S shares the systemwide preference r i = r_s, discretionary and random storage yield identical aggregate defense budgets.