<p>First, this result is listed in the complexity zoo: <a href="https://complexityzoo.uwaterloo.ca/Complexity_Zoo:N#npiconp" rel="noreferrer">https://complexityzoo.uwaterloo.ca/Complexity_Zoo:N#npiconp</a>. Alternatively, it's possible to prove without much trouble (which I do below).</p>

<p>We want to show that $P^{NP \cap coNP} = NP \cap coNP$. Clearly, one direction is obviously true: $NP \cap coNP \subseteq P^{NP \cap coNP}$. To prove the other direction, it is sufficient to show that $P^{NP \cap coNP} \subseteq NP$ since then $P^{NP \cap coNP} \subseteq coNP$ follows simply by complementing all the languages involved and as a result $P^{NP \cap coNP} \subseteq NP \cap coNP$.</p>

<p>So let's prove that $P^{NP \cap coNP} \subseteq NP$. </p>

<p>Suppose we have a deterministic polynomial time machine $M$ which makes oracle queries for languages in $NP \cap coNP$. We define a new, non-deterministic machine $M'$ based on $M$ as follows:</p>

<p>Simulate $M$ until $M$ needs to run an oracle query on some input $x$ for some language $L$. At that point, run a subroutine which branches $M'$ into some number of branches each of which attempts to learn the answer to the oracle query. The subroutine is designed so that no branch learns the wrong answer, at least one branch learns the correct answer, and some branches get "inconclusive" as a result when trying to learn the answer to the query. In $M'$, the branches with inconclusive results then reject. At this point, the only branches left are ones which know the correct answer to the query. Thus we can continue the simulation of $M$ in these branches. At the end of the simulation, the only branches which haven't rejected are the ones which successfully got through all of the steps of the simulation. These branches accept iff $M$ accepts, so the overall $NP$ </p>

<p>Since $L \in NP \cap coNP$, there exists a NP machine $N_L$ with language $L$ and another machine $N_{\neg L}$ whose language is the complement of $L$. To simulate the oracle query (is $x$ in $L$), $M'$ first runs $N_L$ on $x$ and then runs $N_{\neg L}$ on $x$ in every branch. Every resulting branch will have one branch of $N_L$'s computation and one branch of $N_{\neg L}$'s computation. Within any single branch, both the $N_L$ computaion and the $N_{\neg L}$ computation cannot be accepting since that would require $x$ to both be in $L$ and in $\neg L$. Thus each branch will have either the $N_L$ computation accepting, the $N_{\neg L}$ computation accepting, or neither computation accepting. Furthermore, there must be at least one accepting branch of either $N_L$ or $N_{\neg L}$. Next, $M'$ rejects in the branches in which the computations of both $N_L$ and $N_{\neg L}$ reject. In all other branches, $M'$ has learned the answer to the oracle query (since either $N_L$ or $N_{\neg L}$ accept $x$ in the particular branch considered in this $M'$ branch). At that point, $M'$ can continue the simulation of $M$. Note that the simulation will actually continue in at least one branch since at least one accepting branch of either $N_L$ or $N_{\neg L}$ exits. </p>

CC BY-SA 3.0
2017-03-18T09:32:21.297Z
Thanks! I actually checked the complexity zoo but somehow missed the "Equals $\sf{P^{NP \cap coNP}}$" statement. I have only one question. Why would your proof fail to show $\sf{P^{NP}} = NP$? I'm always hesitant when designing a non-deterministic algorithm/Turing machine to do anything else after the non-deterministic branching to not fall in the trap of giving a $\sf{P^{NP}}$ algorithm instead of an $\sf{NP}$ one. In your proof if the oracle were just an $\sf{NP}$ oracle, then couldn't M' simulate it the same way as you described here (only run $N_L$ in the simulation) ? Where's the catch?
user1033363
CC BY-SA 3.0
2017-03-18T09:45:05.060Z
(just to add a clarification, $\sf{P^{NP}}$ contains $\sf{coNP}$ since the $\sf{P}$ machine can just negate the answers of the $\sf{NP}$ oracle. So if $\sf{P^{NP}} = \sf{NP}$ then $\sf{NP} = \sf{coNP}$ and the polynomial hierarchy would collapse)
user1033363
CC BY-SA 3.0
2017-03-18T21:21:21.603Z
In my proof, I rely on the existence of both an NP machine and a coNP machine for the language of the oracle in order foor the simulation to branch such that each branch either gets a result of "inconclusive" or the correct answer. If all you have for the language of the oracle is an NP machine, then you are not guaranteed that some branch gets a conclusive answer: in the case that the NP machine rejects, every branch rejects, which is inconclusive. Thus the same proof fails to show $P^{NP} \subseteq NP$. More generally, an $NP$ oracle is more powerful than an $NP \cap coNP$ oracle.
Mikhail Rudoy
CC BY-SA 3.0
2017-03-18T02:31:59.560Z
2017-03-18T02:37:26.560Z
2017-03-18T02:37:26.560Z
Mikhail Rudoy
<p>If it is unknown, are there reasons to believe that they might not be equal?</p>

