We have already shown in a previous lecture that $ SAT \in NP$ . It remains to show that $ SAT$ is NP-hard, i.e. $ \forall f \in NP$ we have $ f \leq_p SAT$ .
The difficulty of the proof relies in the fact that we cannot use the reduction technique shown in the previous lecture, since there is no choice of another NP-hard problem. Therefore, we need to prove that, for each NP-problem, there exists a polynomial-time reduction to SAT.
Let $ f \in NP$ be a decision problem. The only information that we have of $ f$ is that it is decidable by a nondeterministic Turing Machine in a polynomial time which we consider to be $ T(n) = n^k$ for some $ k \in \mathbb{N}$ .
Thus, the reduction $ f \leq_p SAT$ must construct, for each word $ w$ , a formula $ \varphi_w$ , such that:
In constructing $ \varphi_w$ , we must exploit the limited information we have:
The key idea of the proof is to construct the formula $ \varphi_w$ in such a way that:
In the construction, a key ingredient is the information that, since the machine performs at most $ n^k$ computation steps, then at most $ n^k$ cells of the tape will be employed in the computation.
We will again assume that the machine never moves its head beyond the first position of the tape (an assumption similar to that from the proof of PCP undecidability).
Let $ K$ be the number of states of the NTM and $ \Sigma$ be the alphabet.
A sequence of successful computations may be described in a tabular/matrix manner, as follows:
# | q0 | c1 | c2 | … | cn | # | # | … | # |
---|---|---|---|---|---|---|---|---|---|
# | c | q1 | c2 | … | cn | # | # | … | # |
… | … | … | … | … | … | … | … | … | # |
q0
and the tape contains the word w = c1c2…cn
Note that the matrix has a polynomial number of positions: $ O(n^{k+k})$ positions.
Our task is to use a $ SAT$ formula to describe such a matrix.
i,j
in the matrix, we have the value $ p$ . We can interpret the position i,j
as: after computation step i
, at position j
of the configurationThe formula which we construct must express the appropriate constraints such that the matrix is a valid description of a NTM computation. Hence:
$ \varphi_w = \varphi_{cell} \wedge \varphi_{start} \wedge \varphi_{move} \wedge \varphi_{yes}$
$ \varphi_{cell}$ must express that each position must contain a single value, i.e.
$ \varphi_{cell} = \displaystyle \bigwedge_{i,j\leq n^k} (\bigvee_{p\in K \cup \Sigma} x_{i,j,p} \wedge \bigwedge_{p\neq p' \in K \cup \Sigma} (\lnot x_{i,j,p} \vee \lnot x_{i,j,p'})) $
Note that $ \varphi_{cell}$ is in CNF. Also, the size of $ \varphi_{cell}$ is $ O(n^{2k})$ .
$ \varphi_{start}$ must express the initial configuration, i.e.
$ \varphi_{start} = \displaystyle x_{1,1,\#} \wedge x_{1,2,q_0} \wedge x_{1,3,c1} \wedge \ldots x_{1,n^k+2,\#}$
The size of $ \varphi_{start}$ is $ O(n^{k})$ .
$ \varphi_{yes}$ must express the existence of a successful configuration, i.e.
$ \varphi_{yes} = \displaystyle \bigvee_{i,j\leq n^k} x_{i,j,q_{yes}}$ - that is, the machine enters an accepting state at some time.
The size of $ \varphi_{yes}$ is $ O(n^{2k})$ .
$ \varphi_{move}$ must express the execution of one transition between each step (row) i
and i+1
of the matrix. We illustrate $ \varphi_{move}$ via an example. Suppose $ \delta(q_1,a) = \{(q_2,b,R)\}$ and consider that the head is in position j
after i
transitions have been performed, as shown in the following 2 x 3
chuck of our matrix:
q1 | a | a |
---|---|---|
b | q2 | a |
We express a valid transition as:
$ \displaystyle (x_{i+1,j,b} \wedge x_{i+1,j+1,q_2}) \vee (x_{i+1,j,c} \wedge x_{i+1,j-1,q_3})$