L08 – Chinese remainder theorem, CRT map, and group

Discrete Mathematics2026年3月27日发布 芮和
34.2K 900
8,622字
36–55 分钟

Summary of Lecture 7

L07 – Prime number theorem, Fermat test, linear congruence equations, and system of linear congruences

Chebyshev’s theta function: θ(x)=pxlnp\theta(x) = \sum_{p \le x} \ln p

THEOREM:θ(x)=Θ(π(x)lnx)\theta(x) = \Theta(\pi(x) \ln x).

THEOREM: For any real number x1x \ge 1, θ(x)<(2ln2)x\theta(x) < (2 \ln 2)x.

THEOREM (Hadamard; Poussin, 1896):limxπ(x)xlnx=1\lim_{x \to \infty} \frac{\pi(x)}{\frac{x}{\ln x}} = 1

  • π(x)>xlnx(1+12lnx),x59\pi(x) > \frac{x}{\ln x}\left(1 + \frac{1}{2\ln x}\right), x \ge 59; π(x)<xlnx(1+32lnx),x>1\pi(x) < \frac{x}{\ln x}\left(1 + \frac{3}{2\ln x}\right), x > 1
    // Rosser and Schoenfeld

THEOREM:|n|2nnln2(12+O(1n))|\mathbb{P}_n| \ge \frac{2^n}{n \ln 2}\left(\frac{1}{2} + O\left(\frac{1}{n}\right)\right) when nn \to \infty.

Prime Number Generation: choose and test // at most 2nln22n \ln 2 trials

  • Fermat test: 𝐅𝐞𝐫𝐦𝐚𝐭(n,t)\textbf{Fermat}(n, t)

THEOREM: Let n+,a,b,gcd(a,n)=dn \in \mathbb{Z}^+, a, b \in \mathbb{Z}, \gcd(a, n) = d and t=(ad)1modndt = \left(\frac{a}{d}\right)^{-1} \bmod \frac{n}{d}. If d|bd \mid b, then axb(modn)ax \equiv b \pmod{n} if and only if xbdt(modnd)x \equiv \frac{b}{d}t \pmod{\frac{n}{d}}.


Chinese Remainder Theorem

THEROEM: Let n1,,nk+n_1, \dots, n_k \in \mathbb{Z}^+ be pairwise relatively prime and let n=n1nkn = n_1 \cdots n_k. Then for any b1,,bkb_1, \dots, b_k \in \mathbb{Z}, then the system

