$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!