# How to determine equivalence classes?

Let the relation $$µ$$ on $$Z$$ (set of integers) be defined by $$xµy$$ if and only if $$x^2 ≡ y^2(mod 4).$$

I have already proven that the relation $$µ$$ is an equivalence relation, but I am currently struggling with determining the equivalence classes

Do I just testing values for $$x \in Z$$?

For example:

If $$x ≡ 0 (mod 4)$$, then $$x^2 ≡ 0^2 ≡ 0 (mod 4)$$. So, the equivalence class [x] contains all integers that are congruent to $$0$$ modulo $$4$$.

If $$x ≡ 1 (mod 4)$$, then $$x^2 ≡ 1^2 ≡ 1 (mod 4).$$ The equivalence class [x] contains all integers that are congruent to $$1$$ modulo $$4$$.

Therefore, the equivalence classes of the relation $$µ$$ on $$Z$$ are:

$$[0] = \{..., -8, -4, 0, 4, 8, ...\}$$

$$[1] = \{..., -7, -3, 1, 5, 9, ...\}$$

Is this correct? But I believe that my equivalence classes need to complete $$Z$$? Not sure if I am doing the right thing. And where is $$2$$?

Actually, $$x\mathrel\mu 0\iff x^2\equiv0\pmod4\iff x\text{ is even},$$ and therefore $$[0]$$ is the set of all even integers.

And $$x\mathrel\mu 1\iff x^2\equiv1\pmod4\iff x\text{ is odd,}$$ and therefore $$[1]$$ is the set of all odd integers.

Since every integer is even or odd, you are done: these are the only equivalence classes.

Here's another way of reaching the same conclusion. If $$x,y\in\mathbb{Z}$$, then \begin{align} x\mathrel\mu y&\iff x^2\equiv y^2\pmod4\\ &\iff4\mid(x-y)(x+y). \end{align} Now, when a product of integers is a multiple of $$4$$, then either both factors are even or one of them is odd whereas the other one is a multiple of $$4$$. But the current situation the second possibility cannot occur. Indeed, if, say $$x+y$$ is odd, the $$x-y$$ is odd too, since it is equal to $$(x+y)-2y$$. So, both $$x+y$$ and $$x-y$$ are even, and this means that $$x$$ and $$y$$ have the same parity. So, \begin{align} [x]&=\{y\in\mathbb{Z}\,|\,x\text{ and }y\text{ have the same parity}\}\\ &=\begin{cases} \{\text{even integers}\}&\text{ if x is even}\\ \{\text{odd integers}\}&\text{ if x is odd.} \end{cases} \end{align}

• Thank you for your answer, just one more question, which is kinda unrelated, is μ anti symmetry? From my proof, I think so, but I am not sure. Commented May 20, 2023 at 11:44
• No, it is not: $0\mathrel\mu2$ and $2\mathrel\mu0$, but $0\ne2$. Commented May 20, 2023 at 12:05

We denote $$[\ell]_{\mathbb{Z}_4}:=\{n\in\mathbb{Z}:n\equiv \ell\mbox{ mod } 4\},\qquad\ell=0,1,2,3.$$ Then for each $$m\in[\ell]_{\mathbb{Z}_4}$$, there is $$k\in\mathbb{Z}$$ such that $$m=4k+\ell$$. Therefore $$m^2=(4k+\ell)^2=\ell^2.$$ Denote $$[p]_{\mathbb{Z}_4,2}:=\{n\in\mathbb{Z}:n^2\equiv p^2 \mbox{ mod }4\}.$$ It follows from $$0^2\equiv 2^2\equiv 0 \mbox{ mod 4}$$ and $$1^2\equiv 3^2\equiv 1 \mbox{ mod 4}$$ that $$\begin{equation*} \begin{cases} [0]_{\mathbb{Z}_4,2}=[0]_{\mathbb{Z}_4}\bigcup [2]_{\mathbb{Z}_4}\\ [1]_{\mathbb{Z}_4,2}=[1]_{\mathbb{Z}_4}\bigcup [3]_{\mathbb{Z}_4} \end{cases} \end{equation*}$$ and $$[0]_{\mathbb{Z}_4,2}\bigcup[1]_{\mathbb{Z}_4,2}=\left([0]_{\mathbb{Z}_4}\bigcup [2]_{\mathbb{Z}_4}\right)\bigcup\left([1]_{\mathbb{Z}_4}\bigcup [3]_{\mathbb{Z}_4}\right)=\mathbb{Z}.$$