0

The question states the following:

Prove that the system $x \equiv a \bmod m, x \equiv b \bmod n$ has solution iff $\gcd(m,n) \vert a-b.$

The first implication is immediate since $x-a = km,x-b=qn$, hence subtracting both expressions we get that $a-b = qn - km$, $a-b \in (m,n)$, $\gcd(m,n) \mid (a-b)$. However, I don't know how to prove the reciprocal. Any suggestions?

Joffan
  • 39,627
gal127
  • 583

1 Answers1

0

For the "if" $\Leftarrow$ direction:

Taking $g:=\gcd(m,n)$ we can find $c,d\in \mathbb Z$ such that $cm+dn = g$ by Bézout's identity.

Now $g \mid (a-b)$, so find the remainder $r$ of $a$ divided by $g$ to get $a=kg+r$ and thus also $b = \ell g+r$.

Now take $x=\ell cm+ kdn+r$. Then
$x \equiv \ell cm + k (g-cm) +r \equiv k g+r \equiv a\bmod m$ and
$x \equiv \ell(g-dn)+kdn +r \equiv \ell g+r \equiv b\bmod n$

Basically using the Chinese remainder theorem.

Joffan
  • 39,627