L01 – Fundamental theorem of arithmetic, the well-ordering property, division algorithm, ideal,greatest common divisor, and Bézout’s theorem

Discrete Mathematics2026年3月4日发布 芮和
9.6K 870
5,669字
24–36 分钟

Elementary Number Theory

  • Divisibility
    primes, division algorithm, greatest common divisor, fundamemtal theorem of arithmetic
  • Congruences
    congruence, residue classes, Euler’s theorem
  • Application (Public-key encryption)
    RSA, modular arithmetics, square and multiply, Euclidean algorithm, prime number generation, CRT
  • Application (Key exchange)
    groups, subgroups, cyclic groups, Discrete logarithm, Diffie-Hellman key exchange

Divisibility

Notation:={0,1,2,};={0,±1,};={ba:a,b,a0}\mathbb{N}=\left\{0,1,2,\dots\right\};\,\mathbb{Z}=\left\{0,\pm 1,\dots\right\};\,\mathbb{Q}=\left\{\frac{b}{a}:\, a,b\in\mathbb{Z},\, a\neq 0\right\}(rational); ={a.b1b2,a,b1,b2,}\mathbb{R}=\left\{a.b_1b_2\dots,\,a,b_1,b_2,\dots\in\mathbb{Z}\right\}(real)

Definition: Let a{0}a\in\mathbb{Z}\setminus\left\{0\right\} and let bb\in\mathbb{Z}.

  • aadividesbb: there is an integer cc\in\mathbb{Z} such that b=acb=ac
  • aa is a divisor of bb; bb is a multiple of aa
  • a|ba\mid b: aa divides bb; aba\nmid b: aa does not divide bb
  • n{2,3,}n\in\left\{2,3,\dots\right\} is a prime if the only positive divisors of nn are 11 and nn
  • If n{2,3,}n\in\left\{2,3,\dots\right\} is not a prime, then nn is called a composite
  • Example: nn is composite iff a,b(1,n)\exist a,b\in\left(1,n\right)\cap\mathbb{Z} such that n=abn=ab

Theorem (Fundamental Theorem of Arithmetic):
Every integer n>1n>1 can be uniquely written as n=p1e1prern=p_1^{e_1}\dots p_r^{e_r}, where p1<<prp_1<\dots<p_r are primes and e1,,er1e1,\dots,e_r\geq 1.


FTA Proof

Existence: by mathematical induction on the integer nn

  • n=2n=2: 2=212=2^1 is a product of prime powers
  • Induction hypothesis: suppose there is an integer k>2k>2 such that the theorem is true for all integers nn such that 2n<k2\leq n<k
  • Prove the theorem is true for n=kn = k
    • n=kn=k is a prime
      • n=kn=k is a product of prime powers
    • n=kn=k is composite
      • There are integers n1,n2n_1,n_2 such that 1<n1,n2<n1<n_1,n_2<n and n=n1n2n=n_1n_2
      • By induction hypothesis, n1=p1α1prαrn_1=p_1^{\alpha_1}\dots p_r^{\alpha_r} and n2=q1β1qsβsn_2=q_1^{\beta_1}\dots q_s^{\beta_s}
        • p1,,pr,q1,,qsp_1,\dots,p_r,q_1,\dots,q_s are primes; α1,,αr,β1,,βs1\alpha_1,\dots,\alpha_r,\beta_1,\dots,\beta_s\geq 1
      • n=n1n2=p1α1prαrq1βqsβn=n_1n_2=p_1^{\alpha_1}\dots p_r^{\alpha_r}\cdot q_1^{\beta}\dots q_s^{\beta} is a product of prime powers

Division Algorithm

