RSA algorithm implementation $$m^{ed} \equiv m \bmod n$$
$n =pq$, so by Chinese Remainder Theorem it is equivalent to
$$m^{ed} \equiv m \bmod , m^{ed} \equiv m \bmod q$$
where $n=p\cdot q$
So how did 2 come from 1 by the Chinese remainder theorem?
I know Chinese algorithm but How did $m^{ed} \equiv m \bmod p$ and $q$ come?
Observe that for any $n$, $l$, as long as $l | n$, any equivalence $a \equiv b \pmod n$ also holds mod $l$: $a \equiv b \pmod l$ .
To fully see this, we can write
$$
\begin{align*}
    a &amp;\equiv b \pmod n \\
    \Leftrightarrow \\
    a &amp;= b + kn
    \\&amp;=b + ktl \quad(\text{since } l|n\text{, so } n = tl)\\
    \Rightarrow\\
    a &amp;\equiv b \pmod l
\end{align*}
$$
So you could solve $m^e \pmod p \equiv a$ and $m^e \pmod q \equiv b$, then use CRT to get $m \pmod n$.