L02 – Equivalence, Congruence, and Residue Class

Discrete Mathematics2026年3月6日发布 芮和
3.9K 210
9,943字
42–63 分钟

Summary of Lecture 1

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

Divide, Divisor, Multiple, Prime, Composite

  • Fundamental Theorem of Arithmetic:n=p1e1prern=p_1^{e_1}\dots p_r^{e_r}
  • The Well-Ordering Property:SminSS\emptyset\neq S\subseteq\mathbb{N}\implies\min{S}\in S
  • Division Algorithm:a,b+,!p,q, s.t. a=bq+r,0r<ba\in\mathbb{Z},\,b\in\mathbb{Z}^+,\,\exist!p,q,\text{ s.t. }a=bq+r,\,0\leq r<b
  • Ideal of \mathbb{Z}: A nonempty set II\subseteq\mathbb{Z} such that a,bIa+bIa,b\in I\implies a+b\in I and aI,rraIa\in I,\,r\in\mathbb{Z}\implies ra\in I
    • THEOREM:II is an ideal of I=d\mathbb{Z}\iff I=d\mathbb{Z}
  • Sum of Ideals:I1+I2={x+y:xI1,yI2}I_1+I_2=\set{x+y:\,x\in I_1,\,y\in I_2}
    • THEOREM:I1,I2I_1,I_2 are ideals of I1+I2\mathbb{Z}\implies I_1+I_2 is an ideal of \mathbb{Z}
  • Sum of ideals:a+b=gcd(a,b).{a,b}0a\mathbb{Z}+b\mathbb{Z}=\gcd(a,b)\mathbb{Z}.\,\set{a,b}\neq 0
  • Greatest common divisor:gcd(a,b)=as+bt.\gcd(a,b)=as+bt.

FTA Proof

THEOREM: If a,b,c,c|aba,b,c\in\mathbb{Z},\,c\mid ab and gcd(c,a)=1\gcd(c,a)=1, then c|bc\mid b.

  • s,t\exists s,t\in\mathbb{Z} such that cs+at=1=gcd(c,a)b(cs+at)=b1c\cdot s+a\cdot t=1=\gcd(c,a)\implies b\cdot(c\cdot s+a\cdot t)=b\cdot 1
    • bcs+abt=bbcs+abt=b
    • c|(bcs),c|(abt)c|bc\mid(bcs),\,c\mid(abt)\implies c\mid b

THEOREM: If pp is a prime and p|abp\mid ab, then p|ap\mid a or p|bp\mid b.

  • p|ap\mid a: done
  • pagcd(p,a)=1p\nmid a\implies\gcd(p,a)=1
    • gcd(p,a)=1p|abp|b\gcd(p,a)=1\wedge p\mid ab\implies p\mid b
p|(a1a2an)p|a1,p|a2,,p|an 至少一个成立p\mid\left(a_1a_2\dots a_n\right)\implies p\mid a_1,\,p\mid a_2,\,\dots,\,p\mid a_n\text{ 至少一个成立}

FTA: proof of uniqueness

n=p1e1prern=p_1^{e_1}\dots p_r^{e_r}
  • Suppose that n=p1pr=q1qsn=p_1\dots p_r=q_1\dots q_s, where pi,qjp_i,q_j are all primes
    • p1|np1|q1qsp1|qjp_1\mid n\implies p_1\mid q_1\dots q_s\implies p_1\mid q_j for some jp1=qjj\implies p_1=q_j
    • W.l.o.g., we suppose that j=1j=1. Then p2pr=q2qsp_2\dots p_r=q_2\dots q_s
    • The theorem is true by induction.

FTA Applications

THEOREM: Suppose that a=p1α1prαr,b=p1βprβa=p_1^{\alpha_1}\dots p_r^{\alpha_r},\,b=p_1^{\beta}\dots p_r^{\beta}. Then gcd(a,b)=d\gcd(a,b)=d, where

