Prove that if a and b are integers such that a|b and b > 0, then (x mod b) mod a = x mod a for any x.
Solution: As a|b, we have b = pa for some integer p. Let x mod b = r, then we have x = bq + r = apq + r for some integer q. Hence, we have x mod a = r mod a = (x mod b) mod a
I don't see how the author of this proof went from x = bq + r = apq + r to x mod a = r mod a. Can someone please explain this to me?
We have $x=apq+r$, and $r$ is the class of $x$ modulo $b$.
So, looking at this equality modulo $a$, we have $x \equiv r\; (\textrm{mod}\; a)$ since $apq \equiv 0\; (\textrm{mod}\; a)$. This proves the result, since $x \equiv r\; (\textrm{mod}\; b)$.