Math 2.0

Number theory Proof

Proof of the Lucas–Lehmer test

Builds on Mersenne numberCongruence modulo nPrime numberSubringCommutative ringTwo-sided idealQuotient ringIrrationality of square roots of non-squaresUnit of a ringGroup of units of a ringOrder of an elementg to the n equals 1 iff the order divides nOrder of an element divides the order of the groupComposite numberA composite number has a prime factor at most its square rootQuadratic residueLegendre symbolEuler's criterionLaw of quadratic reciprocityBinomial theoremFactorial formula for binomial coefficientsEuclid's lemmaFermat's little theorem in the form a^p = aMathematical induction

Proof

Let pp be an odd prime and M=Mp=2p−1M = M_p = 2^p - 1, the Mersenne number. Then p≥3p \ge 3, so M≥7M \ge 7 and MM is odd.

Setup.

  1. Let A={a+b3:a,b∈ℤ}A = \set{a + b\sqrt{3} : a, b \in \Z}. It contains 11 and is closed under differences and under products, since (a+b3)(c+d3)=(ac+3bd)+(ad+bc)3(a + b\sqrt3)(c + d\sqrt3) = (ac + 3bd) + (ad + bc)\sqrt3.
  2. So AA is a subring of ℝ\R, and it is a commutative ring.
  3. If a+b3=c+d3a + b\sqrt3 = c + d\sqrt3 with integers a,b,c,da, b, c, d and b≠db \ne d, then 3=(a−c)/(d−b)\sqrt3 = (a - c)/(d - b) is rational. This contradicts the irrationality of square roots of non-squares. So a=ca = c and b=db = d.
  4. For an integer N≥2N \ge 2, the set NA={Nα:α∈A}NA = \set{N\alpha : \alpha \in A} is a two-sided ideal of AA. Let XN=A/NAX_N = A/NA be the quotient ring. We write αˉ\bar\alpha for the coset of α\alpha.
  5. Let ss be an integer. If s∈NAs \in NA, then s=Nc+Nd3s = Nc + Nd\sqrt3 for integers c,dc, d. By step 3, Nd=0Nd = 0 and s=Ncs = Nc. So sˉ=0\bar s = 0 in XNX_N exactly when N∣sN \mid s.
  6. Put ω=2+3\omega = 2 + \sqrt3 and τ=2−3\tau = 2 - \sqrt3 in AA. Then ωτ=4−3=1\omega\tau = 4 - 3 = 1.
  7. We show si=ω2i+τ2is_i = \omega^{2^i} + \tau^{2^i} by induction on ii. For i=0i = 0, ω+τ=4=s0\omega + \tau = 4 = s_0.
  8. If si−1=ω2i−1+τ2i−1s_{i-1} = \omega^{2^{i-1}} + \tau^{2^{i-1}}, then si−12−2=ω2i+2(ωτ)2i−1+τ2i−2=ω2i+τ2is_{i-1}^2 - 2 = \omega^{2^i} + 2(\omega\tau)^{2^{i-1}} + \tau^{2^i} - 2 = \omega^{2^i} + \tau^{2^i}, by step 6.
  9. Put t=2p−2t = 2^{p-2}. So sp−2=ωt+τts_{p-2} = \omega^t + \tau^t, and 2t=2p−1=(M+1)/22t = 2^{p-1} = (M + 1)/2.

