3

The German Wikipedia page on the Chinese Remainder Theorem states the following

Given are the two simultaneous congruences: $$ \begin{aligned} & x \equiv a \quad(\bmod n) \\ & x \equiv b \quad(\bmod m) \end{aligned} $$ If these are solvable, that is $a \equiv b \quad(\bmod d)$, then they are equivalent to $$ x \equiv a-y n \frac{a-b}{d} \pmod{\frac{n m}{d}} $$ with $$ d=\operatorname{gcd}(n, m)=y n+z m . $$ This also works with non-divisor numbers $n$ and $m$ and thus provides a significant simplification in solving simultaneous congruences.

I wanted to derive/proof this statement and you can directly see that $nm/d=\operatorname{lcm} nm$. I translated the congruences $$ x-a=tn $$ $$ x-b=km $$ $$ a-b=sd $$ And tried to work backwards $$ x-a+yn\frac{a-b}{d} = \frac{nm}{d}p $$ which is, after dividing by $n$ $$ t+y\frac{a-b}{d} = \frac{m}{d}p $$ and furthermore $$ (t+ys)d=mp $$ for $k,s,t,p\in\mathbb{Z}$. This is not helpful and leads to nothing. Maybe anyone has an idea or a hint. Thanks in advance.

1 Answers1

2

That follows immediately from the General CRT formula below (chase the link for a proof) $$\ \ x\equiv a + n\left[\dfrac{(b-a)/d}{\color{#c00}{n/d}} \bmod m/d\right]\pmod{mn/d}$$ since $\,\color{#c00}{(n/d)^{-1}}\equiv y\pmod{\!m/d},\, $ by $\,y\,\color{#c00}{n/d} + z\,m/d = 1,\, $ by dividing Bezout by $\:\!d$.


Alternatively scaling by $m,n$ (to equalize moduli) yields an equivalent system $\!\bmod mn,\,$which Hermite reduces to an equivalent single congruence (equiv. by determinant $= \color{#0a0}{zm\!+\!yn} = d\neq 0)$

$$\begin{align} mx&\equiv ma\!\!\pmod{\!mn}\\ nx&\equiv\ nb\!\!\!\:\pmod{\!mn}\end{align}\!\color{#c00} \iff dx\equiv zma+ynb\!\!\pmod{\!mn},\ \color{#c00}{\rm\ by}$$ $$\begin{bmatrix} \color{#0a0}z & \color{#0a0}y\\ \color{#0a0}{-n} & \color{#0a0}m\end{bmatrix} \begin{bmatrix} m & ma\\ n & nb\end{bmatrix} \equiv \begin{bmatrix} d & zma+ynb\\ 0 & 0\end{bmatrix}\! \pmod{\!mn}\qquad\qquad\qquad\qquad\qquad\qquad\ $$

But $\,\color{#0af}{zm} = d-yn\,\Rightarrow\, dx = \color{#0ad}{zm}a+ynb = da- yn(\color{#b0f}{a-b})\ \pmod{\!mn},\,$ so cancelling $\,d\,$ yields the claimed result (recall that $\,d\mid \color{#b0f}{a\!-\!b}\,$ is necessary for the original system to be solvable).

This is a special case of reduction to Hermite normal form, which is performable using the fractional extended Euclidean algorithm, as explained by an example at the end of this answer.

Bill Dubuque
  • 272,048