# Modular Arithmetic and divisibility proof

I could use some help with this proof.

Let $n, m ∈ Z^+$ and $a, b ∈ Z$. Suppose that $a ≡ b$(mod n) and $a ≡ b$(mod m) and $(m, n) = 1.$ Show that $a ≡ b$(mod mn).

From what I understand, it is obvious that $n|(a-b)$ and $m|(a-b)$. So since $(m, n) = 1$ does it mean that there is some prime factor that divides $mn$ like so: $p^a | mn$? Can someone help me figure this proof out, I'm not totally sure if I'm doing this right.

Any help is greatly appreciated! Thanks!

$a-b=mp = nq$ for some $p,q$ integers. Now you need to show that $q$ is divisible by $m$ and $p$ is divisible by $n$. But that follows from the relatively prime condition.
If $$a|c$$ and $$b|c$$ and $$(a,b)=1$$, then $$ab|c$$.
If you apply it to what you have already stated concerning: $$m/(a-b)$$ and $$n/(a-b)$$, you obtain:
$$mn|(a-b)$$
If we suppose that $$mn=k$$ this leads to the result:
$$a \equiv b \pmod k$$
N.B: I used $$k$$ because i couldn't fit the two letters $$m$$ and $$n$$ in the $$mod$$ for some reason.. Perhaps my relatively minimal knowledge of MathJaX.