4

The definition of the complexity class $\mathsf{NP}$ seems to ensure (as good as possible) that it is computably enumerable. It looks as if the class could be enumerated by enumerating all Turing machines, and for each Turing machine report for each $k\in\mathbb{N}$ the language generated by stopping each computation after $n^k$ steps, and reject if the input hasn't been accepted before reaching this step limit.

This only gives a computable enumeration of Turing machines. However, it seems that the corresponding languages will be decidable, because the enumeration includes an explicit time bound for each of its Turing machines. Hence this should give an computable enumeration of $\mathsf{NP}$.

Question: Is the conclusion from this reasoning correct, i.e. is $\mathsf{NP}$ computably enumerable? One issue that I have is that even for decidable languages, we can only (computably) decide whether two given languages are different, but not whether they are equal. Hence it seems that we can't avoid to report the same language more than once. The deeper issue here is that being computably enumerable is a property of subsets of the natural numbers, but the complexity class $\mathsf{NP}$ doesn't seem to correspond to a subset of the natural numbers in any canonical way.

Raphael
  • 73,212
  • 30
  • 182
  • 400
Thomas Klimpel
  • 5,440
  • 29
  • 69

2 Answers2

4

I can't make heads nor tails from what you attempt to do, but I know that the answer to your question is: no, NP is not enumerable.

First, let's fix what that means. I assume you are asking if

$\qquad\displaystyle \mathrm{TM}_{\mathsf{NP}} = \{ \langle M \rangle \mid L(M) \in \mathsf{NP} \}$

is recursively enumerable. It's not by the extended Rice theorem since the Turing machine $M$ that never halts is an NP-acceptor for the empty language, so $M \in \mathrm{TM}_{\mathsf{NP}}$, but there certainly are $M'$ with $M \subsetneq M'$ and $M' \notin \mathrm{TM}_{\mathsf{NP}}$.

Intuitively, no algorithm can separate $M$ (which has infinitely many equivalent brethren, by the way) from any other Turing machine in finite time, and thus can never enumerate them.

Raphael
  • 73,212
  • 30
  • 182
  • 400
3

Your trick is actually used in structural complexity theory, say in these proofs of Ladner's theorem. In order to enumerate all languages in NP, you instead enumerate all timed Turing machines $\langle M, k \rangle$, which automatically stop and (say) reject after $kn^k$ steps. Another variant is that a time polytime machine is a pair $\langle M,k \rangle$, where $M$ is guaranteed to stop within $kn^k$ steps. You can't enumerate timed polytime machines under this definition, for the same reason as in Raphael's answer.

Yuval Filmus
  • 280,205
  • 27
  • 317
  • 514