NP-Completeness and the Cook-Levin Theorem

Graduate Depth 76 in the knowledge graph I know this Set as goal
Unlocks 4 downstream topics
np-completeness cook-levin sat completeness

Core Idea

The Cook-Levin theorem proves that Boolean satisfiability (SAT) is NP-complete: every NP problem reduces to SAT, and SAT is in NP. This provides the first NP-complete problem; all other NP-complete problems are discovered by reducing from previously known NP-complete problems, creating a network of reductions.

How It's Best Learned

Carefully study the Cook-Levin proof structure: how an NP Turing machine is encoded in a Boolean formula. Work through simplified reductions (e.g., CLIQUE → 3-SAT).

Common Misconceptions

Explainer

You already understand what NP-hardness means and what the Cook-Levin theorem says. Now it is time to see why those two things together produce an extraordinary structural result about computation. A problem is NP-complete if it is both in NP (it can be verified in polynomial time) and NP-hard (every NP problem reduces to it in polynomial time). The Cook-Levin theorem shows that SAT — Boolean satisfiability — is NP-complete. This is not a routine observation; it is the theorem that turned NP-hardness from a definition into a usable tool.

The proof of Cook-Levin works by encoding computation as Boolean formulas. Given any NP problem with verifier V running in polynomial time p(n), Cook-Levin constructs a formula φ such that: the input x is a yes-instance if and only if φ is satisfiable. The formula encodes the entire tableau of V's computation — the state of the machine at each time step — as Boolean variables, with clauses enforcing valid transitions, input consistency, and acceptance. The formula is polynomial in size because V runs in polynomial time. What makes this remarkable is that it works for *every* NP problem simultaneously: each such problem's verifier produces a different formula, but the construction is uniform. SAT is therefore the "receptacle" that absorbs all of NP.

The consequence is a chain reaction. Once SAT is known to be NP-complete, proving any other problem X is NP-complete requires only: (1) showing X is in NP, and (2) giving a polynomial-time reduction from SAT (or from any already-known NP-complete problem) to X. This is far easier than repeating the full Cook-Levin tableau construction. The direction matters: to show X is NP-hard, reduce a known hard problem *to* X, not the other way around. If SAT → X in polynomial time and SAT is hard, then X must be at least as hard. Over fifty years of research has produced hundreds of NP-complete problems this way — graph problems, scheduling problems, packing problems — all linked by this reduction network.

The deepest implication is what NP-completeness says about the entire complexity class. If any single NP-complete problem is in P — if any one of them can be solved in polynomial time — then every problem in NP is also in P, because the reduction chain collapses: solve any NP problem by reducing it to your one easy NP-complete problem. Conversely, if any NP-complete problem is provably not in P, then P ≠ NP. The P vs NP question is therefore equivalent to asking whether any one NP-complete problem is tractable. Cook-Levin turned an open question about the structure of computation into a question you can attack by studying any single combinatorial problem.

Practice Questions 5 questions

Prerequisite Chain

Counting to 10Counting to 20Understanding ZeroThe Number ZeroCounting to FiveOne-to-One CorrespondenceCombining Small Groups Within 5Addition Within 10Addition Within 20Two-Digit Addition Without RegroupingTwo-Digit Addition with RegroupingAddition Within 100Repeated Addition as MultiplicationMultiplication Facts Within 100Division as Equal SharingDivision as Grouping (Measurement Division)Division: Grouping (Repeated Subtraction) ModelDivision: Fair Sharing ModelDivision as Equal SharingDivision as GroupingBasic Division FactsDivision Facts Within 100Two-Digit by One-Digit DivisionDivision with RemaindersRemainders and Quotients in DivisionDivision Word ProblemsIntroduction to Long DivisionFactors and MultiplesPrime and Composite NumbersEquivalent FractionsRelating Fractions and DecimalsDecimal Place ValueReading and Writing DecimalsComparing and Ordering DecimalsAdding and Subtracting DecimalsMultiplying DecimalsDividing DecimalsDividing FractionsMixed Number ArithmeticOrder of OperationsInteger Order of OperationsVariable ExpressionsCombining Like TermsOne-Step EquationsTwo-Step EquationsSolving Multi-Step EquationsEquations with Variables on Both SidesLiteral EquationsSlope-Intercept FormPoint-Slope FormWriting Linear EquationsParallel and Perpendicular Line SlopesGraphing Linear EquationsPiecewise FunctionsStep FunctionsComposition of FunctionsInverse FunctionsRadical Functions and GraphsRational ExponentsExponential Functions and GraphsLogarithms IntroductionBig-O Notation and Asymptotic AnalysisBreadth-First Search (BFS)Shortest Paths in Unweighted GraphsDijkstra's Shortest Path AlgorithmAlgorithm Analysis and Big-O NotationTuring MachinesTime Complexity and the Class PNondeterministic Turing MachinesNP and Polynomial-Time VerificationProbabilistic Computation and BPPBPP and Randomized ComplexityRandomized Complexity: RP, co-RP, and ZPPComplexity Classes and the Complexity HierarchyThe P Versus NP Problem: Central Open QuestionNP-Hardness: Definition and PropertiesNP-Completeness and the Cook-Levin Theorem

Longest path: 77 steps · 427 total prerequisite topics

Prerequisites (2)

Leads To (2)