coNP and the Limits of NP
Hand me a filled-in Sudoku grid and I can check it in a minute: every row, column and box gets each
digit once, done. Hand me a satisfying assignment to a giant Boolean formula and, again, I just plug it
in and watch every clause light up. This is the whole personality of
NP:
a yes answer comes with a short certificate that a polynomial-time verifier
can rubber-stamp.
Now flip the question. Prove to me that a formula has no satisfying assignment — that
every one of its 2^n settings fails. What do you hand me? There is
no obvious short receipt for "I checked all of infinity and found nothing." That nagging asymmetry —
yes looks cheap to certify, no looks expensive — is the entire subject of this page.
The class of problems whose no-answers have short certificates has a name:
coNP.
coNP: short certificates for NO
Take any decision problem L — a set of "yes" instances. Its
complement \overline{L} just swaps the labels: the old
no-instances become the new yes-instances. The class coNP is defined by this swap.
- L \in \mathrm{NP} iff every yes-instance has a
polynomial-size certificate a verifier accepts in polynomial time.
- L \in \mathrm{coNP} iff every no-instance has such a
certificate — equivalently, iff \overline{L} \in \mathrm{NP}.
- Using
quantifiers:
NP asks \exists\, w\, .\, V(x,w) ("there is a witness"); coNP asks
\forall\, w\, .\, V(x,w) ("all candidate witnesses check out").
So coNP is not "the problems not in NP" — it is NP looked at from the other side, the class of
problems with easily-checkable rejections. Three canonical members:
| Problem | Yes-instance means… | A NO-answer has a short certificate? |
| TAUTOLOGY | formula true under every assignment | a single falsifying assignment proves it is not a tautology |
| UNSAT | formula true under no assignment | a single satisfying assignment proves it is satisfiable |
| NO-HAMILTON | graph has no Hamiltonian cycle | an actual Hamiltonian cycle proves the graph does have one |
Read the right-hand column carefully: in each case the easy-to-check receipt certifies the
opposite verdict. That is exactly what coNP membership means. UNSAT is the complement of
SAT,
and just as SAT is NP-complete, UNSAT and TAUTOLOGY are coNP-complete — the hardest
problems in coNP.
The map: P, NP and coNP
P
— problems solvable in polynomial time — sits inside both NP and coNP. If you can actually
solve a problem quickly you can certify a yes (just solve it and show the run) and certify a no
just as easily, so the answer's sign never mattered. That places P squarely in the overlap.
The picture captures the two great open questions of the field. Nobody knows whether P fills the whole
overlap (\mathrm{P} = \mathrm{NP} \cap \mathrm{coNP}?), and nobody knows
whether the two big blobs actually differ (\mathrm{NP} = \mathrm{coNP}?).
What we do know is a clean logical link between them, coming next.
The asymmetry, and why it bites
P is closed under complement: flip the accept/reject wire on a polynomial-time machine and you decide
the complement, still in polynomial time. So \mathrm{P} = \mathrm{coP}, and P
never notices which way a question is phrased. NP is different. A nondeterministic machine
accepts if some branch says yes; negating "some branch accepts" gives "all branches
reject," which is not the same machine at all. There is no known way to turn a guess-and-check for
yes into a guess-and-check for no.
This is why "disproving" feels harder than "proving." To prove a formula satisfiable you exhibit one
lucky assignment; to prove it unsatisfiable you must somehow account for all
2^n of them. The belief — unproven but near-universal — is that this
difficulty is real:
- It is conjectured that \mathrm{NP} \neq \mathrm{coNP}:
some problems have short yes-certificates but no short no-certificates.
- If \mathrm{NP} \neq \mathrm{coNP}, then
\mathrm{P} \neq \mathrm{NP}. Contrapositive: if
\mathrm{P} = \mathrm{NP} then, since
\mathrm{P} = \mathrm{coP} = \mathrm{coNP}, we would get
\mathrm{NP} = \mathrm{coNP}.
- So proving \mathrm{NP} \neq \mathrm{coNP} would settle
\mathrm{P} \neq \mathrm{NP} — a harder-looking route to the same summit,
and equally open.
Concretely: a short, checkable proof of unsatisfiability for every unsatisfiable formula would put
UNSAT in NP, forcing \mathrm{NP} = \mathrm{coNP}. Decades of proof-complexity
research is essentially the hunt for exactly such certificates — and its steady stream of exponential
lower bounds is the best circumstantial evidence that they do not exist.
Living in the overlap: NP ∩ coNP
Some problems sit in both classes without being known to be in P — you can certify a yes
and certify a no, yet nobody has a fast algorithm. These are prime suspects for "not
NP-complete, not in P."
- FACTORING (as a decision problem: "does N have a factor
below k?"). A yes is certified by the factor itself; a
no is certified by N's full prime factorisation (each factor
proved prime), which pins down every divisor. So FACTORING
\in \mathrm{NP} \cap \mathrm{coNP} — strong evidence it is not
NP-complete, because an NP-complete problem in coNP would collapse
\mathrm{NP} = \mathrm{coNP}.
- PRIMES ("is N prime?"). It lived in
\mathrm{NP} \cap \mathrm{coNP} for years — until the 2002
AKS algorithm proved \mathrm{PRIMES} \in \mathrm{P} outright. A
reminder that "in the overlap but not known to be in P" is a statement about our ignorance, not a
law of nature.
The moral: \mathrm{NP} \cap \mathrm{coNP} is where the genuinely mysterious
problems hide. Being there is a near-guarantee of not being NP-complete, yet gives no promise
of being tractable. Factoring's presence there is precisely why RSA-style cryptography is built on it
rather than on an NP-complete problem.
A tautology claims a universal: "true for all 2^n rows of the truth
table." Universals are cheap to refute and dear to confirm — a single counterexample
row (one falsifying assignment) demolishes the claim, but confirming it means surveying every row. SAT
claims an existential, "true for some row," and the economics reverse: one witnessing row
confirms it, while refuting it means ruling out all rows. NP is the home of cheap-to-confirm
existentials; coNP is the home of cheap-to-refute universals. The
polynomial
hierarchy is what you get when you start alternating these quantifiers.
The prefix "co" tempts people to read coNP as the complement of the class NP — the problems
not in NP. That is wrong twice over. First, coNP is
\{\overline{L} : L \in \mathrm{NP}\}, the complements of the individual
problems, not the set-difference of classes. Second, the two classes overlap
hugely: all of P is in both, and possibly (if \mathrm{NP} = \mathrm{coNP})
they are equal. A problem can be in NP, in coNP, in both, or in neither. And note the direction of the
one-way implication: \mathrm{NP} \neq \mathrm{coNP} would prove
\mathrm{P} \neq \mathrm{NP}, but \mathrm{P} \neq \mathrm{NP}
does not settle whether \mathrm{NP} = \mathrm{coNP} — they are
separate open questions.