Documentation

CslibFrontier.Foundations.Combinatorics.SimpleGraph.IndepCount

Bounding 2-SAT solutions by the number of independent sets #

Every edge of a 2-SAT instance on a simple graph G = (V, E) forbids at least one of the four Boolean value pairs (b_u, b_v) ∈ Bool × Bool across its endpoints. Aligning polarities one vertex at a time (Finset.card_union_add_card_inter) shows that the number of satisfying truth assignments never exceeds G.indepSetCount, the number of independent sets of G (realized when every edge forbids (true, true)).

Main definitions #

Main results #

noncomputable def SimpleGraph.indepSetCount {V : Type u_1} [Finite V] (G : SimpleGraph V) :

The number i(G) of independent sets of a finite simple graph G. The finite vertex type ensures that Set.ncard counts independent sets rather than returning 0 on an infinite family (such as ∅ and all singletons).

Every finite simple graph has at least one independent set (∅), so 0 < G.indepSetCount.

theorem SimpleGraph.ncard_le_indepSetCount_of_forall_adj {V : Type u_1} [Finite V] (G : SimpleGraph V) {S : Set (V → Bool)} (hS : ∀ ⦃u w : V⦄, G.Adj u w → ∃ (bu : Bool) (bw : Bool), ∀ x ∈ S, ¬(x u = bu ∧ x w = bw)) :

2-SAT solutions are at most i(G). If for every adjacent pair G.Adj u w in a finite simple graph G, at least one pair of Boolean values (bu, bw) is forbidden across S, then S.ncard ≤ G.indepSetCount.

Exact independent-set counts on basic families #

@[simp]

The edgeless graph on a finite vertex type V has 2 ^ |V| independent sets.

theorem SimpleGraph.indepSetCount_star {V : Type u_1} [Finite V] (G : SimpleGraph V) (v₀ : V) (hstar : ∀ ⦃u w : V⦄, G.Adj u w → u = v₀ ∨ w = v₀) (hfull : ∀ (w : V), w ≠ v₀ → G.Adj v₀ w) :
G.indepSetCount = 2 ^ (Nat.card V - 1) + 1

Independent sets of a star (K_{1, d}). If every edge of G meets v₀ and v₀ is adjacent to every other vertex, then G.indepSetCount = 2 ^ (|V| - 1) + 1.

Independent sets of a path (i(P_n) = F_{n + 2}). The n-vertex path pathGraph n has Nat.fib (n + 2) independent sets (1, 2, 3, 5, 8, ... for n = 0, 1, 2, 3, 4, ...).