If sp−2≡0(modM)s_{p-2} \equiv 0 \pmod M, then MM is prime.

  1. Assume M∣sp−2M \mid s_{p-2} and, for a contradiction, that MM is composite. By the square root bound, MM has a prime factor qq with q2≤Mq^2 \le M. Since MM is odd, qq is odd.
  2. Work in X=XqX = X_q. Since q∣sp−2q \mid s_{p-2}, step 5 gives ωˉt+τˉt=0\bar\omega^t + \bar\tau^t = 0.
  3. Multiply by ωˉt\bar\omega^t and use ωτ=1\omega\tau = 1. This gives ωˉ2t+1=0\bar\omega^{2t} + 1 = 0, so ωˉ2p−1=−1\bar\omega^{2^{p-1}} = -1 and ωˉ2p=1\bar\omega^{2^p} = 1.
  4. In XX we have −1≠1-1 \ne 1: otherwise 2ˉ=0\bar 2 = 0, so q∣2q \mid 2 by step 5, but qq is odd.
  5. By step 6, ωˉ\bar\omega is a unit of XX, so it lies in the group of units X×X^\times. Let rr be its order.
  6. By step 12 and the order criterion, rr divides 2p2^p, so r=2jr = 2^j with j≤pj \le p. If j≤p−1j \le p - 1, then ωˉ2p−1=1\bar\omega^{2^{p-1}} = 1, against steps 12 and 13. So r=2pr = 2^p.
  7. Each element of AA is congruent modulo qAqA to some a+b3a + b\sqrt3 with 0≤a,b<q0 \le a, b < q. So XX has at most q2q^2 elements.
  8. The element 00 of XX is not a unit, since 0⋅β=0≠10 \cdot \beta = 0 \ne 1 by step 13. So X×X^\times has at most q2−1q^2 - 1 elements.
  9. Since the order of an element divides the order of the group, 2p≤q2−1<q2≤M=2p−12^p \le q^2 - 1 < q^2 \le M = 2^p - 1. This is false. So MM is prime.

If MM is prime, then sp−2≡0(modM)s_{p-2} \equiv 0 \pmod M.

  1. Assume MM is prime. Congruences below are modulo MM. Since 2p≡12^p \equiv 1 and pp is odd, 2≡2p+1=(2(p+1)/2)22 \equiv 2^{p+1} = (2^{(p+1)/2})^2.
  2. So 22 is a quadratic residue modulo MM, and M∤2M \nmid 2. By Euler's criterion, 2(M−1)/2≡12^{(M-1)/2} \equiv 1.
  3. Since pp is odd, 2p=2⋅4(p−1)/2≡2(mod3)2^p = 2 \cdot 4^{(p-1)/2} \equiv 2 \pmod 3. So M≡1(mod3)M \equiv 1 \pmod 3, and M≠3M \ne 3.
  4. The number 1=121 = 1^2 is a quadratic residue modulo 33, so the Legendre symbol (M3)\left(\frac{M}{3}\right) equals 11.
  5. Also (M−1)/2=2p−1−1(M - 1)/2 = 2^{p-1} - 1 is odd. By quadratic reciprocity, (3M)(M3)=(−1)(M−1)/2=−1\left(\frac{3}{M}\right)\left(\frac{M}{3}\right) = (-1)^{(M-1)/2} = -1. So (3M)=−1\left(\frac{3}{M}\right) = -1.
  6. By Euler's criterion, 3(M−1)/2≡−13^{(M-1)/2} \equiv -1.
  7. For 0<k<M0 < k < M, the factorial formula gives k! (M−k)!(Mk)=M!k!\,(M - k)! \binom{M}{k} = M!. The prime MM divides M!M! but no factor of k! (M−k)!k!\,(M-k)!. By Euclid's lemma, M∣(Mk)M \mid \binom{M}{k}.
  8. Work in X=XMX = X_M. For integers a,ba, b, the binomial theorem and step 25 give (a+b3)M‾=aM+bM(3)M‾\overline{(a + b\sqrt3)^M} = \overline{a^M + b^M (\sqrt3)^M}. Here (3)M=3(M−1)/23(\sqrt3)^M = 3^{(M-1)/2}\sqrt3, since MM is odd.
  9. By Fermat's little theorem and step 24, aM≡aa^M \equiv a and bM3(M−1)/2≡−bb^M 3^{(M-1)/2} \equiv -b. So (a+b3)M‾=a−b3‾\overline{(a + b\sqrt3)^M} = \overline{a - b\sqrt3}.
  10. Note (1+3)2=4+23=2ω(1 + \sqrt3)^2 = 4 + 2\sqrt3 = 2\omega. With step 27 for a=b=1a = b = 1, (2ω)(M+1)/2‾=(1+3)M+1‾=(1+3)(1−3)‾=−2‾.\overline{(2\omega)^{(M+1)/2}} = \overline{(1 + \sqrt3)^{M+1}} = \overline{(1 + \sqrt3)(1 - \sqrt3)} = \overline{-2}.
  11. By step 20, 2(M+1)/2‾=2⋅2(M−1)/2‾=2ˉ\overline{2^{(M+1)/2}} = \overline{2 \cdot 2^{(M-1)/2}} = \bar 2. So 2ˉ ωˉ(M+1)/2=−2ˉ\bar 2 \, \bar\omega^{(M+1)/2} = -\bar 2.
  12. The element 2ˉ\bar 2 is a unit of XX, with inverse (M+1)/2‾\overline{(M+1)/2}. Hence ωˉ(M+1)/2=−1\bar\omega^{(M+1)/2} = -1, that is, ωˉ2t=−1\bar\omega^{2t} = -1 by step 9.
  13. Multiply by τˉt\bar\tau^t and use ωτ=1\omega\tau = 1. This gives ωˉt=−τˉt\bar\omega^t = -\bar\tau^t, so sp−2‾=ωˉt+τˉt=0\overline{s_{p-2}} = \bar\omega^t + \bar\tau^t = 0.
  14. By step 5, MM divides sp−2s_{p-2}. So sp−2≡0(modMp)s_{p-2} \equiv 0 \pmod{M_p}.

