How would one prove that if $x_1$ and $x_2$ are elements of $\mathbb{Z}$, then $x_1$ ~ $x_2$ <=> $n$|$(x_1 - x_2)$?
Giving an example, such as $n=6$ or such would better help me understand the answer. I kind of figured it out for $n=5$, however I am having difficulty understanding how to do it for any other value.
Thanks you
For equivalence relations, you have to prove that it is RST - reflexive, symmetric and transitive.
In addition, it may help to consider modulo arithmetic:
$${n\, | \,x_1-x_2} \iff {x_1 \equiv x_2 \pmod n}$$
Now you should be able to solve this.
EDIT: Proof for transitivity at request. (Note that I've used $R$ to refer to the relation - personal preference)
Transitive:
$$aRb \iff n\, | \,a-b \iff {a \equiv b \pmod n}$$
$$bRc \iff n\, | \,b-c \iff {b \equiv c \pmod n}$$
$\iff a \equiv b \equiv c\pmod n$
$\iff a \equiv c\pmod n$
$\iff n\, | \,a-c$
$\iff aRc$
$\implies$ Transitive.