Equivalence of Definitions of Congruence

Theorem
The definitions of congruence (in the context of Number Theory):


 * $$(1) \qquad x \equiv y \left({\bmod\, z}\right) \iff \left({x, y}\right) \in \left\{{\left({x, y}\right) \in \R \times \R: \exists k \in \Z: x = y + k z}\right\}$$


 * $$(2) \qquad x \equiv y \left({\bmod\, z}\right) \iff x \,\bmod\, z = y \,\bmod\, z$$


 * $$(3) \qquad x \equiv y \left({\bmod\, z}\right) \iff \exists k \in \Z: x - y = k z$$

... are equivalent.

Integer definition
Also, if $$x, y, z$$ are all integers, the definition:
 * $$x \equiv y \left({\bmod\, z}\right) \iff z \backslash \left({x - y}\right)$$

is likewise equivalent to the other given definitions.

Proof
Let $$x_1, x_2, z \in \R$$.

Let $$x_1 \equiv x_2 \left({\bmod\, z}\right)$$ in the sense of Definition by Equivalence Relation.

That is, let $$\mathcal{R}_z$$ be the relation on the set of all $$x, y \in \R$$:
 * $$\mathcal{R}_z = \left\{{\left({x, y}\right) \in \R \times \R: \exists k \in \Z: x = y + k z}\right\}$$

Let $$\left({x_1, x_2}\right) \in \mathcal{R}_z$$.

Then by definition, $$\exists k \in \Z: x_1 = x_2 + k z$$.

So, by definition of the modulo operation, we have:

$$ $$ $$ $$ $$

So:
 * $$x_1 \equiv x_2 \left({\bmod\, z}\right)$$

in the sense of Definition by Modulo Operation.

Now let $$x_1 \equiv x_2 \left({\bmod\, z}\right)$$ in the sense of Definition by Modulo Operation.

That is, :$$x_1 \equiv x_2 (\bmod\, z) \iff x_1 \,\bmod\, z = x_2 \,\bmod\, z$$.

Let $$z = 0$$.

Then by definition, $$x_1 \,\bmod\, 0 = x_1$$ and $$x_2 \,\bmod\, 0 = x_2$$.

So as $$x_1 \,\bmod\, 0 = x_2 \,\bmod\, 0$$ we have that $$x_1 = x_2$$.

So $$x_1 - x_2 = 0 = 0.z$$ and so $$x_1 \equiv x_2 \left({\bmod\, z}\right)$$ in the sense of Definition by Integral Multiple.

Now suppose $$z \ne 0$$.

Then from definition of the modulo operation:
 * $$x_1 \,\bmod\, z = x_1 - z \left \lfloor {\frac {x_1} z}\right \rfloor$$
 * $$x_2 \,\bmod\, z = x_2 - z \left \lfloor {\frac {x_2} z}\right \rfloor$$

Thus $$x_1 - z \left \lfloor {\frac {x_1} z}\right \rfloor = x_2 - z \left \lfloor {\frac {x_2} z}\right \rfloor$$

and so $$x_1 - x_2 = z \left({\left \lfloor {\frac {x_1} z}\right \rfloor - \left \lfloor {\frac {x_2} z}\right \rfloor}\right)$$.

From the definition of the floor function, we see that both $$\left \lfloor {\frac {x_1} z}\right \rfloor$$ and $$\left \lfloor {\frac {x_2} z}\right \rfloor$$ are integers.

Therefore, so is $$\left \lfloor {\frac {x_1} z}\right \rfloor - \left \lfloor {\frac {x_2} z}\right \rfloor$$ an integer.

So $$\exists k \in \Z: x_1 - x^2 = k z$$.

Thus $$x_1 - x_2 = k z$$ and:
 * $$x_1 \equiv x_2 \left({\bmod\, z}\right)$$

in the sense of Definition by Integral Multiple.

Now let $$x_1 \equiv x_2 \left({\bmod\, z}\right)$$ in the sense of Definition by Integral Multiple.

That is, $$\exists k \in \Z: x_1 - x_2 = k z$$.

Then $$x_1 = x_2 + k z$$ and so $$\left({x_1, x_2}\right) \in \mathcal{R}_z$$ where:
 * $$\mathcal{R}_z = \left\{{\left({x, y}\right) \in \R \times \R: \exists k \in \Z: x = y + k z}\right\}$$

and so
 * $$x_1 \equiv x_2 \left({\bmod\, z}\right)$$

in the sense of Definition by Equivalence Relation.

So all three definitions are equivalent: $$(1) \implies (2) \implies (3) \implies (1)$$.

Proof for Integer Definition
By definition of divisor, we have that:
 * $$z \backslash x - y \iff x - y = k z$$

which is equivalent to the third definition.