4

If P = NP, why does P = NP also then equal NP-Complete?

I.e. Why would it then be the case that P = NP = NP-Complete?

Assuming P != NP , there were problems in NP not in NP - Complete. When P = NP, all NP problems are actually now P.

Shouldn't there still be P = NP problems not in NP - Complete?

enter image description here

Raphael
  • 72,336
  • 29
  • 179
  • 389
LazerSharks
  • 141
  • 1
  • 5

1 Answers1

4

If $P=NP$ then every non-trivial language $L$ is NP-hard, where non-trivial means that $L$ is neither the empty language nor the language of all words. This follows immediately from the definition of NP-hardness (exercise!). In particular, every non-trivial language in NP is NP-hard, and so NP equals NPC plus the two trivial languages.

Yuval Filmus
  • 276,994
  • 27
  • 311
  • 503
  • Hmm, I'm sorry, I haven't learned about languages in relation to complexity classes... do you have a short explanation of how are they related? (Good readings you could point me to?) – LazerSharks Dec 11 '14 at 07:56
  • @Gnuey If you don't know what P, NP and NPC are, you can't expect to understand why P=NP implies P=NP=NPC. So your first step should be to understand the definitions of P, NP and NPC. These are very standard notions, described in many online lecture notes and offline textbooks. Some of these probably even explain why P=NP implies P=NP=NPC. – Yuval Filmus Dec 11 '14 at 07:59
  • Hmm, I have an understanding in terms of problems, just not in terms of languages. Most lecture notes do not talk about P, NP, and NPC in terms of languages. Thanks, will take another look at P, NP, NPC in terms of languages. – LazerSharks Dec 11 '14 at 08:26
  • Problems and languages are the same thing. See http://cs.stackexchange.com/questions/13669/what-is-the-difference-between-an-algorithm-a-language-and-a-problem. – Yuval Filmus Dec 11 '14 at 08:31
  • @YuvalFilmus I saw this http://cs.stackexchange.com/a/7455/98 as well as your answer here, and I learned that NP-complete=[NP(=P) -the trivial problems]. Now my question is how to show that the two trivial problems($\phi$ and $\Sigma *$) belongs to the class P? can you help me out with a proof or a link to an answer? any help shall be appreciated, but please do help me, as I am feeling quite uncomfortable until I have got hold of the proof. Thanks. Moreover in that case NPC$\approx$NP – Abhishek Ghosh May 16 '20 at 14:35
  • 1
    It follows immediately from the definition of P. It would be pointless for me to spell it out. Either you “get it”, or seeing the proof will only help so much. – Yuval Filmus May 16 '20 at 14:37
  • @YuvalFilmus only a little hint shall help – Abhishek Ghosh May 16 '20 at 14:40
  • 1
    It’s very easy. – Yuval Filmus May 16 '20 at 14:40
  • @YuvalFilmus Class P refers to all problems which can be solved by DTM in polytime. When the problem is $\phi$ then giving the YES or NO answer is simple for the DTM and it does so in constant time,by giving the NO for all inputs. When the problem is $\Sigma *$ here as well the DTM answers the question in constant time by saying YES for all its inputs. SO is my idea ok? – Abhishek Ghosh May 16 '20 at 14:49
  • 1
    Yes, that’s the idea. – Yuval Filmus May 16 '20 at 14:54