Modulo Multiplication is Associative/Proof 2

Theorem
Multiplication modulo $m$ is associative:


 * $\forall x, y, z \in \Z_m: \left({x \cdot_m y}\right) \cdot_m z = x \cdot_m \left({y \cdot_m z}\right)$

Proof
Let $j$ be the largest integer such that:
 * $j m \le x y$

Let $p$ be the largest integer such that:
 * $p m \le y z$

By definition of multiplication modulo $m$:
 * $x \cdot_m y = x y - j m$
 * $y \cdot_m z = y z - p m$

Let $k$ be the largest integer such that:
 * $k m \le \left({x y - j m}\right) z$

Let $q$ be the largest integer such that:
 * $q m \le x \left({y z - p m}\right)$

Then:
 * $\left({j z + k}\right) m \le \left({x y}\right) z$
 * $\left({q + x p}\right) m \le x \left({y z}\right)$

Thus:

But suppose that there exists an integer $s$ such that:
 * $s m \le \left({x y}\right) z$

and:
 * $j z + k < s$

Then:
 * $\left({j z + k + 1}\right) m \le \left({x y}\right) z$

from which:
 * $\left({k + 1}\right) m \le \left({x y - j m}\right) z$

But this contradicts the definition of $k$.

Thus $j z + k$ is the largest of those integers $i$ such that $i m \le \left({x y}\right) z$.

Similarly, $q + x p$ is the largest of those integers $i$ such that $i m \le x \left({y z}\right)$.

From Integer Multiplication is Associative:
 * $\left({x y}\right) z = x \left({y z}\right)$

Thus $j z + k = q + x p$ and so: