Satisfiability & Cook-Levin


Theorem 1 (circuits simulate TMs): Let t,s:NN be functions. If a language L{0,1} is decidable by a TM M that runs in time t(n) and uses s(n) space, then L is decidable by a circuit family C that has size O(t(n)s(n)) and depth O(t(n)).

Moreover, the construction of the circuit family C can be done in time O(t(n)s(n)).


Proof: See written notes.


We are now ready to establish our first natural NP-complete language, and to prove the Cook-Levin Theorem. To do so, we need to introduce the following language:


Definition 1 (Circuit-SAT): The CIRCUIT-SAT language is defined as follows:

CIRCUIT-SAT:={CC is a satisfiable boolean circuit}.

where by a satisfiable boolean circuit we mean a boolean circuit C such that there exists an assignment of the input variables that makes the output gate of C output 1.


We can use theorem 1 to show that CIRCUIT-SAT is NP-complete.


Theorem 2: CIRCUIT-SAT is NP-complete.


Proof: Membership in NP is clear, since given a circuit C, a certificate is a satisfying assignment for C, and we can check in polynomial time if the certificate is correct by evaluating the circuit.

To show that CIRCUIT-SAT is NP-hard, we will show a polynomial-time (Karp) reduction from any language LNP to CIRCUIT-SAT. More precisely, we need to give a polynomial-time computable function f:{0,1}{0,1} such that for all x{0,1}, we have xLf(x)CIRCUIT-SAT.

Since LNP, there exists a poly-time TM V and a polynomial p:NN such that for all x{0,1}, we have

xLy{0,1}p(|x|) such that V(x,y)=1.

Let f be the function that maps x to the description of the circuit Cx that simulates V on input x and certificate y. Since the TM V runs in time polynomial on |x|, there is a polynomial t:NN such that V runs in time t(|x|). In particular, V also uses at most t(|x|) space, and by theorem 1, we can construct a circuit Cx that simulates V on input x and certificate y using at most t(|x|)2 gates and depth t(|x|). Moreover, this construction can be done in polynomial time.

Note that xLy{0,1}p(|x|) such that V(x,y)=1Cx is satisfiablef(x)CIRCUIT-SAT, as desired.


The language CIRCUIT-SAT is a natural NP-complete language, but one could ask if we need to consider general boolean circuits, or if we could restrict our attention to a simpler class of circuits while preserving NP-completeness. The answer is affirmative, and we can consider the following language:


Definition 2 (3-SAT): The 3-SAT language is defined as follows:

3-SAT:={ϕϕ is a satisfiable 3-CNF formula}.

where by a satisfiable 3-CNF formula we mean a 3-CNF formula ϕ such that there exists an assignment of the variables that makes ϕ true.


We can now prove the Cook-Levin Theorem, which states that 3-SAT is NP-complete.


Theorem 3 (Cook-Levin Theorem): 3-SAT is NP-complete.


Proof: It is clear that 3-SAT is in NP, since given a 3-CNF formula ϕ, a certificate is a satisfying assignment for ϕ, and we can check in polynomial time if the certificate is correct by evaluating ϕ on it.

To show that 3-SAT is NP-hard, we will show a polynomial-time (Karp) reduction from CIRCUIT-SAT to 3-SAT. Let C be a boolean circuit, where x1,,xn are the input variables, and g1,,gm are the gates of C. The idea is to add extra variables to encode the computation of the circuit C as a 3-CNF formula ϕ.

Our formula ϕ will have the following structure:

  • each gate of the circuit C will be represented by a variable in ϕ. Thus, we will have the variables x1,,xn representing the input variables, and g1,,gm representing the gates of C.
  • We will add clauses to ϕ to ensure that the output of each gate is computed correctly. This is done as follows:
    • If gi is a NOT gate with input u, then we add the clauses (giu)(giu).
    • If gi is an AND gate with inputs u,v, then we add the clauses (uvgi)(uvgi)(uvgi)(uvgi).
    • If gi is an OR gate with inputs u,v, then we add the clauses (uvgi)(uvgi)(uvgi)(uvgi).
  • Lastly, we will add the clause (gm) to ensure that ϕ is satisfiable if and only if the circuit C is satisfiable.

Remark: we can make sure that the formula ϕ is a 3-CNF formula (i.e., each clause has exactly 3 literals) by adding extra (dummy) variables and clauses to ϕ. The main point is that each clause has at most 3 literals, and the construction can be done in polynomial time.

The above construction shows that C is satisfiable if and only if ϕ is satisfiable, and hence CIRCUIT-SAT reduces to 3-SAT in polynomial time.


Acknowledgements & References

This lecture was based on these resources:

Previous
Next