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.