Metamath Proof Explorer


Theorem perfect

Description: The Euclid-Euler theorem, or Perfect Number theorem. A positive even integer N is a perfect number (that is, its divisor sum is 2 N ) if and only if it is of the form 2 ^ ( p - 1 ) x. ( 2 ^ p - 1 ) , where 2 ^ p - 1 is prime (a Mersenne prime). (It follows from this that p is also prime.) This is Metamath 100 proof #70. (Contributed by Mario Carneiro, 17-May-2016)

Ref Expression
Assertion perfect N 2 N 1 σ N = 2 N p 2 p 1 N = 2 p 1 2 p 1

Proof

Step Hyp Ref Expression
1 simplr N 2 N 1 σ N = 2 N 2 N
2 2prm 2
3 simpll N 2 N 1 σ N = 2 N N
4 pcelnn 2 N 2 pCnt N 2 N
5 2 3 4 sylancr N 2 N 1 σ N = 2 N 2 pCnt N 2 N
6 1 5 mpbird N 2 N 1 σ N = 2 N 2 pCnt N
7 6 nnzd N 2 N 1 σ N = 2 N 2 pCnt N
8 7 peano2zd N 2 N 1 σ N = 2 N 2 pCnt N + 1
9 pcdvds 2 N 2 2 pCnt N N
10 2 3 9 sylancr N 2 N 1 σ N = 2 N 2 2 pCnt N N
11 2nn 2
12 6 nnnn0d N 2 N 1 σ N = 2 N 2 pCnt N 0
13 nnexpcl 2 2 pCnt N 0 2 2 pCnt N
14 11 12 13 sylancr N 2 N 1 σ N = 2 N 2 2 pCnt N
15 nndivdvds N 2 2 pCnt N 2 2 pCnt N N N 2 2 pCnt N
16 3 14 15 syl2anc N 2 N 1 σ N = 2 N 2 2 pCnt N N N 2 2 pCnt N
17 10 16 mpbid N 2 N 1 σ N = 2 N N 2 2 pCnt N
18 pcndvds2 2 N ¬ 2 N 2 2 pCnt N
19 2 3 18 sylancr N 2 N 1 σ N = 2 N ¬ 2 N 2 2 pCnt N
20 simpr N 2 N 1 σ N = 2 N 1 σ N = 2 N
21 nncn N N
22 21 ad2antrr N 2 N 1 σ N = 2 N N
23 14 nncnd N 2 N 1 σ N = 2 N 2 2 pCnt N
24 14 nnne0d N 2 N 1 σ N = 2 N 2 2 pCnt N 0
25 22 23 24 divcan2d N 2 N 1 σ N = 2 N 2 2 pCnt N N 2 2 pCnt N = N
26 25 oveq2d N 2 N 1 σ N = 2 N 1 σ 2 2 pCnt N N 2 2 pCnt N = 1 σ N
27 25 oveq2d N 2 N 1 σ N = 2 N 2 2 2 pCnt N N 2 2 pCnt N = 2 N
28 20 26 27 3eqtr4d N 2 N 1 σ N = 2 N 1 σ 2 2 pCnt N N 2 2 pCnt N = 2 2 2 pCnt N N 2 2 pCnt N
29 6 17 19 28 perfectlem2 N 2 N 1 σ N = 2 N N 2 2 pCnt N N 2 2 pCnt N = 2 2 pCnt N + 1 1
30 29 simprd N 2 N 1 σ N = 2 N N 2 2 pCnt N = 2 2 pCnt N + 1 1
31 29 simpld N 2 N 1 σ N = 2 N N 2 2 pCnt N
32 30 31 eqeltrrd N 2 N 1 σ N = 2 N 2 2 pCnt N + 1 1
33 6 nncnd N 2 N 1 σ N = 2 N 2 pCnt N
34 ax-1cn 1
35 pncan 2 pCnt N 1 2 pCnt N + 1 - 1 = 2 pCnt N
36 33 34 35 sylancl N 2 N 1 σ N = 2 N 2 pCnt N + 1 - 1 = 2 pCnt N
37 36 eqcomd N 2 N 1 σ N = 2 N 2 pCnt N = 2 pCnt N + 1 - 1
38 37 oveq2d N 2 N 1 σ N = 2 N 2 2 pCnt N = 2 2 pCnt N + 1 - 1
39 38 30 oveq12d N 2 N 1 σ N = 2 N 2 2 pCnt N N 2 2 pCnt N = 2 2 pCnt N + 1 - 1 2 2 pCnt N + 1 1
40 25 39 eqtr3d N 2 N 1 σ N = 2 N N = 2 2 pCnt N + 1 - 1 2 2 pCnt N + 1 1
41 oveq2 p = 2 pCnt N + 1 2 p = 2 2 pCnt N + 1
42 41 oveq1d p = 2 pCnt N + 1 2 p 1 = 2 2 pCnt N + 1 1
43 42 eleq1d p = 2 pCnt N + 1 2 p 1 2 2 pCnt N + 1 1
44 oveq1 p = 2 pCnt N + 1 p 1 = 2 pCnt N + 1 - 1
45 44 oveq2d p = 2 pCnt N + 1 2 p 1 = 2 2 pCnt N + 1 - 1
46 45 42 oveq12d p = 2 pCnt N + 1 2 p 1 2 p 1 = 2 2 pCnt N + 1 - 1 2 2 pCnt N + 1 1
47 46 eqeq2d p = 2 pCnt N + 1 N = 2 p 1 2 p 1 N = 2 2 pCnt N + 1 - 1 2 2 pCnt N + 1 1
48 43 47 anbi12d p = 2 pCnt N + 1 2 p 1 N = 2 p 1 2 p 1 2 2 pCnt N + 1 1 N = 2 2 pCnt N + 1 - 1 2 2 pCnt N + 1 1
49 48 rspcev 2 pCnt N + 1 2 2 pCnt N + 1 1 N = 2 2 pCnt N + 1 - 1 2 2 pCnt N + 1 1 p 2 p 1 N = 2 p 1 2 p 1
50 8 32 40 49 syl12anc N 2 N 1 σ N = 2 N p 2 p 1 N = 2 p 1 2 p 1
51 50 ex N 2 N 1 σ N = 2 N p 2 p 1 N = 2 p 1 2 p 1
52 perfect1 p 2 p 1 1 σ 2 p 1 2 p 1 = 2 p 2 p 1
53 2cn 2
54 mersenne p 2 p 1 p
55 prmnn p p
56 54 55 syl p 2 p 1 p
57 expm1t 2 p 2 p = 2 p 1 2
58 53 56 57 sylancr p 2 p 1 2 p = 2 p 1 2
59 nnm1nn0 p p 1 0
60 56 59 syl p 2 p 1 p 1 0
61 expcl 2 p 1 0 2 p 1
62 53 60 61 sylancr p 2 p 1 2 p 1
63 mulcom 2 p 1 2 2 p 1 2 = 2 2 p 1
64 62 53 63 sylancl p 2 p 1 2 p 1 2 = 2 2 p 1
65 58 64 eqtrd p 2 p 1 2 p = 2 2 p 1
66 65 oveq1d p 2 p 1 2 p 2 p 1 = 2 2 p 1 2 p 1
67 2cnd p 2 p 1 2
68 prmnn 2 p 1 2 p 1
69 68 adantl p 2 p 1 2 p 1
70 69 nncnd p 2 p 1 2 p 1
71 67 62 70 mulassd p 2 p 1 2 2 p 1 2 p 1 = 2 2 p 1 2 p 1
72 52 66 71 3eqtrd p 2 p 1 1 σ 2 p 1 2 p 1 = 2 2 p 1 2 p 1
73 oveq2 N = 2 p 1 2 p 1 1 σ N = 1 σ 2 p 1 2 p 1
74 oveq2 N = 2 p 1 2 p 1 2 N = 2 2 p 1 2 p 1
75 73 74 eqeq12d N = 2 p 1 2 p 1 1 σ N = 2 N 1 σ 2 p 1 2 p 1 = 2 2 p 1 2 p 1
76 72 75 syl5ibrcom p 2 p 1 N = 2 p 1 2 p 1 1 σ N = 2 N
77 76 impr p 2 p 1 N = 2 p 1 2 p 1 1 σ N = 2 N
78 77 rexlimiva p 2 p 1 N = 2 p 1 2 p 1 1 σ N = 2 N
79 51 78 impbid1 N 2 N 1 σ N = 2 N p 2 p 1 N = 2 p 1 2 p 1