Cook-Levin theorem Created 2026-10-07 Updated 2026-10-14
Every NP verifier can be compiled into a polynomial-size Boolean circuit whose inputs encode its certificate, and then into an equisatisfiable conjunctive normal form by a Tseitin transformation. This gives a polynomial-time many-one reduction from every NP language to SAT. Checking a guessed assignment proves membership, so SAT is NP-complete.
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 59 1 a Solution Created 2026-10-03 Updated 2026-10-07
The Cook-Levin theorem states that the Boolean satisfiability problem is NP-complete under polynomial-time many-one reductions. Membership in NP follows by guessing an assignment and evaluating the formula in time polynomial in its description length.
For hardness, let have a deterministic polynomial-time verifier , with a polynomial witness-length bound. Use a fixed polynomial certificate length: a short certificate is encoded by its length followed by padded data, and the verifier checks this encoding. Pad the computation to exactly steps, with accepting and rejecting states absorbing. Enlarge polynomially if necessary to cover input/witness initialization. A standard polynomial slowdown permits a single-tape Turing machine, so it suffices to handle that model.
Encode a tape cell by a fixed number of bits recording its alphabet symbol and either no head or the head's finite control state. Starting with one head, a cell's next label depends only on its own label and the two neighboring labels: a head can change the symbol where it sits and can enter only a neighbor. Each such finite local function has a constant-size Boolean circuit. The initial row fixes , blanks and the starting head, leaving only the witness bits as Boolean circuit inputs. There are relevant cells with blank margins beyond every possible head position, and updates. Repeating these local Boolean circuits produces a Boolean circuit of size , with an output detecting an accepting head in the final row. The construction is computable in polynomial time. Induction on rows shows that every assignment to produces exactly the verifier's valid computation; invalid local encodings can be assigned arbitrary Boolean circuit behavior because they never arise from the valid initial row.
Convert this Boolean circuit to conjunctive normal form using a Tseitin transformation. Introduce one variable for each wire, and encode each gate output by:
| Gate relation | Clauses imposing equivalence |
|---|---|
Unit clauses fix constant sources and assert the final output. Each input assignment has exactly one extension to its gate values, so the resulting formula is satisfiable precisely when some witness makes accept. It has clauses of bounded length and is produced in polynomial time. ThusThis proof also gives hardness for clauses of at most three literals, without needing a separate satisfiability assumption.
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 59 3 a Solution Created 2026-10-03 Updated 2026-10-07
A circuit size class consists of languages whose length- indicator functions have Boolean circuits of size at most , for all sufficiently large , over a fixed finite bounded-fan-in complete basis. The notation allows a constant factor. Input-node counting conventions do not affect the polynomial and exponential bounds here.
The nonuniform class P/poly isThere is no requirement that a uniform algorithm construct the Boolean circuits. Equivalently, a polynomial-time machine can receive polynomial-length advice depending only on the input length, and the advice need not be computable.
Choose an undecidable set , for example the set in the halting problem of indices of machines that halt on empty input, and define . For each length , use a constant-zero Boolean circuit if , and an AND of all input bits if . These Boolean circuits have size and accept exactly . Thus undecidable unary languages with linear-size circuits belong to P/poly.
Every NP language is decidable by enumerating its finitely many polynomial-length certificate encodings and running the polynomial-time verifier. If were decidable, testing would decide , a contradiction. ThereforeThis separates the classes in the stated direction; it does not claim that NP is not contained in P/poly.
Query certificate 2026-10-07
For a Boolean function and a chosen input , a set of coordinates is a query certificate if every agreeing with on has . It fixes actual input bits rather than supplying an independently guessed certificate to an NP verifier. Minimizing its size at each input and then maximizing gives query certificate complexity.