This proof is based on the one given by . There are two parts to proving that the Boolean satisfiability problem (SAT) is NP-complete. One is to show that SAT is an NP problem. The other is to show that every NP problem can be reduced to an instance of a SAT problem by a
polynomial-time many-one reduction. SAT is in NP because any assignment of Boolean values to Boolean variables that is claimed to satisfy the given expression can be
verified in polynomial time by a deterministic Turing machine. (The statements
verifiable in polynomial time by a deterministic Turing machine and
solvable in polynomial time by a non-deterministic Turing machine are equivalent, and the proof can be found in many textbooks, for example Sipser's
Introduction to the Theory of Computation, section 7.3., as well as
in the Wikipedia article on NP). showing Cook's reduction of M to SAT. Data sizes and program runtimes are colored in and , respectively. Now suppose that a given problem in NP can be solved by the
nondeterministic Turing machine M = (Q, \Sigma, s, F, \delta), where Q is the set of states, \Sigma is the alphabet of tape symbols, s \in Q is the initial state, F \subseteq Q is the set of accepting states, and \delta \subseteq ((Q \setminus F) \times \Sigma) \times (Q \times \Sigma \times \{-1, +1\}) is the transition relation. Suppose further that M accepts or rejects an instance of the problem after at most p(n) computation steps, where n is the size of the instance and p is a polynomial function. For each input, I, specify a Boolean expression B that is satisfiable
if and only if the machine M accepts I. The Boolean expression uses the variables set out in the following table. Here, q \in Q is a machine state, -p(n) \leq i \leq p(n) is a tape position, j \in \Sigma is a tape symbol, and 0 \leq k \leq p(n) is the number of a computation step. Define the Boolean expression B to be the
conjunction of the sub-expressions in the following table, for all -p(n) \leq i \leq p(n) and 0 \leq k \leq p(n): If there is an accepting computation for M on input I, then B is satisfiable by assigning T_{i,j,k}, H_{i,k} and Q_{i,k} their intended interpretations. On the other hand, if B is satisfiable, then there is an accepting computation for M on input I that follows the steps indicated by the assignments to the variables. There are O(p(n)^2) Boolean variables, each encodable in space O(\log p(n)). The number of clauses is O(p(n)^3) so the size of B is O(\log(p(n)) p(n)^3). Thus the transformation is certainly a polynomial-time many-one reduction, as required. Only the first table row (T_{i,j,0}) actually depends on the input string I. The remaining lines depend only on the input length n and on the machine M; they formalize a generic computation of M for up to p(n) steps. The transformation makes extensive use of the polynomial p(n). As a consequence, the above proof is not
constructive: even if M is known,
witnessing the membership of the given problem in NP, the transformation cannot be effectively computed, unless an upper bound p(n) of M's time complexity is also known. ==Complexity==