Well-Defined Mapping/Examples/Square Function on Congruence Modulo 6

Example of Well-Defined Mapping
Let $x \mathrel {C_6} y$ be the equivalence relation defined on the natural numbers as congruence modulo $6$:


 * $x \mathrel {C_6} y \iff x \equiv y \pmod 6$

defined as:


 * $\forall x, y \in \N: x \equiv y \pmod 6 \iff \exists k, l, m \in \N, m < 6: 6 k + m = x \text { and } 6 l + m = y$

Let $\eqclass x {C_6}$ denote the equivalence class of $x$ under $C_6$.

Let $\N / {C_6}$ denote the quotient set of $\N$ by $C_6$.

Let us define the mapping $\mathrm {sq}$ on $\N / {C_6}$ as follows:


 * $\map {\mathrm {sq} } {\eqclass x {C_6} } = m^2$

where $x = 6 k + m$ for some $k, m \in \N$ such that $m < 6$.

Then $L$ is a well-defined mapping.

Proof
Let:
 * $x \mathrel {C_6} x'$

for arbitrary $x, x' \in \N$.

We need to demonstrate that:
 * $\map {\mathrm {sq} } {\eqclass x {C_6} } = \map {\mathrm {sq} } {\eqclass {x'} {C_6} }$

Let $m, n \in \N$ such that:
 * $\map {\mathrm {sq} } {\eqclass x {C_6} } = m^2$
 * $\map {\mathrm {sq} } {\eqclass {x'} {C_6} } = n^2$

We have by definition of $C_6$ that:


 * $x \mathrel {C_6} x' \iff \exists k, l, m \in \N, m < 6: 6 k + m = x \text { and } 6 l + m = x'$

Hence:
 * $\map {\mathrm {sq} } {\eqclass {x'} {C_6} } = m^2$

But for $m^2 \ne n^2$ where $0 \le m < 6$ and $0 \le n < 6$:
 * $m = n$

and the result follows.