Euclidean Algorithm Correctness Theorem