Documentation

CslibFrontier.Logics.Propositional.ClauseSet.Sparsification.Step

Sparsification -- the branching step #

The sparsification procedure of Impagliazzo, Paturi and Zane [IPZ01], in the presentation of Calabro, Impagliazzo and Paturi [CIP06] and of Calabro's thesis Calabro, Chapter 5.

Clause sets are kept reduced: no clause strictly contains another (reduce). For thresholds θ, a set H of h ≥ 1 literals is a heavy heart for clause size c > h when at least θ (c - h) clauses of size c contain it (Heavy); those clauses form its flower. A clause set without heavy hearts is sparse. Otherwise the procedure picks a heavy heart with c as small as possible and then h as large as possible (Choice), and branches: either H is satisfied (add the clause H, the heart branch), or it is not, and then every petal C \ H of the flower is satisfied (add the petals, the petal branch). Both branches are reduced again.

This file proves the local facts: the two branches cover the solutions and only lose solutions of the original clause set, they preserve the width and reducedness, and the potential ∑_{C ∈ ψ} 2 ^ |C| strictly decreases, so the procedure terminates.

Main definitions #

Main results #

References #

Remove every clause that strictly contains another clause, keeping the minimal clauses (mem_reduce_iff_minimal).

No clause strictly contains another: the clauses form an antichain (reduced_iff_isAntichain).

The flower of H at clause size c: the clauses of size c that contain H.

def Cslib.Logic.PL.ClauseSet.Sparsification.Heavy {V : Type u_1} [DecidableEq V] (θ : ℕ → ℕ) (ψ : ClauseSet V) (c : ℕ) (H : Finset (Literal V)) :

H is a heavy heart for clause size c: 1 ≤ |H| < c and at least θ (c - |H|) clauses of size c contain H.

A clause set is sparse for the thresholds θ when it has no heavy heart.

def Cslib.Logic.PL.ClauseSet.Sparsification.Choice {V : Type u_1} [DecidableEq V] (θ : ℕ → ℕ) (ψ : ClauseSet V) (c : ℕ) (H : Finset (Literal V)) :

A valid branching choice: a heavy heart with the smallest clause size, and among those the largest heart.

The petals C \ H of the flower of H.

The clauses a branch introduces: the heart (false) or the petals (true).

A child of a branching node: add the introduced clauses and reduce.

The potential ∑_{C ∈ ψ} 2 ^ |C|, which every branching step decreases.

Reduction #

theorem Cslib.Logic.PL.ClauseSet.Sparsification.mem_reduce {V : Type u_1} [DecidableEq V] {ψ : ClauseSet V} {C : Finset (Literal V)} :
C ∈ reduce ψ ↔ C ∈ ψ ∧ ∀ D ∈ ψ, ¬D ⊂ C

A clause C belongs to reduce ψ if and only if C ∈ ψ and no clause of ψ is a strict subset of C.

The reduction keeps the minimal clauses.

theorem Cslib.Logic.PL.ClauseSet.Sparsification.reduced_iff_isAntichain {V : Type u_1} {ψ : ClauseSet V} :
Reduced ψ ↔ IsAntichain (fun (x1 x2 : Finset (Literal V)) => x1 ⊆ x2) ↑ψ

A reduced clause set is an antichain for inclusion.

reduce ψ is a subset of ψ.

The reduction reduce ψ of any clause set is reduced.

theorem Cslib.Logic.PL.ClauseSet.Sparsification.exists_mem_reduce_subset {V : Type u_1} [DecidableEq V] {ψ : ClauseSet V} {C : Finset (Literal V)} (hC : C ∈ ψ) :
∃ D ∈ reduce ψ, D ⊆ C

Every clause contains a clause of the reduction.

Reduction does not change the solutions.

