Write and Explain Cook’s Theorem (Cook–Levin Theorem)
Cook’s theorem (often grouped with the Cook–Levin theorem) is the foundational result in computational complexity that establishes SAT (Boolean satisfiability) as NP-complete. Concretely, it shows two things:
- SAT is in NP (a satisfying assignment can be verified in polynomial time), and
- Every language in NP can be reduced to SAT in polynomial time, meaning SAT is NP-hard, hence NP-complete. 2
A useful way to “write and explain” Cook’s theorem is to separate the story into (i) formal definitions (NP, reductions, NP-complete), (ii) the verifier-to-formula translation, and (iii) the resulting complexity consequence. We’ll follow that structure.
Key learning targets:
- SAT
- NP
- NP-complete
- Polynomial-time reduction
- Cook reduction
Footnotes
-
Stephen A. Cook, “The Complexity of Theorem-Proving Procedures” (1971). https://doi.org/10.1145/321694.321712 - Introduces Cook’s original NP-completeness result for SAT/related formulations. ↩
-
NP-completeness (Cook–Levin theorem / Cook’s theorem) overview and SAT NP-completeness discussion. https://en.wikipedia.org/wiki/Cook%27s_theorem - States SAT is NP-complete and describes the core reduction idea. ↩
Cook–Levin theorem / Cook’s theorem overview (NP-completeness of SAT)
Definitions you must write down before proving anything
To explain Cook’s theorem rigorously, you need standard definitions.
-
NP
A language is in NP if there exists a nondeterministic polynomial-time Turing machine deciding it, i.e., every input has an accepting computation of length polynomial in if and only if . -
Polynomial-time many-one reduction ()
We say if there exists a polynomial-time computable function such that for all :
This is the type of reduction used in Cook’s theorem to show NP-hardness of SAT. 2
- NP-complete
A language is NP-complete if:
- , and
- for every , .
Cook’s theorem’s main goal is to show SAT meets both conditions. 2
Footnotes
-
NP (definition via nondeterministic polynomial time / verifiers). https://en.wikipedia.org/wiki/NP - Formal characterization of NP used in complexity proofs. ↩
-
NP-completeness (Cook–Levin theorem / Cook’s theorem) overview and SAT NP-completeness discussion. https://en.wikipedia.org/wiki/Cook%27s_theorem - States SAT is NP-complete and describes the core reduction idea. ↩ ↩2
-
Reduction and NP-complete definitions via polynomial-time many-one reductions. https://en.wikipedia.org/wiki/NP-completeness - Explains reductions () and the definition of NP-complete. ↩
-
Stephen A. Cook, “The Complexity of Theorem-Proving Procedures” (1971). https://doi.org/10.1145/321694.321712 - Introduces Cook’s original NP-completeness result for SAT/related formulations. ↩
Write and prove Cook’s theorem (proof sketch with the core construction)
- 1Step 1
Let . By definition, there exists a nondeterministic Turing machine and a polynomial such that for any input with , iff has an accepting computation that halts within steps.
Footnotes
-
NP (definition via nondeterministic polynomial time / verifiers). https://en.wikipedia.org/wiki/NP - Formal characterization of NP used in complexity proofs. ↩
-
- 2Step 2
Consider a time horizon . Any accepting run can be viewed as a sequence of configurations (starting from the initial configuration and ending in an accepting one). The key idea is to encode the existence of such a sequence using Boolean variables. 2
Footnotes
-
NP-completeness (Cook–Levin theorem / Cook’s theorem) overview and SAT NP-completeness discussion. https://en.wikipedia.org/wiki/Cook%27s_theorem - States SAT is NP-complete and describes the core reduction idea. ↩
-
Reduction and NP-complete definitions via polynomial-time many-one reductions. https://en.wikipedia.org/wiki/NP-completeness - Explains reductions () and the definition of NP-complete. ↩
-
- 3Step 3
Create variables that represent, for each time and tape cell position , which tape symbol appears, and which state (if any) the head is in. Also include variables to represent head position / state. This forms a tableau encoding of the computation. 2
Footnotes
-
NP-completeness (Cook–Levin theorem / Cook’s theorem) overview and SAT NP-completeness discussion. https://en.wikipedia.org/wiki/Cook%27s_theorem - States SAT is NP-complete and describes the core reduction idea. ↩
-
Reduction and NP-complete definitions via polynomial-time many-one reductions. https://en.wikipedia.org/wiki/NP-completeness - Explains reductions () and the definition of NP-complete. ↩
-
- 4Step 4
Write clauses ensuring (i) the initial configuration matches , (ii) transitions follow the transition function of , (iii) exactly one symbol/state assignment holds where required, and (iv) the final configuration is accepting. These constraints ensure the formula can be true only if the encoded computation is valid. 2
Footnotes
-
Stephen A. Cook, “The Complexity of Theorem-Proving Procedures” (1971). https://doi.org/10.1145/321694.321712 - Introduces Cook’s original NP-completeness result for SAT/related formulations. ↩
-
NP-completeness (Cook–Levin theorem / Cook’s theorem) overview and SAT NP-completeness discussion. https://en.wikipedia.org/wiki/Cook%27s_theorem - States SAT is NP-complete and describes the core reduction idea. ↩
-
- 5Step 5
Prove both directions:
• If , then the accepting run of gives a consistent tableau, producing a satisfying assignment for the constructed formula.
• If the formula is satisfiable, then the satisfying assignment defines a valid accepting computation of within steps, so . 2Footnotes
-
NP-completeness (Cook–Levin theorem / Cook’s theorem) overview and SAT NP-completeness discussion. https://en.wikipedia.org/wiki/Cook%27s_theorem - States SAT is NP-complete and describes the core reduction idea. ↩
-
Reduction and NP-complete definitions via polynomial-time many-one reductions. https://en.wikipedia.org/wiki/NP-completeness - Explains reductions () and the definition of NP-complete. ↩
-
- 6Step 6
Show the constructed Boolean formula has size polynomial in (roughly because is polynomial and you add polynomially many local constraints). Since the mapping is computable in polynomial time, you get . Together with , SAT is NP-complete. 3
Footnotes
-
Stephen A. Cook, “The Complexity of Theorem-Proving Procedures” (1971). https://doi.org/10.1145/321694.321712 - Introduces Cook’s original NP-completeness result for SAT/related formulations. ↩
-
NP-completeness (Cook–Levin theorem / Cook’s theorem) overview and SAT NP-completeness discussion. https://en.wikipedia.org/wiki/Cook%27s_theorem - States SAT is NP-complete and describes the core reduction idea. ↩
-
Reduction and NP-complete definitions via polynomial-time many-one reductions. https://en.wikipedia.org/wiki/NP-completeness - Explains reductions () and the definition of NP-complete. ↩
-
The heart of the explanation: “local constraints” simulate transitions
When you write the Cook theorem argument, the most important explanation sentence is usually:
“The Boolean formula enforces that consecutive configurations differ exactly according to the transition function of the nondeterministic machine, using local (time to ) constraints.”
This is why the tableau method works: TM computation is inherently “step-by-step,” and SAT can represent consistency across steps via clauses that constrain pairs of adjacent time layers. 2
A compact way to visualize the encoding is:
Footnotes
-
NP-completeness (Cook–Levin theorem / Cook’s theorem) overview and SAT NP-completeness discussion. https://en.wikipedia.org/wiki/Cook%27s_theorem - States SAT is NP-complete and describes the core reduction idea. ↩
-
Reduction and NP-complete definitions via polynomial-time many-one reductions. https://en.wikipedia.org/wiki/NP-completeness - Explains reductions () and the definition of NP-complete. ↩
Pro Tip: write Cook’s theorem as two proofs
To “write and explain” Cook’s theorem cleanly, structure it as: (1) SAT ∈ NP, (2) for arbitrary L ∈ NP, build a poly-time reduction L ≤p SAT via computation tableau. Readers follow faster when SAT’s membership and NP-hardness are separate mini-proofs. 2
Footnotes
-
Stephen A. Cook, “The Complexity of Theorem-Proving Procedures” (1971). https://doi.org/10.1145/321694.321712 - Introduces Cook’s original NP-completeness result for SAT/related formulations. ↩
-
NP-completeness (Cook–Levin theorem / Cook’s theorem) overview and SAT NP-completeness discussion. https://en.wikipedia.org/wiki/Cook%27s_theorem - States SAT is NP-complete and describes the core reduction idea. ↩
Common pitfall: confusing NP with verification vs. search
NP is about existence of a short certificate verifiable in poly time (or equivalently nondeterministic poly-time computation), not about finding that certificate efficiently. Cook’s construction encodes existence of an accepting computation as satisfiability, not the act of finding it. 2
Footnotes
-
NP (definition via nondeterministic polynomial time / verifiers). https://en.wikipedia.org/wiki/NP - Formal characterization of NP used in complexity proofs. ↩
-
Reduction and NP-complete definitions via polynomial-time many-one reductions. https://en.wikipedia.org/wiki/NP-completeness - Explains reductions () and the definition of NP-complete. ↩
Why the theorem is “complete” for NP
Once you have shown that every NP language reduces to SAT, you can phrase Cook’s theorem as a completeness statement:
- If you could solve SAT efficiently (e.g., in polynomial time), then by reduction you could solve every language in NP efficiently.
- Conversely, if SAT is hard, then all of NP inherits that hardness under reductions.
Formally, Cook’s theorem implies SAT is NP-complete, meaning it is in NP and NP-hard. 2
Footnotes
-
Stephen A. Cook, “The Complexity of Theorem-Proving Procedures” (1971). https://doi.org/10.1145/321694.321712 - Introduces Cook’s original NP-completeness result for SAT/related formulations. ↩
-
NP-completeness (Cook–Levin theorem / Cook’s theorem) overview and SAT NP-completeness discussion. https://en.wikipedia.org/wiki/Cook%27s_theorem - States SAT is NP-complete and describes the core reduction idea. ↩
From NP definitions to Cook’s theorem and NP-completeness
Define NP
Step ANP languages have polynomial-size accepting witnesses (or nondeterministic poly-time machines). "
Footnotes
-
NP (definition via nondeterministic polynomial time / verifiers). https://en.wikipedia.org/wiki/NP - Formal characterization of NP used in complexity proofs. ↩
Define reductions
Step BPolynomial-time many-one reductions preserve yes-instances. 2"
Footnotes
-
NP-completeness (Cook–Levin theorem / Cook’s theorem) overview and SAT NP-completeness discussion. https://en.wikipedia.org/wiki/Cook%27s_theorem - States SAT is NP-complete and describes the core reduction idea. ↩
-
Reduction and NP-complete definitions via polynomial-time many-one reductions. https://en.wikipedia.org/wiki/NP-completeness - Explains reductions () and the definition of NP-complete. ↩
Encode computation as SAT
Step CCreate tableau variables and clauses for valid transitions and acceptance. 2"
Footnotes
-
NP-completeness (Cook–Levin theorem / Cook’s theorem) overview and SAT NP-completeness discussion. https://en.wikipedia.org/wiki/Cook%27s_theorem - States SAT is NP-complete and describes the core reduction idea. ↩
-
Reduction and NP-complete definitions via polynomial-time many-one reductions. https://en.wikipedia.org/wiki/NP-completeness - Explains reductions () and the definition of NP-complete. ↩
Prove equivalence
Step DAccepting run ↔ satisfiable formula; mapping is polynomial-time. 2"
Footnotes
-
Stephen A. Cook, “The Complexity of Theorem-Proving Procedures” (1971). https://doi.org/10.1145/321694.321712 - Introduces Cook’s original NP-completeness result for SAT/related formulations. ↩
-
NP-completeness (Cook–Levin theorem / Cook’s theorem) overview and SAT NP-completeness discussion. https://en.wikipedia.org/wiki/Cook%27s_theorem - States SAT is NP-complete and describes the core reduction idea. ↩
Conclude NP-completeness
Step ESAT ∈ NP and every NP language reduces to SAT. 2"
Footnotes
-
Stephen A. Cook, “The Complexity of Theorem-Proving Procedures” (1971). https://doi.org/10.1145/321694.321712 - Introduces Cook’s original NP-completeness result for SAT/related formulations. ↩
-
NP-completeness (Cook–Levin theorem / Cook’s theorem) overview and SAT NP-completeness discussion. https://en.wikipedia.org/wiki/Cook%27s_theorem - States SAT is NP-complete and describes the core reduction idea. ↩
What Cook’s theorem establishes (and what each part requires)
Conceptual checklist for writing the proof.
Frequently needed details when you write the proof
Cook’s theorem: write/teach yourself terms
Knowledge Check
Cook’s theorem is commonly used to show that SAT is: