# Equivalence relation if $n>0$, $n\mid (a-b)$

prove that if $n>0$ is a positive integer then relation $\equiv_n$ on integers defined by $a\equiv_n b$ if $n\mid (a − b)$ is an equivalence relation. what if $n=2$?

so i know we have to proof reflexivity, symmetry and transitivity.

$\tag 1 a\sim a ?$ $\tag 2 a\sim b \text{ then } b\sim a$ $\tag 3 a\sim b, b\sim c \text{ then } a=c$

but im kind of confused of how to prove it

-
What have you tried? This is a very straight forward verification of the definitions. – EuYu Oct 30 '12 at 0:24

You are correct that we need to check 1) reflexivity, 2) symmetry, and 3) transitivity. (except note your transitivity should have a (~) not $=$ in the last part)

So lets check these:

1) Fix any $a$. Then $(a - a) = 0$, so $n \mid (a - a)$ and hence $a \equiv_n a$.

2) Suppose $a \equiv_n b$. Then $n \mid (a-b)$. So we have some $k$ so that $nk = (a-b)$, but then $n(-k) = (b-a)$ and hence $n \mid (b-a)$ so we have $b \equiv_n a$.

3) Suppose $a \equiv_n b$ and $b \equiv_n c$. Then $n \mid (a-b)$ and $n\mid (b-c)$ so we have some $k$ so that $nk = (a-b)$ and $j$ so that $nj = (b-c)$ Then $n(j + k) = nk + nj = (a-b) + (b-c) = a - c$. So $n \mid (a-c)$ and $a \equiv_n c$.

So $\equiv_n$ is an equivalence relation.

-
\mid gives better spacing than | for divides. Since this is homework, it would be better to give hints or to answer part of the question with hints for the rest. – Brian M. Scott Oct 30 '12 at 0:51
@BrianM.Scott Thanks for \mid didn't know about that. And okay, I'll be sure to look for homework in the tags from now on. – Deven Ware Oct 30 '12 at 1:03
@Deven Ware how does the equivalence class is different? is it like a whole set that is compared or what? – Jack F Oct 30 '12 at 1:03
Not to worry: I sometimes miss it myself, but since I was commenting anyway on the \mid, I thought that I’d mention it. – Brian M. Scott Oct 30 '12 at 1:05
@DevenWare what would the equivalence class be when n=3? I am having trouble figuring this out – Jack F Oct 30 '12 at 16:29