d:=p1min({α1,β1})prmin({αr,βr}).d:=p_1^{\min\left(\set{\alpha_1,\beta_1}\right)}\dots p_r^{\min\left(\set{\alpha_r,\beta_r}\right)}.
  • dd is a common divisor of a,ba,b
  • dd is largest among the common divisors
    • Suppose that dd’ is a common divisor of a,ba,b
    • d=p1e1prerd’=p_1^{e_1}\dots p_r^{e_r}
      • d|aeiαid’\mid a\implies e_i\leq \alpha_i for all i[r]i\in[r];
        d|beiβid’\mid b\implies e_i\leq \beta_i for all i[r]i\in[r];
        • eimin{αi,βi}e_i\leq\min\set{\alpha_i,\beta_i} for all i[r]i\in[r]

THEOREM (Euclid) There are infinitely many primes.

  • Supposethereare only nn primes: p1,,pnp_1,\dots,p_n
  • By FTA, N=p1pn+1N=p_1\dots p_n+1 must be a product of primes
  • i[n]\exists i\in[n] such that pi|Np_i\mid N
  • But piNp_i\nmid N

Equivalence Relation

DEFINITION: Let A,BA,B be two sets. A binary relation from AA to BB is a subset RA×BR\subseteq A\times B. aA,bB,aRb(a,b)R\forall a\in A,\,b\in B,\,aRb\iff(a,b)\in R

EXAMPLE:R={(a,a):a}R=\set{(a,a):\,a\in\mathbb{Z}} is a binary relation from \mathbb{Z} to \mathbb{Z}

  • A=,B=,R={(a,a):a}A×B,a,b,aRb(a,b)Ra=bA=\mathbb{Z},\,B=\mathbb{Z},\,R=\set{(a,a):\,a\in\mathbb{Z}}\subseteq A\times B,\,\forall a,b\in\mathbb{Z},\,aRb\iff(a,b)\in R\iff a=b

DEFINITION: Let AA be a set. An equivalence relationRA×AR\subseteq A\times A on AA is a binary relation RR from AA to AA such that

  • Reflective:aA,aRa\forall a\in A,\,aRa
  • Symmetric:a,bA,aRbbRa\forall a,b\in A,\,aRb\implies bRa
  • Transitive:a,b,cA,aRb,bRcaRc\forall a,b,c\in A,\,aRb,\,bRc\iff aRc

DEFINITION: The equivalence class of aAa\in A is the set

[a]R={bA:aRb}[a]_R=\set{b\in A:\,aRb}

Equivalence Class

