0

I was reading this short book about Modular arithmetic, towards the end (Chapter 6.3) it provided a fast way to solve a linear system of congruences, instead of solving two of them at a time. Here's an example of how it works:

$x ≡ 2 (mod 3)≡ 2 (mod 4)≡ 1 (mod 5)$

then it write x as a "sum of three modular parts":

$x ≡ 4 · 5x_3 + 3 · 5x_4 + 3 · 4x_5 $

and it solves each part indipendently:

$x ≡ 4 · 5x_3 ≡ 20x_3 ≡ 2x_3 ≡ 2 (mod 3) ⇒ x_3 ≡ 1 (mod 3)$

$x ≡ 3 · 5x_4 ≡ 15x_4 ≡ −x_4 ≡ 2 (mod 4) ⇒ x_4 ≡ −2 ≡ 2 (mod 4)$

$x ≡ 3 · 4x_5 ≡ 12x_5 ≡ 2x_5 ≡ 1 ≡ 6 (mod 5) ⇒ x_5 ≡ 3 (mod 5)$

and at the end it substitute the values that it found: $x ≡ 4 · 5 · 1 + 3 · 5 · 2 + 3 · 4 · 3 ≡ 86 ≡ 26 (mod 60)$

I don't understand why this is true and when this is true, I have tried with a few systems and when the gcd of the modulus isn't 1 it doesn't work. (the explanation on the book is: The reason these coefficients ensure independence is that if we look at x in a given modulus, the irrelevant parts disappear. For instance, (mod 4) or (mod 5), the (mod 3) part 4 · 5x3 disappears, but (mod 3), 4 · 5x3 is all that remains) Online I haven't found this method, does it have another name? Is there a place that explains this way of solving system of congruences and gives a proof of why it works?

Bill Dubuque
  • 272,048
  • This is the Chinese Remainder Theorem – D S Mar 18 '24 at 19:37
  • This is in the typical proof of the "Chinese Remainder Theorem". It's the same idea as in Lagrange Interpolation for polynomials. – davidlowryduda Mar 18 '24 at 19:37
  • 1
    The explanation that the parts disapear seems pretty straight forward as $4\cdot 5 \equiv 0 \pmod{4,5}$ and $2\cdot 3\equiv 0 \pmod{2,3}$ etc. As for being relatively prime must divide all terms by the gcd and it should work. – fleablood Mar 18 '24 at 19:39
  • This is the idea in the proof of CRT and the method to solve for $x \equiv a_i \pmod{m_i}$. The author mentions this before. – D S Mar 18 '24 at 19:47
  • See e.g. here in the linked dupe for a detailed explanation for why this common CRT formula works. – Bill Dubuque Mar 18 '24 at 20:16
  • @BillDubuque sorry I can't comment on that post. I still don't understand why this works, why can we write it as a sums, an multiply each term by some number. I understand why there exist a solution modulo the lcm of all numbers but not why this method finds it. Can i understand it without knowledge of abstract algebra? – Lorenzo Spada Mar 19 '24 at 08:49
  • The first few paragraphs of the answer linked in my prior comment explains why the CRT formula yields a solution of the congruence system. Precisely which part of that don't you understand? That formula only works when the moduli are pairwise coprime. – Bill Dubuque Mar 19 '24 at 08:55
  • See the answers linked here for methods for solving congruence systems whose moduli are not pairise coprime. – Bill Dubuque Mar 19 '24 at 09:04
  • @BillDubuque I'm sorry, the only part that I understood is that $-57 = 1 (mod 3)$, $37 = 1 (mod 5)$ and $ 7*3 = 1 (mod 7)$ I don't understand why you have summed "them". It is clear that when we reduce the formula mod (3, 5 or 7) only one part remain, but I don't understand what is the meaning of this and why does multiplying by the $lcm/m_i$ yields a correct answer. – Lorenzo Spada Mar 19 '24 at 09:10
  • They must be summed because each summand yields the sought value for only one modulus (the summand is $\equiv 0$ mod all other moduli). What is not clear in the explanation there, viz: "when reduced $!\bmod \color{#c00}3,,$ the 2nd and 3rd summands are $\equiv\color{#c00} 0,,$ both having factors of $,\color{#c00}3,,$ so the formula reduces to $, x\equiv a\color{#0a0}{(1)} \color{#c00}{+ 0 + 0}\equiv a,,$ as sought. Similarly $!\bmod 5,$ and $!\bmod 7.$" That proves that the integer given by the formula is a solution of all $3$ congruences in the system. – Bill Dubuque Mar 19 '24 at 09:26
  • @BillDubuque really thank you, I now understand why this works. You helped me a lot! – Lorenzo Spada Mar 19 '24 at 09:42

0 Answers0