Division Algorithm

Theorem
For $$a,b\in\mathbb{Z}$$, with $$a\neq 0$$ there exist unique integers $$q$$ and $$r$$ such that $$b=aq+r$$ with $$0\leq r<a$$

Show Existence
Consider the progression,

$$\ldots,b-3a,b-2a,b-a,b,b+a,b+2a,b+3a,\ldots$$

which extends in both directions. Then by the well-ordering principle, there must exist a smallest non-negative element, denoted by r. So, $$r=b-qa$$ for some $$q\in\mathbb{Z}$$. $$r$$ must be in the interval $$[0,a)$$ because otherwise $$r-a$$ would be smaller then $$r$$ and a non-negative element in progression.

Show Uniqueness
Assume we have another pair $$q_0$$ and $$r_0$$ such that $$b=aq_0+r_0$$, with $$0\leq r_0<a$$ Then $$aq+r=aq_0+r_0$$. Factoring we see that $$r-r_0=a(q_0-q)$$, and so $$a|(r-r_0)$$.

Since $$0\leq r < a$$ and $$0\leq r_0 < a$$, we have that $$-a<r-r_0<a$$. Hence, $$r-r_0=0\rightarrow r=r_0$$. So now $$r-r_0=0=a(q_0-q)$$ which implies that $$q=q_0$$.

Therefore solution is unique.

Q.E.D.