Suppose that I have an option on a single stock expiring at time $T$ and I replicate the payoff of this derivative by investing in the stock market and the money market. So this condition reads $$X(T) = V(T) \quad \text{almost surely}$$ where $X(T)$ is the value of my portfolio and $V(T)$ is the payoff of the derivative.
This condition holding under the actual probability measure is equivalent to it holding under the risk neutral measure, which I assume to exist and to be unique.
We then price the option by saying $$D(t)X(t) = \widetilde{E}[D(T)X(T)|F(t)] = \widetilde{E}[D(T)V(T)|F(t)]$$
I have a problem with the last equality. If the "almost surely" condition holds, then the last equality is implied. However, that equality does not necessarily imply the "almost surely" condition. Am I missing something here or is the fact that the price that comes of this method is unique and that it is a necessary condition for the almost surely condition to hold good enough for our purposes?