Let and assume . Define , we'll show that is non-empty. We can think of as taking and then either adding muliples of or subtracting them to , each time leaving some remainder, thinking ahead we can guess that the smallest value of this set should be the smallest remainder and possibly the we are looking for.
If then when we have thus , on the other hand if , then observe that since , then and also , then we have . But also we can see that so it's of the form of an element in and since it's non-negative, it must be an element of . Therefore this paragraph shows us that has at least one element, no matter the value of .
Due to this and since , then by the well ordering principle there is some smallest element , we know that this value satisfies . Now we will show that .
so therefore , if we were to assume that then . By recalling the equality that satisifies we can write , therefore but since then which is a contradiction because we assumed that was the smallest element in , thus we must have that
At this point we have where so take and . If , then and , so we obtain , if , then and so again we have . We'll finish the proof by showing that these values are unique.
Assume we have another pair satisfying with but and , therefore we have .
Without loss of generality assume , then and since then , recalling that , we can re-write our last inequality as and since we can divide by to get but since this force , which then shows by previous equalities, therefore assuming we have another solution, it turns out it must be our original one, and thus our solution is unique.