I have a question regarding a line in this proof:
The system of congruences $x \equiv a_1 (\mod m_1)$ and $x \equiv a_2 (\mod m_2)$ where $(m_1, m_2) = 1$, has a unique solution modulo $m_1m_2$.
Proof: If $x \equiv a_1 (\mod m_1)$, then $x = a_1 + k_1m_1$ for some $k_1$. If in addition $x = a_2 (\mod m_2)$, then $$a_1 + k_1m_1 \equiv a_2 (\mod m_2)$$ or $$k_1m_1 \equiv a_2 - a_1 (\mod m_2).$$
Because $(m_1, m_2) = 1$, we know that this congruence, with $k_1$ as the unknown, has a unique solution modulo $m_2$. Call it $t$. Then $k_1 = t + k_2m_2$ for some $k_2$, and $x = a_1 + (t + k_2m_2)m_1 \equiv a_1 + tm_1 (\mod m_1m_2)$.
My question is the line "Then $k_1 = t + k_2m_2$." I have studied this proof for a couple of hours and I cannot figure out where this line is coming from. It doesn't appear obvious at all, where is it coming from?