Co-NP


In computational complexity theory, co-NP is a complexity class. A decision problem is a member of co-NP if and only if its complement is in the complexity class NP. The class can be defined as follows: a decision problem is in co-NP precisely if for any no-instance x there is a "certificate" which a polynomial-time algorithm can use to verify that x is a no-instance, and for any yes-instance there is no such certificate.
Equivalently, co-NP is the set of decision problems where there exists a polynomial p and a polynomial-time bounded non-deterministic Turing machine such that for every instance x, x is a yes instance if and only if: for every possible certificate c of length bounded by p, the Turing machine accepts the pair.

Problems

The complement of any problem in NP is a problem in co-NP. An example of an NP-complete problem is the circuit satisfiability problem: given a Boolean circuit, is there a possible input for which the circuit outputs true? The complementary problem asks: "given a Boolean circuit, do all possible inputs to the circuit output false?". This is in co-NP because a polynomial-time certificate of a no-instance is a set of inputs which make the output true.
An example of a problem that is known to belong to both NP and co-NP is integer factorization: given positive integers m and n, determine if m has a factor less than n and greater than one. Membership in NP is clear; if m does have such a factor then the factor itself is a certificate. Membership in co-NP is also straightforward: one can just list the prime factors of m, all greater or equal to n, which the verifier can confirm to be valid by multiplication and the AKS primality test. It is presently not known whether there is a polynomial-time algorithm for factorization, equivalently that integer factorization is in P, and hence this example is interesting as one of the most natural problems known to be in NP and co-NP but not known to be in P.
A problem L is co-NP-complete if and only if L is in co-NP and for any problem in co-NP, there exists a polynomial-time reduction from that problem to L. An example such problem is that of determining if a formula in propositional logic is a tautology: that is, if the formula evaluates to true under every possible assignment to its variables.

Relationship to other classes

, the class of polynomial time solvable problems, is a subset of both NP and co-NP. P is thought to be a strict subset in both cases.
NP and co-NP are also thought to be unequal. If so, then no NP-complete problem can be in co-NP and no co-NP-complete problem can be in NP. This can be shown as follows. Suppose there exists an NP-complete problem that is in co-NP. Since all problems in NP can be reduced to, it follows that for every problem in NP we can construct a non-deterministic Turing machine that decides its complement in polynomial time, i.e., NP ⊆ co-NP. From this it follows that the set of complements of the problems in NP is a subset of the set of complements of the problems in co-NP, i.e., co-NP ⊆ NP. Thus co-NP = NP. The proof that no co-NP-complete problem can be in NP if NP ≠ co-NP is symmetrical.