# Show that $a\equiv b \pmod{n_1n_2...n_r}$ if and only if $a \equiv b\pmod {n_i}$ for all $i = 1, 2,. . . , r$

Get $n_1,n_2,...,n_r$ positive integers such that $\gcd(n_i,n_j)=1$ always that $i\neq j$ and get $a,b$ two arbitrary integers..

Show that $$a\equiv b \pmod{n_1n_2...n_r}$$ if and only if $$a \equiv b \pmod{n_i}$$ for all $i = 1, 2,. . . , r$

• Welcome to the site! So you are aware, this is not a homework site. People here don't like to respond to questions that show no effort. What have you tried? Can you, for example show one of the two implications? (that is, can you prove either "if" or "only if"?
– lulu
Oct 13 '16 at 14:23
• yes,, <- this implication Oct 13 '16 at 14:26
• @AndrewNew Oh, but $\to$ is even more trvial ... Oct 13 '16 at 14:26
• I agree with @HagenvonEitzen...$\Rightarrow$ is a lot easier. Can you edit your post to show your argument for $\Leftarrow$?
– lulu
Oct 13 '16 at 14:29
• @lulu I feel like this is the most friendly way to welcome newcomers! almost spit in their faces. Oct 13 '16 at 14:35

if $a\equiv b \mod n_1\dots n_r$, then $a=b+k\cdot n_1\dots n_r$, and so $a\equiv b\mod n_i,\quad\forall i$.
If $a\equiv b\mod n_i,\quad\forall i$, then $a=b+k_1n_1=\dots=k_rn_r$. However as $\gcd(n_i,n_j)=1$ for $i\ne j$, each $k_i$ must be divisible by all the other $n_j$, and so $a\equiv b \mod n_1\dots n_r$.