# 二次互反律

二次互反律是数论中的一条定理，它联系着两个同余式 \( x^{2} \equiv q \pmod p \) 与 \( x^{2} \equiv p \pmod q \) 的可解性，其中 \( p \) 和 \( q \) 为互不相同的奇素数：这两个同余式要么同时可解，要么同时不可解，除非两个素数除以 4 时都余 3，此时恰好有一个可解。<sup>[1](https://mathworld.wolfram.com/QuadraticReciprocityTheorem.html)</sup> 卡尔·弗里德里希·高斯（Carl Friedrich Gauss）给出了第一个完整证明，称之为“aureum theorema”（黄金定理），它后来成为构建现代代数数论的高次互反律的原型。<sup>[1](https://mathworld.wolfram.com/QuadraticReciprocityTheorem.html)</sup><sup> • </sup><sup>[2](https://www.sophiararebooks.com/pages/books/6460/carl-friedrich-gauss/disquisitiones-arithmeticae)</sup>

| 关键事实 | 详情 |
|---|---|
| 陈述 | 对互不相同的奇素数 \( p, q \)：\( \left(\frac{p}{q}\right)\left(\frac{q}{p}\right) = (-1)^{\frac{(p-1)(q-1)}{4}} \)<sup>[1](https://mathworld.wolfram.com/QuadraticReciprocityTheorem.html)</sup> |
| 补充公式 | \( \left(\frac{-1}{p}\right) = (-1)^{(p-1)/2} \) 与 \( \left(\frac{2}{p}\right) = (-1)^{(p^{2}-1)/8} \)<sup>[3](https://encyclopediaofmath.org/wiki/Quadratic_reciprocity_law)</sup> |
| 首个证明 | 高斯在《算术研究》（*Disquisitiones arithmeticae*，1801）中用归纳法给出；他已于 1795 年 3 月独立表述了该定律<sup>[4](https://www.sciencedirect.com/science/chapter/edited-volume/abs/pii/B9780444508713501030)</sup> |
| 更早的历史 | 欧拉（1783，未给证明）与勒让德曾表述该定理，勒让德 1785 年的证明有漏洞<sup>[1](https://mathworld.wolfram.com/QuadraticReciprocityTheorem.html)</sup><sup> • </sup><sup>[5](https://proofwiki.org/wiki/Law_of_Quadratic_Reciprocity/Historical_Note)</sup> |
| 高斯的证明数 | 各家说法不一：据狄利克雷–戴德金为六个，其未刊手稿中又发现第七个，部分作者称八个<sup>[6](https://www.cis.upenn.edu/~jean/RSA-primality-testing.pdf)</sup> |
| 推广 | 由艾森斯坦、库默尔、希尔伯特与阿廷推广；朗兰兹纲领是影响深远的推广<sup>[2](https://www.sophiararebooks.com/pages/books/6460/carl-friedrich-gauss/disquisitiones-arithmeticae)</sup> |

## 陈述与记号

该定理通常用勒让德符号书写，此符号由阿德里安-马里·勒让德（Adrien-Marie Legendre）在其《数论随笔》（*Essai sur la théorie des nombres*，1798）中引入，不过也有记载称该符号可追溯到 1785 年的一篇文章，勒让德在那篇文章中表述互反律时尚未使用此符号。<sup>[7](https://mathshistory.st-andrews.ac.uk/Miller/mathsym/nth/)</sup> 对奇素数 \( p \) 与不被 \( p \) 整除的整数 \( a \)，若 \( a \) 是模 \( p \) 的非零二次剩余（即 \( x^{2} \equiv a \pmod p \) 有解），则符号 \( \left(\frac{a}{p}\right) \) 等于 1，否则等于 −1；当 \( p \mid a \) 时它为 0。<sup>[8](https://math.mit.edu/classes/18.782/2013fa/LectureNotes3.pdf)</sup> 用此记号，该定律写作

\[ \left(\frac{p}{q}\right)\left(\frac{q}{p}\right) = (-1)^{\frac{p-1}{2}\cdot\frac{q-1}{2}}. \]

等价地，\( \left(\frac{p}{q}\right) = \left(\frac{q}{p}\right) \)，除非 \( p \equiv q \equiv 3 \pmod 4 \)，此时 \( \left(\frac{p}{q}\right) = -\left(\frac{q}{p}\right) \)。<sup>[6](https://www.cis.upenn.edu/~jean/RSA-primality-testing.pdf)</sup> 该定律由两个补充公式补全，分别针对 \( -1 \) 与 \( 2 \)，它们遵循同样的模式：把模 \( p \) 的问题归结为 \( p \) 模一个较小整数的剩余类。<sup>[3](https://encyclopediaofmath.org/wiki/Quadratic_reciprocity_law)</sup>

## 历史

**欧拉与勒让德。** 莱昂哈德·欧拉（Leonhard Euler）于 1783 年未加证明地表述了该定理，形式复杂，但等价于现代陈述。<sup>[1](https://mathworld.wolfram.com/QuadraticReciprocityTheorem.html)</sup><sup> • </sup><sup>[6](https://www.cis.upenn.edu/~jean/RSA-primality-testing.pdf)</sup> 勒让德正确地表述了它，并于 1785 年发表了一个尝试性证明，1798 年《随笔》中又以改进形式重述；高斯后来指出其论证有漏洞。<sup>[5](https://proofwiki.org/wiki/Law_of_Quadratic_Reciprocity/Historical_Note)</sup><sup> • </sup><sup>[9](https://www.originalsources.com/Document.aspx?DocID=57ZFF2F82XIMBSN)</sup> 勒让德在这一领域的主要贡献常被认为就是这条定律，他早在 1785 年就表述了它，并附有一个冗长而不完美的论证。<sup>[10](https://mathshistory.st-andrews.ac.uk/DSB/Legendre.pdf)</sup>

**高斯。** 高斯于 1795 年 3 月独立表述了该定律；1796 年 3 月 30 日，十九岁的他以正十七边形的作图开始撰写科学日记，一周之后，他得到了第一个证明。<sup>[4](https://www.sciencedirect.com/science/chapter/edited-volume/abs/pii/B9780444508713501030)</sup><sup> • </sup><sup>[11](https://mathshistory.st-andrews.ac.uk/Miscellaneous/messages/03-30/)</sup> 1801 年以拉丁文出版的《算术研究》给出了互反律的第一个证明，用的是归纳法，依赖于一个关于具有指定二次特征的素数存在性的非平凡引理。<sup>[4](https://www.sciencedirect.com/science/chapter/edited-volume/abs/pii/B9780444508713501030)</sup><sup> • </sup><sup>[2](https://www.sophiararebooks.com/pages/books/6460/carl-friedrich-gauss/disquisitiones-arithmeticae)</sup> 该书包含两个证明；高斯后来又提出四个，其未刊手稿中又发现第七个，因此包括阿波斯托尔在内的一些作者认为他有八个证明。<sup>[12](https://www.treccani.it/enciclopedia/l-ottocento-matematica-teoria-dei-numeri_%28Storia-della-Scienza%29/)</sup><sup> • </sup><sup>[6](https://www.cis.upenn.edu/~jean/RSA-primality-testing.pdf)</sup> MathWorld 干脆声称他一生中给出了不少于八个证明。<sup>[1](https://mathworld.wolfram.com/QuadraticReciprocityTheorem.html)</sup> 勒让德在 1808 年《数论》（*Théorie des nombres*）第二版中采用了高斯的证明，并恰当地致谢，但同时痛斥高斯把一切优先权都归于自己。<sup>[13](https://mathshistory.st-andrews.ac.uk/Biographies/Legendre/)</sup>

## 该定律在计算上的重要性

直接的替代方案是欧拉准则 \( \left(\frac{a}{p}\right) \equiv a^{(p-1)/2} \pmod p \)，当两个数都很大时代价高昂。勒让德本人的例子——证明素数 1013 不整除形如 \( t^{2} + 601 \) 的数——需要计算 \( 601^{506} \bmod 1013 \)，即 14 次乘法与 14 次除法，而互反律把工作量缩减为 3 次除法与 3 次非常简单的因式分解。<sup>[12](https://www.treccani.it/enciclopedia/l-ottocento-matematica-teoria-dei-numeri_%28Storia-della-Scienza%29/)</sup>

该定律从素数推广到雅可比符号：对任意正奇数分母 \( n \)，将 \( n \) 分解为素数并把相应的勒让德符号相乘即得。<sup>[6](https://www.cis.upenn.edu/~jean/RSA-primality-testing.pdf)</sup> 对满足 \( \gcd(m,n) = 1 \) 的奇整数 \( m, n \geq 3 \)，

\[ \left(\frac{m}{n}\right) = (-1)^{\frac{m-1}{2}\cdot\frac{n-1}{2}}\left(\frac{n}{m}\right). \]

这一推广消除了勒让德符号的一个计算缺陷：原则上，应用互反律之前必须先分解分子；而用雅可比符号则无需分解分子，这是一大优势，因为分解通常被认为是困难的。<sup>[14](https://math.mit.edu/~hrm/papers/18.781/hw3.pdf)</sup><sup> • </sup><sup>[6](https://www.cis.upenn.edu/~jean/RSA-primality-testing.pdf)</sup> 雅可比符号的互反律用于索洛韦–施特拉森素性检验，而建立在这些符号上的二次剩余计算遍及素性检验与密码学。<sup>[6](https://www.cis.upenn.edu/~jean/RSA-primality-testing.pdf)</sup><sup> • </sup><sup>[15](https://www1.spms.ntu.edu.sg/~guojian/backup/phd/Books/Applied_Cryptography/ch11/11-09.html)</sup>

## 结构性推论

该定律控制着素数在二次数域中的行为。对无平方因子的整数 \( d \)，使 \( d \) 成为模 \( p \) 二次剩余的素数 \( p \) 落在某些公差为 \( 2|d| \) 或 \( 4|d| \) 的等差数列中，这些等差数列的个数为 \( \phi(2|d|)/2 \) 或 \( \phi(4|d|)/2 \)，其中 \( \phi \) 为欧拉函数。<sup>[3](https://encyclopediaofmath.org/wiki/Quadratic_reciprocity_law)</sup> 同一定律确立了有理数域的二次扩张 \( \mathbf{Q}(\sqrt{d}) \) 中的分解律，因为不整除 \( d \) 的素数的分解方式取决于 \( x^{2} - d \) 模该素数是否可约。<sup>[3](https://encyclopediaofmath.org/wiki/Quadratic_reciprocity_law)</sup> 用分圆的语言说，\( \mathbf{Q}(\sqrt{p^{*}}) \)（其中 \( p^{*} = (-1)^{(p-1)/2}p \)）是 \( \mathbf{Q}(\mu_p) \) 中唯一的二次域，而互反律可由比较 \( q \) 在两个域中的分裂方式得出。<sup>[16](https://www.math.ucla.edu/~sharifi/notes/algnum-ch03.html)</sup>

## 证明与推广

已知该定理有两百多个不同的证明。<sup>[17](https://www.ams.org/bookstore/pspdf/amstext-31-prev.pdf)</sup> 其中几个尤为突出。高斯的第三个证明计算矩形中的格点，戈特霍尔德·艾森斯坦（Gotthold Eisenstein）著名的几何证明是它的重新表述：在以 \( (0,0) \) 与 \( (p/2, q/2) \) 为角的矩形中，从 \( (0,0) \) 到 \( (p,q) \) 画一条直线，用两种方式计算直线下方与上方的格点，得到 \( m + n = (p-1)(q-1)/4 \)，这正是定理背后的奇偶性恒等式。<sup>[18](https://crypto.stanford.edu/pbc/notes/numbertheory/quadrecip.html)</sup> 其他证明用到高斯和、有限域与弗罗贝尼乌斯自同构，或者如卢梭 1991 年的证明，在 \( (\mathbf{Z}/pq\mathbf{Z})^{\times} \) 上作一个简短的计数论证——Math Overflow 的一次投票以压倒性多数将其评为“最佳”证明。<sup>[19](https://arxiv.org/abs/1210.7744)</sup><sup> • </sup><sup>[8](https://math.mit.edu/classes/18.782/2013fa/LectureNotes3.pdf)</sup>

该定理更重大的意义在于它的推广。高斯后期的工作寻求推广到三次与四次剩余，这需要高斯整数 \( \mathbf{Z}[i] \)，常被视为代数数的开端；三次与四次互反律的第一个完整证明由艾森斯坦于 1844 年用高斯和与分圆域给出，而恩斯特·库默尔（Ernst Kummer）于 1845 年引入他的“理想数”，以恢复分圆域中的唯一分解。<sup>[20](https://www.ams.org/bull/2007-44-04/S0273-0979-07-01152-4/S0273-0979-07-01152-4.pdf)</sup> 艾森斯坦、库默尔、希尔伯特与阿廷的相继推广产生了互反律，它们构成了现代代数数论的骨干，而朗兰兹纲领或可理解为高斯 1801 年首次证明的这一定理的更为宏大的推广。<sup>[2](https://www.sophiararebooks.com/pages/books/6460/carl-friedrich-gauss/disquisitiones-arithmeticae)</sup> 1901 年英国科学促进会的一次演讲已将该定律描述为“数论大厦的基石”，既因其对众多分支的影响，也因其催生的新方法而著称。<sup>[21](https://mathshistory.st-andrews.ac.uk/Extras/BA_1901/)</sup>

## References

1. [Quadratic Reciprocity Theorem, Wolfram MathWorld](https://mathworld.wolfram.com/QuadraticReciprocityTheorem.html)
2. [Disquisitiones Arithmeticae, first edition description, Sophia Rare Books](https://www.sophiararebooks.com/pages/books/6460/carl-friedrich-gauss/disquisitiones-arithmeticae)
3. [Quadratic reciprocity law, Encyclopedia of Mathematics](https://encyclopediaofmath.org/wiki/Quadratic_reciprocity_law)
4. [Carl Friedrich Gauss, Disquisitiones arithmeticae (1801), Landmark Writings in Western Mathematics (ScienceDirect)](https://www.sciencedirect.com/science/chapter/edited-volume/abs/pii/B9780444508713501030)
5. [Law of Quadratic Reciprocity/Historical Note, ProofWiki](https://proofwiki.org/wiki/Law_of_Quadratic_Reciprocity/Historical_Note)
6. [Notes on Primality Testing, University of Pennsylvania](https://www.cis.upenn.edu/~jean/RSA-primality-testing.pdf)
7. [Earliest Uses of Symbols of Number Theory, MacTutor History of Mathematics](https://mathshistory.st-andrews.ac.uk/Miller/mathsym/nth/)
8. [18.782 Introduction to Arithmetic Geometry, Lecture 3, MIT (Andrew V. Sutherland)](https://math.mit.edu/classes/18.782/2013fa/LectureNotes3.pdf)
9. [A Source Book in Mathematics, 1200–1800, Original Sources (Legendre's Essai)](https://www.originalsources.com/Document.aspx?DocID=57ZFF2F82XIMBSN)
10. [Adrien-Marie Legendre, Dictionary of Scientific Biography via MacTutor](https://mathshistory.st-andrews.ac.uk/DSB/Legendre.pdf)
11. [30th March, MacTutor History of Mathematics](https://mathshistory.st-andrews.ac.uk/Miscellaneous/messages/03-30/)
12. [L'ottocento: matematica. Teoria dei numeri, Treccani, Storia della Scienza](https://www.treccani.it/enciclopedia/l-ottocento-matematica-teoria-dei-numeri_%28Storia-della-Scienza%29/)
13. [Adrien-Marie Legendre (1752–1833), MacTutor History of Mathematics](https://mathshistory.st-andrews.ac.uk/Biographies/Legendre/)
14. [18.781 Problem Set 3, MIT (Harvard/MIT number theory notes on the Jacobi symbol)](https://math.mit.edu/~hrm/papers/18.781/hw3.pdf)
15. [Applied Cryptography, Second Edition, chapter 11 (Jacobi symbol and primality testing)](https://www1.spms.ntu.edu.sg/~guojian/backup/phd/Books/Applied_Cryptography/ch11/11-09.html)
16. [Algebraic Number Theory, Chapter 3 Applications, Romyar Sharifi, UCLA](https://www.math.ucla.edu/~sharifi/notes/algnum-ch03.html)
17. [Chapter 3: Quadratic Reciprocity, AMS textbook preview](https://www.ams.org/bookstore/pspdf/amstext-31-prev.pdf)
18. [Number Theory: Quadratic Reciprocity, Stanford notes](https://crypto.stanford.edu/pbc/notes/numbertheory/quadrecip.html)
19. [A proof of the Quadratic Reciprocity Law, arXiv:1210.7744](https://arxiv.org/abs/1210.7744)
20. [Book review: Gauss sums and higher reciprocity, Bulletin of the AMS (2007)](https://www.ams.org/bull/2007-44-04/S0273-0979-07-01152-4/S0273-0979-07-01152-4.pdf)
21. [British Association 1901, MacTutor History of Mathematics](https://mathshistory.st-andrews.ac.uk/Extras/BA_1901/)

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

Topic: 物质世界与数学 › 数学与统计学 › 数与代数 › Number theory › Elementary number theory › Quadratic residues and reciprocity

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/quadratic-reciprocity

English original: https://www.edgepedia.org/quadratic-reciprocity
