Documentation

Complexity.Logics.Propositional.CNF.ThreeCNF

Splitting clauses into clauses of width three #

A clause l₁ ∨ l₂ ∨ ⋯ ∨ lₘ with m > 3 is equisatisfiable with the chain of width-three clauses

(l₁ ∨ l₂ ∨ y₀) ∧ (¬y₀ ∨ l₃ ∨ y₁) ∧ ⋯ ∧ (¬yₘ₋₄ ∨ lₘ₋₁ ∨ lₘ)

in fresh variables y₀, …, yₘ₋₄: in a satisfying assignment yⱼ can be taken to say that one of the literals after lⱼ₊₂ is true Arora and Barak, Section 2.3.1. Splitting every clause of a formula, with the fresh variables of a clause indexed by its position, gives a formula with clauses of width at most three that is satisfiable exactly when the original one is.

Main definitions #

Main results #

References #

One clause #

def Cslib.Logic.PL.Clause.splitAux {W : Type u_2} (fresh : ℕ → W) :
ℕ → Literal W → Clause W → CNF W

The chain of width-three clauses for the clause carry :: rest, with auxiliary variables fresh j, fresh (j + 1), ….

Instances For
    def Cslib.Logic.PL.Clause.split3 {W : Type u_2} (fresh : ℕ → W) (j : ℕ) :
    Clause W → CNF W

    The chain of width-three clauses for a clause, with auxiliary variables fresh j, fresh (j + 1), …. A clause with at most three literals is kept as it is.

    Instances For

      Formulas #

      def Cslib.Logic.PL.CNF.to3CNF {V : Type u_1} (φ : CNF V) :

      Split every clause of a formula, renaming its variables into the left summand and naming the auxiliary variables of clause i by (i, j).

      Instances For
        theorem Cslib.Logic.PL.Clause.length_le_three_of_mem_split3 {W : Type u_2} (fresh : ℕ → W) (j : ℕ) (c d : Clause W) :
        d ∈ split3 fresh j c → List.length d ≤ 3
        theorem Cslib.Logic.PL.CNF.length_le_three_of_mem_to3CNF {V : Type u_1} {φ : CNF V} {c : Clause (V ⊕ ℕ × ℕ)} (hc : c ∈ φ.to3CNF) :

        Every clause of CNF.to3CNF φ has at most three literals.

        theorem Cslib.Logic.PL.Clause.eval_of_eval_split3 {W : Type u_2} (fresh : ℕ → W) (σ : W → Bool) (j : ℕ) (c : Clause W) (h : CNF.eval σ (split3 fresh j c) = true) :
        eval σ c = true

        Splitting the clauses of a formula preserves satisfiability.

        theorem Cslib.Logic.PL.CNF.length_to3CNF {V : Type u_1} (φ : CNF V) :
        List.length φ.to3CNF = (List.map (fun (c : Clause V) => max 1 (List.length c - 2)) φ).sum

        The number of clauses after splitting.

        Splitting keeps falsified clauses falsified: an assignment of the split formula falsifies at least as many clauses as its restriction to the original variables falsifies in the original formula.