Division Theorem/Positive Divisor/Existence/Proof 1

Theorem
For every pair of integers $a, b$ where $b > 0$, there exist integers $q, r$ such that $a = q b + r$ and $0 \le r < b$:


 * $\forall a, b \in \Z, b > 0: \exists q, r \in \Z: a = q b + r, 0 \le r < b$

Proof
From Division Theorem: Positive Divisor: Positive Dividend: Existence:
 * $\forall a, b \in \Z, a \ge 0, b > 0: \exists q, r \in \Z: a = q b + r, 0 \le r < b$

That is, the result holds for positive $a$.

It remains to be shown that the statement holds for $a < 0$.

From Division Theorem: Positive Divisor: Positive Dividend:
 * $\exists \tilde q, \tilde r \in \Z: \left|{a}\right| = \tilde q b + \tilde r, 0 \le \tilde r < b$

where $\left|{a}\right|$ denotes the absolute value of $a$: by definition $\left|{a}\right| \ge 0$.

As $a < 0$ it follows by definition of absolute value that $\left \vert {a} \right \vert = -a$.

This gives:

Let $\tilde r = 0$.

Then:
 * $q = -\tilde q, r = \tilde r = 0$

which gives:
 * $a = q b + r, 0 \le r < b$

as required.

Otherwise:
 * $0 < \tilde r < b \implies 0 < b - \tilde r < b$

which suggests a rearrangement of the expression for $a$ above:

Taking:
 * $q = \left({-1 - \tilde q}\right)$

and:
 * $r = \left({b - \tilde r}\right)$

the required result follows.

Uniqueness of $q$ and $r$ follow from the Uniqueness of $\tilde q$ and $\tilde r$.