The first \mathcal {NP}-complete problem [00WY]
- December 4, 2026
Definition Boolean circuit [00WZ]
- December 4, 2026
A boolean circuit is a directed, acyclic graph G such that:
- Each indegree-0 vertex (“input”) is labelled with either \mathsf {T}, \mathsf {F}, or a distinct variable.
- All other vertices have indegree 1 or 2, and are labelled with either \neg (if indegree 1) or \lor or \land (if indegree 2).
- Only one vertex has outdegree 0, which we call the “output”.
(Note this is not really a “circuit” as we would usually conceive it, since in particular there are no loops!)
Remark [00X2]
- December 4, 2026
Given a truth assignment for the variables labelling the inputs, we think of a Boolean circuit as resulting in a \mathsf {T} / \mathsf {F} value in the obvious way: each edge corresponds to a wire which carries a single \mathsf {T} / \mathsf {F} value to the input of the next logic gate. Boolean circuits come with a natural decision problem.
Problem CIRCUIT-SAT [00X0]
- December 4, 2026
Given a boolean circuit, is there an assignment of the input variables such that the circuit outputs \mathsf {T}?
Theorem CIRCUIT-SAT is \mathcal {NP}-complete [00X1]
- December 4, 2026
Around 1971, Stephen Cook and Leonid Levin independently proved that \mathcal {NP}-complete problems exist, although their proofs were a bit different than the one presented here.
Proof.
- December 4, 2026
First, it is easy to see that CIRCUIT-SAT \in \mathcal {NP}: a certificate is a truth assignment; to verify it in polynomial time we can just run the circuit and check that it outputs \mathsf {T}.
Now we must show CIRCUIT-SAT is \mathcal {NP}-hard. Suppose X \in \mathcal {NP}, i.e. X has a polynomial-time certifier B. We must show X \leq _P CIRCUIT-SAT.
Since B is an algorithm, it can be encoded as a boolean circuit (proof: computers exist, and any boolean function can be encoded using \land , \lor , \neg ). Well, except for one problem: our boolean circuits have no loops. But we can circumvent that by simply “unrolling” any loops, by making a whole bunch of copies of a circuit that computes a single step. If the algorithm only runs for a polynomial amount of time then we need at most a polynomial number of copies to make this work. So, intuitively, we can build a polynomial-sized boolean circuit that simulates the algorithm B. Given an input s, we fix the inputs corresponding to s, and leave as variables the inputs corresponding to t. Now we ask whether the resulting circuit is satisfiable. If it is, that means there is some t such that B(s,t) = \mathsf {T}, that is, s \in X. If it is not satisfiable, then there is no such t, so s \notin X. Hence X \leq _P CIRCUIT-SAT.