11

The other day, a student asked me whether, if $P \ne NP$, whether any language outside of $NP$ is known to be $NP$-hard. I wasn't sure if

  • This is definitely known to be true,
  • This is definitely known to be false, or
  • This depends on another set of complexity assumptions that do not immediately follow from $P \ne NP$ (that is, even if we knew $P \ne NP$, this would still be an open question)

None of the texts on complexity I looked into seemed to answer this question (though it is quite possible that I simply missed it). Does anyone know which of the above three is true, or know a good reference where I could look up the answer?

(Note: This earlier question is related, but I'm considering solely questions outside of $NP$ (so the existing answer doesn't really help) and am not restricting this to just the decidable languages)

Thanks!

4 Answers4

10

So it looks like the answer to this question is as follows: If $P \ne NP$, then there exists a language not contained in NP that is not NP-hard. This follows from Mahaney's theorem, which says that $P = NP$ iff there is some sparse language L such that SAT is polynomial-time reducible to L. In particular, this says that if $P \ne NP$, then SAT is not polynomial-time reducible to any sparse language. So consider the unary halting language $UNARYHALT$ consisting of unary encodings of TM/string pairs where the given TM halts on the particular input. This language is sparse, since for any length there is either zero or one strings in the language with that length. Moreover, this language is undecidable by a reduction from the halting problem, so it cannot be in NP. Therefore, if $P \ne NP$, by Mahaney's theorem this language is not NP-hard, because there is no polynomial-time reduction from SAT to it.

4

It seems that the probabilistic method works.

Consider $\{0,1\} \times \{0,1\} \times \dots$ as a probability space, corresponding to throwing a coin countably many times (product measure).

Any event $a \in \{0,1\} \times \{0,1\} \times \dots$ encodes a subset $L \subseteq \{0,1\}^{\ast}$, the consecutive bits decide if $\epsilon \in L, 0 \in L, 1 \in L, 00 \in L, \dots$. We will now select random $L$, equivalently random $a$, and check its properties.

With probability 1, $L \notin \mathsf{NP}$ (since $\mathsf{NP}$ is countable), even more: with probability 1, $L$ is undecidable.

Now, suppose you have a reduction $f \colon A^{\ast} \to \{0,1\}^{\ast}$ that attempts to reduce SAT to $L$. Since $\mathsf{P} \neq \mathsf{NP}$ by assumption, the image of $f$ must be infinite; otherwise you could convert the reduction to a decision procedure for $SAT$. However, for any $x$, it must hold $x \in SAT \iff f(x)\in L$, and that happens with probability 1/2. Since there are infinitely many values for $f(x)$, the probability that $f$ is a valid reduction from SAT to $L$ is 0.

Since there are countably many reductions, and countable intersection of sets of measure 1 has measure 1, the overall probability of $L$ satisfying all conditions is 1.

So a "generic" random language is neither decidable nor $\mathsf{NP}$-hard, unless $\mathsf{P} = \mathsf{NP}$.

It is possible to convert this proof to diagonalization: on $2i$-th stage, you diagonalize against $i$-th $\mathsf{NP}$ problem; on $2i+1$-th stage, you diagonalize against $i$-th polynomial time reduction with infinite image. This gives a constructive example; with more careful bookkeeping you can get a decidable example.

sdcvvc
  • 10,528
  • 1
    @templatetypedef: No, there's definitely uncountably many NP-hard languages. Pick arbitrary language $L$ and then $M=0\cdot L \cup 1\cdot SAT$ is NP-hard by reduction from SAT to $M$: $f(x) = 1 x$. In your argument, a pair does not specify the NP-hard language completely, outside the image of the reduction. – sdcvvc Jan 17 '14 at 09:27
  • Excellent point. I stand corrected! – templatetypedef Jan 17 '14 at 16:57
  • Following up on this answer, over eight years later! I was rereading this and followed everything you said up to the point where you said that "generic" languages aren't NP-hard unless P = NP. Why would the connection between P and NP change anything that you've mentioned here? – templatetypedef May 07 '20 at 00:37
  • 1
    @templatetypedef In the answer, I've shown that $L$ is not NP-hard with probability 1 under the assumption that P!=NP. (I mention that assumption in the proof). If P=NP, the proof does not work and the statement is false: if P=NP, then any language L that is nonempty and nonfull is NP-hard. Proof: suppose u is any word in L and v is any word not in L. Then, L is NP-hard: we can reduce SAT to L, by solving SAT in polynomial time (possible because of the assumption P=NP), depending on the answer the reduction answers u or v. – sdcvvc Jul 07 '20 at 00:25
