Cook-Levin Theorem
Context: FIT2014_MOC Β· the first NP-complete language β pays condition (b) of NP-Completeness once, generically, so every later proof is one reduction instead of an argument about all of
The proof (Lecture 29) is explicitly NON-EXAMINABLE. Learn the statement, the two obligations, and the architecture below β it is the payoff for CNF encoding and TM configurations. Do not spend SWOTVAC time reproducing the clause algebra.
Quick Revision
- π― Objective: satisfiable Boolean expressions in CNF is NP-complete (S. Cook 1971, L. Levin 1972).
- β‘ Key Constraint: part (a) β SAT β is easy and examinable; part (b) is the hard generic construction and is not.
π Core
- The two obligations β (a) ; (b) .
- (a) in full (the examinable half β the standard 4-part membership proof) β certificate = a truth assignment to the variables of ; verifier = check each clause has a true literal; iff = satisfiable some assignment passes; time = one pass over , polynomial in .
- Why (b) is hard β it quantifies over an infinite set of languages, so no fixed gadget works. The only handle every shares is that it has a polynomial-time verifier β so the reduction must encode an arbitrary machineβs run, not the problemβs combinatorics.
- The generic idea β given with polynomial-time verifier on tape ( the input, the certificate), build a CNF such that
- The polynomial clock β with , set β an integer bound on the number of timesteps, which is what makes the variable set finite and polynomially large.
𧬠Proof architecture (non-examinable β read once for the shape)
Variables β one Boolean for every possibility of every part of at every timestep, with :
| Variable | Meaning at time | Range |
|---|---|---|
| the machine is in state | (states) | |
| tape cell contains letter | , | |
| the tape head is scanning cell |
- Why polynomially many β the counts are , and β all polynomial in because is.
Clauses β left unconstrained, the variables describe nonsense (machine in several states at once, head in two places, a cell holding two letters). Two families rule that out:
| Family | Condition | Clause form |
|---|---|---|
| Static β sanity, every | exactly one state | at least: Β· at most: per pair |
| exactly one head position | at least: Β· at most: per pair | |
| exactly one letter per cell | at least: Β· at most: per pair | |
| Static β boundary | correct start, | |
| accepted, | β state is Accept | |
| Dynamic β inertia | cells away from the head do not change | , one per letter |
| Dynamic β transition | for with if Right, if Left | Β· Β· |
- Reading the dynamic clauses β each is an implication pushed into CNF by and De Morgan β the W1 rewriting, applied mechanically.
- Conclusion β is the conjunction of everything above; is computable in polynomial time (lengthy but routine), and .
- The omitted detail (posed as an open exercise on the revision slide β no answer given in the handout) β the construction assumes acceptance happens exactly at ; extra clauses are needed for a TM that accepts earlier. (A natural fix is to make the Accept state absorbing so an early accept persists to time β not stated in the slides.)
β οΈ Common Mistakes
- π‘ Attempting the proof under exam pressure β it is non-examinable. What is examinable is the statement, part (a), and the consequence that one reduction now suffices.
- π‘ Forgetting the sanity clauses β without βexactly oneβ per component the variables describe an impossible machine, and becomes satisfiable for inputs rejects.
- π‘ Confusing the two normal forms β this is Conjunctive Normal Form (logic), never Chomsky Normal Form (grammars).
- π‘ Saying Cook-Levin proves β it proves SAT is a hardest problem in . Which side of the frontier that summit sits on is still open.
π§ Active Recall
Why must the reduction encode time explicitly, with a variable per timestep?
Answer
- Short answer: a Boolean formula is static β it has no notion of sequence β so a whole computation must be flattened into one assignment by indexing every component with .
- Why: the polynomial bound makes the flattening finite β the run is at most steps on at most cells, so variables suffice. A verifier without a polynomial time bound would need infinitely many variables, which is exactly why this works for and not for r.e. languages (see Recursively Enumerable Languages).
What does Cook-Levin buy that the PARTITION INTO TRIANGLES reduction does not?
Answer
- Short answer: universality. One worked reduction shows one language is ; Cook-Levin shows every language in is, which is condition (b) of NP-completeness.
- Why: the handmade reductions encode a problemβs rules, the generic one encodes a machine β the only property shared by all of is the existence of a polynomial-time verifier, so that is the object the construction must talk about. Karpβs follow-up then makes the effort a one-off: every later NP-completeness proof reduces from SAT rather than repeating this.