Documentation

CslibFrontier.GameTheory.Network.InfluenceModels

Probabilistic Threshold and Cascade Models of Network Influence #

This module formalizes the general threshold and probabilistic cascade models of social contagion on finite directed graphs from [Kle07], Section 24.3 (pp. 618–622), due to [KKT03] and [KKT05]:

  1. General Threshold Model (GeneralThresholdModel G, pp. 619–620): each vertex v carries a monotone [0, 1]-valued threshold function thresholdFn v : Finset V → ℝ (g_v(∅) = 0) depending only on its active in-neighbors inNeighbors G v, draws an independent uniform threshold θ v ∈ [0, 1], and activates once θ v ≤ g_v(A).
  2. Linear Threshold Model (LinearThresholdModel G, p. 619): specialization with nonnegative incoming edge weights weight u v summing to at most 1 at each vertex (toGeneralThresholdModel).
  3. Order-Independent Cascade Model (CascadeModel G, pp. 620–621): active vertices attempt to activate inactive out-neighbors sequentially with incremental success probability prob v u X, whose sequential survival probability is invariant under reordering of attempts, together with the diminishing-returns predicate (HasDiminishingReturns) and the Independent Cascade Model (IndependentCascadeModel G, p. 621).
  4. Equivalence of General Threshold and Cascade Models ([KKT05]; [Kle07], Section 24.3, pp. 620–621): explicit forward and backward translations GeneralThresholdModel.toCascadeModel and CascadeModel.toGeneralThresholdModel produce identical distributions over final active sets (CascadeModel.activeSetProb_eq_toGeneralThresholdModel, GeneralThresholdModel.activeSetProb_toCascadeModel) and identical expected influence under every valid edge-attempt schedule.
  5. Time-layered DAG reduction ([KKT03]; [Kle07], Section 24.3, pp. 621–622): T steps of a synchronous nonprogressive threshold process on G coincide slice by slice with the progressive threshold process on the layered digraph timeLayeredDigraph G T over V × Fin (T + 1) (mem_thresholdFinal_toTimeLayered_iff).

Main definitions #

Main results #

References #

Directed in-neighborhoods #

Incoming neighbors {u | G.Adj u v} of vertex v in G : Digraph V, matching the neighbor convention of [Kle07], Section 24.3, p. 619, Footnote 1.

@[simp]
theorem Cslib.GameTheory.Network.mem_inNeighbors {V : Type u_1} [Fintype V] {G : Digraph V} [DecidableRel G.Adj] {u v : V} :
u ∈ inNeighbors G v ↔ G.Adj u v

General and Linear Threshold Models #

General Threshold Model on a finite directed graph G : Digraph V ([Kle07], Section 24.3, pp. 619–620): each vertex v has a monotone [0, 1]-valued threshold function thresholdFn v (g_v(∅) = 0) determined by its active incoming neighbors inNeighbors G v.

  • thresholdFn : V → Finset V → ℝ

    Local threshold function g_v(X) for cumulative influence of active set X on v.

  • thresholdFn_empty (v : V) : self.thresholdFn v ∅ = 0

    Empty active set exerts zero influence (g_v(∅) = 0, [Kle07], Section 24.4, p. 623).

  • thresholdFn_le_one (v : V) (X : Finset V) : self.thresholdFn v X ≤ 1

    Local threshold values are at most 1.

  • monotone (v : V) : Monotone (self.thresholdFn v)

    Adding active vertices never decreases g_v(X).

  • inNeighbors_congr (v : V) (X : Finset V) : self.thresholdFn v (X ∩ inNeighbors G v) = self.thresholdFn v X

    g_v(X) depends only on active incoming neighbors X ∩ inNeighbors G v.

theorem Cslib.GameTheory.Network.GeneralThresholdModel.ext {V : Type u_1} {inst✝ : DecidableEq V} {inst✝¹ : Fintype V} {G : Digraph V} {inst✝² : DecidableRel G.Adj} {x y : GeneralThresholdModel G} (thresholdFn : x.thresholdFn = y.thresholdFn) :
x = y
theorem Cslib.GameTheory.Network.GeneralThresholdModel.ext_iff {V : Type u_1} {inst✝ : DecidableEq V} {inst✝¹ : Fintype V} {G : Digraph V} {inst✝² : DecidableRel G.Adj} {x y : GeneralThresholdModel G} :

