I am trying to prove the following as a study problem for an upcoming number-theory exam: if $a_1 \not \equiv a_2$ (mod gcd($m_1,m_2$)) then the system of equations
$x \equiv a_1$ (mod $m_1$)
$x \equiv a_2$ (mod $m_2$)
has no solution.
My attempt so far is this. Suppose $c \in \mathbb{Z}$ is a solution. Then $c \equiv a_1$ (mod ($m_1$) $\implies$ $c - a_1 = m_1k, \ k \in \mathbb{Z}$ $\implies$ $c - a_2 = m_2r$, $r \in \mathbb{Z}$ $\implies$ $a_2 - a_1 = m_1 k - m_2r$. Any hints would be appreciated.