3

The answer to this question depends on the complexity assumptions.

  • If $\mathrm P = \mathrm {NP}$, then every nontrivial language $L$ is $\mathrm{NP}$-hard. [A language is said to be nontrivial if it contains at least one yes instance and at least one no instance.] To reduce a given $\mathrm {NP}$ problem $A$ to $L$, we simply ignore $L$ and use the polynomial-time algorithm for $A$ -- this is guaranteed to exist under our assumption.

  • Assuming $\mathrm{NP} \neq \text{co-}\mathrm{NP}$, no problem in $\text{co-}\mathrm{NP}$ would be $\mathrm{NP}$-hard.

Srivatsan
  • 26,311
  • So even if P != NP, we cannot say for certain whether every language outside NP is NP-hard, since it depends on whether NP = co-NP? It seems like there might be some other known result that would show this result either way. – templatetypedef Dec 13 '11 at 08:19
  • @templatetypedef Yes, this does not answer your question completely because I need the stronger hypothesis that NP $\neq$ coNP (although most people believe this stronger assumption anyway). – Srivatsan Dec 13 '11 at 08:30
  • Any co-NP-complete problem, for example the set of Boolean formula tautologies, is NP-hard. The definition NP-hardness allows arbitrary oracle ("Turing" or "Cook") reductions, not just many-one ("Karp") reductions. – Colin McQuillan Dec 13 '11 at 09:07
  • @Colin, You raise a nice point. Indeed under the Turing (Cook) reductions, coNP-complete problems are NP-complete as well. However, without explicit qualification, I always take NP-complete in the sense of Karp reductions (as my post shows :-)). However I will be happy to see answers from the other point of view. :) – Srivatsan Dec 13 '11 at 09:16
  • "NP-complete" is always Karp, "NP-hard" is always Turing. – Colin McQuillan Dec 13 '11 at 09:28
  • Sorry, apparently your use of NP-hard does also get used. So "NP-complete" is always Karp, but "NP-hard" is sometimes Turing. – Colin McQuillan Dec 13 '11 at 09:35
  • The argument for the $P=NP$-case only works when using $P$-reductions, not when using $L$-reductions. And $L$-reductions should be considered here, as they don't affect the notion of $NP$-hardness, but still make sense when talking about $P$-hardness. – Mike B. Dec 13 '11 at 10:14
  • @Mike I agree that logspace reductions could be considered, but don't see a compelling reason why they should. And as far as I can see, we are not discussing P-hardness in this post. – Srivatsan Dec 13 '11 at 10:19
  • Take $PARITY$, a nontrivial language. If you assume $P=NP$, and consider $NP$-hardness under $P$-reductions, then $PARITY$ is $NP$-hard, but not $P$-hard. So a problem is hard for a class, but not hard for the same class? – Mike B. Dec 13 '11 at 11:13
  • @Mike I do not understand your point. I agree that the answer could vary if you consider P-reductions versus Logspace reductions. But why is it that we should consider logspace reductions? – Srivatsan Dec 13 '11 at 11:15
  • Because $P$-completeness is defined under logspace reductions ($P$-reductions for $P$-hardness woudldn't make much sense). And why do we consider $P$-completeness at all? Because we are considering $NP$-completeness, and have the assumption of $P=NP$. Considering the fact that otherwise we get that some languages can be $NP$-hard, but not $P$-hard, I ask why whe shouldn't consider logspace reductions. – Mike B. Dec 13 '11 at 11:24
  • @Mike Perhaps I am being dense but I do not see your point at all. If you post an answer with this alternate standpoint, then I will be happy to read and upvote. – Srivatsan Dec 13 '11 at 11:40
2

Take any undecidable language L and let L' be the language of pairs (n,x) with x in L and n=2^|x| in unary. Then L' is in P/poly but not in NP. If L' is NP-hard then NP$\subset$P/poly and the polynomial hierarchy collapses by the Karp-Lipton theorem.