Search to decision for SAT #
A procedure that decides satisfiability also finds satisfying assignments
Arora and Barak, Section 2.5. The self-reduction
(Cslib.Complexity.SAT.selfReduce) fixes the variables of a formula φ one literal occurrence
at a time: it asks whether φ, with the values chosen so far as unit clauses and the next
variable set to true, is satisfiable, and fixes the variable to the answer. If φ is satisfiable
and the answers are correct, the formula stays satisfiable, so at the end the chosen values
satisfy φ (Cslib.Complexity.SAT.verifier_search). The answers need only be correct on the
formulas the self-reduction asks about, whose encodings are at most queryBound of the length of
φ's, so a procedure that is correct up to that length suffices; this is how Karp and Lipton use
circuits for SAT. The values are output as a certificate for Cslib.Complexity.SAT.verifier,
one bit for each literal occurrence. Correctness only uses that each answer chooses a value that
keeps the formula satisfiable (Cslib.Complexity.SAT.verifier_search_of_step); this is how a
P-selector for SAT decides it (Cslib.Complexity.SAT.mem_P_of_mem_PSel).
The self-reduction makes one query for each literal occurrence, so it runs in polynomial time when
the queries are answered in polynomial time
(Cslib.Complexity.SAT.computableInPolyTime_search). In particular, if SAT is in P,
satisfying assignments can be found in polynomial time (Cslib.Complexity.SAT.exists_search).
The unit clauses and the bounds on their encoded length are in
CslibFrontier/Computability/Complexity/Problems/SAT/Units.lean.
Main definitions #
Cslib.Complexity.SAT.selfReduce: the variables and values fixed by the self-reduction.Cslib.Complexity.SAT.search: the certificate found by the self-reduction.Cslib.Complexity.SAT.queryBound: a bound on the length of the queries.
Main results #
Cslib.Complexity.SAT.map_fst_foldl_selfReduceStep: the steps fix the variables in order.Cslib.Complexity.SAT.verifier_search_of_step: if each step of the self-reduction keeps the formula satisfiable, it finds a satisfying assignment of every satisfiable formula.Cslib.Complexity.SAT.verifier_search: with answers correct up toqueryBound, the self-reduction finds a satisfying assignment of every satisfiable formula.Cslib.Complexity.SAT.computableInPolyTime_search: the self-reduction is polynomial-time when the queries are answered in polynomial time.Cslib.Complexity.SAT.exists_search: ifSAT ∈ P, satisfying assignments are found in polynomial time.
References #
One step of the self-reduction of φ with the decision procedure D: fix v to the answer
of D on φ with the values fixed so far and v set to true.
The self-reduction of φ with the decision procedure D: for each literal occurrence
v of φ in turn, the value fixed for v.
The certificate found by the self-reduction: the value fixed at each literal occurrence.
A bound on the length of the encoded formulas that the self-reduction of a formula of encoded
length L asks about.
Correctness #
Each step of the self-reduction fixes the next variable: folding the steps over l appends
l to the variables fixed so far.
The formulas that the self-reduction asks about are no longer than queryBound.
When the formula obtained by appending all unit clauses chosen by selfReduce D φ remains
satisfiable, the certificate produced by search D φ is accepted by the verifier.
Search to decision, stepwise. If each step of the self-reduction of φ keeps a
satisfiable formula satisfiable (the value D chooses for the next variable v leaves
φ, with the values fixed so far, satisfiable), and φ is satisfiable, the certificate found
by the self-reduction satisfies φ. The answers of D need not be correct: the self-reduction
only needs them to choose a satisfiable branch.
Search to decision. If D decides satisfiability correctly on the formulas of length at
most queryBound of the length of φ, and φ is satisfiable, the certificate found by the
self-reduction satisfies φ.
The self-reduction never finds a satisfying assignment of an unsatisfiable formula: the certificate it finds is accepted exactly when the formula is satisfiable.
Polynomial time #
The self-reduction is polynomial-time when its queries are answered in polynomial time,
with a procedure D x that may depend on the input x.
Search reduces to decision for SAT: if SAT is in P, a polynomial-time function
finds a satisfying assignment of every satisfiable formula, as a certificate for SAT.verifier.