0

$a \cong b$ mod $n_1$ and $a \cong b$ mod $n_2$ implies $a \cong b$ mod lcm($n_1,n_2$)

Can't seem to figure this one out... So....

By hypothesis there exists $x,y \in \mathbb{Z}$ such that:

$a-b=xn_1$

$a-b=yn_2$.

Also, by definition of the least common multiple, there exists $r,s \in \mathbb{Z}$ such that:

$lcm(n_1,n_2)=rn_1$

$lcm(n_1,n_2)=sn_2$

I'm wondering if the formula $lcm(n_1,n_2)gcd(n_1,n_2) = n_1n_2$ will come in handy.

But yeah, I could use some help on this one. Thanks!

  • I find when worse comes to worst one can always convert $a = b+Mn_1$ for some integer $M$ can give insight. (It's a bad habit and we need to outgrow it but... a proof is a proof...) So $a=b+Mn_1$ and $a=b+Kn_2$ so $Mn_1 = Kn_2$. This number is a common multiple of $n_1,n_2$. And all common multiple are multiples of the least common multiple. So $S=Mn_1=Kn_2 = Wlcm(n_1,n_2)$ and so $a= b+ Wlcm(n_1,n_2)$ and $a\equiv b$. Not elegant. Not slick and your professor will frown, but ... it was something one can work through when one is stuck. – fleablood Feb 09 '22 at 05:07
  • \equiv gives $\equiv$, more common than \cong. And \bmod will give the "binary mod operator" which gives the correct spacing and typesetting. If you want the version with parentheses, us3 \pmod – Arturo Magidin Feb 09 '22 at 05:21
  • See CCRT in the linked dupe. – Bill Dubuque Feb 09 '22 at 09:59

3 Answers3

2

$$a-b \equiv 0 \text{ (mod }n_1\text{)}$$ $$a-b \equiv 0 \text{ (mod }n_2\text{)}$$

Thus $a-b$ is a common multiple of $n_1$ and $n_2$. All common multiples are multiples of the least common multiple (can be proved easily by using prime factorization and proof by contradiction), so:

$$a-b \equiv 0 \text{ (mod lcm}(n_1,n_2)\text{)}$$ $$\therefore a \equiv b \text{ (mod lcm}(n_1,n_2)\text{)}$$

Saturday
  • 1,358
0

If $a \pmod n = b$, then $a=b+cn$, for some integer $c$. If $a \pmod m = b$, then $a=b+c'm$ for somr integer $c'$. Now $cn=c'm$ [make sure you see why] and is divisible by both $n$ and $m$, so $c'm=cn$ is a multiple of $\text{lcm}(m,n)$.

Can you finish from here.

Mike
  • 20,434
0

Heres a way spelled out from first principles:

Using your notation there exist integers $x,y$ such that:

$$ a - b = xn_1$$ $$ a - b = yn_2$$

So we have that

$$ xn_1 = yn_2 $$

Now if $a-b = 0$ and then $a-b \equiv 0 \mod \text{LCM}(n_1,n_2)$ trivially. So let's assume consider now the case where $a-b\ne 0$.

Clearly $a-b$ is divisible by both $n_1$ and $n_2$. So $a-b$ is a multiple of $n_1, n_2$. There is a famous theorem which states the least common multiple divides all common multiples

So it must be there exists a non zero integer $r$ such that

$$ a - b = r \text{LCM}(n_1, n_2) $$

Well this can be equivalently stated as

$$ a - b \equiv 0 \mod \text{LCM}(n_1, n_2) $$