Idea

The sequence is si=ω2i+ω−2is_i = \omega^{2^i} + \omega^{-2^i} with ω=2+3\omega = 2 + \sqrt3. If MpM_p divides sp−2s_{p-2}, then ω\omega has order 2p2^p modulo any prime factor qq, which is too large when q2≤Mpq^2 \le M_p. If MpM_p is prime, 33 is a nonresidue, so the MpM_p-th power map acts like conjugation on a+b3a + b\sqrt3. This forces ω(Mp+1)/2=−1\omega^{(M_p+1)/2} = -1.

Reading path

To understand this page from the ground up, read these 203 pages in order. The foundations come first. The path takes the proofs Proof of Bézout's identity, Proof of cancellation in an integral domain, Proof of the approximation property of the supremum, Proof of Gauss's lemma on quadratic residues, Proof of the generalized Euclid's lemma, Proof of Eisenstein's lemma, Proof of the commutativity of addition by induction, Proof of Fermat's little theorem by rearrangement, Proof that equivalence classes form a partition, Proof that g to the n equals 1 iff the order divides n, Proof of Euclid's lemma, Proof that R[x] is an integral domain iff R is, Proof that the reals form an ordered field, with the Cauchy sequence construction, Proof of the law of quadratic reciprocity by counting lattice points, Proof that the order of an element divides the order of the group, Proof of the degree of a product over an integral domain, Proof of strong induction from ordinary induction, Proof of the laws of exponents in a group, Proof of the fundamental theorem of arithmetic, Proof that the integers modulo a prime form a field, Proof of Pascal's rule from the recursive definition, Proof of Fermat's little theorem in the form a^p = a, Proof that congruence is compatible with addition, Proof of Euler's criterion by counting quadratic residues, Proof of the existence of prime factorization, Proof of the second supplement to quadratic reciprocity from Gauss's lemma, Proof that a polynomial over a field has at most as many roots as its degree, Proof of the remainder theorem, Proof of the factorial formula for binomial coefficients by induction, Proof that congruence is compatible with multiplication, Proof of the binomial theorem by induction, Proof that the order of a cyclic subgroup equals the order of its generator, Proof of the well-ordering principle from strong induction, Proof of the division algorithm, Proof of the uniqueness of inverses, Proof of the first supplement to quadratic reciprocity from Euler's criterion, Proof that the reals are Archimedean from the completeness axiom, Proof that a composite number has a prime factor at most its square root, Proof of Lagrange's theorem, Proof of the irrationality of square roots of non-squares, Proof of the factor theorem, Proof that cosets have the same cardinality as the subgroup, Proof of the existence of a prime divisor, Proof that congruence is compatible with powers.

  1. Binary operation definition
  2. Binomial coefficient definition
  3. Construction of the reals from Cauchy sequences concept
  4. Definition by recursion concept
  5. Divisibility definition
  6. Element definition
  7. Factorial definition
  8. Group concept
  9. Integers object
  10. Left coset concept
  11. Mathematical induction concept
  12. Mersenne number definition
  13. Natural numbers object
  14. Order of an element concept
  15. Ordered field definition
  16. Peano axioms concept
  17. Proposition concept
  18. Rational numbers object
  19. Real numbers object
  20. Set bounded above definition
  21. Identity element definition
  22. Proof of Pascal's rule from the recursive definition proof
  23. Congruence modulo n definition
  24. Greatest common divisor definition
  25. Prime number definition
  26. Set definition
  27. Order of a group definition
  28. Ring definition
  29. Subgroup definition
  30. Ring of integers statement
  31. Successor function definition
  32. Archimedean ordered field definition
  33. Conjunction definition
  34. Disjunction definition
  35. Implication definition
  36. Predicate definition
  37. Irrational number definition
  38. The reals form a field statement
  39. Supremum definition
  40. Inverse element definition
  41. Pascal's rule statement
  42. Quadratic residue definition
  43. Residue class definition
  44. Coprime integers definition
  45. Proof that congruence is compatible with addition proof
  46. Proof that congruence is compatible with multiplication proof
  47. Composite number definition
  48. Prime factorization definition
  49. Empty set object
  50. Family of sets definition
  51. Ordered pair definition
  52. Commutative ring definition
  53. Ideal definition
  54. Polynomial ring definition
  55. Ring homomorphism definition
  56. Subring definition
  57. Unit of a ring definition
  58. Zero divisor definition
  59. Intersection definition
  60. Union definition
  61. Left coset definition
  62. Right coset definition
  63. Addition of natural numbers definition
  64. Set-builder notation concept
  65. The successor function is injective statement
  66. Zero is not a successor statement
  67. Biconditional definition
  68. The rationals form a field statement
  69. Existential quantifier definition
  70. Universal quantifier definition
  71. Completeness axiom statement
  72. Proof of the factorial formula for binomial coefficients by induction proof
  73. Legendre symbol definition
  74. Congruence is compatible with addition statement
  75. Proof of the uniqueness of inverses proof
  76. Congruence is compatible with multiplication statement
  77. Cartesian product definition
  78. Divisibility in a commutative ring definition
  79. Group of units of a ring definition
  80. Two-sided ideal definition
  81. Subset definition
  82. Degree of a polynomial definition
  83. Disjoint sets definition
  84. Polynomial evaluation definition
  85. Proof of the commutativity of addition by induction proof
  86. Field definition
  87. Integral domain definition
  88. Axiom of extensionality statement
  89. Order on the natural numbers definition
  90. Union of a family of sets definition
  91. The rationals form an ordered field statement
  92. Uniqueness quantifier definition
  93. Factorial formula for binomial coefficients statement
  94. Integers modulo n definition
  95. Proof that congruence is compatible with powers proof
  96. Uniqueness of inverses statement
  97. Binary relation definition
  98. Quotient ring definition
  99. Leading coefficient definition
  100. Order on the reals definition
  101. Proof of cancellation in an integral domain proof
  102. Root of a polynomial definition
  103. Partition of a set definition
  104. Evaluation homomorphism definition
  105. Commutativity of addition statement
  106. Proof of strong induction from ordinary induction proof
  107. Congruence is compatible with powers statement
  108. Proof of the binomial theorem by induction proof
  109. Antisymmetric relation definition
  110. Reflexive relation definition
  111. Symmetric relation definition
  112. Transitive relation definition
  113. Proof of the laws of exponents in a group proof
  114. Monic polynomial definition
  115. Multiplicity of a root definition
  116. Proof of the degree of a product over an integral domain proof
  117. Cancellation in an integral domain statement
  118. Proof of the remainder theorem proof
  119. Function definition
  120. Strong induction statement
  121. Binomial theorem statement
  122. Equivalence relation definition
  123. Preorder definition
  124. Laws of exponents in a group statement
  125. Degree of a product statement
  126. Division algorithm for polynomials statement
  127. Codomain definition
  128. Injective function definition
  129. Proof of the well-ordering principle from strong induction proof
  130. Partial order definition
  131. Order of an element definition
  132. Cyclic subgroup generated by an element definition
  133. Surjective function definition
  134. Remainder theorem statement
  135. Proof that R[x] is an integral domain iff R is proof
  136. Well-ordering principle statement
  137. Equivalence class definition
  138. Total order definition
  139. Proof of the existence of a prime divisor proof
  140. Bijective function definition
  141. Proof of the division algorithm proof
  142. Proof of the factor theorem proof
  143. Proof that equivalence classes form a partition proof
  144. R[x] is an integral domain iff R is statement
  145. Equinumerous sets definition
  146. Existence of a prime divisor statement
  147. Division algorithm statement
  148. Factor theorem statement
  149. Equivalence classes form a partition statement
  150. Proof that the reals form an ordered field, with the Cauchy sequence construction proof
  151. Cardinality definition
  152. Smallest prime factor definition
  153. Proof that g to the n equals 1 iff the order divides n proof
  154. Proof of Bézout's identity proof
  155. Proof that a composite number has a prime factor at most its square root proof
  156. Proof of the existence of prime factorization proof
  157. Proof that a polynomial over a field has at most as many roots as its degree proof
  158. The reals form an ordered field statement
  159. g to the n equals 1 iff the order divides n statement
  160. Bézout's identity statement
  161. A composite number has a prime factor at most its square root statement
  162. Existence of prime factorization statement
  163. A polynomial over a field has at most as many roots as its degree statement
  164. Proof that cosets have the same cardinality as the subgroup proof
  165. Proof of the approximation property of the supremum proof
  166. Proof of the generalized Euclid's lemma proof
  167. Proof that the order of a cyclic subgroup equals the order of its generator proof
  168. Proof that the integers modulo a prime form a field proof
  169. Cosets have the same cardinality as the subgroup statement
  170. Approximation property of the supremum statement
  171. Integers modulo a prime form a field statement
  172. Order of a cyclic subgroup equals the order of its generator statement
  173. Generalized Euclid's lemma statement
  174. Proof of Lagrange's theorem proof
  175. Proof that the reals are Archimedean from the completeness axiom proof
  176. Proof of Euclid's lemma proof
  177. Lagrange's theorem statement
  178. The reals are Archimedean statement
  179. Proof that the order of an element divides the order of the group proof
  180. Euclid's lemma statement
  181. Floor function definition
  182. Order of an element divides the order of the group statement
  183. Proof of Fermat's little theorem by rearrangement proof
  184. Proof of the fundamental theorem of arithmetic proof
  185. Fermat's little theorem statement
  186. Fundamental theorem of arithmetic statement
  187. Proof of Euler's criterion by counting quadratic residues proof
  188. Proof of Fermat's little theorem in the form a^p = a proof
  189. Proof of the irrationality of square roots of non-squares proof
  190. Euler's criterion statement
  191. Fermat's little theorem in the form a^p = a statement
  192. Irrationality of square roots of non-squares statement
  193. Proof of the first supplement to quadratic reciprocity from Euler's criterion proof
  194. Proof of Gauss's lemma on quadratic residues proof
  195. Proof of Eisenstein's lemma proof
  196. First supplement to quadratic reciprocity statement
  197. Gauss's lemma on quadratic residues statement
  198. Eisenstein's lemma statement
  199. Proof of the second supplement to quadratic reciprocity from Gauss's lemma proof
  200. Proof of the law of quadratic reciprocity by counting lattice points proof
  201. Second supplement to quadratic reciprocity statement
  202. Law of quadratic reciprocity statement
  203. Proof of the Lucas–Lehmer test proof

Where this leads

1 page builds on this one.

Further reading

  1. Web https://en.wikipedia.org/wiki/Lucas%E2%80%93Lehmer_primality_test, Proof of correctness
About this page