数论「同余」(未完待续)

  • 提示:本文主要为干货,公式较多,请耐心等待

一、同余定理

对于整数除以正整数的问题,如果我们只关心余数,便有了同余的概念

定义

用一个正整数\(m\)除整数 \(a, b\) ,若其余数相等,即 \(a \bmod m = b \bmod m\) ,则称 \(a, b\) 对模 \(m\) 同余,记作 \(a \equiv b \pmod{m}\)

定理1

  • \(\forall a, b, m \in \mathbb{Z}\), 整数 \(a \equiv b \pmod{m}\) 的充要条件是 \(a-b\) 能被 \(m\) 整除,即 \(m | (a - b)\)

证明:
设:$$a = m * q_1 + r_1, b = m * q_2 + r_2 (0 \le r_1, r_2 < m)$$

充分性证明:
将 $$a = m * q_1 + r_1, b = m * q_2 + r_2 (0 \le r_1, r_2 < m)$$
代入 $$m | (a - b)$$
则有:

\[\begin{aligned} & m | (a - b)\\ & \Rightarrow m | ((m * q_1 + r_1) - (m * q_2 + r_2))\\ & \Rightarrow m | (m * (q_1 - q_2) + (r_1 - r_2)\\ & \because 0 \le r_1, r_2 < m\\ & \therefore |r_1 - r_2| < m\\ & \therefore r_1 - r_2 = 0, r_1 = r_2\\ & \therefore a \equiv b \pmod{m} \end{aligned} \]

证毕

必要性证明:
将 $$a = m * q_1 + r_1, b = m * q_2 + r_2 (0 \le r_1, r_2 < m)$$
代入 $$(a - b)$$
则有:

\[\begin{aligned} & a - b = (m * q_1 + r_1) - (m * q_2 + r_2)\\ & \qquad = m * (q_1 - q_2) + (r_1 - r_2)\\ & \because a \equiv b \pmod{m}\\ & \therefore r_1 = r_2\\ & \therefore a - b = m * (q_1 - q_2)\\ & \therefore m | (a - b)\\ & \end{aligned} \]

证毕

推论:\(\forall a, b, m \in \mathbb{Z}, a \equiv b \pmod{m}\) 的充要条件为 \(a = m * t + b\)

证明:

\[\because a - b = m * (q_1 - q_2) \]

\[\therefore a = m * t + b, t = q_1 - q_2 \]

定理2

  • 同余关系具有自反性,对称性,与传递性
    \(\forall a, b, c, m \in \mathbb{Z}\),
    自反性:\(a \equiv a \pmod{m}\)
    对称性:若 \(a \equiv b \pmod{m}\),则 \(b \equiv a \pmod{m}\)
    传递性:若 \(a \equiv b \pmod{m}, b \equiv c \pmod{m}\),则\(a \equiv c \pmod{m}\)

此定理比较直观,故不予以证明

定理3

条件: \(\forall a, b, c, d, m \in \mathbb{Z}, a \equiv b \pmod{m}, c \equiv d \pmod{m}\)

  • 同余式加减:
    \(a \pm c \equiv b \pm d \pmod{m}\)

证明:
设:

\[a = m * q_1 + r_1, b = m * q_2 + r_1 \]

\[c = m * q_3 + r_2, d = m * q_4 + r_2 \]

\[(0 \le r_1, r_2 < m) \]

则有:

\[a \pm c = m * (q_1 \pm q_3) + (r_1 \pm r_2) \]

\[b \pm d = m * (q_2 \pm q_4) + (r_1 \pm r_2) \]

\[a \pm c \equiv b \pm d \pmod{m} \]

证毕

  • 同余式相乘:
    \(\forall a, b, c, d, m \in \mathbb{Z}, a * c \equiv b * d \pmod{m}\)

证明:
设:

\[a = m * q_1 + r_1, b = m * q_2 + r_1 \]

\[c = m * q_3 + r_2, d = m * q_4 + r_2 \]

\[(0 \le r_1, r_2 < m) \]

则有:

\[a * c = m^2 * q_1 * q_3 + m * r_1 + m * r_2 + r_1 * r_2 \]

\[b * d = m^2 * q_2 * q_4 + m * r_1 + m * r_2 + r_1 * r_2 \]

\[a * c \equiv b * d \pmod{m} \]

证毕

  • 据此推论:
    \(\forall a, b, m, n \in \mathbb{Z}\),
    \(a * n \equiv b * n \pmod{m}\)
    \(a ^ n \equiv b ^ n \pmod{m}\)

定理4

  • \(\forall a, b, c, m \in \mathbb{Z},\)\(a*c \equiv b*c \pmod{m}\)\(\gcd(c, m) = d\),则 \(a \equiv b \pmod{\frac md}\)

证明

\[\begin{aligned} & \because m | (a * c - b * c)\\ & \therefore m | (c * (a - b))\\ & \therefore \frac md | (\frac cd * (a - b))\\ & \because \gcd(c, m) = 1\\ & \therefore \gcd(\frac cd, \frac md) = 1\\ & \therefore \frac md | (a - b)\\ & \therefore a \equiv b \pmod{\frac md}\\ \end{aligned} \]

证毕

  • 据此推论:
    \(c * a \equiv c * b \pmod{m}\), 则 \(a \equiv b \pmod{m}\)
    \(a \equiv b \pmod{m}, \exists d | m\), 则 \(a \equiv b \pmod{d}\)

定理5

  • \(\forall a, b, m, n, \in \mathbb{Z}\),若\(a \equiv b \pmod{m}, a \equiv b \pmod{n}\),则\(a \equiv b \pmod{\operatorname{lcm}(m, n)}\)

证明:
设:

\[d = \gcd(m, n), m = x * d, n = y * d(x, y \in \mathbb{Z^{+}}, \gcd(x, y) = 1) \]

\[\begin{aligned} & \because a \equiv b \pmod{m}, a \equiv b \pmod{n}\\ & \therefore x * d | (a - b), y * d | (a - b)\\ & 即x, y, d都是(a - b)的因子\\ & \therefore x * y * d | (a - b)\\ & \because \operatorname{lcm}(m, n) = \frac{m * n}{\gcd(m, n)} = \frac{x * d * y * d}{d} = x * y * d\\ & \therefore \operatorname{lcm}(m, n) | (a - b)\\ & \therefore a \equiv b \pmod{\operatorname{lcm}(m, n)}\\ \end{aligned} \]

证毕

二、剩余系

概念

  • 同余类: \(\forall a \in [0, m - 1]\),集合 \(a + km (k \in \mathbb{Z})\) 的所有数字对于模 \(m\) 同余,余数均为 \(a\) ,这个集合被成为一个模 \(m\) 的同余类,简记为 \(\bar{a}\)
    • \(m\) 的同余类一共有 \(m\) 个,即\(\bar{0}, \bar{1}, \bar{2}, \cdots, \bar{m - 1}\),它们构成了 \(m\)完全剩余系
    • 同余类又名剩余类
  • 剩余系:
    • 完全剩余系:对于正整数
posted @ 2021-03-17 15:53  陈智障  阅读(114)  评论(0编辑  收藏  举报