13.1. CoNP


Nondeterministic algorithms treat yes and no differently

For deterministic computation, the time needed to solve set S is the same as the time needed to solve S. Just swap the yes and no answers.

But nondeterministic classes are different. There is an asymmetry between yes and no. The evidence that a nondeterministic algorithm checks is only needed when the answer is yes. When the answer is no, we only require that there not exist acceptable evidence showing that the answer is yes.

That asymmetry shows up in the compositeness problem,

COMPOSITE = {x | x is a composite integer}.

A nondeterministic algorithm for COMPOSITE takes, as evidence, a pair of integers u and v. It accepts (u, v) as evidence that x is composite if 1 < u < x and 1 < v < x and uv = x.

There is no need to have evidence showing that x is not composite. And such evidence would need to be of a very different nature from factors.


CoNP

Class CoNP switches the roles of yes and no.

Definition. CoNP = {S | S ∈ NP}

For example, we know that COMPOSITE is in NP. So COMPOSITE is in CoNP.

COMPOSITE = {x | x is not a composite integer}.

A number x > 1 is prime if it is not composite. So the set of prime numbers is

PRIME = {x | x > 1 and x is not a composite integer}.

Since testing whether x > 1 is very easy, determining whether x is prime takes the same amount of time as determining whether x is not composite. So PRIME is in CoNP.