I was studying some number theory and I came across this theorem in a book, but unfortunately there was no proof of it. Can somebody tell me the proof?
$$(a + b) \bmod m = ( (a \bmod m) + (b \bmod m) ) \bmod m$$
And also,
$$ab \bmod m = ( (a \bmod m) * (b \bmod m) ) \bmod m$$
This is intuitively easy, but this proof might clear it up for you if you don't see it immediately.
The first equivalence can be written $$(a + b) + n_1 m = ((a + n_2m) + (b + n_3 m)) + n_4 m \hspace{1cm} \text{for some } n_1, n_2, n_3, n_4 \in \mathbb{Z}$$ The $m$ terms in the right-hand side can be distributed to $$= (a + b) + (n_2+n_3+n_4)m$$ so we can just choose $n_1 = n_2+n_3+n_4$ to make the two sides equal.
The second statement can be proved in a similar way but you have to assume that $a$, $b$, and $m$ are integers after distributing them and grouping terms by an $m$ factor.