# Modular arithmetic proof

If $a\equiv b \pmod {m_i}$, $1\leq i\leq k$, there $m_1,m_2,\dots,m_k$ relatively prime, then $a\equiv b\pmod{m_1m_2\cdots m_k}$

My attempt: $$\frac{a-b}{m_i}=t_i, t_i\in Z$$ $$\frac{(a-b)^k}{m_1m_2\cdots m_k}=t_1t_2\cdots t_k$$ $$(a-b)^k\equiv 0 \pmod {m_1m_2\cdots m_k}$$ (not sure about this step) $$a-b\equiv 0 \pmod {m_1m_2\cdots m_k}$$ $$a\equiv b \pmod {m_1m_2\cdots m_k}$$ Is there an error in my proof? I didn't use the fact that $m_1,m_2,\dots,m_k$ are relatively prime and I guess it is given for a reason.

-
This is a part of the Chinese Reminder Theorem. –  Lior B-S Mar 21 '13 at 9:55
This isn't sure right: $2^k = 0 (mod~4)$ for any $k \ge 2$, but $2\ne 0(mod~4)$.
You can prove your statement easily, note that $$\frac{a-b}{m_i}=t_i, t_i\in Z$$ [$m_i$ are coprime] $$\frac{(a-b)}{m_1m_2\cdots m_k} \in Z$$