Theorem. Correctness of Euclid’s algorithm [01E5]

Euclid’s algorithm gcd, reproduced below, terminates on all pairs of positive integers and, for such m and n, the value of gcd (m, n) is the greatest common divisor of m and n.