1

I read up on the Wikipedia article on the Chinese Remainder Theorem, and I understand the concepts. However, I am wondering how it can apply to the following (which is slightly different from their example): $$a = (k\bmod{m})$$ $$b = (k\bmod{n})$$ where $m$ and $n$ are relatively prime. Also, $a$ and $b$ are constants. How can I prove that $k$ is unique given $0\le k < mn$. Does this fall under the theorem?

Many thanks!

Bill Dubuque
  • 272,048
aiyan
  • 125
  • 8
  • 1
    Your claim is true. Hint: If $ X \equiv 0 \pmod m, X \equiv 0 \pmod n$, then $ X \equiv 0 \pmod{mn / \gcd (m.n) }$ – Calvin Lin Mar 25 '20 at 18:15
  • @CalvinLin Thank you for your response, and I agree with your statement, but I'm not sure how it supports my claim. Could you point me to some resources that provide some proof? Logically, my claim makes sense to me, but I don't know how I can back it. – aiyan Mar 25 '20 at 18:24
  • If I understand this question, your claim isn't true. Take $m=5, n=3, k = 2$. Then any pair $(a,b)$ with $a\in{2,7,12},\ b\in{2,5,8,11,14}$ satisfies the requirement, doesn't it? – saulspatz Mar 25 '20 at 18:30
  • @saulspatz You are absolutely right; I misphrased my question and edited it. What I meant is: no two integers $k_1$ and $k_2$ will map to the same $(a,b)$. – aiyan Mar 25 '20 at 18:53
  • 1
    CRT $\Rightarrow$ solution $,k,$ is unique $!!\pmod{!mn},$ so $,k_1\equiv k_2\pmod{!mn},$ so $,k_1 = k_2,$ by $,0\le k_1,k_2 < mn$ – Bill Dubuque Mar 25 '20 at 19:01
  • 1
    In fact this is stated (and proved) in the "Uniqueness" section on the Wikipedia page you linked (and also in many prior answers here, so your question is a dupe). If it is now clear I recommend that you delete the question. If not, then please clarify what remains unclear. – Bill Dubuque Mar 25 '20 at 19:07
  • @BillDubuque Thanks a lot. I am beginning to understand it. Now that you mentioned it, can you link me to the similar questions? I was unable to find any prior to posting this one. – aiyan Mar 25 '20 at 19:11
  • 1
    E.g. see the (same) uniqueness proof in Easy CRT. – Bill Dubuque Mar 25 '20 at 19:13
  • @BillDubuque I read several of your excellent Constant CRT posts. However, would they apply to my case, in which we are not solving for $x$ on the left-hand side for both congruences? Specifically, $a$ and $b$ are not necessarily the same. Rather, the constant here is $k$. – aiyan Mar 25 '20 at 19:25
  • 1
    Yes, if $k,k'$ are solutions then $,k-k'\equiv 0\pmod{! m\ &\ n}\Rightarrow,k-k'\equiv 0\pmod{!mn},$ by CCRT, where we used $\bmod m!:\ k\equiv a\equiv k',$ so $,k-k'\equiv 0,,$ and similarly $\bmod n\ \ $ – Bill Dubuque Mar 25 '20 at 19:45
  • @BillDubuque Your edit may be misrepresenting my question. Maybe I can clarify it this way: In function terms - I have an input $k$. I mod $k$ by $m$ and $n$, resulting in two outputs of $a$ and $b$. Is there another integer $k$ in $[0, mn)$ that can result in the same $a$ and $b$? – aiyan Mar 25 '20 at 20:01
  • 1
    That's a special case of said CRT uniqueness - the special case $,a = k\bmod m,\ b = k\bmod n.\ $ Be sure you understand the difference between congruence relations and mod operations, e.g. see here.. – Bill Dubuque Mar 25 '20 at 20:44
  • Why do you insist on writing $k$ (or $x)$ on the RHS? That may be indicate you are viewing something strangely. – Bill Dubuque Mar 25 '20 at 20:45
  • @BillDubuque I intend it to be a mod operation. $k$ is on the RHS because I have a program that calculates the remainders of $k$ when divided by $m$ and $n$. – aiyan Mar 25 '20 at 20:50
  • @BillDubuque I am essentially solving for $k$ here. I am trying to prove that $k$ is unique. – aiyan Mar 25 '20 at 20:54
  • 1
    I edited it to what you intend in a way that is unambiguous. It still is a special case of uniqueness of a CRT solution, since $,(k\bmod m) = a\Rightarrow k\equiv a\pmod{!m}\ $ (and conversely iff $,0\le a < m).\ \ $ – Bill Dubuque Mar 25 '20 at 21:17
  • @BillDubuque Ah, I understand now. I must have confused congruence relations and mod operators. Thanks alot for the help! – aiyan Mar 25 '20 at 21:26
  • 1
    Great! The sooner you learn to think in terms of congruences rather than mod operations, the sooner you will see the essence of the matter in number theory. – Bill Dubuque Mar 25 '20 at 21:49

1 Answers1

1

Translating the mod operations into more convenient congruences we have

$$\begin{align}k\bmod m &=\, a\\ k\bmod n \ &=\, b\end{align}\ \Rightarrow\ \begin{array}{}k\equiv a\pmod{\!m}\\ k\equiv b\pmod{\!n} \end{array}\qquad$$

By $m,n$ coprime, CRT $\Rightarrow$ the RHS congruence system has a $\rm\color{#c00}{unique}$ solution $\!\pmod{\!mn}.\,$ So there is exactly $\rm\color{#c00}{one}$ solution $k$ in the complete system of reps $\,0,1,\ldots, mn\!-\!1\,$ for integers $\!\bmod mn$.

Bill Dubuque
  • 272,048