[Math] Prove a mod b = b mod a iff a=b

discrete mathematics

I'm just starting to learn the three types of proofs and I came across this question.

                 a mod b = b mod a iff a=b

I tried looking for solution to prove this but couldn't find it. Most examples I have are of the same divisor like: a mod n = b mod n. But i couldn't find anything on this.

I assumed it would be by using a contradiction proof but what got me confused is the if and only if condition.

Thanks for any help you send this way!!

Best Answer

Suppose $a\neq b$. Then, without loss of generality we can assume that $a>b$. In that case $b\pmod a$ is $b$. But $a\pmod b$ is the remainder of $a$ on division by $b$, hence it is less than $b$.

Related Question