# 乘法逆元

元素 \( a \) 的**乘法逆元**是元素 \( b \)，满足 \( a \cdot b = b \cdot a = 1 \)，其中 1 是所讨论系统的乘法单位元。它通常写作 \( a^{-1} \)；对普通数而言，它就是倒数 \( 1/a \)。逆元只在特定条件下存在：在域中，除零以外的每个元素都有逆元；在整数中，只有 1 和 −1 有逆元；在模算术中，\( \mathbb{Z}_n \) 的元素有逆元，当且仅当它与 \( n \) 互素。<sup>[1](https://abel.math.harvard.edu/~elkies/M55a.10/field.html)</sup><sup> • </sup><sup>[2](https://www.math.ucla.edu/~sharifi/notes/algebra-ch02.html)</sup><sup> • </sup><sup>[3](https://www.math.ksu.edu/~bennett/gc/828.html)</sup>

| 关键事实 | 细节 |
|---|---|
| 定义 | \( a^{-1} \) 满足 \( a \cdot a^{-1} = a^{-1} \cdot a = 1 \)；对于数而言，这就是倒数 \( 1/a \)<sup>[2](https://www.math.ucla.edu/~sharifi/notes/algebra-ch02.html)</sup> |
| 域 | 域是一个满足 \( 0 \neq 1 \) 的交换环，其中除 0 以外的每个元素都有乘法逆元；求逆是 \( F - \{0\} \) 到 \( F - \{0\} \) 的函数<sup>[4](https://mathwiki.cs.ut.ee/doku.php?id=finite_fields%3A01_definitions_and_motivation)</sup><sup> • </sup><sup>[1](https://abel.math.harvard.edu/~elkies/M55a.10/field.html)</sup> |
| 整数 | 在 \( \mathbb{Z} \) 中，唯一具有乘法逆元的元素是 \( \pm 1 \)<sup>[2](https://www.math.ucla.edu/~sharifi/notes/algebra-ch02.html)</sup> |
| 模算术 | 在 \( \mathbb{Z}_n \) 中，\( a \) 有逆元当且仅当 \( \gcd(a, n) = 1 \)；若 \( p \) 为素数，则 \( \mathbb{Z}_p \) 的每个非零元素都有逆元<sup>[3](https://www.math.ksu.edu/~bennett/gc/828.html)</sup> |
| 计算 | 扩展欧几里得算法可在 \( \Theta(\log a) \) 步内求出一个模逆元<sup>[5](https://www.usna.edu/Users/cs/wcbrown/courses/S17SI335/notes/03/notes.html)</sup> |
| 历史 | 古巴比伦书吏使用 2 到 81 之间的正则六十进制数的倒数表，把除法化为乘法<sup>[6](https://myslu.stlawu.edu/~dmel/mesomath/reciprocal.html)</sup> |
| 硬件 | x86 的 `rcpps` 指令返回的倒数精确到尾数最高 12 位，延迟为 3 个周期，而除法为 26 个周期<sup>[7](https://download.intel.com/design/PentiumII/manuals/24512701.pdf)</sup> |

## 定义与唯一性

逆元是相对于单位元定义的。在一个带有二元运算和单位元 \( e \) 的集合中，\( x \) 的左逆元是满足 \( y \star x = e \) 的元素 \( y \)，右逆元满足 \( x \star y = e \)，而逆元则两者兼具。若该运算满足结合律，那么当 \( x \) 同时有左逆元和右逆元时，二者相等：若 \( y \) 是 \( x \) 的左逆元，\( z \) 是 \( x \) 的右逆元，则 \( y = y \star e = y \star (x \star z) = (y \star x) \star z = e \star z = z \)。这就是为什么人们可以说*那个*逆元 \( a^{-1} \)，而不是*一个*逆元。<sup>[2](https://www.math.ucla.edu/~sharifi/notes/algebra-ch02.html)</sup><sup> • </sup><sup>[18](https://math.ucla.edu/~sharifi/algebra.pdf)</sup>

对于数而言，记号与普通算术一致：在乘法下，\( x^{-1} = 1/x \) 是 \( \mathbb{Q} \)、\( \mathbb{R} \) 和 \( \mathbb{C} \) 中任意 \( x \neq 0 \) 的逆元。<sup>[2](https://www.math.ucla.edu/~sharifi/notes/algebra-ch02.html)</sup> 初等教材常把非零数的逆元称为它的倒数；1797 年的《大英百科全书》（Encyclopaedia Britannica）用这个词指乘积为 1 的量，这是该词在英语中的一处记载。<sup>[8](https://mathshistory.st-andrews.ac.uk//Miller/mathword/r/)</sup>

## 逆元存在与不存在之处

逆元的存在与否，正是域区别于单纯环的地方。交换环有加法、减法和乘法，但一般没有除法；域的公理额外要求每个非零元素都有乘法逆元。<sup>[4](https://mathwiki.cs.ut.ee/doku.php?id=finite_fields%3A01_definitions_and_motivation)</sup> 用环论的语言说，带单位元的交换环中的元素 \( a \) 若存在 \( b \) 使 \( ab = 1 \)，就称为可逆的，或称**可逆元**；所有可逆元在乘法下构成一个阿贝尔群。<sup>[9](https://faculty.niu.edu/math_beachy/aaol/rings.shtml)</sup>

这些例子表明这一条件限制有多强。在 \( \mathbb{Z} \) 中，只有 \( \pm 1 \) 是可逆元，因为其他整数与任何整数相乘都不能得到 1。在矩阵环 \( M_n(\mathbb{R}) \) 中，可逆元素恰好是行列式非零的矩阵。在函数环 \( \mathbb{R} \to \mathbb{R} \) 中，可逆元素是无处为零的函数。<sup>[2](https://www.math.ucla.edu/~sharifi/notes/algebra-ch02.html)</sup>

**为什么排除零。** 在任何非平凡环中，零都没有乘法逆元。由分配律可证对每个 \( x \) 都有 \( x \cdot 0 = 0 \)：因为 \( 0 + 0 = 0 \)，两边乘以 \( x \) 得 \( x \cdot 0 + x \cdot 0 = x \cdot 0 \)，再在两边加上 \( x \cdot 0 \) 的加法逆元，便得 \( x \cdot 0 = 0 \)。因此，除非在 0 与 1 重合的平凡环中，任何元素与零相乘都不可能得到 1。<sup>[4](https://mathwiki.cs.ut.ee/doku.php?id=finite_fields%3A01_definitions_and_motivation)</sup>

## 模逆元

在模 \( n \) 的整数中，\( a \) 的逆元是满足 \( ax \equiv 1 \pmod n \) 的整数 \( x \)。这样的 \( x \) 存在，当且仅当 \( \gcd(a, n) = 1 \)。例如，12 在模 15 下不可逆，因为 \( \gcd(15, 12) = 3 \)；而 8 在模 15 下可逆，因为 \( \gcd(15, 8) = 1 \)。当模 \( p \) 为素数时，从 1 到 \( p-1 \) 的每个整数都与 \( p \) 互素，所以 \( \mathbb{Z}_p \) 的每个非零元素都有逆元，\( \mathbb{Z}_p \) 是一个域。<sup>[3](https://www.math.ksu.edu/~bennett/gc/828.html)</sup><sup> • </sup><sup>[5](https://www.usna.edu/Users/cs/wcbrown/courses/S17SI335/notes/03/notes.html)</sup>

计算逆元的标准方法是**扩展欧几里得算法**。除了最大公约数，它还返回系数 \( s \) 和 \( t \)，满足 \( as + bt = g \)。当 \( \gcd(m, a) = 1 \) 时，对 \( (m, a) \) 运行该算法会返回 \( (1, s, t) \)，满足 \( sm + ta = 1 \)，于是 \( ta \equiv 1 \pmod m \)，\( t \) 就是 \( a \) 模 \( m \) 的逆元。代价为 \( \Theta(\log a) \) 步，与普通欧几里得算法相同。<sup>[5](https://www.usna.edu/Users/cs/wcbrown/courses/S17SI335/notes/03/notes.html)</sup> 若结果为负数，则将其解释为模 \( n \) 的加法逆元，例如输出 −12 表示 \( n - 12 \)。<sup>[10](https://www.usna.edu/Users/cs/wcbrown/courses/S18SI335/lec/l33/lec.html)</sup>

模求逆是实际部署的密码学中的一个必需步骤。NIST 数字签名标准（FIPS 186-5，2023 年 2 月）规定，ECDSA 签名生成需要 \( k^{-1} \bmod n \)，即每条消息的秘密值 \( k \) 模 \( n \) 的乘法逆元，并在其附录 B.1 中给出了求取该值的例程；同一附录例程还生成验证期间使用的签名部分 \( s \) 的逆元。<sup>[11](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf)</sup>

## 计算中的倒数

浮点硬件把倒数当作一种独立的函数来处理。英特尔的 SIMD 倒数指令 `rcpps` 返回一个近似值，精确到尾数最高 12 位，延迟为 3 个周期，而除法指令为 26 个周期；再做一次牛顿-拉夫森精化迭代，便得到精确到 23 或 24 位的结果，足以满足单精度。<sup>[7](https://download.intel.com/design/PentiumII/manuals/24512701.pdf)</sup> 英特尔的 DPC++ 编译器将其作为 `rcp` 和 `rcp_nr`（牛顿-拉夫森）运算符与标准除法运算符一并提供。<sup>[12](https://www.intel.com/content/www/us/en/docs/dpcpp-cpp-compiler/developer-guide-reference/2025-1/arithmetic-operators.html)</sup> 将倒数按 IEEE-754 精度正确舍入仍是一个活跃的设计问题：2024 年，卢卡斯·M·达顿（Lucas M. Dutton）、麦克马斯特大学的克里斯托弗·库马尔·阿南德（Christopher Kumar Anand）、IBM 的罗伯特·埃嫩克尔（Robert Enenkel）和西尔维娅·梅利塔·米勒（Silvia Melitta Müller）发表论文，提出了校正倒数、除法和平方根近似值，并在所有二进制 IEEE-754 舍入模式下正确舍入的算法。<sup>[13](https://arxiv.org/abs/2404.00387)</sup>

## 历史

乘法逆元是有记录的最古老的计算工具之一。约公元前 1800—前 1600 年的古巴比伦书吏没有长除法算法；他们改用恒等式 \( a/b = a \times (1/b) \)，并在倒数表中查 \( 1/b \)，于是除法变成了乘法。<sup>[14](https://mathshistory.st-andrews.ac.uk/HistTopics/Babylonian_mathematics/)</sup> 标准的古巴比伦倒数表列出 2 到 81 之间的正则六十进制数的倒数，所谓正则六十进制数，即倒数为有限六十进制小数的数；表中把 2 与 30、3 与 20、4 与 15 等配对，因为在 1 可以表示 60 的任意幂的位值制中，\( 2 \times 30 = 60 \) 表示 1。<sup>[6](https://myslu.stlawu.edu/~dmel/mesomath/reciprocal.html)</sup><sup> • </sup><sup>[15](https://www.math.mcgill.ca/darmon/courses/history/katz.pdf)</sup> 7、11、13 这类数不在表中，因为它们的倒数不是有限的六十进制小数，不过书吏仍可将 \( 1/13 \) 近似到若干六十进制位。<sup>[14](https://mathshistory.st-andrews.ac.uk/HistTopics/Babylonian_mathematics/)</sup><sup> • </sup><sup>[16](https://www.open.edu/openlearn/mod/oucontent/view.php?id=1976&printable=1)</sup> 现存倒数表收录了大至数十亿的数的倒数。<sup>[14](https://mathshistory.st-andrews.ac.uk/HistTopics/Babylonian_mathematics/)</sup>

## 推广

同一定义可迁移到任何具有乘法和单位元的结构。对方阵 \( A \)，逆元 \( A^{-1} \) 满足 \( A A^{-1} = A^{-1} A = I \)；它只对方阵存在，而且在方阵中只对可逆方阵存在，可逆方阵恰好是行列式非零的方阵。当 \( A \) 可逆时，方程组 \( A\mathbf{x} = \mathbf{b} \) 有唯一解 \( \mathbf{x} = A^{-1}\mathbf{b} \)。<sup>[17](https://www.cs.bu.edu/fac/snyder/cs132-book/L10MatrixInverse.html)</sup><sup> • </sup><sup>[2](https://www.math.ucla.edu/~sharifi/notes/algebra-ch02.html)</sup> 在函数复合下，函数 \( f: \mathbb{R} \to \mathbb{R} \) 有逆函数，当且仅当它是双射。<sup>[2](https://www.math.ucla.edu/~sharifi/notes/algebra-ch02.html)</sup>

## References

1. [Field axioms, Math 55, Harvard University (Noam D. Elkies)](https://abel.math.harvard.edu/~elkies/M55a.10/field.html)
2. [Romyar Sharifi, Abstract Algebra, Chapter 2: Group theory, UCLA](https://www.math.ucla.edu/~sharifi/notes/algebra-ch02.html)
3. [Math 511, Modular Inverses, Kansas State University](https://www.math.ksu.edu/~bennett/gc/828.html)
4. [What are rings and fields? MathWiki, University of Tartu](https://mathwiki.cs.ut.ee/doku.php?id=finite_fields%3A01_definitions_and_motivation)
5. [SI335 Unit 3: Number-Theoretic Computations, United States Naval Academy](https://www.usna.edu/Users/cs/wcbrown/courses/S17SI335/notes/03/notes.html)
6. [Reciprocal Table, Mesopotamian Mathematics, St. Lawrence University (Duncan J. Melville)](https://myslu.stlawu.edu/~dmel/mesomath/reciprocal.html)
7. [Intel Architecture Optimization Reference Manual, order number 24512701](https://download.intel.com/design/PentiumII/manuals/24512701.pdf)
8. [Earliest Known Uses of Some of the Words of Mathematics (R), MacTutor History of Mathematics](https://mathshistory.st-andrews.ac.uk//Miller/mathword/r/)
9. [Rings, Abstract Algebra Online (Beachy/Blair), Northern Illinois University](https://faculty.niu.edu/math_beachy/aaol/rings.shtml)
10. [SI335 Lecture: The Euclidean Algorithm, United States Naval Academy](https://www.usna.edu/Users/cs/wcbrown/courses/S18SI335/lec/l33/lec.html)
11. [FIPS 186-5, Digital Signature Standard, NIST (February 2023)](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf)
12. [Arithmetic Operators, Intel oneAPI DPC++/C++ Compiler Developer Guide](https://www.intel.com/content/www/us/en/docs/dpcpp-cpp-compiler/developer-guide-reference/2025-1/arithmetic-operators.html)
13. [Dutton, Anand, Enenkel, Müller (2024). Inexactness and Correction of Floating-Point Reciprocal, Division and Square Root. arXiv:2404.00387](https://arxiv.org/abs/2404.00387)
14. [Babylonian mathematics, MacTutor History of Mathematics, University of St Andrews](https://mathshistory.st-andrews.ac.uk/HistTopics/Babylonian_mathematics/)
15. [Victor J. Katz, A History of Mathematics (course text), McGill University](https://www.math.mcgill.ca/darmon/courses/history/katz.pdf)
16. [Babylonian mathematics, OpenLearn, The Open University](https://www.open.edu/openlearn/mod/oucontent/view.php?id=1976&printable=1)
17. [The Inverse of a Matrix, Linear Algebra, Geometry, and Computation, Boston University](https://www.cs.bu.edu/fac/snyder/cs132-book/L10MatrixInverse.html)
18. [math.ucla.edu](https://math.ucla.edu/~sharifi/algebra.pdf)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 30, 2026; Oct 15, 2026 · Edited: Sep 30, 2026; Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 数与代数 › Arithmetic and number systems › Elementary and formal arithmetic › Properties and laws of arithmetic

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/multiplicative-inverse

English original: https://www.edgepedia.org/multiplicative-inverse
