A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

The Cook-Levin Theorem

Graduate Depth 98 in the knowledge graph ☐ I know this ☆ Set as goal
50topics build on this
500prerequisites beneath it
See this on the map →
NP-Completeness and Cook-Levin TheoremBoolean Type and Truth Values→→Boolean Satisfiability, Cook-Levin, and ReductionsShor's Algorithm
Cook-Levin SAT NP-complete CNF-SAT circuit-complexity

Core Idea

The Cook-Levin theorem (Cook 1971, Levin 1973) proves that Boolean satisfiability (SAT) — and 3-SAT — is NP-complete, establishing the first NP-complete problem. The proof encodes any polynomial-time nondeterministic TM computation as a Boolean formula in CNF: variables represent the tableau of TM configurations, and clauses enforce valid transitions. If SAT could be solved in polynomial time, so could every NP problem. Once SAT was known NP-complete, hundreds of other problems were shown NP-complete by polynomial reduction from SAT or 3-SAT.

How It's Best Learned

Study the tableau construction at a high level: understand that rows represent TM configurations, columns represent time steps, and clauses enforce consistency. Then read Karp's 1972 paper listing 21 NP-complete problems to see the reduction cascade that followed Cook's result.

Common Misconceptions

Explainer

You already know what NP-completeness means: a problem is NP-complete if it is in NP (a solution can be verified in polynomial time) and every problem in NP can be reduced to it in polynomial time. But knowing the definition raises an obvious question: how do you prove the *first* NP-complete problem? You cannot reduce from a known NP-complete problem because none has been established yet. The Cook-Levin theorem breaks this circularity by proving directly, from the definition of NP itself, that Boolean satisfiability (SAT) is NP-complete.

The proof strategy is to show that any NP computation can be encoded as a SAT instance. Here is the intuition. An NP problem, by definition, has a nondeterministic Turing machine that decides it in polynomial time. That machine's computation can be laid out as a tableau — a two-dimensional grid where rows represent successive configurations (tape contents, head position, state) and columns represent time steps. The entire computation fits in a p(n) × p(n) grid for some polynomial p. Cook and Levin's insight was to create Boolean variables for every cell in this tableau and then write clauses in conjunctive normal form (CNF) that enforce three things: the initial configuration is correct, each row follows from the previous one by a valid transition rule, and the machine reaches an accepting state. The resulting formula is satisfiable if and only if the Turing machine accepts — meaning a SAT solver could answer any NP question.

The theorem's importance is not that SAT is hard (though practitioners know it often is). It is that SAT is universal for NP: it can express any polynomial-time verification problem. Once Cook and Levin established SAT as NP-complete, Richard Karp showed in 1972 that 21 other well-known problems — including Clique, Vertex Cover, Hamiltonian Path, and Integer Programming — are also NP-complete by polynomial-time reductions from SAT or 3-SAT. Each new reduction was far simpler than Cook-Levin because it only needed to reduce from one already-known NP-complete problem. This cascade of reductions is why Cook-Levin is the keystone of NP-completeness theory: it did the heavy lifting once, and everything else followed.

One subtlety worth noting: the theorem as originally proved applies to SAT in general, not specifically to 3-SAT (where every clause has exactly three literals). The reduction from SAT to 3-SAT is a separate, relatively straightforward step that introduces auxiliary variables to break long clauses into groups of three. The reason 3-SAT matters is practical — it is the most common starting point for further NP-completeness reductions because its restricted structure makes reductions cleaner to construct.

Practice Questions 5 questions

Prerequisite Chain

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Addition Within 10 → Number Bonds to 10 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Comparing and Ordering Integers → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Introduction to Exponents → Order of Operations → Integer Order of Operations → Variable Expressions → The Distributive Property → Variables and Expressions Review → Introduction to Polynomials → Adding and Subtracting Polynomials → Multiplying Polynomials → Factorial → Permutations → Combinations → Counting Principles: Addition and Multiplication Rules → Introduction to Graph Theory → Propositional Logic Foundations → Logical Equivalences → Boolean Algebra → Boolean Type and Truth Values → Comparison Operators and Boolean Tests → Logical Operators and Boolean Algebra → Boolean Algebra and Fundamental Laws → Logic Gates Fundamentals → Implementing Boolean Functions with Gates → Karnaugh Map Simplification → Combinational Circuit Design → Flip-Flops and Latches → Finite State Machines (FSMs) → Deterministic Finite Automata (DFA) → Nondeterministic Finite Automata (NFA) → Two-Way Finite Automata → NFA to DFA Conversion (Subset Construction) → DFA Properties and Minimization Algorithms → Regular Languages: Definition and Characterization → Context-Free Grammars (CFGs) → Pushdown Automata (PDA) → Equivalence of CFGs and Pushdown Automata → Closure Properties of Context-Free Languages → Limitations of Context-Free Languages → Pumping Lemma for Context-Free Languages → Turing Machines → Variants of Turing Machines and Equivalence → Nondeterministic Time Complexity and NP → The P vs. NP Problem → Complexity Class P: Polynomial Time → Complexity Class NP: Nondeterministic Polynomial Time → NP-Completeness and Cook-Levin Theorem → The Cook-Levin Theorem

Longest path: 99 steps · 500 total prerequisite topics

Prerequisites (2)

Leads To (2)