# Is the complement of the given language necessarily in NP?

$A$ is a given language so that $A \in NP$.

Assume that $P = NP$.

Is $A'$ necessarily in NP?

What I did:

$A \in NP , P=NP$

$P=coP$ (Can be proven by running a TM $M$ as a decider for P, and building a TM $M'$ and switching 'accept's to 'reject's and vice-versa).

If $P=NP$, then $L \in NP \Rightarrow L \in P$

$P=coP \Rightarrow L' \in P \Rightarrow L' \in NP \Rightarrow L \in coNP$

Which proves that $coP=coNP$

And hence that $NP=coNP$

So $A \in NP \Rightarrow A \in coNP \Rightarrow A' \in NP$

Is this the correct way of solving this kind of questions?

Is there a better way?

Did I make any mistakes?

Is the proof of $coP=coNP$ correct?

• By $A'$ you mean the complement? \overline{A} gets you more commonly used notation. – Raphael Feb 2 '16 at 13:36
That can make your argument very concise: $A \in NP \Rightarrow A \in P \Rightarrow A' \in P \Rightarrow A' \in NP$