# 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.