Why is $NP \subseteq P \implies NP^A \subseteq P^A$ false? My question is about why does the result of Baker-Gill-Solovay not prove that $P \neq NP$. There have been several questions on this forum about this topic perhaps but I couldn't find my specific question amongst them.

Context: This is what I had in mind when I first saw the Baker-Gill-Solovay result (there exists an oracle $A$ such that $P^A \neq NP^A$): I will try to give a proof for $P \neq NP$. Suppose $P=NP$ then $P^A = NP^A$ for all oracles $A$. By Baker-Gill-Solovay result we arrive at a contradiction. When I asked my prof about this he said that the implication $P=NP \implies P^A = NP^A$ is wrong. So I wanted to check why (and where) does it fail.

I think it is correct that $P \subseteq NP \implies P^A \subseteq NP^A$ for all oracles $A$ because any poly-time TM with oracle access to $A$, is also a poly-time NDTM with oracle access to $A$.

My question is: Why (if $NP \subseteq P$ then for any oracle $A$, $NP^A \subseteq P^A$) is false?



My reasoning would go as follows: $NP \subseteq P$ means that given any NDTM (which involves a guessing sequence, followed by a poly-time verification), I can replace the guessing sequence with some poly-time TM. But given a NDTM with oracle access to $A$, I cannot directly replace the guessing sequence with some poly-time TM (as per the hypothesis), because in this NDTM, the guessing sequence might involve the access to oracle $A$.

Following that, I want to argue why isn't it so, that given a NDTM with oracle access to $A$, I can move all these calls to oracle $A$, after the guessing sequence? That is to say - why couldn't I, using non-determinism, guess the answers to my oracle queries and in the final step, verify these particular guesses using actual oracle queries?



More precisely, can I not re-define the definition of $L \in NP^A$ as follows: there exists a poly-time TM $M$ and a polynomial $p$ such that $x \in L \iff \exists w$ such that $|w| \leq p(|x|)$ and $M^A(x,w) = 1$?

Apologies for being too vague in my arguments above but I have just started learning Complexity Theory.

Edit1: Changed the question from 
given a oracle $A$, if $NP \subseteq P$ then $NP^A \subseteq P^A$ to if $NP \subseteq P$ then for any oracle $A$, $NP^A \subseteq P^A$

Edit2: My definitions are: $P^A$ is the set of languages decided by a poly-time TM with oracle access to $A$ and $NP^A$ is the set of languages decided by a poly-time NDTM with oracle access to $A$

Edit3: Added more context to the problem.
Your statement holds for all oracles $A$ iff $\mathsf{P} \neq \mathsf{NP}$. Indeed, if $\mathsf{P} \neq \mathsf{NP}$ then your statement vacuously holds. Conversely, if $\mathsf{P} = \mathsf{NP}$, then your statement fails for a random oracle $O$, since such an oracle satisfies $\mathsf{P}^O \neq \mathsf{NP}^O$ almost surely.

A similar argument shows that if $A$ is a $\mathsf{PSPACE}$-complete language then your statement holds, since in that case $\mathsf{P}^A = \mathsf{NP}^A$ is known to hold.

The proof that $\mathsf{P} \subseteq \mathsf{NP}$ relativizes, which means that it works even in the presence of an oracle. That is, the proof only uses arguments that keep holding even when the Turing machines are allowed access to an oracle. In all other cases, you cannot conclude from a statement of the form $\mathsf{A} \subseteq \mathsf{B}$ that $\mathsf{A}^O \subseteq \mathsf{B}^O$ for all oracles $O$. The two statements are about two different objects: the first one is about Turing machines without oracle access, and the second one is about Turing machines with oracle access to $O$.

This actually happens in practice, as mentioned in the comments: $\mathsf{IP}=\mathsf{PSPACE}$, but there are oracles $O$ relative to which $\mathsf{IP}^O \neq \mathsf{PSPACE}^O$.