Documentation

CslibFrontier.Computability.Complexity.Problems.SAT.Units

Unit clauses fixing variables #

Search procedures for SAT fix variables one at a time by adding unit clauses: the unit clauses of a list of literals a (Cslib.Complexity.SAT.units) hold exactly when the literals do, so units a ++ φ is the formula φ with the values in a fixed. This file collects their semantics and the bounds on their encoded length that the self-reduction of SAT (CslibFrontier/Computability/Complexity/Classes/NP/SelfReduction.lean) and the pruned searches of Fortune and Mahaney (CslibFrontier/Computability/Complexity/Classes/Sparse/) use.

Main definitions #

Main results #

The unit clauses of a list of literals.

Semantics #

theorem Cslib.Complexity.SAT.eval_units (σ : ℕ → Bool) (answers : List (Logic.PL.Literal ℕ)) :
Logic.PL.CNF.eval σ (units answers) = true ↔ ∀ l ∈ answers, σ l.1 = l.2

Unit clauses hold exactly when their literals do.

The variables of unit clauses are those of their literals.

The variables of a formula after unit clauses are those of the literals, then those of the formula.

theorem Cslib.Complexity.SAT.eval_units_append (σ : ℕ → Bool) (answers : List (Logic.PL.Literal ℕ)) (φ : Logic.PL.CNF ℕ) :
Logic.PL.CNF.eval σ (units answers ++ φ) = true ↔ (∀ l ∈ answers, σ l.1 = l.2) ∧ Logic.PL.CNF.eval σ φ = true

A formula after unit clauses holds exactly when the literals and the formula do.

theorem Cslib.Complexity.SAT.eval_append_units (σ : ℕ → Bool) (φ : Logic.PL.CNF ℕ) (answers : List (Logic.PL.Literal ℕ)) :
Logic.PL.CNF.eval σ (φ ++ units answers) = true ↔ Logic.PL.CNF.eval σ φ = true ∧ ∀ l ∈ answers, σ l.1 = l.2

A formula with unit clauses holds exactly when the formula holds and the literals do.

Encoded length #

The encoding of a concatenation of formulas is as long as the two encodings together.

A variable of a formula takes fewer bits than the formula.

Literals fixing variables of φ have short encodings: each takes at most 4 L + 5 bits, where L is the length of φ.

The unit clause of a literal on v takes 8 b + 11 bits, where b is the length of the binary digits of v.

The unit clause of a literal on a variable of φ takes at most 8 L + 11 bits, where L is the length of φ.

theorem Cslib.Complexity.SAT.length_encCNF_units_le {φ : Logic.PL.CNF ℕ} {answers : List (Logic.PL.Literal ℕ)} (hanswers : ∀ l ∈ answers, l.1 ∈ φ.vars) :
(encCNF (units answers)).length ≤ answers.length * (8 * (encCNF φ).length + 11)

Unit clauses fixing variables of φ take at most 8 L + 11 bits each, where L is the length of φ.