Example. Fractions in lowest terms [01EC]
In a previous lecture, we gave a non-constructive proof that rational numbers are characterised by fractions m/n such that no prime divides both m and n.
What we meant by “non-constructive” is that the proof did not provide any clarity on which m and n correspond to a given rational x. Euclid’s algorithm gives us a way to compute the actual fraction in question:
let lowest_terms (m, n) = let k = gcd (m, n) in (quo (m, k), quo (n, k))