Let . The modular-addition quantum oracle obeys
The three steps replace by , then , then . Thus a query to the inverse costs one forward query and two known unitary operators. The negation operator is a permutation matrix with .
Applying the two modular-addition quantum oracles consecutively adds to the answer register. Thus
Let . Applying , then , then gives
Therefore
using one query and two unitary operators independent of . This is modular-oracle inversion by negation.