<complexity-classes><np><oracles><polynomial-hierarchy>
Is $\sf{P^{NP \cap coNP}} = \sf{NP \cap coNP}$?
user1033363
# Is $\sf{P^{NP \cap coNP}} = \sf{NP \cap coNP}$?

(Asked by: username_0 on 2017-03-18)

If it is unknown, are there reasons to believe that they might not be equal?

**Tags:** complexity-classes, np, oracles, polynomial-hierarchy

---

## 1 answers

### Answer by username_1 on 2017-03-18. Score: 12 | Accepted answer

First, this result is listed in the complexity zoo: <https://complexityzoo.uwaterloo.ca/Complexity_Zoo:N#npiconp>. Alternatively, it's possible to prove without much trouble (which I do below).

We want to show that $P^{NP \cap coNP} = NP \cap coNP$. Clearly, one direction is obviously true: $NP \cap coNP \subseteq P^{NP \cap coNP}$. To prove the other direction, it is sufficient to show that $P^{NP \cap coNP} \subseteq NP$ since then $P^{NP \cap coNP} \subseteq coNP$ follows simply by complementing all the languages involved and as a result $P^{NP \cap coNP} \subseteq NP \cap coNP$.

So let's prove that $P^{NP \cap coNP} \subseteq NP$.

Suppose we have a deterministic polynomial time machine $M$ which makes oracle queries for languages in $NP \cap coNP$. We define a new, non-deterministic machine $M'$ based on $M$ as follows:

Simulate $M$ until $M$ needs to run an oracle query on some input $x$ for some language $L$. At that point, run a subroutine which branches $M'$ into some number of branches each of which attempts to learn the answer to the oracle query. The subroutine is designed so that no branch learns the wrong answer, at least one branch learns the correct answer, and some branches get "inconclusive" as a result when trying to learn the answer to the query. In $M'$, the branches with inconclusive results then reject. At this point, the only branches left are ones which know the correct answer to the query. Thus we can continue the simulation of $M$ in these branches. At the end of the simulation, the only branches which haven't rejected are the ones which successfully got through all of the steps of the simulation. These branches accept iff $M$ accepts, so the overall $NP$

Since $L \in NP \cap coNP$, there exists a NP machine $N\_L$ with language $L$ and another machine $N\_{\neg L}$ whose language is the complement of $L$. To simulate the oracle query (is $x$ in $L$), $M'$ first runs $N\_L$ on $x$ and then runs $N\_{\neg L}$ on $x$ in every branch. Every resulting branch will have one branch of $N\_L$'s computation and one branch of $N\_{\neg L}$'s computation. Within any single branch, both the $N\_L$ computaion and the $N\_{\neg L}$ computation cannot be accepting since that would require $x$ to both be in $L$ and in $\neg L$. Thus each branch will have either the $N\_L$ computation accepting, the $N\_{\neg L}$ computation accepting, or neither computation accepting. Furthermore, there must be at least one accepting branch of either $N\_L$ or $N\_{\neg L}$. Next, $M'$ rejects in the branches in which the computations of both $N\_L$ and $N\_{\neg L}$ reject. In all other branches, $M'$ has learned the answer to the oracle query (since either $N\_L$ or $N\_{\neg L}$ accept $x$ in the particular branch considered in this $M'$ branch). At that point, $M'$ can continue the simulation of $M$. Note that the simulation will actually continue in at least one branch since at least one accepting branch of either $N\_L$ or $N\_{\neg L}$ exits.

> **Comments:**
> **username_0**: Thanks! I actually checked the complexity zoo but somehow missed the "Equals $\sf{P^{NP \cap coNP}}$" statement. I have only one question. Why would your proof fail to show $\sf{P^{NP}} = NP$? I'm always hesitant when designing a non-deterministic algorithm/Turing machine to do anything else after the non-deterministic branching to not fall in the trap of giving a $\sf{P^{NP}}$ algorithm instead of an $\sf{NP}$ one. In your proof if the oracle were just an $\sf{NP}$ oracle, then couldn't M' simulate it the same way as you described here (only run $N_L$ in the simulation) ? Where's the catch?  
> **username_0**: (just to add a clarification, $\sf{P^{NP}}$ contains $\sf{coNP}$ since the $\sf{P}$ machine can just negate the answers of the $\sf{NP}$ oracle. So if $\sf{P^{NP}} = \sf{NP}$ then $\sf{NP} = \sf{coNP}$ and the polynomial hierarchy would collapse)  
> **username_1**: In my proof, I rely on the existence of both an NP machine and a coNP machine for the language of the oracle in order foor the simulation to branch such that each branch either gets a result of "inconclusive" or the correct answer. If all you have for the language of the oracle is an NP machine, then you are not guaranteed that some branch gets a conclusive answer: in the case that the NP machine rejects, every branch rejects, which is inconclusive. Thus the same proof fails to show $P^{NP} \subseteq NP$. More generally, an $NP$ oracle is more powerful than an $NP \cap coNP$ oracle.  

---

