Proof of fungibility theorem