theorem Cslib.Logic.PL.ClauseSet.Sparsification.exists_ssubset_of_notMem_reduce {V : Type u_1} [DecidableEq V] {ψ X : ClauseSet V} (hred : Reduced ψ) {a : Finset (Literal V)} (ha : a ∈ ψ) (hna : a ∉ reduce (ψ ∪ X)) :
∃ b ∈ X, b ⊂ a

A clause of a reduced set that is not in the reduction of a larger set strictly contains one of the added clauses.

Flowers, petals and choices #

theorem Cslib.Logic.PL.ClauseSet.Sparsification.mem_flower {V : Type u_1} [DecidableEq V] {ψ : ClauseSet V} {c : ℕ} {H C : Finset (Literal V)} :
C ∈ flower ψ c H ↔ C ∈ ψ ∧ C.card = c ∧ H ⊆ C

A clause C belongs to flower ψ c H if and only if C ∈ ψ, C.card = c, and H ⊆ C.

theorem Cslib.Logic.PL.ClauseSet.Sparsification.flower_subset {V : Type u_1} [DecidableEq V] (ψ : ClauseSet V) (c : ℕ) (H : Finset (Literal V)) :
flower ψ c H ⊆ ψ

flower ψ c H is a subset of ψ.

theorem Cslib.Logic.PL.ClauseSet.Sparsification.mem_petals {V : Type u_1} [DecidableEq V] {ψ : ClauseSet V} {c : ℕ} {H p : Finset (Literal V)} :
p ∈ petals ψ c H ↔ ∃ C ∈ flower ψ c H, C \ H = p

A clause p belongs to petals ψ c H if and only if p = C \ H for some C ∈ flower ψ c H.

The petal map C ↦ C \ H is injective on the flower.

theorem Cslib.Logic.PL.ClauseSet.Sparsification.card_of_mem_petals {V : Type u_1} [DecidableEq V] {ψ : ClauseSet V} {c : ℕ} {H p : Finset (Literal V)} (hp : p ∈ petals ψ c H) :
p.card = c - H.card

Every petal in petals ψ c H has cardinality c - H.card.

theorem Cslib.Logic.PL.ClauseSet.Sparsification.Heavy.flower_nonempty {V : Type u_1} [DecidableEq V] {θ : ℕ → ℕ} (hθ : ∀ (j : ℕ), 1 ≤ θ j) {ψ : ClauseSet V} {c : ℕ} {H : Finset (Literal V)} (h : Heavy θ ψ c H) :

When all thresholds are at least 1, the flower of a heavy heart is nonempty.

theorem Cslib.Logic.PL.ClauseSet.Sparsification.card_of_mem_intro {V : Type u_1} [DecidableEq V] {θ : ℕ → ℕ} {ψ : ClauseSet V} {c : ℕ} {H : Finset (Literal V)} (h : Heavy θ ψ c H) {b : Bool} {a : Finset (Literal V)} (ha : a ∈ intro ψ c H b) :
1 ≤ a.card ∧ a.card < c

Every introduced clause is nonempty and smaller than the flower's clause size.

theorem Cslib.Logic.PL.ClauseSet.Sparsification.exists_flower_ssuperset {V : Type u_1} [DecidableEq V] {θ : ℕ → ℕ} (hθ : ∀ (j : ℕ), 1 ≤ θ j) {ψ : ClauseSet V} {c : ℕ} {H : Finset (Literal V)} (h : Heavy θ ψ c H) {b : Bool} {a : Finset (Literal V)} (ha : a ∈ intro ψ c H b) :
∃ C ∈ flower ψ c H, a ⊂ C

Every introduced clause is strictly contained in a clause of the flower.

theorem Cslib.Logic.PL.ClauseSet.Sparsification.intro_nonempty {V : Type u_1} [DecidableEq V] {θ : ℕ → ℕ} (hθ : ∀ (j : ℕ), 1 ≤ θ j) {ψ : ClauseSet V} {c : ℕ} {H : Finset (Literal V)} (h : Heavy θ ψ c H) (b : Bool) :

