$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$
So the answer is YES
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?
Thanks in advance