When a real gas has a pressure lower than the expected value from ideal gas (because of the intermolecular force of attraction) , we have -
$$P_{\text{ideal}}= P_{\text{real}} + \frac{an^2}{V^2}$$ where a is the Van der Waal's constant for intermolecular forces of attraction between a gas.
Similarly, a real gas has a lower volume than the calculated volume in ideal gas. Here, when we say volume , we mean the empty space around molecules or atoms. So, for volume, we have - $$ V_{\text{real}}=V_{\text{ideal}}-nb$$ where b is the Van der Waal's constant for the volume of a molecule or atom.
Having said this, when we plug in these values into the ideal gas equation to get the real gas equation.
We put $\rightarrow$
$$ \left(P+\frac{an^2}{V^2}\right)(V-nb)=nRT $$
But shouldn't this be wrong? Because for pressure, we put $P_{\text{ideal}}$ but for Volume we put $V_{\text{real}}$. Shouldn't we put both $P_{\text{ideal}}$, $V_{\text{ideal}}$ so as to satisfy ideal gas equation?
Why do we not do so?
Please give a theoretical explanation along with a mathematical one if possible.