Why if $a = kb + c$ then $a \text{ mod } b = c \text{ mod } b$

40 Views Asked by At

Here is a very simple question in number theory that I can't prove it. If $a = kb + c$, then I would like to know why the following is true ($a,b,c,k \in \mathbb{Z}$):

$$a \bmod b = c \bmod b$$

And another question, Why if $a+b \equiv 0 \pmod{p}$ then $a \equiv -b \pmod{p}$

1

There are 1 best solutions below

2
On BEST ANSWER

When $b\ne0$ (which is needed for doing the “$\!\bmod b$” operation), $x\bmod b$ is the unique integer $r$ such that

  1. $x=bq+r$, for some integer $q$,
  2. $0\le r<|b|$

It is a well known fact that such an $r$ exists and is unique.

Now, suppose $a=bk+c$ and write $c=bq+r$, with $0\le r<|b|$. Then also $$ a=b(k+q)+r $$ thereby proving that $$ a\bmod b=c\bmod b $$ by the uniqueness of the remainder $r$ stated above.


For the second part, note that $x\equiv y\pmod{n}$ means that $x-y$ is divisible by $n$. Then use the fact that $a+b=a-(-b)$.