Since a mod n is a remaider when dividing a by n, we have that
a mod n=a-kn

Similarly, b mod n=b-ln

Now notice that a mod n=b mod n if and only if a-kn=b-ln

which holds if and only if a-b=(k-l)n

Recall that, by definition, a=b mod n if and only if a-b=mn, where m is some integer.

Since k and l are integers, k-l is also an integer. Thus, a-b=(k-l)n

if and only if a=b mod n

Thus, we have proven that a mod n=b mod n if and only if a=b mod n, as required.

Similarly, b mod n=b-ln

Now notice that a mod n=b mod n if and only if a-kn=b-ln

which holds if and only if a-b=(k-l)n

Recall that, by definition, a=b mod n if and only if a-b=mn, where m is some integer.

Since k and l are integers, k-l is also an integer. Thus, a-b=(k-l)n

if and only if a=b mod n

Thus, we have proven that a mod n=b mod n if and only if a=b mod n, as required.