Documentation

CslibFrontier.Computability.Complexity.FineGrained.PPSZ.CriticalTree

Critical clause trees and the forcing lemma for PPSZ #

Let σ satisfy a CNF formula φ. It is h-isolated (IsIsolated) if flipping any nonempty set of at most h variables falsifies φ [Paturi, Pudlák, Saks, Zane, p. 343] [PPSZ05]; a unique satisfying assignment is h-isolated for every h (isIsolated_of_unique).

The critical clause tree of a variable x has root labelled x. A node is identified with its root path p, the list of the variable labels from the node up to the root. A node of depth less than h has at most h labels on its root path, so flipping them falsifies φ; the node is labelled by a clause C p of φ violated by that flip, and its children are labelled by the variables of C p not on p (children) Scheder, §3.1 Paturi, Pudlák, Saks, Zane, §3.2. Here the tree is given by the labelling C, a function on all lists, and IsCriticalTree φ σ h C says that it labels every root path of at most h variables by such a clause. Labellings exist for h-isolated σ (exists_isCriticalTree), labels on a path are distinct (nodup_append_of_descends), and every node of depth less than h has at most k - 1 children when the clauses of φ have at most k literals (card_children_le).

The tree of x only visits root paths that contain x. IsCriticalTreeAt φ σ x h C asks for the clause labels on those paths only; it follows from IsCriticalTree φ σ h C (IsCriticalTree.isCriticalTreeAt), and the degree bound and the forcing lemma need no more. For general satisfiable formulas, PPSZ needs trees for frozen variables of restricted formulas, which are rooted trees but not isolated ones.

Cut C A d p says that every downward path of d steps from the node p has a node other than p labelled in A (cut_iff_forall_descends). It is decidable, monotone in A (Cut.mono), and satisfies Cut C A (d + 1) p ↔ ∀ y ∈ children C p, y ∈ A ∨ Cut C A d (y :: p) (cut_succ).

Forcing lemma. If every path from the root of the tree of x to depth h meets A, then x = σ x is implied, under σ restricted to A, by the clause labels of the tree, which are at most ∑ i < h, (k - 1) ^ i (wImplied_of_cut, and IsCriticalTreeAt.wImplied_of_cut for rooted trees). In PPSZ, with A the variables placed before x, this says that x is forced Scheder, Lemma 3.2.

Main definitions #

Main results #

References #

Isolation and critical clause trees #

def Cslib.Complexity.PPSZ.IsIsolated {n : ℕ} (φ : Logic.PL.CNF (Fin n)) (σ : Fin n → Bool) (h : ℕ) :

σ is h-isolated in φ: flipping any nonempty set of at most h variables falsifies φ. For a satisfying σ, no other satisfying assignment is within Hamming distance h Paturi, Pudlák, Saks, Zane, p. 343.

theorem Cslib.Complexity.PPSZ.isIsolated_of_unique {n : ℕ} {φ : Logic.PL.CNF (Fin n)} {σ : Fin n → Bool} (huniq : ∀ (τ : Fin n → Bool), Logic.PL.CNF.eval τ φ = true → τ = σ) (h : ℕ) :
IsIsolated φ σ h

A unique satisfying assignment is h-isolated for every h.

def Cslib.Complexity.PPSZ.IsCriticalTree {n : ℕ} (φ : Logic.PL.CNF (Fin n)) (σ : Fin n → Bool) (h : ℕ) (C : List (Fin n) → Logic.PL.Clause (Fin n)) :

The clause labelling C defines a critical clause tree of height h for σ: every root path p of at most h variables (a node of depth less than h, listed from the node up to the root) is labelled by a clause of φ that flipping the variables of p violates Scheder, §3.1.

theorem Cslib.Complexity.PPSZ.exists_isCriticalTree {n : ℕ} {φ : Logic.PL.CNF (Fin n)} {σ : Fin n → Bool} {h : ℕ} (hiso : IsIsolated φ σ h) :
∃ (C : List (Fin n) → Logic.PL.Clause (Fin n)), IsCriticalTree φ σ h C

Critical clause trees exist for isolated assignments.

def Cslib.Complexity.PPSZ.IsCriticalTreeAt {n : ℕ} (φ : Logic.PL.CNF (Fin n)) (σ : Fin n → Bool) (x : Fin n) (h : ℕ) (C : List (Fin n) → Logic.PL.Clause (Fin n)) :

