Finished correctness proof.