Documentation

CslibFrontier.Computability.Complexity.Problems.SAT.LeftSet

The left set of SAT #

The left set of a problem A ∈ NP, for a witness relation of A, consists of the pairs (x, w) of an instance x ∈ A and a candidate witness w that is lexicographically at most the largest witness of x Arvind, Köbler and Mundhenk, Definition 2.3. It is the device of Ogiwara and Watanabe's proof that sparse sets are not NP-hard under bounded truth-table reductions unless P = NP [OW91]: the left-set members among the candidate prefixes of a level of the search tree are exactly those at most the prefix of the largest witness, so the boundary of the left set locates that prefix.

For SAT, a witness of a formula φ lists the values of a satisfying assignment at the literal occurrences of φ, in order (φ.vars), as in the self-reduction of CslibFrontier/Computability/Complexity/Classes/NP/SelfReduction.lean. So ⟨φ, w⟩ ∈ LeftSAT when w has one bit per occurrence and some satisfying assignment, read along the occurrences, gives a word lexicographically at least w (Cslib.Complexity.LeftSAT). Words are compared in Mathlib's lexicographic order on List Bool, with false < true.

The clauses SAT.atLeast a say that the values of the occurrences fixed by a list of literals a are lexicographically at least the values a gives them (Cslib.Complexity.SAT.eval_atLeast): for every position j where a has true, the assignment has true there or at an earlier position where a has false. Adding them to φ reduces the left set to SAT (Cslib.Complexity.LeftSAT_polyTimeReducible_SAT), so the left set is in NP (Cslib.Complexity.LeftSAT_mem_NP). Conversely SAT reduces to its left set, by pairing a formula with the all-false word (Cslib.Complexity.SAT_polyTimeReducible_LeftSAT).

The search procedures query the left set at prefixes: a node of the self-reduction tree fixes the first occurrences of φ, and SAT.atLeast a ++ φ is satisfiable exactly when the values of the node a, padded with false, form a member of the left set (Cslib.Complexity.SAT.atLeast_append_mem_SAT_iff_mem_LeftSAT). For a fixed formula the members form an initial segment of the words of the right length (Cslib.Complexity.LeftSAT.mem_of_le): the words at most the largest witness. Its largest member is a witness (Cslib.Complexity.LeftSAT.exists_eq_map_of_maximal), so membership queries find a satisfying assignment, which is the search-to-decision property behind the left-set technique.

Main definitions #

Main results #

References #

Lexicographic lower bounds as clauses #

The clauses saying that an assignment is lexicographically at least the values of a, read along the variables of a: for each position j where a has the value true, the clause that one of the variables of a at a position before j with the value false, or the variable at j, is true.

A first position with the value true adds the unit clause of its variable.

A first position with the value false adds its variable to every clause.

SAT.atLeast a holds exactly when the assignment is lexicographically at least a, read along the variables of a.

Satisfiability with a lexicographic lower bound: SAT.atLeast a ++ φ is satisfiable exactly when some satisfying assignment of φ is lexicographically at least a.

The left set #

An instance of the left set of SAT: a formula in conjunctive normal form paired with a candidate witness prefix word.

  • formula : Logic.PL.CNF ℕ

    The formula in conjunctive normal form.

  • word : List Bool

    The bit string compared lexicographically against satisfying witnesses.

Instances For

    Pairs of a formula and a bit string, encoded by encCNF and encBits.

    theorem Cslib.Complexity.encLeftSAT_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 : γ → Logic.PL.CNF ℕ} {x1 : γ → List Bool} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn encCNF budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn Turing.MultiTapeTM.encBits budget) :
    Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { formula := x0 x, word := x1 x }) encIn encLeftSAT budget
    @[reducible, inline]

    The tuple of the fields of encLeftSAT.

    theorem Cslib.Complexity.encLeftSAT_word_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → LeftSATInstance} :
    theorem Cslib.Complexity.encLeftSAT_formula_polyTime {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {g✝ : γ✝ → LeftSATInstance} :
    theorem Cslib.Complexity.encLeftSAT_formula_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → LeftSATInstance} :
    Turing.MultiTapeTM.ComputableInSpace g✝ encIn✝ encLeftSAT S✝ → Turing.MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).formula) encIn✝ encCNF S✝
    theorem Cslib.Complexity.encLeftSAT_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → Logic.PL.CNF ℕ} {T0 S0 : γ → ℕ} {x1 : γ → List Bool} {T1 S1 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn encCNF T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn Turing.MultiTapeTM.encBits T1 S1) :
    Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { formula := x0 x, word := x1 x }) encIn encLeftSAT (fun (x : γ) => T0 x + T1 x) fun (x : γ) => S0 x + S1 x

    The left set of SAT [Arvind, Köbler and Mundhenk, Definition 2.3] [AKM92]: the instances x : LeftSATInstance of a formula x.formula and a word x.word with one bit for each literal occurrence of x.formula, such that the values of some satisfying assignment of x.formula at its occurrences, read in order, form a word lexicographically at least x.word. The witnesses of x.formula are these words of values, and x.word is in the left set exactly when it is at most the largest of them.

    theorem Cslib.Complexity.mem_LeftSAT {φ : Logic.PL.CNF ℕ} {w : List Bool} :
    { formula := φ, word := w } ∈ LeftSAT ↔ w.length = φ.vars.length ∧ ∃ (σ : ℕ → Bool), Logic.PL.CNF.eval σ φ = true ∧ w ≤ List.map σ φ.vars
    theorem Cslib.Complexity.LeftSAT.mem_of_le {φ : Logic.PL.CNF ℕ} {w w' : List Bool} (h : { formula := φ, word := w } ∈ LeftSAT) (hlen : w'.length = w.length) (hle : w' ≤ w) :
    { formula := φ, word := w' } ∈ LeftSAT

    The left set of a formula is an initial segment of the words of the right length.

    theorem Cslib.Complexity.LeftSAT.exists_eq_map_of_maximal {φ : Logic.PL.CNF ℕ} {w : List Bool} (h : { formula := φ, word := w } ∈ LeftSAT) (hmax : ∀ (w' : List Bool), w'.length = w.length → w < w' → { formula := φ, word := w' } ∉ LeftSAT) :
    ∃ (σ : ℕ → Bool), Logic.PL.CNF.eval σ φ = true ∧ w = List.map σ φ.vars

    The largest member of the left set of a formula is a witness, so searching for it with membership queries, for example bit by bit, finds a satisfying assignment.

    Membership in the left set as satisfiability: pair the occurrences of φ with the bits of w, and require the assignment to be lexicographically at least them.

    The search queries the left set at prefixes. For a node a fixing the first occurrences of φ, SAT.atLeast a ++ φ is satisfiable exactly when the values of a, padded with false to one bit per occurrence, form a member of the left set.

    Reductions #

    The left set reduces to SAT: an instance x with one bit per occurrence goes to x.formula with the clauses saying that the assignment is at least x.word, and any other instance to the unsatisfiable formula with an empty clause.

    The left set of SAT is in NP.

    SAT reduces to its left set: pair a formula with the all-false word, which is at most every witness.

    The witness tree of SAT #

    Strict verifier for SAT matching LeftSAT: accepts (φ, w) iff w gives the values of a satisfying assignment along φ.vars consistently across repeated occurrences.

    The binary witness tree of SAT, with witnesses φ.vars.map σ of length φ.vars.length matching LeftSAT.

    The prefix set of SAT.witnessTree reduces to SAT: fix the first u.length occurrences of φ to the bits of u via unit clauses.