Modulo Multiplication is Well-Defined/Proof 2

Theorem
The multiplication modulo $m$ operation on $\Z_m$, the set of integers modulo $m$, defined by the rule:


 * $\left[\!\left[{x}\right]\!\right]_m \times_m \left[\!\left[{y}\right]\!\right]_m = \left[\!\left[{x y}\right]\!\right]_m$

is a well-defined operation.

Proof
The equivalence class $\left[\!\left[{a}\right]\!\right]_m$ is defined as:
 * $\left[\!\left[{a}\right]\!\right]_m = \left\{{x \in \Z: x = a + k m: k \in \Z}\right\}$

that is, the set of all integers which differ from $a$ by an integer multiple of $m$.

Thus the notation for addition of two residue classes modulo $z$ is not usually $\left[\!\left[{a}\right]\!\right]_m +_m \left[\!\left[{b}\right]\!\right]_m$.

What is more normally seen is:
 * $a + b \pmod m$

Using this notation:

Warning
This result does not hold when $x, y, m \notin \Z$.

We get to this stage in the above proof:
 * $x y = \left({x' + k_1 m}\right) \left({y' + k_2 m}\right) = x' y' + \left({x' k_2 + y' k_1}\right) m + k_1 k_2 m^2$

and we note that:
 * $\left({x' k_2 + y' k_1}\right) m + k_1 k_2 m^2$

is not necessarily an integer.

In fact, $\left({x' k_2 + y' k_1}\right) m + k_1 k_2 m^2$ can only be guaranteed to be an integer if each of $x', y', m \in \Z$.

Hence $x' y'$ is not necessarily congruent to $x y$.