$a\equiv{b}\pmod{m},a\equiv{b}\pmod{n}\ \Rightarrow\ a\equiv{b}\pmod{lcm(m,n)}$ Show that if $a\equiv{b}\pmod{m},a\equiv{b}\pmod{n}\ \Rightarrow\ a\equiv{b}\pmod{lcm(m,n)}$
I think this must be a basic theorem in number theory but couldn't find it in my books,also it's very useful in solving many problems concerning LCM and GCD.
Please give a proof.I have no idea for it.
 A: $a=b$ mod $m$ is equivalent $a-b= cm$; $a=b$ mod $n$ is equivalent $a-b=dn$. $a-b$ is a multiple of $m$ and $n$  implies that $a-b$  is a multiple of $lcm(m,n)$. This implies that $a-b=0$ mod $lcm(m,n)$ and $a=b$ mod $lcm(m,n)$. 
A: $m|a-b$ and $\,n|a-b$ thus by definition of lcm, we can say  $[m,n]\,|\,a-b$ 
A: Suppose first that $gcd(m,n)=1$, then:
$$ a-b=mnk \quad \text{ for some }k\in\mathbb{Z}$$
so is clear that $a\equiv b$ (mod $mn$). 
If $gcd(m,n)=d$, so $m=p_1d$ and $n=p_2d$; 
then: 
$$a-b=dp_1p_2l \quad\text{ for some } l\in \mathbb{Z},$$
in particular $dp_1p_2=lcm(m,n)$ divide $a-b$, then $a\equiv b$ (mod $lcm(m,n)$).
A: $a\equiv b \pmod n$ and $a \equiv b \pmod m$ is equivalent to $n|(a-b)$ and $m|(a-b)$. 
Let $n=P_1^{\alpha_1}P_2^{\alpha_2}...P_k^{\alpha_k}$ and $m=P_1^{\beta_1}P_2^{\beta_2}...P_k^{\beta_k}$ (with $\alpha_i$ and $\beta_i$ positive integers, possibly zero)
It is easy to show that $lcm(m,n)=P_1^{max(\alpha_1,\beta_1)}P_2^{max(\alpha_2,\beta_2)}...P_k^{max(\alpha_k,\beta_k)}$
We have, by hypothesis, $n|(a-b)$ and $m|(a-b)$.
Therefore, $lcm(m,n)|(a-b)$, i.e. $a\equiv b \pmod {lcm(m,n)}$
