Completed correctness proof.