THEOREM: Let RR be an equivalence relation on AA. For any a,bA,[a]R=[b]Ra,b\in A,\,[a]_R=[b]_R if and only if aRbaRb.

  • :[a]R=[b]R{a[b]Rb[a]RaRb\implies:\,[a]_R=[b]_R\implies\begin{cases}a\in[b]_R\\b\in[a]_R\end{cases}\implies aRb
  • :aRb\impliedby:\,aRb
    • x[b]R,bRx\forall x\in[b]_R,\,bRx;
      x[a]R,aRxxRbx[b]R\forall x\in[a]_R,\,aRx\implies xRb\implies x\in[b]_R
    • [b]R[a]R[b]_R\subseteq[a]_R
    • Similarly, [a]R[b]R[a]_R\subseteq[b]_R

THEOREM: Let RR be an equivalence relation on AA. For any a,bAa,b\in A, either [a]R[b]R=[a]_R\cap[b]_R=\emptyset or [a]R=[b]R[a]_R=[b]_R.

  • [a]R[b]R=:x[a]R[b]R[a]_R\cap[b]_R=\emptyset:\,x\in[a]_R\cap[b]_R, done
  • [a]R[b]R[a]_R\cap[b]_R\neq\emptyset
    • x[a]R[b]R,{aRxbRxaRb\exists x\in[a]_R\cap[b]_R,\,\begin{cases}aRx\\bRx\end{cases}\implies aRb, i.e., [a]R=[b]R[a]_R=[b]_R

The equivalence classes under RR form a partition of AA: a set {A1,A2,,An}\set{A_1,A_2,\dots,A_n} of nonempty subsets of AA such that

  • AiAj=,ijA_i\cap A_j=\emptyset,\,\forall i\neq j
  • i=1nAi=A\bigcup_{i=1}^n A_i=A

Congruence

THEOREM: Let n+n\in\mathbb{Z}^+. Then R={(a,b)2:n|(ab)}×R=\set{(a,b)\in\mathbb{Z}^2:\,n\mid(a-b)}\subseteq\mathbb{Z}\times\mathbb{Z} is an equivalence relation on \mathbb{Z} (from \mathbb{Z} to \mathbb{Z}).

  • RR is a binary relation from \mathbb{Z} to \mathbb{Z}
    • Reflective: a,n|(aa)aRa\forall a\in\mathbb{Z},\,n\mid(a-a)\implies aRa
    • Symmetric: a,b,aRbn|(ab)b|(ba)bRa\forall a,b\in\mathbb{Z},\,aRb\implies n\mid(a-b)\implies b\mid(b-a)\implies bRa
    • Transitive: a,b,c,{aRbbRc{n|(ab)n|(bc)n|(ac)aRc\forall a,b,c\in\mathbb{Z},\,\begin{cases}aRb\\bRc\end{cases}\implies\begin{cases}n\mid(a-b)\\n\mid(b-c)\end{cases}\implies n\mid(a-c)\implies aRc

DEFINITION: Let n+n\in\mathbb{Z}^+ and R={(a,b)2:n|(ab)}R=\set{(a,b)\in\mathbb{Z}^2:\,n\mid(a-b)}.

  • The notation ab(modn)a\equiv b\pmod{n} means that aRbaRb.
    • abmodna\equiv b\mod n is called a congruence
      • Read as: aa is congruent to bb modulo nn
      • nn is called the modulus of the congruence
    • a≢b(modn):(a,b)Ra\not\equiv b\pmod{n}:\,(a,b)\notin R, or equivalently n(ab)n\nmid(a-b)
      • Read as: aa is not congruent to bb modulo nn

Residue Class

DEFINITION: Let a,n+a\in\mathbb{Z},\,n\in\mathbb{Z}^+. We denote the equivalence class of aa under the equivalence relation modn\mod n with [a]n[a]_n and call it the residue class of amodna\bmod n.

  • [a]n={b:abmodn}={a+nx:x}=a+n[a]_n=\set{b\in\mathbb{Z}:\,a\equiv b\mod n}=\set{a+nx:\,x\in\mathbb{Z}}=a+n\mathbb{Z}
    • any element of [a]n[a]_n is a representative 代表元 of [a]n[a]_n

EXAMPLE:[0]6={0,±6,±12,}={0+6x:x}=6;[1]6={,11,5,1,7,13,};[0]_6=\set{0,\pm 6,\pm 12,\dots}=\set{0+6x:\,x\in\mathbb{Z}}=6\mathbb{Z};\,[1]_6=\set{\dots,-11,-5,1,7,13,\dots};\,\dots

THEOREM: Let n+n \in \mathbb{Z}^+. For any aa \in \mathbb{Z}, there is a unique integer rr such that 0r<n0 \leq r < n and ar(modn)a \equiv r \pmod{n}. [a]n=[r]n[a]_n=[r]_n

  • Existence: by division algorithm, q,r\exists q, r \in \mathbb{Z} such that 0r<n,a=qn+r0 \leq r < n,\,a = qn + r
    • ar(modn)a \equiv r \pmod{n}
  • Uniqueness: suppose that 0r<n0 \leq r’ < n and ar(modn)a \equiv r’ \pmod{n}
  • |rr|<n\left|r – r’\right| < n and rr(modn)r \equiv r’ \pmod{n}
    • |rr|<n\left|r – r’\right| < n and n|(rr)n \mid\left(r – r’\right)
      • r=rr = r’

COROLLARY: For n+n \in \mathbb{Z}^+, there are nn residue classes, i.e., {[0]n,[1]n,,[n1]n}\set{[0]_n, [1]_n, \dots, [n-1]_n}.


mod\bmod

DEFINITION: Let a,na, n \in \mathbb{Z} and n>0n > 0. Then there are unique integers q,rq, r such that 0r<n0 \leq r < n and a=nq+ra = nq + r.

  • We define amodna \bmod n as rr.

DEFINITION: Let α\alpha \in \mathbb{R}.

  • α\lfloor \alpha \rfloor: floor of α\alpha, the largest integer α\leq\alpha
  • α\lceil \alpha \rceil: ceiling of α\alpha, the smallest integer α\geq \alpha
    • If a=nq+ra = nq + r, then q=anq = \left\lfloor \frac{a}{n} \right\rfloor and r=anqr = a – nq
α=1.2{α=2α=1\alpha=-1.2\implies\begin{cases}\lfloor \alpha \rfloor=-2\\\lceil \alpha \rceil=-1\end{cases}

n\mathbb{Z}_n

DEFINITION: Let nn be any positive integer. We define n\mathbb{Z}_n to be the set of all residue classes modulo nn.

  • n={[0]n,[1]n,,[n1]n}\mathbb{Z}_n = \set{[0]_n, [1]_n, \dots, [n-1]_n} 完全剩余系
    • n={0,1,,n1}\mathbb{Z}_n = \set{0, 1, \dots, n-1};
  • n={[1]n,[2]n,,[n]n}\mathbb{Z}_n = \set{[1]_n, [2]_n, \dots, [n]_n}
    • n={1,2,,n}\mathbb{Z}_n = \set{1, 2, \dots, n}

EXAMPLE: Two representations of the set 6\mathbb{Z}_6

  • 6={[0]6,[1]6,[2]6,[3]6,[4]6,[5]6}={0,1,2,3,4,5}\mathbb{Z}_6 = \set{[0]_6, [1]_6, [2]_6, [3]_6, [4]_6, [5]_6}=\set{0, 1, 2, 3, 4, 5}
  • 6={[3]6,[2]6,[1]6,[0]6,[1]6,[2]6}={3,2,1,0,1,2}\mathbb{Z}_6 = \set{[-3]_6, [-2]_6, [-1]_6, [0]_6, [1]_6, [2]_6}= \set{-3, -2, -1, 0, 1, 2}

DEFINITION: Let n+n \in \mathbb{Z}^+. For all [a]n,[b]nn[a]_n, [b]_n \in \mathbb{Z}_n, define

  • addition:[a]n+[b]n=[a+b]n[a]_n + [b]_n = [a + b]_n
  • subtraction:[a]n[b]n=[ab]n[a]_n – [b]_n = [a – b]_n
  • multiplication:[a]n[b]n=[ab]n[a]_n \cdot [b]_n = [a \cdot b]_n

Well-defined?[a]n=[a]n,[b]n=[b]n[a]n[b]n=[a]n[b]n,{+,,}[a]_n = \left[a’\right]_n,\,[b]_n = \left[b’\right]_n \implies [a]_n \star [b]_n = \left[a’\right]_n \star \left[b’\right]_n,\,\star \in \set{+, -, \cdot}?

  • Yes.
  • [a]n=[a]naa(modn)n|(aa)x[a]_n = \left[a’\right]_n \implies a \equiv a’ \pmod{n} \implies n \mid \left(a – a’\right) \implies \exists x such that aa=nxa – a’ = nx
  • [b]n=[b]nbb(modn)n|(bb)y[b]_n = \left[b’\right]_n \implies b \equiv b’ \pmod{n} \implies n \mid \left(b – b’\right) \implies \exists y such that bb=nyb – b’ = ny
    • (a+b)(a+b)=nx+ny(a + b) – \left(a’ + b’\right) = nx + ny
    • (ab)(ab)=nxny(a – b) – \left(a’ – b’\right) = nx – ny
    • abab=a(bb)+b(aa)=any+bnxab – a’b’ = a\left(b – b’\right) + b’\left(a – a’\right) = any + b’nx
  • [a]n[b]n=[a]n[b]n[a]_n \star [b]_n = \left[a’\right]_n \star \left[b’\right]_n

n\mathbb{Z}_n^*

{[bs]n=[b]n[s]n=[1]n[bt]n=[b]n[t]n=[1]n[bs]n=[bt]n,bsbt(modn)\begin{cases}[bs]_n=[b]_n\cdot[s]_n=[1]_n\\[bt]_n=[b]_n\cdot[t]_n=[1]_n\end{cases}\implies[bs]_n=[bt]_n,\,bs\equiv bt\pmod{n}

DEFINITION: Let n+n \in \mathbb{Z}^+ and [b]nn[b]_n \in \mathbb{Z}_n. The residue class [s]nn[s]_n \in \mathbb{Z}_n is called an inverse of [b]n[b]_n if [b]n[s]n=[1]n[b]_n [s]_n = [1]_n.

  • The inverse of a residue class is unique (if exist). We denote ([b]n)1=[s]n\left([b]_n\right)^{-1} = [s]_n.
  • division: If [b]n[s]n=[1]n[b]_n [s]_n = [1]_n, define [a]n[b]n=[a]n([b]n)1=[a]n[s]n\frac{[a]_n}{[b]_n} = [a]_n \cdot \left([b]_n\right)^{-1} = [a]_n \cdot [s]_n

THEOREM: Let n+n \in \mathbb{Z}^+. [b]nn[b]_n \in \mathbb{Z}_n has an inverse if and only if gcd(b,n)=1\gcd(b, n) = 1.

  • Only if: s\exists s such that [b]n[s]n[1]n;t,bs1=nt;gcd(b,n)=1[b]_n [s]_n \equiv [1]_n;\,\exists t, bs – 1 = nt;\,\gcd(b, n) = 1
  • If: s,t\exists s, t such that bs+nt=1;bs1(modn)bs + nt = 1;\,bs \equiv 1 \pmod{n}

DEFINITION: Let n+n \in \mathbb{Z}^+. Define n={[b]nn:gcd(b,n)=1}\mathbb{Z}_n^* = \set{[b]_n \in \mathbb{Z}_n :\,\gcd(b, n) = 1}.

  • If nn is prime, then n={1,2,,n1}\mathbb{Z}_n^* = \set{1, 2, \dots, n-1}
  • If nn is composite, then nn\mathbb{Z}_n^* \subset \mathbb{Z}_n

EXAMPLE:5={1,2,3,4};6={1,5};8={1,3,5,7}\mathbb{Z}_5^* = \set{1, 2, 3, 4};\,\mathbb{Z}_6^* = \set{1, 5};\,\mathbb{Z}_8^* = \set{1, 3, 5, 7}

© 版权声明

相关文章

21 条评论

  • 谦和
    谦和 读者

    这讲义写得也太干了吧,看得我头大 😵

    中国山东
    回复
  • Silent Thunder
    Silent Thunder 读者

    模运算这块儿有点绕啊

    美国
    回复
  • value29
    value29 读者

    同余关系这块得画个图才清楚

    墨西哥
    回复
    • PinkyPinky
      PinkyPinky 读者

      我也画了图才明白

      中国湖南@ value29
      回复
  • 米粒粒
    米粒粒 读者

    等价类的划分原来这么来的

    巴西
    回复
    • 铁背苍龙
      铁背苍龙 读者

      同感,一下就明白了

      印度@ 米粒粒
      回复
  • Classy Clyde
    Classy Clyde 读者

    数学系的吧,看着就眼熟

    阿根廷
    回复
  • 糖豆妹妹
    糖豆妹妹 读者

    同余那块儿老记混,得再瞅瞅

    爱尔兰
    回复
  • 夜色如墨
    夜色如墨 读者

    等价关系的定义还是得背熟

    德国
    回复
  • 宇宙第一帅的猪
    宇宙第一帅的猪 读者

    模运算这块儿挺绕的

    中国浙江
    回复
  • 社交催化剂
    社交催化剂 读者

    同余类乘法那块儿有点懵

    中国山东
    回复
  • 乐呵呵
    乐呵呵 读者

    这些定理证明写得好详细啊

    日本
    回复
    • 暗夜独航
      暗夜独航 读者

      证明过程确实清晰

      印度@ 乐呵呵
      回复
  • 韵凝霜雪
    韵凝霜雪 读者

    模运算的应用场景多吗?

    奥地利
    回复
    • 糖豆子
      糖豆子 读者

      很多,密码学里常用

      中国北京@ 韵凝霜雪
      回复
  • 小绒绒糖糖
    小绒绒糖糖 读者

    mod n 的逆元那块卡了好久,有人能说说为啥 gcd(b,n)=1 就一定有逆吗?

    中国北京
    回复
  • 郑十二
    郑十二 游客

    之前搞密码学作业就栽在 residue class 上,现在看还是有点懵

    中国湖北
    回复
  • 社恐但话多
    社恐但话多 游客

    这数学符号看得我眼花缭乱 🤯

    日本
    回复