The clause labelling C defines a critical clause tree of height h rooted at x for σ: every root path p of at most h variables that contains x is labelled by a clause of φ that flipping the variables of p violates. The root paths of the nodes of the tree of x end in x, so this is the part of IsCriticalTree that the tree of x uses (IsCriticalTree.isCriticalTreeAt). Unlike IsCriticalTree, it can hold when σ is not isolated, for instance for a frozen variable of a restricted formula (original).

theorem Cslib.Complexity.PPSZ.IsCriticalTree.isCriticalTreeAt {n : ℕ} {φ : Logic.PL.CNF (Fin n)} {σ : Fin n → Bool} {h : ℕ} {C : List (Fin n) → Logic.PL.Clause (Fin n)} (hC : IsCriticalTree φ σ h C) (x : Fin n) :
IsCriticalTreeAt φ σ x h C

A critical clause tree is a critical clause tree rooted at every variable.

def Cslib.Complexity.PPSZ.children {n : ℕ} (C : List (Fin n) → Logic.PL.Clause (Fin n)) (p : List (Fin n)) :

The children of the node with root path p: the variables of its clause label that are not on p Paturi, Pudlák, Saks, Zane, §3.2.

theorem Cslib.Complexity.PPSZ.mem_children {n : ℕ} {C : List (Fin n) → Logic.PL.Clause (Fin n)} {p : List (Fin n)} {y : Fin n} :
y ∈ children C p ↔ y ∈ PPZ.vars (C p) ∧ y ∉ p

Membership in children.

theorem Cslib.Complexity.PPSZ.notMem_of_mem_children {n : ℕ} {C : List (Fin n) → Logic.PL.Clause (Fin n)} {p : List (Fin n)} {y : Fin n} (hy : y ∈ children C p) :
y ∉ p

A child is not on the root path of its parent.

theorem Cslib.Complexity.PPSZ.card_children_le {n k h : ℕ} {φ : Logic.PL.CNF (Fin n)} {σ : Fin n → Bool} {x : Fin n} {C : List (Fin n) → Logic.PL.Clause (Fin n)} (hσ : Logic.PL.CNF.eval σ φ = true) (hC : IsCriticalTreeAt φ σ x h C) (hlen : ∀ c ∈ φ, List.length c ≤ k) {p : List (Fin n)} (hxp : x ∈ p) (hph : p.length ≤ h) :
(children C p).card ≤ k - 1

The critical clause tree has degree at most k - 1 for clauses of at most k literals: some variable of a node's clause label is on its root path Scheder, §3.1.

Paths and cuts #

def Cslib.Complexity.PPSZ.Descends {n : ℕ} (C : List (Fin n) → Logic.PL.Clause (Fin n)) :
ℕ → List (Fin n) → List (Fin n) → Prop

Descends C d p s: the list s, deepest first, labels a downward path of d steps from the node p, so that s ++ p is the root path of its end node.

theorem Cslib.Complexity.PPSZ.nodup_append_of_descends {n : ℕ} {C : List (Fin n) → Logic.PL.Clause (Fin n)} {d : ℕ} {p s : List (Fin n)} :
p.Nodup → Descends C d p s → (s ++ p).Nodup

Labels on a path are distinct Scheder, Observation 3.1.

def Cslib.Complexity.PPSZ.Cut {n : ℕ} (C : List (Fin n) → Logic.PL.Clause (Fin n)) (A : Finset (Fin n)) :
ℕ → List (Fin n) → Prop

Cut C A d p: every downward path of d steps from the node p has a node other than p labelled by a variable of A. For the root [x] of the tree of x with x ∉ A, this says that every path from the root to depth d meets A; the set of nodes labelled in A then contains a cut in the sense of Paturi, Pudlák, Saks, Zane, p. 347.

