160 likes | 410 Views
The Cook-Levin Theorem. CS468/568. Author : David Costanzo, Yale University A dapted from Computational Complexity: A Modern Approach by Arora and Barak. The Claim. Claim 1: SAT is NP-complete Claim 2: 3SAT is NP-complete. Proof Structure. SAT ϵ NP. SAT NP-complete. SAT NP-hard.
E N D
The Cook-Levin Theorem CS468/568 Author: David Costanzo, Yale University Adapted from Computational Complexity: A Modern Approach by Arora and Barak
The Claim • Claim 1: SAT is NP-complete • Claim 2: 3SAT is NP-complete
Proof Structure SATϵNP SATNP-complete SATNP-hard SAT ≤p3SAT Lemma 2.11 Lemma 2.14 3SATNP-hard 3SATNP-complete 3SATϵNP
Lemma 2.14: SAT ≤p3SAT • Convert each CNF clause of size k to equivalent clauses of sizes k-1 and 3 • repeat until all clauses are size 3 (fresh variable) ʌ
Lemma 2.11: SAT is NP-hard • Pick any LϵNP, and let be a poly-time TM recognizing L on any input and valid certificate u • Assumptions: • has 1 input tape and 1 work/output tape • is oblivious
Lemma 2.11: SAT is NP-hard • Need to describe a poly-time function mapping input of length n to formula such that:
Lemma 2.11: SAT is NP-hard • Need to describe a poly-time function mapping input of length n to formula such that: Or equivalently:
Lemma 2.11: SAT is NP-hard • Variables of : • y1, y2, ..., yn (first n bits of input u) • yn+1, yn+2, ..., yn+p(n) (next p(n) bits of input u) • z1, z2, ..., zT(n) (snapshots of TM on input u) (bit strings of length c)
Lemma 2.11: SAT is NP-hard • Variables of : • y1, y2, ..., yn (first n bits of input u) • yn+1, yn+2, ..., yn+p(n) (next p(n) bits of input u) • z1, z2, ..., zT(n) (snapshots of TM on input u) • The goal: The formula is satisfied iff the input snapshots represent a valid execution of on input y = u (bit strings of length c)
Lemma 2.11: SAT is NP-hard • What is a snapshot? ... input tape > 0 1 0 0 1 ... work/output tape > 1 1 1 0 0 snapshot = (0, 1, q7) (constant # of bits) state register q7
Lemma 2.11: SAT is NP-hard • What is a snapshot? ... input tape > 0 1 0 0 1 ... work/output tape > 1 1 1 0 0 snapshot = (0, 1, q7) (constant # of bits) state register q7 • How to determine the correct snapshot at time i?
Lemma 2.11: SAT is NP-hard • Given input y and all snapshots z1, ..., zi-1, there exists at most one valid snapshot zi • This zi depends only on zi-1, zprev(i), and yinputpos(i) • prev(i) = the most recent step preceding i at which the work/output head was at the same position as at step i • inputpos(i) = the position of the input head at step i • These are well-defined by obliviousness, and poly-time computable by simulating on dummy input 0|x|
Lemma 2.11: SAT is NP-hard - : the first n bits of y are equal to the bits of x - : z1 correctly encodes the initial snapshot of - : zT(n) correctly encodes a halting snapshot of from which outputs 1 (i.e. accept) - : For each i between 2 and T(n)-1,
Lemma 2.11: SAT is NP-hard How to express in CNF? etc...