Let $n \in \mathbb{Z}$, $n > 0$ be a fixed positive integer.
Define the relation $\sim$ on the set $\mathbb{Z}$ of integers by setting $$ \forall a, b \in\mathbb{Z}\ (a \sim b \iff n | a−b). $$ Show that $\sim$ is an equivalence relation, and determine the cardinality $\#(Z/ \sim)$ of the quotient set $Z/\sim$.
First, $a \sim a$ because $n|0 = a - a$, and $a \sim b \iff b \sim a$ because $n|(a-b) \iff n|(b-a)$, and finally, if $a \sim b, b \sim c$, then $n|(a-b)$, and $n|(b-c)$, then $n|(a-b)+(b-c) = a-c$, thus $a \sim c$. Thus $\sim$ is an equivalence relation on $\mathbb{Z^{+}}$. This means if $a, b\in \mathbb{Z^{+}}$, and $[a] = [b] \iff n|(a-b)$. Consider $0 \leq m \leq n - 1$ and $[m]$. Observe that the classes $[k]$'s with $k \in [0,n-1]$ are distint, and they are the only classes of the quotient set $\mathbb{Z}/\sim$. For if $[p]$ be a class in this set, then $p = qn + r$, with $0 \leq r \leq n-1$. So $n|(n-r)$, and $[p]=[r]$, so $[p]$ is one of the classes mentioned. Thus: $\mathbb{Z}/\sim = \{[0],[1],...,[n-1]\}$, and $|\mathbb{Z}/\sim| = n$