Instances For
    @[simp]
    theorem Cslib.Complexity.PPSZ.cut_zero {n : ℕ} (C : List (Fin n) → Logic.PL.Clause (Fin n)) (A : Finset (Fin n)) (p : List (Fin n)) :
    ¬Cut C A 0 p

    No node has a cut of depth 0.

    theorem Cslib.Complexity.PPSZ.cut_succ {n : ℕ} (C : List (Fin n) → Logic.PL.Clause (Fin n)) (A : Finset (Fin n)) (d : ℕ) (p : List (Fin n)) :
    Cut C A (d + 1) p ↔ ∀ y ∈ children C p, y ∈ A ∨ Cut C A d (y :: p)

    The recursion of Cut: every child is in A or has a cut one level shallower.

    @[instance_reducible]
    instance Cslib.Complexity.PPSZ.Cut.decidable {n : ℕ} (C : List (Fin n) → Logic.PL.Clause (Fin n)) (A : Finset (Fin n)) (d : ℕ) (p : List (Fin n)) :
    Decidable (Cut C A d p)

    Cut is decidable, by its recursion.

    theorem Cslib.Complexity.PPSZ.Cut.mono {n : ℕ} {C : List (Fin n) → Logic.PL.Clause (Fin n)} {A B : Finset (Fin n)} (hAB : A ⊆ B) {d : ℕ} {p : List (Fin n)} :
    Cut C A d p → Cut C B d p

    Cut is monotone in the set of variables.

    theorem Cslib.Complexity.PPSZ.cut_insert_of_mem {n : ℕ} {C : List (Fin n) → Logic.PL.Clause (Fin n)} {A : Finset (Fin n)} {y : Fin n} {d : ℕ} {p : List (Fin n)} :
    y ∈ p → (Cut C (insert y A) d p ↔ Cut C A d p)

    A cut does not depend on the labels of the root path: the nodes below p are labelled by variables not on p, so adding a variable of p to the set does not change Cut.

    theorem Cslib.Complexity.PPSZ.cut_iff_forall_descends {n : ℕ} {C : List (Fin n) → Logic.PL.Clause (Fin n)} {A : Finset (Fin n)} {d : ℕ} {p : List (Fin n)} :
    Cut C A d p ↔ ∀ (s : List (Fin n)), Descends C d p s → ∃ y ∈ s, y ∈ A

    Cut in terms of paths: every downward path of d steps from p meets A outside p.

    The forcing lemma #

    The clause labels of the nodes of depth less than d below the node p, including p.

    theorem Cslib.Complexity.PPSZ.mem_labels_succ {n : ℕ} {C : List (Fin n) → Logic.PL.Clause (Fin n)} {d : ℕ} {p : List (Fin n)} {c : Logic.PL.Clause (Fin n)} :
    c ∈ labels C (d + 1) p ↔ c = C p ∨ ∃ y ∈ children C p, c ∈ labels C d (y :: p)

    Membership in the clause labels of a tree of depth d + 1.

    theorem Cslib.Complexity.PPSZ.mem_of_mem_labels {n : ℕ} {φ : Logic.PL.CNF (Fin n)} {σ : Fin n → Bool} {x : Fin n} {h : ℕ} {C : List (Fin n) → Logic.PL.Clause (Fin n)} (hC : IsCriticalTreeAt φ σ x h C) {d : ℕ} {p : List (Fin n)} :
    x ∈ p → p.length + d ≤ h + 1 → ∀ c ∈ labels C d p, c ∈ φ

    The clause labels of a critical clause tree are clauses of the formula.

    theorem Cslib.Complexity.PPSZ.card_labels_le {n k h : ℕ} {φ : Logic.PL.CNF (Fin n)} {σ : Fin n → Bool} {x : Fin n} {C : List (Fin n) → Logic.PL.Clause (Fin n)} (hσ : Logic.PL.CNF.eval σ φ = true) (hC : IsCriticalTreeAt φ σ x h C) (hlen : ∀ c ∈ φ, List.length c ≤ k) {d : ℕ} {p : List (Fin n)} :
    x ∈ p → p.length + d ≤ h + 1 → (labels C d p).card ≤ ∑ i ∈ Finset.range d, (k - 1) ^ i

    The number of clause labels of nodes of depth less than d is at most ∑ i < d, (k - 1) ^ i.

    theorem Cslib.Complexity.PPSZ.exists_mem_labels_eval_eq_false {n : ℕ} {φ : Logic.PL.CNF (Fin n)} {σ γ : Fin n → Bool} {x : Fin n} {h : ℕ} {C : List (Fin n) → Logic.PL.Clause (Fin n)} (hC : IsCriticalTreeAt φ σ x h C) {A : Finset (Fin n)} (hA : ∀ y ∈ A, γ y = σ y) {d : ℕ} {p : List (Fin n)} :
    x ∈ p → p.length + d ≤ h + 1 → (∀ y ∈ p, γ y ≠ σ y) → Cut C A d p → ∃ c ∈ labels C d p, Logic.PL.Clause.eval γ c = false

    The core of the forcing lemma: an assignment γ that agrees with σ on A and differs from σ on the root path p violates a clause label below p if p has a cut in A. Follow the children on which γ differs from σ; where this stops, γ agrees with the flip of σ on the whole clause label.

    theorem Cslib.Complexity.PPSZ.IsCriticalTreeAt.wImplied_of_cut {n k h w : ℕ} {φ : Logic.PL.CNF (Fin n)} {σ : Fin n → Bool} {x : Fin n} {C : List (Fin n) → Logic.PL.Clause (Fin n)} (hC : IsCriticalTreeAt φ σ x h C) (hσ : Logic.PL.CNF.eval σ φ = true) (hlen : ∀ c ∈ φ, List.length c ≤ k) (hw : ∑ i ∈ Finset.range h, (k - 1) ^ i ≤ w) {A : Finset (Fin n)} (hcut : Cut C A h [x]) :
    WImplied φ w (PPZ.restrict σ A) x (σ x)

    The forcing lemma for a rooted tree (original: a strengthening of Scheder, Lemma 3.2, whose proof uses only the number of clause-labelled nodes). Let σ satisfy φ, whose clauses have at most k literals, and let C label a critical clause tree of height h rooted at x. If every path from the root x to depth h meets A outside the root, then x = σ x is w-implied under σ restricted to A whenever w ≥ ∑ i < h, (k - 1) ^ i, a bound on the number of nodes of depth less than h.

    theorem Cslib.Complexity.PPSZ.wImplied_of_cut {n k h w : ℕ} {φ : Logic.PL.CNF (Fin n)} {σ : Fin n → Bool} {C : List (Fin n) → Logic.PL.Clause (Fin n)} (hσ : Logic.PL.CNF.eval σ φ = true) (hC : IsCriticalTree φ σ h C) (hlen : ∀ c ∈ φ, List.length c ≤ k) (hw : ∑ i ∈ Finset.range h, (k - 1) ^ i ≤ w) {A : Finset (Fin n)} {x : Fin n} (hcut : Cut C A h [x]) :
    WImplied φ w (PPZ.restrict σ A) x (σ x)

    The forcing lemma (original: a strengthening of Scheder, Lemma 3.2, whose proof uses only the number of clause-labelled nodes). Let σ satisfy φ, whose clauses have at most k literals, and let C label a critical clause tree of height h. If every path from the root x to depth h meets A outside the root, then x = σ x is w-implied under σ restricted to A whenever w ≥ ∑ i < h, (k - 1) ^ i, a bound on the number of nodes of depth less than h.

    theorem Cslib.Complexity.PPSZ.wImplied_of_forall_descends {n k h w : ℕ} (hk : 3 ≤ k) {φ : Logic.PL.CNF (Fin n)} {σ : Fin n → Bool} {C : List (Fin n) → Logic.PL.Clause (Fin n)} (hσ : Logic.PL.CNF.eval σ φ = true) (hC : IsCriticalTree φ σ h C) (hlen : ∀ c ∈ φ, List.length c ≤ k) (hw : (k - 1) ^ (h + 1) ≤ w) {A : Finset (Fin n)} {x : Fin n} (hpath : ∀ (s : List (Fin n)), Descends C h [x] s → ∃ y ∈ s ++ [x], y ∈ A) :
    WImplied φ w (PPZ.restrict σ A) x (σ x)

    The forcing lemma Scheder, Lemma 3.2. Let σ satisfy the k-CNF formula φ with k ≥ 3, let C label a critical clause tree of height h, and let w ≥ (k - 1) ^ (h + 1). If every path from the root x to a node at depth h contains a node labelled in A, then x = σ x is w-implied under σ restricted to A. Scheder builds the tree for a unique satisfying assignment; here it only needs to exist, which h-isolation guarantees (exists_isCriticalTree). For bounded resolution in place of w-implication, the corresponding statements are Paturi, Pudlák, Saks, Zane, Definition 1 and Lemma 4.