r=abx,{a=bq+r0r<br=a-bx,\,\begin{cases}a=bq+r\\0\leq r<b\end{cases}

The Well-Ordering Property: Every non-empty subset of \mathbb{N} has a least element.

THEOREM (Division Algorithm):
Let a,ba,b\in\mathbb{Z} and b>0b>0. Then there are unique q,rq,r\in\mathbb{Z} such that 0r<b0\leq r<b and a=bq+ra=bq+r.

  • Existence: Let S={abx:x and abx0}S=\left\{a-bx:\,x\in\mathbb{Z}\text{ and }a-bx\geq 0\right\}. Then
    • SS\neq\emptyset and SS\subseteq\mathbb{N}
      • SS has a least element, say r=abq0r=a-bq\geq 0
      • If rbr\geq b, then rb=ab(q+1)Sr-b=a-b(q+1)\in S and rb<rr-b<r.
        • The contradiction shows that 0r<b0\leq r<b.
  • Uniqueness: Suppose that q,r,0r<bq’,r’\in\mathbb{Z},\,0\leq r'<b and a=bq+ra=bq’+r’
    • Recall that a=bq+r,0r<ba=bq+r,\,0\leq r<b
      • Then b(qq)=rr(b,b)b\left(q-q’\right)=r’-r\in(-b,b)
        • It must be the case that q=qq=q’ and thus r=rr=r’

Ideal

{a=bq+r0r<b\begin{cases}a=bq’+r’\\0\leq r'<b\end{cases}

bq+r=bq+rbq’+r’=bq+r
b(qq)=rr(b,b)b\left(q’-q\right)=r-r’\in(-b,b)

DEFINITION: Let II \subseteq \mathbb{Z} be nonempty. II is called an ideal of \mathbb{Z} if:

  • a,bIa+bIa, b \in I \implies a + b \in I; and
  • aI,rraIa \in I, r \in \mathbb{Z} \implies ra \in I.
    • Example: d=0,±d,±2d,d\mathbb{Z} = {0, \pm d, \pm 2d, \dots} is an ideal of \mathbb{Z} for all dd \in \mathbb{Z}.

THEOREM: Let II be an ideal of \mathbb{Z}. Then d\exists d \in \mathbb{Z} such that I=dI = d\mathbb{Z}.

  • If I={0}I = \{0\}, then d=0d = 0.
  • Otherwise, let S={aI:a>0}S = \left\{a \in I :\,a > 0\right\}.
    • SS \subseteq \mathbb{N} and SS \neq \emptyset.
    • due to the well-ordering property, SS has a least element, say dSd \in S.
      • dId\mathbb{Z} \subseteq I:
        • dIdrId \in I \implies dr \in I for any rr \in \mathbb{Z}.
      • IdI \subseteq d\mathbb{Z}:
        • xI,x=dq+r,0r<d\forall x \in I,\,x = dq + r,\,0 \le r < d.
        • r=xdqI,0r<dr = x – dq \in I,\,0 \le r < d.
        • r=0r = 0 (otherwise, there is a contradiction)
        • x=dqdx = dq \in d\mathbb{Z}.

DEFINITION: Let I1,I2I_1, I_2 be ideals of \mathbb{Z}. Then the sum of I1I_1 and I2I_2 is defined as I1+I2={x+y:xI1,yI2}I_1 + I_2 = \left\{x + y :\, x \in I_1, y \in I_2\right\}

THEOREM: If I1,I2I_1, I_2 are ideals of \mathbb{Z}, then I1+I2I_1 + I_2 is an ideal of \mathbb{Z}.

  • a,bI1+I2,a+bI1+I2\forall a, b \in I_1 + I_2,\, a + b \in I_1 + I_2
    • x1,x2I1,y1,y2I2\exists x_1, x_2 \in I_1,\,y_1, y_2 \in I_2 such that a=x1+y1;b=x2+y2a = x_1 + y_1;\,b = x_2 + y_2
    • a+b=(x1+x2)+(y1+y2)I1+I2a + b = (x_1 + x_2) + (y_1 + y_2) \in I_1 + I_2
  • aI1+I2,r,raI1+I2\forall a \in I_1 + I_2,\,r \in \mathbb{Z},\,ra \in I_1 + I_2
    • xI1,yI2\exists x \in I_1,\,y \in I_2 such that a=x+ya = x + y
    • ra=(rx)+(ry)I1+I2ra = (rx) + (ry) \in I_1 + I_2

EXAMPLE:3+5=;4+6=23\mathbb{Z} + 5\mathbb{Z} = \mathbb{Z};\,4\mathbb{Z} + 6\mathbb{Z} = 2\mathbb{Z}

  • 3+53\mathbb{Z} + 5\mathbb{Z} \subseteq \mathbb{Z}: this is obvious
  • 3+5\mathbb{Z} \subseteq 3\mathbb{Z} + 5\mathbb{Z}:
    • For every n,n=3(2n)+5(n)3+5n \in \mathbb{Z},\,n = 3 \cdot (2n) + 5 \cdot (-n) \in 3\mathbb{Z} + 5\mathbb{Z}
a+b=gcd(a,b)a\mathbb{Z} + b\mathbb{Z} =\gcd(a,b)\cdot\mathbb{Z}

Greatest Common Divisor

DEFINITION: Let a,ba, b \in \mathbb{Z} and at least one of them is nonzero.

  • common divisor: an integer dd such that d|a,d|bd\mid a, d\mid b
  • greatest common divisorgcd(a,b)\gcd(a, b): the largest common divisor
    • relatively prime:gcd(a,b)=1\gcd(a, b) = 1

THEOREM: Let a,ba, b \in \mathbb{Z} and at least one of them is nonzero. Then a+b=gcd(a,b)a\mathbb{Z} + b\mathbb{Z} = \gcd(a, b)\mathbb{Z}.

  • a,b0a+b0{a, b} \neq {0} \implies a\mathbb{Z} + b\mathbb{Z} \neq {0}
  • There exists d0d \in \mathbb{Z} \setminus {0} such that a+b=da\mathbb{Z} + b\mathbb{Z} = d\mathbb{Z}. W.l.o.g., d>0d > 0.
    • dd is a common divisor of a,b:a1+b0da, b:\,a \cdot 1 + b \cdot 0 \in d\mathbb{Z}
    • dd is greatest: Suppose that dd’ is a common divisor of a,ba, b
      • d|a,d|bd’|a,\,d’|b
      • a+b=dd=as+bta\mathbb{Z} + b\mathbb{Z} = d\mathbb{Z} \implies d = as + bt for some integers s,ts, t
      • d|dd’\mid d and thus ddd’ \leq d

THEOREM (Bézout): There exist s,ts,t\in\mathbb{Z} such that gcd(a,b)=as+bt\gcd(a,b)=as+bt.

© 版权声明

相关文章

87 条评论

  • 烈焰剑士
    烈焰剑士 读者

    算s和t的时候最容易翻车

    中国河南
    回复
  • 篮球高手
    篮球高手 读者

    归纳法证存在性那步逻辑挺顺的

    中国辽宁
    回复
  • 菠萝咕咾肉
    菠萝咕咾肉 读者

    贝祖定理这名字听起来就很有故事

    中国广东
    回复
  • 好奇的求知者
    好奇的求知者 读者

    well-ordering这条性质看似基础,支撑了整个初等数论体系

    韩国
    回复
  • 乐观的旅行者
    乐观的旅行者 读者

    同余这一块感觉比理想那块好理解多了

    美国
    回复
  • HollowHowl
    HollowHowl 读者

    整除的定义从小学就在用,现在才懂为啥要排除0

    菲律宾
    回复
    • 滑雪狂人
      滑雪狂人 读者

      我也是最近才搞懂

      日本@ HollowHowl
      回复
  • 织女冯
    织女冯 读者

    3Z+5Z=Z这个例子蛮好懂的

    美国
    回复
  • 星夜Star
    星夜Star 读者

    原来RSA加密背后是这些数学原理

    美国
    回复
    • 夕阳斜照
      夕阳斜照 读者

      数论确实很神奇

      中国北京@ 星夜Star
      回复
  • 鬼手琴师
    鬼手琴师 游客

    除法算法唯一性证明挺巧妙的

    中国浙江
    回复
    • 奔跑的羚羊
      奔跑的羚羊 游客

      这证明绕来绕去的,但细看确实妙

      中国江西@ 鬼手琴师
      回复
  • EbonEnigma
    EbonEnigma 读者

    理想那块定义看着有点绕

    意大利
    回复
  • 狐狸小旋
    狐狸小旋 游客

    贝祖定理考试时我也卡住了,握手

    中国内蒙古
    回复
  • 银河系打酱油
    银河系打酱油 读者

    良序原理那段让我想起被数学分析支配的恐惧😭

    中国湖北
    回复
  • 落日小屋
    落日小屋 游客

    密码学原来靠这些数学基础撑着啊

    中国北京
    回复
  • 植物爱好者
    植物爱好者 游客

    RSA那块太简略了,能举个具体数字例子吗

    中国广东
    回复
  • 龙渊客
    龙渊客 读者

    求问扩展欧几里得具体咋求模逆?

    中国上海
    回复
    • 沧海一笑
      沧海一笑 游客

      模逆那步卡了好久,有人能手把手教下吗?

      中国浙江@ 龙渊客
      回复
  • 紫罗兰之吻
    紫罗兰之吻 游客

    这排版看得我眼睛疼

    中国山东
    回复
  • 藕榭仙子
    藕榭仙子 读者

    密码学底层原来全是这些玩意撑着,细思极恐又佩服

    中国辽宁
    回复
  • 甜蜜的蜂蜜
    甜蜜的蜂蜜 读者

    扩展欧几里得才是真香,求模逆全靠它,结果就一句话带过?

    中国重庆
    回复
  • 地狱火
    地狱火 游客

    除法算法里b要是负数还成立吗?感觉余数定义会乱

    中国浙江
    回复
  • 玄冥
    玄冥 游客

    看到质因数分解唯一性,想起我大二挂科的数论课😂

    韩国
    回复
    • 春野樱子
      春野樱子 游客

      大二那门数论课我也挂过,后来手写质因数分解时头都大了,真的记忆深刻 😂

      中国浙江@ 玄冥
      回复
  • 烬灭
    烬灭 游客

    欧拉定理在RSA里到底怎么套用的?光列名字没流程看不懂啊

    韩国
    回复
  • 迷雾信使
    迷雾信使 游客

    理想那段跳得太快,dℤ咋就等于gcd的倍数集了?卡住了

    韩国
    回复
  • 小熊白白
    小熊白白 游客

    贝祖定理那句as+bt= gcd(a,b) 看着简单,当年考试愣是没证出来😭

    中国贵州
    回复
  • 小猴猴猴
    小猴猴猴 游客

    整篇最实用的其实是扩展欧几里得,可惜一笔带过

    中国重庆
    回复
  • 苍梧怨
    苍梧怨 读者

    排版能不能别把公式挤成一行,读着好累

    中国福建
    回复
    • 梦境考古者
      梦境考古者 读者

      公式挤成一行真的劝退,能不能分行排版啊?

      韩国@ 苍梧怨
      回复
  • 人海捕手
    人海捕手 游客

    RSA那块例子太简略了,光说名字不给流程等于没说啊

    中国广西
    回复
  • 幻影琉璃
    幻影琉璃 读者

    看到除法算法证明里用良序原理,瞬间梦回大一数学分析课

    中国重庆
    回复
    • 青崖问天
      青崖问天 游客

      良序原理一出来我就知道要构造集合了,老套路了hhh

      中国辽宁@ 幻影琉璃
      回复
  • 小园漫步
    小园漫步 游客

    理想那部分讲得有点跳,dℤ怎么突然就等于gcd(a,b)ℤ了?

    中国浙江
    回复
    • 仓鼠米
      仓鼠米 游客

      其实是因为ℤ里所有理想都是主理想,d自然就是gcd的生成元。

      日本@ 小园漫步
      回复
  • 雪原独行
    雪原独行 游客

    贝祖定理居然能直接导出模逆,之前完全没意识到

    中国浙江
    回复
    • 犀牛侠
      犀牛侠 读者

      哇,这点我也刚发现,真是意外的便利。

      中国湖北@ 雪原独行
      回复
  • 梼杌破岳
    梼杌破岳 游客

    这符号密密麻麻的,看得我眼睛发花😂

    日本
    回复
  • 长夜未央歌
    长夜未央歌 读者

    这段关于最大公约数的解释,我超有感。

    中国江苏
    回复
    • 暴躁哥
      暴躁哥 读者

      说得对,我之前碰到gcd的坑,真是救了我。

      中国福建@ 长夜未央歌
      回复
    • 咕噜咕噜怪
      咕噜咕噜怪 读者

      最大公约数那块让我想起当年用欧几里得算法算到凌晨三点

      中国江苏@ 长夜未央歌
      回复
    • 社恐小蓝鲸
      社恐小蓝鲸 读者

      同感,最大公约数那块讲得确实明白

      中国广西@ 长夜未央歌
      回复
  • 星辰细语
    星辰细语 游客

    别说这套理论太抽象,我觉得它其实是密码学的基石,没有它RSA根本跑不起来。

    韩国
    回复
    • NocturneVeil
      NocturneVeil 游客

      没错,没这套数论,RSA根本不成立,感觉背后真的挺惊人的。

      中国湖北@ 星辰细语
      回复
    • PhantomWhisper
      PhantomWhisper 读者

      确实,没有它RSA根本不行。

      中国浙江@ 星辰细语
      回复
  • Rosie
    Rosie 游客

    如果把b设成负数,除法算法还能保证唯一性吗?我想知道细节。

    日本
    回复
    • SilentOracle
      SilentOracle 游客

      b要是负数的话,余数范围得重定义吧?感觉唯一性会出问题

      中国河北@ Rosie
      回复
  • 迷雾孤岛
    迷雾孤岛 游客

    我上大学时手写过质数分解,脑袋疼。

    中国北京
    回复
    • 光年余烬
      光年余烬 游客

      哈哈,我也试过,尤其是大数,真是脑细胞在燃烧。

      中国广东@ 迷雾孤岛
      回复
    • 小小小可爱
      小小小可爱 游客

      手写质数分解谁没崩溃过,草稿纸堆成山了都

      越南@ 迷雾孤岛
      回复
  • 星光迷途
    星光迷途 游客

    感觉还行👍

    中国广东
    回复
  • 星陨记事本
    星陨记事本 游客

    这排版真的把我绕晕了。

    中国北京
    回复
    • 风语幻影
      风语幻影 读者

      排版真的把我绕晕,公式跳来跳去看得眼花 😂

      中国浙江@ 星陨记事本
      回复
  • 咩咩小羊
    咩咩小羊 游客

    顺带一提,欧几里得算法还能直接求模逆,省时又省力。

    中国贵州
    回复
    • 独坐观心
      独坐观心 游客

      对啊,用扩展欧几里得直接算逆元,真的省了不少手动推倒的功夫。

      中国陕西@ 咩咩小羊
      回复
    • 染匠董
      染匠董 游客

      模逆原来用欧几里得就能求?学到了

      日本@ 咩咩小羊
      回复
  • Louie
    Louie 游客

    欧拉定理在实际加密里到底怎么用的?

    中国浙江
    回复
    • 暗焰巫师
      暗焰巫师 读者

      欧拉定理其实就是a^{φ(n)}≡1(mod n),算模逆时直接套进去就行。

      中国广东@ Louie
      回复
  • Vinnie
    Vinnie 游客

    看到RSA的例子,我直接笑出声。

    越南
    回复
    • 水晶蝶
      水晶蝶 读者

      哈哈,确实把抽象变得挺逗的 😂

      中国浙江@ Vinnie
      回复
  • 灵异观测站
    灵异观测站 游客

    我觉得这段唯一性证明写得挺顺畅。

    中国北京
    回复
    • 余音绕
      余音绕 游客

      确实,唯一性那步写得特别清晰,读起来顺手。

      中国湖北@ 灵异观测站
      回复
    • 云朵啾啾
      云朵啾啾 游客

      唯一性那段我也觉得顺手,感觉比别的证明省事儿。

      中国安徽@ 灵异观测站
      回复
    • 星辰手札
      星辰手札 读者

      确实写得清晰,唯一性那一步让我恍然大悟。

      中国湖北@ 灵异观测站
      回复
    • 刀客苏
      刀客苏 读者

      这证明读着顺,但手写一遍就头疼了。

      中国北京@ 灵异观测站
      回复
  • 踏歌者
    踏歌者 读者

    数论课笔记整理得挺详细

    美国
    回复
  • Noble Crane
    Noble Crane 读者

    贝祖定理证明蛮简洁的

    日本
    回复
  • 雾隐星瞳
    雾隐星瞳 读者

    理想的和最大公约数关系这块挺妙

    日本
    回复
    • 焰心之语
      焰心之语 读者

      这个联系确实很精妙

      中国湖南@ 雾隐星瞳
      回复
  • 沉默的星尘
    沉默的星尘 读者

    整除定义那块儿有点抽象啊

    法国
    回复
  • value20
    value20 读者

    欧几里得算法那部分有点没懂

    法国
    回复
  • RinBloom
    RinBloom 读者

    公钥加密应用这块挺酷的

    中国湖北
    回复
    • 梦回鲸歌
      梦回鲸歌 读者

      我也觉得挺有意思的

      中国陕西@ RinBloom
      回复
  • 山雾轻扬
    山雾轻扬 读者

    理想那部分有点绕,得再看几遍

    中国北京
    回复
  • 夏树
    夏树 读者

    讲算术基本定理的证明还挺清楚的

    罗马尼亚
    回复
  • 神经同步
    神经同步 读者

    贝祖定理这名字还挺有意思的

    英国
    回复
    • yue了
      yue了 读者

      名字确实有点意思

      中国河北@ 神经同步
      回复
    • 夜叉魂
      夜叉魂 游客

      贝祖定理名字听着像法国菜hhh

      中国河北@ 神经同步
      回复
  • 反骨精
    反骨精 读者

    这数学符号看着有点懵圈啊

    美国
    回复
    • NebulaShade
      NebulaShade 游客

      符号太密集,我也是先划重点才看得明白。

      韩国@ 反骨精
      回复
    • 月光轻纱
      月光轻纱 读者

      符号太多直接劝退

      印度尼西亚@ 反骨精
      回复