euclidean algorithm
Let such that , if , then . Otherwise if , then and
If , then , therefore , so now assume that
Recall that , therefore , so that if divides both , then it must divide (and clearly ), and by the original equation if is a divisor of both then divides (and clearly ).
The above paragraph shows that a number is a divisor of if and only if it is a divisor of , which shows that their set of divisors are equal and thus
bounded sum implies one less then half
Suppose that and with , then
Suppose for the sake of contradiction that , then we know that so therefore , so we have which is a contradiction so that .
euclidean algorithm has exponentially decreasing remainders
Let with be two integers, and suppose we will preform the euclidean algorithm on them to compute , supposing that represents the remainder after (where ) steps into the euclidean algorithm, then
For the base case, suppose that , so we'd like to prove that . Firstly we know that with , then applying the next iteration we have with and one more time, we get with , this shows us that .
Since , and , then , and , therefore therefore which concludes the base case
Now let assuming that , we want to prove that , noting that .
To start let's say we have an intance of the euclidean algorithm that lasts for at least iterations, therefore we know that by our induction hypothesis, additionally at the -th iteration we would have an equation of the form , since we know that , then , which then shows that , and since , then we know that which is what we needed to show
upper bound on euclidean algorithm iterations
The euclidean algorithm terminates in at most iterations
The euclidean algorithm terminates in iterations if and only if , we know that for all that , therefore when , then we have , but if , then since the remainders are always elements of , then we know that , thus we've shown after iterations the algorithm must terminate