Proof of Cook-
Levin TheoremTeam: 921S
Member: Xiechuan Liu
Song Song
Shuo Su
1CS 6212/Arora/Fall 2015Xiechuan/Song/Shuo
The Content of Theorem
β’ Simply: SAT is NP-complete problem
β’ Actually, there is an explicit CNF formula f
of length O(π(π)3) which is satisfiable if
and only if N accepts w. In particular, when
f(n) is a polynomial, f has polynomial
length in terms of n.
CNF f=True
(length= O(π(π)3) )NTM N accepts
language w
iff
2CS 6212/Arora/Fall 2015Xiechuan/Song/Shuo
The importance of Cook-Levin
Theoremβ’ Find the first NPC problem: SAT.
β’ The theorem shows that every problem in
NP-complete can be reduced to a SAT.
β’ A breakthrough that if SAT = P, Then NP =
P.
3CS 6212/Arora/Fall 2015Xiechuan/Song/Shuo
The proof process
β’ 1. SAT is NP
Easily proved because any assignment can be verified
whether is satisfiable in polynomial time.
4CS 6212/Arora/Fall 2015Xiechuan/Song/Shuo
The proof process
β’ 2. SAT is NP-complete
Proof idea: construct a NTM N that accepts w, and reduce
this accepting process into a CNF formula.
CNF f=True
(length= O(π(π)3) )NTM N accepts
language w
iff
5CS 6212/Arora/Fall 2015Xiechuan/Song/Shuo
Definition of NTM N
NTM N (Q, , , , π0,πππππππ‘,πππππππ‘)
1. Q is the set of states.
2. is the input alphabet not containing the special blank symbol Λ½ ,
3. is the tape alphabet, where Λ½β and β ,
4. : Q Γ β Q Γ Γ {L,R} is the transition function,
5. π0 β Q is the start state,
6. πππππππ‘ β Q is the accept state, and
7. πππππππ‘ β Q is the reject state, where πππππππ‘ β πππππππ‘
Essence: Use the Boolean formula as the constraints to assure the
whole accepting process is a legal computation history that NTM
accepts w.
6CS 6212/Arora/Fall 2015Xiechuan/Song/Shuo
1βY,R
A
REJECT
CB
ACCEPT
Any
wrong
symbol
0βX,R
Λ½ β Λ½ ,R
0βX,R
L=01*0
w=01110
1 2 3 4 5 6 7 8 9 10
# state w1 w2 w3 w4 w5 w6 w7 #
1 # A 0 1 1 1 0 Λ½ Λ½ #
2 # B X 1 1 1 0 Λ½ Λ½ #
3 # B X Y 1 1 0 Λ½ Λ½ #
4 # B X Y Y 1 0 Λ½ Λ½ #
5 # B X Y Y Y 0 Λ½ Λ½ #
6 # C X Y Y Y X Λ½ Λ½ #
7 #ACC
EPTX Y Y Y X Λ½ Λ½ #
Constraints: cell β§ start β§ accept β§ moveππ,π,π (for all 1β€ i, j β€ ππ and s β Q βͺ βͺ {#}) = True iff the cell[i][j]
contains βsβ
For example, π3,5,β1β = True iff the cell[3][5] contains β1β
7Xiechuan/Song/Shuo CS 6212/Arora/Fall 2015
cell
1. Every cell must contains one symbol
s β Q βͺ βͺ {#}
ππ,π,π
2. Every cell can only contains one symbol.
π β π‘
(Β¬ππ,π,π β¨ Β¬ππ,π,π‘)
means (for example):
π1,1,β#β β¨ π1,2,β0β β¨ π1,3,β1β β¨β¦β¦
means (for example):
(Β¬π1,1,β#β β¨ Β¬π1,1,β0β β¨ Β¬π1,1,β1β ) β§
(Β¬π1,2,β#β β¨ Β¬π1,2,β0β β¨ Β¬π1,2,β1β ) β§
(Β¬π1,3,β#β β¨ Β¬π1,3,β0β β¨ Β¬π1,3,β1β ) β§β¦.
8CS 6212/Arora/Fall 2015Xiechuan/Song/Shuo
start
1. The first row describes the initial configuration.
start = π1,1,"#" β§ π1,2,"π΄" β§ π1,2,"0" β§β¦
β¦ β§ π1,ππβ2,"Λ½" β§ π1,ππβ1,"Λ½" β§
π1,ππβ1,"#"
accept
1. The ACCEPT state is reached in the
configuration history.
accept =
1β€ i, j β€ ππ
ππ,π,"ππ΄πΆπΆπΈππ"
9Xiechuan/Song/Shuo CS 6212/Arora/Fall 2015
β’ move
Every configuration can legally follow the
previous configuration according to the details
of the Non-deterministic Turing Machineβs
transition function.
π7 π8b β a,R
a q7 b
a a q8
b q7 b
b a q8
c q7 b
c a q8
move = ππ,πβ1,"π" β§ ππ,π,"π7" β§ ππ,π+1,"π" β§
ππ+1,πβ1,"π" β§ ππ+1,π,"π" β§ ππ+1,π+1,"π8"
10CS 6212/Arora/Fall 2015Xiechuan/Song/Shuo
cell =
1β€ i, j β€ ππ
[(
s β Q βͺ βͺ {#}
ππ,π,π ) β§ (
π β π‘
(Β¬ππ,π,π β¨ Β¬ππ,π,π‘))]
start = π1,1,s1 β§ π1,2,s2 β§ π1,3,π 3 β§β¦
β¦ β§ π1,ππβ2,"Λ½" β§ π1,ππβ1,"Λ½" β§ π1,ππβ1,"#"
accept =
1β€ i, j β€ ππ
ππ,π,"ππ΄πΆπΆπΈππ"
move =
1β€ i, j β€ ππ
(
πππ π‘βπ πππππππ¦ π€πππππ€
(π β§ π β§ π β§ π β§ π β§ π))
= cell β§ start β§ accept β§ move
11Xiechuan/Song/Shuo CS 6212/Arora/Fall 2015
Summary
1. We build a CNF formula
= cell β§ start β§ accept β§ move
which only contains ππ,π,π (true or false),
ANDs and ORs.
2. The whole process of NTM accepting w is
described by , if and only if the process is
correct, = True
12CS 6212/Arora/Fall 2015Xiechuan/Song/Shuo
The last step-Time Analysis
β’ The time we consume is the running time
of NTM, set i β€ f(n)
β’ cell = O(π(π)2)
β’ start = O(f(n))
β’ accept = O(1)
β’ move = O(π(π)2)
So = cell β§ start β§ accept β§ move
and = O(π(π)2)
13CS 6212/Arora/Fall 2015Xiechuan/Song/Shuo