We would like to prove that:
$(a-b) \text{ mod } N = (a \text{ mod } N + (-b) \text{ mod } N) \text{ mod }N$
and
$(a-b) \text{ mod } N = (a \text{ mod } N -b \text{ mod } N) \text{ mod }N$
Let us first start proving that $c=(a+b) \text{ mod } N = (a \text{ mod } N + b \text{ mod } N) \text{ mod }N$
This means, in other words, that:
(1) $ a+b = c+Nf : 0<c<N\rightarrow c=(a+b) \text{ mod } N $
(2) $a = r+Nk : 0<r<N\rightarrow r=a \text{ mod } N $
(3) $b = r'+Nk' : 0<r'<N \rightarrow r'=b \text{ mod } N $
Summing (2) and (3) we get:
(4) $a+b = r+r'+N(k+k') = r+r'+Nt$
This is very similar to (1), however, not equal since $0<(r+r')<2N$
Let us take the mod of $r+r'$ and insert (4):
$r+r'= \gamma +No$
$a+b-N(k+k')=\gamma + No \rightarrow $
$a+b =\gamma + N(k+k'+o)=\gamma+Nh : 0<\gamma<N$ , which is eq (1).
Therefore, $(a+b) \text{ mod } N = (a \text{ mod } N + b \text{ mod } N) \text{ mod }N$
Making $b=-b$
$(a-b) \text{ mod } N = (a \text{ mod } N + (-b) \text{ mod } N) \text{ mod }N$
Since $(-a) \text{ mod } N= N-a \text{ mod } N$,
$(a-b) \text{ mod } N = (a \text{ mod } N +N- b \text{ mod } N) \text{ mod }N$
And then, finally
$(a-b) \text{ mod } N = (a \text{ mod } N - b \text{ mod } N) \text{ mod }N$
=
means they are numerically equal. Please do not confuse it with $\equiv$. – user103816 Jul 29 '15 at 15:27