Division Theorem/Positive Divisor/Existence/Proof 3

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
Let there exist $q \in Z$ such that $a - b q = 0$.

Then $a = b q$ as required, with $r = 0$.

Otherwise, let $S$ be defined as the set of all positive integers of the form $a - z b$ where $z$ is an integer:


 * $S = \left\{{x \in \Z_{\ge 0}: \exists z \in \Z: x = a - z b}\right\}$

Setting $z = 0$ it is seen that $a \in S$, so $S \ne \varnothing$.

From Set of Integers Bounded Below has Smallest Element, $S$ has a smallest element.

Let $r$ be the smallest element of $S$.

Let $r = a - b q$.

As there does not exist $q \in Z$ such that $a - b q = 0$:
 * $r > 0$

Suppose $r = b$.

Then $a = b \left({q + 1}\right)$ and it has already been declared that there does not exist such a $q + 1 \in Z$.

Suppose $r > b$.

Then $x = a - b \left({q + 1}\right) \in S$ such that $x < r$, which contradicts the assumption that $r$ is the smallest element of $S$.

Hence the result.