Linear Threshold Model on G : Digraph V ([Kle07], Section 24.3, p. 619): each directed edge (u, v) carries weight weight u v ≥ 0 with incoming sum at most 1 at every vertex v.

  • weight : V → V → ℝ

    Nonnegative influence weight b_{vu} = weight u v exerted by u on v.

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

    Edge weights are nonnegative.

  • weight_eq_zero_of_not_adj (u v : V) : ¬G.Adj u v → self.weight u v = 0

    Weights vanish on non-edges of G.

  • sum_inNeighbors_le_one (v : V) : ∑ u ∈ inNeighbors G v, self.weight u v ≤ 1

    Incoming weights into each vertex sum to at most 1.

Embed a LinearThresholdModel as a GeneralThresholdModel via additive neighbor sums g_v(X) = ∑ u ∈ X ∩ N(v), weight u v ([Kle07], Section 24.3, pp. 619–620).

Uniform [0, 1] product measure #

Uniform probability measure on [0, 1] ⊆ ℝ.

Instances For

    Product uniform probability measure on [0, 1]^V governing node thresholds ([Kle07], Section 24.3, pp. 619–620).

    Instances For

      Under thresholdMeasure V, almost every threshold draw satisfies θ v ∈ (0, 1) at every vertex v : V.

      Progressive Threshold Dynamics and Outcome Distribution #

      One synchronous progressive activation step under threshold realization θ : V → ℝ ([Kle07], Section 24.3, p. 620): active vertices stay active, and every vertex v with θ v ≤ g_v(A) becomes active.

      @[simp]

      Final active set after |V| progressive steps from seed set S under thresholds θ ([Kle07], Section 24.4, p. 623).

      Every vertex remaining inactive at thresholdFinal θ S has threshold strictly above g_v(thresholdFinal θ S).

      theorem Cslib.GameTheory.Network.GeneralThresholdModel.thresholdFinal_subset_of_lt {V : Type u_1} [DecidableEq V] [Fintype V] {G : Digraph V} [DecidableRel G.Adj] (M : GeneralThresholdModel G) {θ : V → ℝ} {S B : Finset V} (hSB : S ⊆ B) (hclosed : ∀ v ∉ B, M.thresholdFn v B < θ v) :
      M.thresholdFinal θ S ⊆ B

      Least post-fixed point property of thresholdFinal: if S ⊆ B and every vertex outside B has threshold strictly above g_v(B), then thresholdFinal θ S ⊆ B.

      Piecemeal growth identity ([MR07b]): running from S first and then adding T under the same thresholds θ produces the exact same final set as starting from S ∪ T.

      theorem Cslib.GameTheory.Network.GeneralThresholdModel.thresholdFinal_eq_iff_piecewise {V : Type u_1} [DecidableEq V] [Fintype V] {G : Digraph V} [DecidableRel G.Adj] (M : GeneralThresholdModel G) (θ : V → ℝ) (S K : Finset V) :
      M.thresholdFinal θ S = K ↔ M.thresholdFinal (K.piecewise θ fun (x : V) => 2) S = K ∧ ∀ v ∉ K, M.thresholdFn v K < θ v

      Factorization of the event M.thresholdFinal θ S = K into coordinates inside K and independent survival inequalities g_v(K) < θ v on Kᶜ.

      Probability (thresholdMeasure V).real {θ | M.thresholdFinal θ S = A} that the progressive threshold process starting from S terminates at exact active set A.

      Expected number of active nodes f(S) = E_θ[|thresholdFinal θ S|] at the end of the process ([Kle07], Section 24.4, p. 623).

      If every inactive vertex outside S has zero threshold value g_v(S) = 0, no additional vertices activate almost surely and M.influence S = S.card.

      If every inactive vertex outside S already has saturated threshold g_v(S) = 1, the entire vertex set activates in one step almost surely and M.influence S = Fintype.card V.

      Order-Independent and Independent Cascade Models #

      def Cslib.GameTheory.Network.seqSurvival {V : Type u_1} [DecidableEq V] (p : V → V → Finset V → ℝ) (v : V) :
      List V → Finset V → ℝ

      Sequential survival probability ∏_{i=1}^k (1 - p_v(u_i, X_{i-1})) when neighbors in us attempt to activate v in list order after failed set X ([Kle07], Section 24.3, p. 621).

      Order-Independent Cascade Model on G : Digraph V ([KKT05]; [Kle07], Section 24.3, pp. 620–621): active in-neighbors u attempt to activate inactive v with incremental success probability prob v u X, where sequential survival is invariant under permuting attempt order (swap_survival).

      • prob : V → V → Finset V → ℝ

        Incremental probability p_v(u, X) that u activates v given failed set X.

      • prob_nonneg (v u : V) (X : Finset V) : 0 ≤ self.prob v u X

        Incremental probabilities are nonnegative.

      • prob_le_one (v u : V) (X : Finset V) : self.prob v u X ≤ 1

        Incremental probabilities are at most 1.

      • prob_eq_zero_of_not_adj (v u : V) (X : Finset V) : ¬G.Adj u v → self.prob v u X = 0

        Non-neighbors exert zero activation probability.

      • inNeighbors_congr (v u : V) (X : Finset V) : self.prob v u (X ∩ inNeighbors G v) = self.prob v u X

        Failed-history dependence looks only at incoming neighbors X ∩ inNeighbors G v.

      • swap_survival (v u₁ u₂ : V) (X : Finset V) : u₁ ≠ u₂ → u₁ ∉ X → u₂ ∉ X → (1 - self.prob v u₁ X) * (1 - self.prob v u₂ (insert u₁ X)) = (1 - self.prob v u₂ X) * (1 - self.prob v u₁ (insert u₂ X))

        Order-independence of two-step survival probabilities for distinct untried vertices.

      Independent Cascade Model on G : Digraph V ([KKT03]; [Kle07], Section 24.3, p. 621): activation attempts across (u, v) succeed independently with parameter edgeProb u v ∈ [0, 1].

      • edgeProb : V → V → ℝ

        Edge activation probability p_{uv}.

      • edgeProb_nonneg (u v : V) : 0 ≤ self.edgeProb u v

        Edge probabilities are nonnegative.

      • edgeProb_le_one (u v : V) : self.edgeProb u v ≤ 1

        Edge probabilities are at most 1.

      • edgeProb_eq_zero_of_not_adj (u v : V) : ¬G.Adj u v → self.edgeProb u v = 0

        Edge probabilities vanish outside G.

      Embed an IndependentCascadeModel into CascadeModel via history-independent probabilities p_v(u, X) = edgeProb u v ([Kle07], Section 24.3, p. 621).

      Diminishing-returns condition on incremental cascade probabilities ([Kle07], Section 24.3, p. 621): X ⊆ Y → p_v(u, Y) ≤ p_v(u, X) for untried u ∉ Y.

      theorem Cslib.GameTheory.Network.CascadeModel.seqSurvival_perm {V : Type u_1} [DecidableEq V] [Fintype V] {G : Digraph V} [DecidableRel G.Adj] (C : CascadeModel G) (v : V) {us₁ us₂ : List V} (hp : us₁.Perm us₂) {X : Finset V} :
      us₁.Nodup → (∀ u ∈ us₁, u ∉ X) → seqSurvival C.prob v us₁ X = seqSurvival C.prob v us₂ X

      seqSurvival C.prob v us X is invariant under permuting any duplicate-free list us disjoint from X, confirming multi-step order-independence ([Kle07], Section 24.3, pp. 620–621).

      noncomputable def Cslib.GameTheory.Network.CascadeModel.survivalProb {V : Type u_1} [DecidableEq V] [Fintype V] {G : Digraph V} [DecidableRel G.Adj] (C : CascadeModel G) (v : V) (X : Finset V) :

      Order-independent survival probability ∏_{i=1}^k (1 - p_v(u_i, X_{i-1})) that vertex v is not activated when all vertices in X attempt to activate it ([Kle07], Section 24.3, p. 621).

      theorem Cslib.GameTheory.Network.CascadeModel.survivalProb_insert {V : Type u_1} [DecidableEq V] [Fintype V] {G : Digraph V} [DecidableRel G.Adj] (C : CascadeModel G) (v : V) {u : V} {X : Finset V} (hu : u ∉ X) :
      C.survivalProb v (insert u X) = C.survivalProb v X * (1 - C.prob v u X)
      theorem Cslib.GameTheory.Network.CascadeModel.survivalProb_anti {V : Type u_1} [DecidableEq V] [Fintype V] {G : Digraph V} [DecidableRel G.Adj] (C : CascadeModel G) (v : V) ⦃X Y : Finset V⦄ (hXY : X ⊆ Y) :

      Translate an order-independent CascadeModel to its equivalent GeneralThresholdModel via g_v(X) = 1 - survivalProb C v X ([KKT05]; [Kle07], Section 24.3, p. 621).

      Forward Translation GeneralThresholdModel → CascadeModel and Equivalence #

      Translate a GeneralThresholdModel to an order-independent CascadeModel via p_v(u, X) = (g_v(insert u X) - g_v(X)) / (1 - g_v(X)) ([KKT05]; [Kle07], Section 24.3, p. 621). When g_v(X) = 1, Lean's 0 / 0 = 0 sets p_v(u, X) = 0 and preserves (1 - g_v(X)) * (1 - p_v(u, X)) = 1 - g_v(insert u X) unconditionally.

      Operational Cascade Dynamics and Equivalence of Final Active-Set Distributions #

      def Cslib.GameTheory.Network.CascadeModel.untriedEdges {V : Type u_1} [DecidableEq V] [Fintype V] (G : Digraph V) [DecidableRel G.Adj] (active : Finset V) (tried : V → Finset V) :
      Finset (V × V)

      Set of remaining untried active-to-inactive directed edges (u, v) at cascade state (active, tried).

      @[simp]
      theorem Cslib.GameTheory.Network.CascadeModel.mem_untriedEdges {V : Type u_1} [DecidableEq V] [Fintype V] {G : Digraph V} [DecidableRel G.Adj] {active : Finset V} {tried : V → Finset V} {e : V × V} :
      e ∈ untriedEdges G active tried ↔ e.1 ∈ active ∧ e.2 ∉ active ∧ G.Adj e.1 e.2 ∧ e.1 ∉ tried e.2
      noncomputable def Cslib.GameTheory.Network.CascadeModel.defaultNextEdge {V : Type u_1} [DecidableEq V] [Fintype V] (G : Digraph V) [DecidableRel G.Adj] (active : Finset V) (tried : V → Finset V) :
      Option (V × V)

      Default edge-attempt selector choosing an untried active-to-inactive edge from untriedEdges G active tried when nonempty and returning none otherwise.

      def Cslib.GameTheory.Network.CascadeModel.ValidNextEdge {V : Type u_1} [DecidableEq V] [Fintype V] (G : Digraph V) [DecidableRel G.Adj] (nextEdge : Finset V → (V → Finset V) → Option (V × V)) :

      An edge selector nextEdge is valid if it picks an untried active-to-inactive edge whenever one exists and returns none when none exists.

      noncomputable def Cslib.GameTheory.Network.CascadeModel.activeSetProb {V : Type u_1} [DecidableEq V] [Fintype V] {G : Digraph V} [DecidableRel G.Adj] (C : CascadeModel G) (nextEdge : Finset V → (V → Finset V) → Option (V × V)) (S A : Finset V) :

      Probability that the Cascade Model starting from seed set S (with empty initial tried histories) under selector nextEdge terminates at active set A.

      Expected number of final active nodes in the Cascade Model starting from S ([Kle07], Section 24.4, p. 623).

      theorem Cslib.GameTheory.Network.CascadeModel.activeSetProb_eq_of_step {V : Type u_1} [DecidableEq V] [Fintype V] {G : Digraph V} [DecidableRel G.Adj] (C : CascadeModel G) {nextEdge : Finset V → (V → Finset V) → Option (V × V)} (hvalid : ValidNextEdge G nextEdge) (S A : Finset V) (F : Finset V → (V → Finset V) → ℝ) (hbase : ∀ (active : Finset V) (tried : V → Finset V), (∀ w ∉ active, tried w = active ∩ inNeighbors G w) → F active tried = if active = A then ∏ w ∈ activeᶜ, C.survivalProb w (tried w) else 0) (hstep : ∀ (active : Finset V) (tried : V → Finset V), (∀ w ∉ active, tried w ⊆ active ∩ inNeighbors G w) → ∀ (u v : V), u ∈ active → v ∉ active → G.Adj u v → u ∉ tried v → F active tried = C.prob v u (tried v) * C.survivalProb v (tried v) * F (insert v active) (Function.update tried v (insert u (tried v))) + F active (Function.update tried v (insert u (tried v)))) :
      C.activeSetProb nextEdge S A = F S fun (x : V) => ∅

      Structural recursion characterizing C.activeSetProb nextEdge S A: any state invariant F active tried matching the terminal survival product when all active-to-inactive edges have been tried and satisfying the one-step survival-weighted recurrence along each untried edge (u, v) agrees with C.activeSetProb nextEdge S A at (S, fun _ => ∅).

      theorem Cslib.GameTheory.Network.CascadeModel.activeSetProb_eq_toGeneralThresholdModel {V : Type u_1} [DecidableEq V] [Fintype V] {G : Digraph V} [DecidableRel G.Adj] (C : CascadeModel G) {nextEdge : Finset V → (V → Finset V) → Option (V × V)} (hvalid : ValidNextEdge G nextEdge) (S A : Finset V) :

      Equivalence of Order-Independent Cascade and General Threshold Models ([KKT05]; [Kle07], Section 24.3, pp. 620–621): under any valid edge-attempt schedule nextEdge, the Cascade Model C produces the exact same probability distribution over final active sets as C.toGeneralThresholdModel.

      theorem Cslib.GameTheory.Network.CascadeModel.activeSetProb_congr_schedule {V : Type u_1} [DecidableEq V] [Fintype V] {G : Digraph V} [DecidableRel G.Adj] (C : CascadeModel G) {nextEdge₁ nextEdge₂ : Finset V → (V → Finset V) → Option (V × V)} (hv₁ : ValidNextEdge G nextEdge₁) (hv₂ : ValidNextEdge G nextEdge₂) (S A : Finset V) :
      C.activeSetProb nextEdge₁ S A = C.activeSetProb nextEdge₂ S A

      Schedule-invariance of the Order-Independent Cascade Model: any two valid edge-attempt schedules induce identical final active-set distributions.

      theorem Cslib.GameTheory.Network.GeneralThresholdModel.activeSetProb_toCascadeModel {V : Type u_1} [DecidableEq V] [Fintype V] {G : Digraph V} [DecidableRel G.Adj] (M : GeneralThresholdModel G) {nextEdge : Finset V → (V → Finset V) → Option (V × V)} (hvalid : CascadeModel.ValidNextEdge G nextEdge) (S A : Finset V) :

      Forward Equivalence (GeneralThresholdModel → CascadeModel) ([KKT05]; [Kle07], Section 24.3, pp. 620–621): translating M : GeneralThresholdModel G to M.toCascadeModel preserves the final active-set distribution under every valid schedule.

      Time-Layered DAG Reduction for Nonprogressive Processes #

      T-step time-layered directed acyclic graph on V × Fin (T + 1) ([KKT03]; [Kle07], Section 24.3, p. 622): copy (u, t) has a directed edge to (v, t + 1) whenever G.Adj u v.

      def Cslib.GameTheory.Network.seedLayer0 {V : Type u_1} (T : ℕ) (S : Finset V) :
      Finset (V × Fin (T + 1))

      Embed an initial seed set S : Finset V into layer 0 of V × Fin (T + 1).

      @[simp]
      theorem Cslib.GameTheory.Network.mem_seedLayer0 {V : Type u_1} {T : ℕ} {S : Finset V} {x : V × Fin (T + 1)} :
      x ∈ seedLayer0 T S ↔ x.2 = 0 ∧ x.1 ∈ S
      theorem Cslib.GameTheory.Network.seedLayer0_union {V : Type u_1} [DecidableEq V] (T : ℕ) (A B : Finset V) :
      seedLayer0 T (A ∪ B) = seedLayer0 T A ∪ seedLayer0 T B
      theorem Cslib.GameTheory.Network.seedLayer0_inter {V : Type u_1} [DecidableEq V] (T : ℕ) (A B : Finset V) :
      seedLayer0 T (A ∩ B) = seedLayer0 T A ∩ seedLayer0 T B

      Lift a GeneralThresholdModel on G to a progressive GeneralThresholdModel on timeLayeredDigraph G T ([Kle07], Section 24.3, p. 622): vertices at layer 0 have zero threshold function, and (v, t + 1) evaluates M.thresholdFn v on {u | (u, t) ∈ X}.

      theorem Cslib.GameTheory.Network.GeneralThresholdModel.toTimeLayered_thresholdFn {V : Type u_1} [DecidableEq V] [Fintype V] {G : Digraph V} [DecidableRel G.Adj] (M : GeneralThresholdModel G) (T : ℕ) (vt : V × Fin (T + 1)) (X : Finset (V × Fin (T + 1))) :
      (M.toTimeLayered T).thresholdFn vt X = if h0 : ↑vt.2 = 0 then 0 else M.thresholdFn vt.1 {u : V | (u, ⟨↑vt.2 - 1, ⋯⟩) ∈ X}
      noncomputable def Cslib.GameTheory.Network.GeneralThresholdModel.nonprogActive {V : Type u_1} [DecidableEq V] [Fintype V] {G : Digraph V} [DecidableRel G.Adj] (M : GeneralThresholdModel G) {T : ℕ} (θ : V × Fin (T + 1) → ℝ) (S : Finset V) (t : Fin (T + 1)) :

      Nonprogressive active set at step t : Fin (T + 1).

      @[simp]
      theorem Cslib.GameTheory.Network.GeneralThresholdModel.mem_nonprogActive_succ {V : Type u_1} [DecidableEq V] [Fintype V] {G : Digraph V} [DecidableRel G.Adj] (M : GeneralThresholdModel G) {T : ℕ} (θ : V × Fin (T + 1) → ℝ) (S : Finset V) {k : ℕ} (hk : k + 1 ≤ T) (v : V) :
      v ∈ M.nonprogActive θ S ⟨k + 1, ⋯⟩ ↔ θ (v, ⟨k + 1, ⋯⟩) ≤ M.thresholdFn v (M.nonprogActive θ S ⟨k, ⋯⟩)
      theorem Cslib.GameTheory.Network.GeneralThresholdModel.mem_thresholdFinal_toTimeLayered_iff {V : Type u_1} [DecidableEq V] [Fintype V] {G : Digraph V} [DecidableRel G.Adj] (M : GeneralThresholdModel G) {T : ℕ} {θ : V × Fin (T + 1) → ℝ} (hθ0 : ∀ (v : V), 0 < θ (v, 0)) (S : Finset V) (v : V) (t : Fin (T + 1)) :

      Time-Layered DAG Reduction ([KKT03]; [Kle07], Section 24.3, p. 622): whenever layer-0 thresholds are positive (0 < θ (v, 0), which holds almost everywhere under thresholdMeasure), vertex (v, t) is activated in the progressive process on timeLayeredDigraph G T starting from seedLayer0 T S if and only if v is active at step t of the nonprogressive process on G.

      Expected number of active vertices at step t of the T-step synchronous nonprogressive threshold process starting from S.

      Expected step-t nonprogressive influence on G equals the expected layer-t progressive slice cardinality on timeLayeredDigraph G T.