Documentation

CslibFrontier.Logics.Propositional.CSP.HardCore

The hard-core model as a weighted CSP #

The hard-core instance of a graph on the vertices 0, …, n - 1 with edge list E (CSP.hardCore n E) has a vertex constraint ⟨false, [v]⟩ for every vertex and an edge constraint ⟨true, [u, v]⟩ for every edge (u, v). Under the hard-core weights with fugacity t (CSP.hardCoreWeight t), a vertex constraint weighs t when its variable is true, and an edge constraint weighs zero when both its variables are true. So the partition function is the sum of t ^ |S| over the independent sets S of the graph (CSP.partitionFunction_hardCore); with t = 1 it is the number of independent sets.

Every vertex occurs once in its vertex constraint and once per incident edge, so a graph of maximum degree Δ gives an instance in which every variable occurs at most Δ + 1 times (CSP.count_vars_hardCore).

Main definitions #

Main results #

The hard-core weights with fugacity t: a vertex constraint (false) weighs t at [true] and one otherwise; an edge constraint (true) weighs zero at [true, true] and one otherwise.

The hard-core instance of the graph on the vertices 0, …, n - 1 with edge list E: a vertex constraint for every vertex and an edge constraint for every edge.

theorem Cslib.Logic.PL.CSP.vars_hardCore (n : ℕ) (E : List (ℕ × ℕ)) :
(hardCore n E).vars = List.range n ++ List.flatMap (fun (e : ℕ × ℕ) => [e.1, e.2]) E
theorem Cslib.Logic.PL.CSP.mem_vars_hardCore {n : ℕ} {E : List (ℕ × ℕ)} (hE : ∀ e ∈ E, e.1 < n ∧ e.2 < n) {v : ℕ} :
v ∈ (hardCore n E).vars ↔ v < n

The variables of the hard-core instance are the vertices, when the edges join vertices.

theorem Cslib.Logic.PL.CSP.numVars_hardCore {n : ℕ} {E : List (ℕ × ℕ)} (hE : ∀ e ∈ E, e.1 < n ∧ e.2 < n) :
theorem Cslib.Logic.PL.CSP.count_vars_hardCore (n : ℕ) (E : List (ℕ × ℕ)) (v : ℕ) :
List.count v (hardCore n E).vars ≤ 1 + List.count v (List.flatMap (fun (e : ℕ × ℕ) => [e.1, e.2]) E)

A variable v occurs at most once in the vertex constraints, plus once for each time it is an endpoint in the edge list E, counting a loop twice and a repeated edge with its multiplicity.

theorem Cslib.Logic.PL.CSP.weight_hardCore {n : ℕ} {E : List (ℕ × ℕ)} (t : ℕ) (σ : ℕ → Bool) :
weight (hardCoreWeight t) (hardCore n E) σ = t ^ {v ∈ Finset.range n | σ v = true}.card * if ∀ e ∈ E, ¬(σ e.1 = true ∧ σ e.2 = true) then 1 else 0

The weight of an assignment: t to the number of true vertices, if no edge has two true ends, and zero otherwise.

theorem Cslib.Logic.PL.CSP.partitionFunction_hardCore {n : ℕ} {E : List (ℕ × ℕ)} (t : ℕ) (hE : ∀ e ∈ E, e.1 < n ∧ e.2 < n) :
partitionFunction (hardCoreWeight t) (hardCore n E) = ∑ S ∈ (Finset.range n).powerset with ∀ e ∈ E, ¬(e.1 ∈ S ∧ e.2 ∈ S), t ^ S.card

The hard-core partition function is the sum of t ^ |S| over the independent sets S of the graph, when its edges join vertices 0, …, n - 1.