{xb1(modn1)xb2(modn2)xbk(modnk)\begin{cases}x \equiv b_1 \pmod{n_1} \\x \equiv b_2 \pmod{n_2} \\\quad \vdots \\x \equiv b_k \pmod{n_k}\end{cases}

always has a solution. Furthermore, if bb \in \mathbb{Z} is a solution, then any solution xx must satisfy xb(modn)x \equiv b \pmod n.

  • Let Ni=nniN_i = \frac{n}{n_i} for every i[k]i \in [k].
    • gcd(Ni,ni)=1\gcd(N_i, n_i) = 1 for every i[k]i \in [k].
    •  si,ti,Nisi+niti=1\exists \ s_i, t_i, N_i s_i + n_i t_i = 1.
  • Let b=b1(N1s1)++bk(Nksk)b = b_1(N_1 s_1) + \dots + b_k(N_k s_k).
    • Then bbi(modni)b \equiv b_i \pmod{n_i} for every i[k]i \in [k].
  • xbi(modni)x \equiv b_i \pmod{n_i} for all ii
    xb(modni)\implies x \equiv b \pmod{n_i} for all ii
    ni|(xb)\implies n_i | (x – b) for all ii
    (n1n2nk)|(xb)\implies (n_1 n_2 \cdots n_k) | (x – b)
    xb(modn)\implies x \equiv b \pmod n

Solution to Sun-Tsu’s Question

EXAMPLE: Solve the system {x2(mod3)x3(mod5)x2(mod7)\begin{cases}x\equiv 2\pmod{3}\\x\equiv 3\pmod{5}\\x\equiv 2\pmod{7}\end{cases}.

  • n1=3,n2=5,n3=7;n=n1n2n3=105;b1=2,b2=3,b3=2n_1 = 3, n_2 = 5, n_3 = 7; n = n_1 n_2 n_3 = 105; b_1 = 2, b_2 = 3, b_3 = 2
    • N1=n2n3=35,N2=n1n3=21,N3=n1n2=15N_1 = n_2 n_3 = 35, N_2 = n_1 n_3 = 21, N_3 = n_1 n_2 = 15
    • 12n1N1=1;4n2+N2=1;2n3+N3=112 n_1 – N_1 = 1; -4 n_2 + N_2 = 1; -2 n_3 + N_3 = 1
    • t1=12,s1=1;t2=4,s2=1;t3=2,s3=1t_1 = 12, s_1 = -1; t_2 = -4, s_2 = 1; t_3 = -2, s_3 = 1
  • b=b1(N1s1)+b2(N2s2)+b3(N3s3)b = b_1(N_1 s_1) + b_2(N_2 s_2) + b_3(N_3 s_3)
    =2(35)+3(21)+2(15)= 2 (-35) + 3 (21) + 2(15)
    =23= 23
  • xx \in \mathbb{Z} is a solution of the system iff x23(mod105)x \equiv 23 \pmod{105}
  • Solutions: [23]105[23]_{105}

CRT Map

THEOREM: Let n1,,nk+n_1, \dots, n_k \in \mathbb{Z}^+ and gcd(ni,nj)=1\gcd(n_i, n_j) = 1 for all iji \neq j. Let n=n1nkn = n_1 \cdots n_k. The CRT map θ([x]n)=([x]n1,,[x]nk)\theta([x]_n) = ([x]_{n_1}, \dots, [x]_{n_k}) is a bijection from n\mathbb{Z}_n^* to n1××nk\mathbb{Z}_{n_1}^*\times \cdots \times \mathbb{Z}_{n_k}^*.

  • θ\theta is well-defined:
    • show that θ([x]n)n1××nk\theta([x]n) \in \mathbb{Z}{n_1}^* \times \cdots \times \mathbb{Z}_{n_k}^* for every [x]nn[x]_n \in \mathbb{Z}_n^*
      • [x]nngcd(x,n)=1gcd(x,ni)=1[x]_n \in \mathbb{Z}_n^* \implies \gcd(x, n) = 1 \implies \gcd(x, n_i) = 1 for every i[k][x]ninii \in [k] \implies [x]_{n_i} \in \mathbb{Z}_{n_i}^* for every i[k]i \in [k]
    • show that [x]n=[y]nθ([x]n)=θ([y]n)[x]_n = [y]_n \implies \theta([x]_n) = \theta([y]_n)
      • [x]n=[y]nxy(modn)xy(modni)[x]_n = [y]_n \implies x \equiv y \pmod{n} \implies x \equiv y \pmod{n_i} for every i[k]i \in [k];
        [x]ni=[y]ni\implies [x]_{n_i} = [y]_{n_i} for every i[k]i \in [k]
        θ([x]n)=θ([y]n)\implies \theta([x]_n) = \theta([y]_n)
  • θ\theta is injective, i.e., θ([x]n)=θ([y]n)[x]n=[y]n\theta([x]_n) = \theta([y]_n) \implies [x]_n = [y]_n
    • θ([x]n)=θ([y]n)([x]n1,,[x]nk)=([y]n1,,[y]nk)[x]ni=[y]ni\theta([x]_n) = \theta([y]_n) \implies ([x]_{n_1}, \dots, [x]_{n_k}) = ([y]_{n_1}, \dots, [y]_{n_k}) \implies [x]_{n_i} = [y]_{n_i} for every i[k]i \in [k]
      ni|(xy)\implies n_i \mid (x – y) for every i[k]i \in [k]
      n|(xy)[x]n=[y]n\implies n \mid (x – y) \implies [x]_n = [y]_n
  • θ\theta is surjective: Let ([b1]n1,,[bk]nk)n1××nk([b_1]_{n_1}, \dots, [b_k]_{n_k}) \in \mathbb{Z}_{n_1}^* \times \cdots \times \mathbb{Z}_{n_k}^*. Preimage?
    • Due to CRT, the system xbi(modni),i=1,,kx \equiv b_i \pmod{n_i}, i = 1, \dots, k, has a solution bb
    • bbi(modni)b \equiv b_i \pmod{n_i} for all i[k]i \in [k]
    • Since [bi]nini[b_i]_{n_i} \in \mathbb{Z}_{n_i}^*, gcd(b,ni)=1\gcd(b, n_i) = 1 for all i[k]i \in [k]
    • gcd(b,n1n2nk)=1\gcd(b, n_1 n_2 \cdots n_k) = 1
    • θ([b]n)=([b]n1,,[b]nk)=([b1]n1,,[bk]nk)\theta([b]_n) = ([b]_{n_1}, \dots, [b]_{n_k}) = ([b_1]_{n_1}, \dots, [b_k]_{n_k})
    • [b]n[b]_n is a preimage of ([b1]n1,,[bk]nk)([b_1]_{n_1}, \dots, [b_k]_{n_k})

Euler’s Phi Function

THEOREM: Let n1,,nk+n_1, \dots, n_k \in \mathbb{Z}^+ be pairwise relatively prime. Let n=n1nkn = n_1 \cdots n_k. Then ϕ(n)=ϕ(n1)ϕ(nk)\phi(n) = \phi(n_1) \cdots \phi(n_k).

  • θ:nn1××nk\theta: \mathbb{Z}_n^* \to \mathbb{Z}_{n_1}^* \times \cdots \times \mathbb{Z}_{n_k}^* is bijective
  • ϕ(n)=ϕ(n1)××ϕ(nk)\phi(n) = \phi(n_1) \times \cdots \times \phi(n_k)

THEOREM: If n=p1e1pkekn = p_1^{e_1} \cdots p_k^{e_k} for distinct primes p1,,pkp_1, \dots, p_k and integers e1,,ek1e_1, \dots, e_k \ge 1, then ϕ(n)=n(1p11)(1pk1)\phi(n) = n(1 – p_1^{-1}) \cdots (1 – p_k^{-1}).

  • ϕ(n)=ϕ(p1e1)ϕ(pkek)=n(1p11)(1pk1)\phi(n) = \phi(p_1^{e_1}) \cdots \phi(p_k^{e_k}) = n(1 – p_1^{-1}) \cdots (1 – p_k^{-1})

EXAMPLE:ϕ(10)=ϕ(2)ϕ(5)=4\phi(10) = \phi(2)\phi(5) = 4; n=10;n1=2,n2=5n = 10; n_1 = 2, n_2 = 5

  • θ:nn1×n2\theta: \mathbb{Z}_n^* \to \mathbb{Z}_{n_1}^* \times \mathbb{Z}_{n_2}^*
    1(1,1);3(1,3);7(1,2);9(1,4)1 \mapsto (1,1); 3 \mapsto (1,3); 7 \mapsto (1,2); 9 \mapsto (1,4)

(n,+)(\mathbb{Z}_n, +)

EXAMPLE: For n+n \in \mathbb{Z}^+, n\mathbb{Z}_n and ++ satisfy the following properties.

  • Closure:[a]n+[b]nn[a]_n + [b]_n \in \mathbb{Z}_n
    • [a]n+[b]n=[a+b]nn[a]_n + [b]_n = [a + b]_n \in \mathbb{Z}_n
  • Associative:([a]n+[b]n)+[c]n=[a]n+([b]n+[c]n)([a]_n + [b]_n) + [c]_n = [a]_n + ([b]_n + [c]_n)
    • ([a]n+[b]n)+[c]n=[a+b]n+[c]n=[(a+b)+c]n([a]_n + [b]_n) + [c]_n = [a + b]_n + [c]_n = [(a + b) + c]_n
      =[a+(b+c)]n=[a]n+[b+c]n= [a + (b + c)]_n = [a]_n + [b + c]_n
      =[a]n+([b]n+[c]n)= [a]_n + ([b]_n + [c]_n)
  • Identity:[a]n+[0]n=[0]n+[a]n=[a]n[a]_n + [0]_n = [0]_n + [a]_n = [a]_n
    • [a]n+[0]n=[a+0]n=[0+a]n=[0]n+[a]n[a]_n + [0]_n = [a + 0]_n = [0 + a]_n = [0]_n + [a]_n
  • Inverse:[a]n+[a]n=[a]n+[a]n=[0]n[a]_n + [-a]_n = [-a]_n + [a]_n = [0]_n
    • [a]n+[a]n=[a+(a)]n=[0]n[a]_n + [-a]_n = [a + (-a)]_n = [0]_n
  • Commutative:[a]n+[b]n=[b]n+[a]n[a]_n + [b]_n = [b]_n + [a]_n
    • [a]n+[b]n=[a+b]n=[b+a]n=[b]n+[a]n[a]_n + [b]_n = [a + b]_n = [b + a]_n = [b]_n + [a]_n

Group

DEFINITION: A group is a set GG together with a binary operation \star on GG such that

  • Closure:a,bG,abG\forall a, b \in G, a \star b \in G
  • Associative:a,b,cG,a(bc)=(ab)c\forall a, b, c \in G, a \star (b \star c) = (a \star b) \star c
  • Identity:eG,aG,ae=ea=a\exists e \in G, \forall a \in G, a \star e = e \star a = a
  • Inverse:aG,bG,ab=ba=e\forall a \in G, \exists b \in G, a \star b = b \star a = e

DEFINITION: A group GG is said to be an Abelian group if it is

  • Commutative:a,bG,ab=ba\forall a, b \in G, a \star b = b \star a

Group n\mathbb{Z}_n^*

THEOREM:n\mathbb{Z}_n^* is an Abelian group for any integer n>1n > 1.

  • Closure:[a]n,[b]nn,[a]n[b]n=[ab]nn\forall [a]_n, [b]_n \in \mathbb{Z}_n^*, [a]_n \cdot [b]_n = [ab]_n \in \mathbb{Z}_n^*
  • Associative:[a]n,[b]n,[c]nn,[a]n([b]n[c]n)=[abc]n=([a]n[b]n)[c]n\forall [a]_n, [b]_n, [c]_n \in \mathbb{Z}_n^*, [a]_n \cdot ([b]_n \cdot [c]_n) = [abc]_n = ([a]_n \cdot [b]_n) \cdot [c]_n
  • Identity element:[1]nn,[a]nn,[a]n[1]n=[1]n[a]n=[a]n\exists [1]_n \in \mathbb{Z}_n^, \forall [a]_n \in \mathbb{Z}_n^, [a]_n \cdot [1]_n = [1]_n \cdot [a]_n = [a]_n
  • Inverse:[a]nn,[s]nn\forall [a]_n \in \mathbb{Z}_n^*, \exists [s]_n \in \mathbb{Z}_n^* such that [a]n[s]n=[s]n[a]n=[1]n[a]_n \cdot [s]_n = [s]_n \cdot [a]_n = [1]_n
  • Commutative:[a]n,[b]nn,[a]n[b]n=[ab]n=[ba]n=[b]n[a]n\forall [a]_n, [b]_n \in \mathbb{Z}_n^*, [a]_n \cdot [b]_n = [ab]_n = [ba]_n = [b]_n \cdot [a]_n

REMARK: we are interested in two types of Abelian groups

  • Additive Group: binary operation ++; identity 00
    • Example: (,+),(n,+),(,+),(n,+)(\mathbb{Z}, +), (n\mathbb{Z}, +), (\mathbb{Q}, +), (\mathbb{Z}_n, +)
  • Multiplicative Group: binary operation \cdot; identity 11 //(n,)(\mathbb{Z}_n^*, \cdot)
    • Example: (,×),(±1,×),(n,)(\mathbb{Q}^*, \times), ({\pm 1}, \times), (\mathbb{Z}_n^*, \cdot)

Order

DEFINITION: The order of a group GG is the cardinality of GG.

  • |n|=n,|p|=p1,||=|\mathbb{Z}_n| = n, |\mathbb{Z}_p^*| = p – 1, |\mathbb{Z}| = \infty

DEFINITION: when |G|<|G| < \infty, aG\forall a \in G, the order of aa is the least integer l>0l > 0 such that al=1a^l = 1 (la=0la = 0 for additive group)

EXAMPLE: Determine the orders of all elements of 7\mathbb{Z}_7^* and 6\mathbb{Z}_6

  • 7={1,2,3,4,5,6};o(1)=1;o(2)=o(4)=3;o(3)=o(5)=6;o(6)=2\mathbb{Z}_7^* = \{1,2,3,4,5,6\}; o(1) = 1; o(2) = o(4) = 3; o(3) = o(5) = 6; o(6) = 2
  • 6={0,1,2,3,4,5};o(0)=1,o(1)=o(5)=6,o(2)=o(4)=3,o(3)=2\mathbb{Z}_6 = \{0,1,2,3,4,5\}; o(0) = 1, o(1) = o(5) = 6, o(2) = o(4) = 3, o(3) = 2

THEOREM: Let GG be a multiplicative Abelian group of order mm. Then for any aGa \in G, am=1a^m = 1.

  • G={a1,,am}G = \{a_1, \dots, a_m\}
  • If iji \neq j, then aaiaajaa_i \neq aa_j.
  • aa1aa2aam=a1a2amaa_1 \cdot aa_2 \cdots aa_m = a_1 a_2 \cdots a_m
  • am=1a^m = 1
© 版权声明

相关文章

90 条评论

  • 白术
    白术 读者

    同余方程组实际应用中常见吗?

    中国北京
    回复
  • 沙尘暴走
    沙尘暴走 游客

    密码学里RSA是不是就靠这个?

    印度尼西亚
    回复
  • 猪猪侠
    猪猪侠 读者

    那个23是代公式算出来的吧

    中国辽宁
    回复
  • 躺平小能手
    躺平小能手 游客

    证明跳得确实有点多,中间缺了几步

    中国浙江
    回复
  • 茶商周
    茶商周 读者

    CRT证明那部分跳步有点多,跟不太上

    哥伦比亚
    回复
    • 花椰菜
      花椰菜 读者

      同感,推导有点快

      墨西哥@ 茶商周
      回复
  • 不说话的小树
    不说话的小树 读者

    同余方程组求解看着就头大

    中国湖北
    回复
  • 旧照相馆
    旧照相馆 读者

    费马测试那个试错次数有点吓人

    中国北京
    回复
  • 橡皮糖
    橡皮糖 读者

    算那个s和t的时候最容易算错

    中国陕西
    回复
  • 凌霄
    凌霄 读者

    群的阶和元素的阶老是搞混

    中国河南
    回复
    • 野性不灭
      野性不灭 读者

      我也搞混过,后来记|G|是群大小,|g|是g的幂次才分清

      中国湖南@ 凌霄
      回复
  • 皮皮虾快跑
    皮皮虾快跑 读者

    CRT不就是韩信点兵嘛

    美国
    回复
  • 企鹅酷
    企鹅酷 读者

    Z_6那个例子讲得挺明白的

    中国河南
    回复
  • MooseMischief
    MooseMischief 读者

    证明欧拉函数那个公式蛮实用的

    美国
    回复
  • 绵绵雪球
    绵绵雪球 读者

    费马测试那块能再展开说说吗

    美国
    回复
    • 烈焰歌者
      烈焰歌者 读者

      同问,这块有点绕

      澳大利亚@ 绵绵雪球
      回复
  • 果酱小奶包
    果酱小奶包 读者

    这例题步骤还挺详细的

    美国
    回复
  • 梦影谣
    梦影谣 游客

    模运算符号老和除法混淆,烦死了

    中国河南
    回复
    • 狂怒之焰
      狂怒之焰 游客

      模那个竖线真的像除号,每次看都得停两秒确认😂

      中国浙江@ 梦影谣
      回复
  • SpecterFang
    SpecterFang 游客

    完全没看懂θ映射那部分在干啥

    韩国
    回复
  • 独行浪子
    独行浪子 读者

    又是抽象代数,每次看到bijection就发怵🤔

    中国河北
    回复
    • AI园丁
      AI园丁 游客

      bijection一出来我就知道要挂了,头大

      中国湖北@ 独行浪子
      回复
    • 滑雪狂人
      滑雪狂人 读者

      bijection那块确实绕,脑子转不过弯来。

      日本@ 独行浪子
      回复
  • 吃土少年不忧伤
    吃土少年不忧伤 游客

    之前搞过同余方程组,确实折腾了好久

    中国香港
    回复
  • 狂野狼
    狂野狼 游客

    密码学里RSA是不是就靠这个?求大佬指点

    韩国
    回复
  • 钟表
    钟表 游客

    欧拉函数那块突然就乘起来了,前面铺垫不够啊

    中国重庆
    回复
  • 柠檬挞
    柠檬挞 游客

    群论定义背了八百遍还是用不利索

    印度尼西亚
    回复
  • 人群导航仪
    人群导航仪 游客

    模7余2、模3也余2,那x-2是21倍数?然后试出23…好像也没那么难

    中国江苏
    回复
  • 神瑛侍者
    神瑛侍者 读者

    23那个结果代进去验算倒是对的,但中间步骤太跳了

    中国北京
    回复