When all thresholds are at least 1, the set of clauses intro ψ c H b introduced at a heavy heart is nonempty.

The children of a branching node #

theorem Cslib.Logic.PL.ClauseSet.Sparsification.reduced_child {V : Type u_1} [DecidableEq V] (ψ : ClauseSet V) (c : ℕ) (H : Finset (Literal V)) (b : Bool) :
Reduced (child ψ c H b)

Every child child ψ c H b of a branching step is reduced.

theorem Cslib.Logic.PL.ClauseSet.Sparsification.child_subset {V : Type u_1} [DecidableEq V] (ψ : ClauseSet V) (c : ℕ) (H : Finset (Literal V)) (b : Bool) :
child ψ c H b ⊆ ψ ∪ intro ψ c H b

Every child child ψ c H b is contained in ψ ∪ intro ψ c H b.

theorem Cslib.Logic.PL.ClauseSet.Sparsification.sat_of_sat_child {V : Type u_1} [DecidableEq V] {ψ : ClauseSet V} {c : ℕ} {H : Finset (Literal V)} {b : Bool} {x : V → Bool} (hx : (child ψ c H b).Sat x) :
ψ.Sat x

A child only loses solutions: its solutions are solutions of the parent.

theorem Cslib.Logic.PL.ClauseSet.Sparsification.sat_child_of_sat {V : Type u_1} [DecidableEq V] {ψ : ClauseSet V} {c : ℕ} {H : Finset (Literal V)} {x : V → Bool} (hx : ψ.Sat x) :
(child ψ c H (decide ¬∃ l ∈ H, x l.1 = l.2)).Sat x

The branches cover. A solution of the parent satisfying the heart is a solution of the heart child; a solution falsifying it is a solution of the petal child.

theorem Cslib.Logic.PL.ClauseSet.Sparsification.card_le_of_mem_child {V : Type u_1} [DecidableEq V] {θ : ℕ → ℕ} (hθ : ∀ (j : ℕ), 1 ≤ θ j) {ψ : ClauseSet V} {c k : ℕ} {H : Finset (Literal V)} (h : Heavy θ ψ c H) (hk : ∀ C ∈ ψ, C.card ≤ k) {b : Bool} {C : Finset (Literal V)} (hC : C ∈ child ψ c H b) :
C.card ≤ k

Children keep the width.

The potential #

The potential is subadditive under union.

theorem Cslib.Logic.PL.ClauseSet.Sparsification.potential_heart_lt {V : Type u_1} [DecidableEq V] {ψ : ClauseSet V} {c : ℕ} {H : Finset (Literal V)} (hlt : H.card < c) (hF : 0 < Finset.card (flower ψ c H)) :

The heart clause weighs less than any nonempty flower of larger clauses.

Each of the |flower ψ c H| petals has width c - |H|.

theorem Cslib.Logic.PL.ClauseSet.Sparsification.potential_lt_of_flower_exchange {V : Type u_1} [DecidableEq V] {ψ ψ' X : ClauseSet V} {c : ℕ} {H : Finset (Literal V)} (hsub : ψ' ⊆ ψ ∪ X) (hdisj : Disjoint (flower ψ c H) ψ') (hX : potential X < Finset.card (flower ψ c H) * 2 ^ c) :

Flower exchange. A step that removes the flower flower ψ c H (of potential |flower ψ c H| · 2 ^ c) and adds only clauses X of smaller total potential strictly decreases the potential. Both the decision step child and the counting refinement are instances.

theorem Cslib.Logic.PL.ClauseSet.Sparsification.potential_child_lt {V : Type u_1} [DecidableEq V] {θ : ℕ → ℕ} (hθ : ∀ (j : ℕ), 1 ≤ θ j) {ψ : ClauseSet V} {c : ℕ} {H : Finset (Literal V)} (h : Heavy θ ψ c H) (b : Bool) :
potential (child ψ c H b) < potential ψ

Termination. Each branching step strictly decreases the potential.