Metamath Proof Explorer


Theorem mersenne

Description: A Mersenne prime is a prime number of the form 2 ^ P - 1 . This theorem shows that the P in this expression is necessarily also prime. (Contributed by Mario Carneiro, 17-May-2016)

Ref Expression
Assertion mersenne P 2 P 1 P

Proof

Step Hyp Ref Expression
1 simpl P 2 P 1 P
2 2nn0 2 0
3 2 numexp1 2 1 = 2
4 df-2 2 = 1 + 1
5 3 4 eqtri 2 1 = 1 + 1
6 prmuz2 2 P 1 2 P 1 2
7 6 adantl P 2 P 1 2 P 1 2
8 eluz2gt1 2 P 1 2 1 < 2 P 1
9 7 8 syl P 2 P 1 1 < 2 P 1
10 1red P 2 P 1 1
11 2re 2
12 11 a1i P 2 P 1 2
13 2ne0 2 0
14 13 a1i P 2 P 1 2 0
15 12 14 1 reexpclzd P 2 P 1 2 P
16 10 10 15 ltaddsubd P 2 P 1 1 + 1 < 2 P 1 < 2 P 1
17 9 16 mpbird P 2 P 1 1 + 1 < 2 P
18 5 17 eqbrtrid P 2 P 1 2 1 < 2 P
19 1zzd P 2 P 1 1
20 1lt2 1 < 2
21 20 a1i P 2 P 1 1 < 2
22 12 19 1 21 ltexp2d P 2 P 1 1 < P 2 1 < 2 P
23 18 22 mpbird P 2 P 1 1 < P
24 eluz2b1 P 2 P 1 < P
25 1 23 24 sylanbrc P 2 P 1 P 2
26 simpllr P 2 P 1 k 2 P 1 k P 2 P 1
27 prmnn 2 P 1 2 P 1
28 26 27 syl P 2 P 1 k 2 P 1 k P 2 P 1
29 28 nncnd P 2 P 1 k 2 P 1 k P 2 P 1
30 2nn 2
31 elfzuz k 2 P 1 k 2
32 31 ad2antlr P 2 P 1 k 2 P 1 k P k 2
33 eluz2nn k 2 k
34 32 33 syl P 2 P 1 k 2 P 1 k P k
35 34 nnnn0d P 2 P 1 k 2 P 1 k P k 0
36 nnexpcl 2 k 0 2 k
37 30 35 36 sylancr P 2 P 1 k 2 P 1 k P 2 k
38 37 nnzd P 2 P 1 k 2 P 1 k P 2 k
39 peano2zm 2 k 2 k 1
40 38 39 syl P 2 P 1 k 2 P 1 k P 2 k 1
41 40 zred P 2 P 1 k 2 P 1 k P 2 k 1
42 41 recnd P 2 P 1 k 2 P 1 k P 2 k 1
43 0red P 2 P 1 k 2 P 1 k P 0
44 1red P 2 P 1 k 2 P 1 k P 1
45 0lt1 0 < 1
46 45 a1i P 2 P 1 k 2 P 1 k P 0 < 1
47 eluz2gt1 k 2 1 < k
48 32 47 syl P 2 P 1 k 2 P 1 k P 1 < k
49 11 a1i P 2 P 1 k 2 P 1 k P 2
50 1zzd P 2 P 1 k 2 P 1 k P 1
51 elfzelz k 2 P 1 k
52 51 ad2antlr P 2 P 1 k 2 P 1 k P k
53 20 a1i P 2 P 1 k 2 P 1 k P 1 < 2
54 49 50 52 53 ltexp2d P 2 P 1 k 2 P 1 k P 1 < k 2 1 < 2 k
55 48 54 mpbid P 2 P 1 k 2 P 1 k P 2 1 < 2 k
56 5 55 eqbrtrrid P 2 P 1 k 2 P 1 k P 1 + 1 < 2 k
57 37 nnred P 2 P 1 k 2 P 1 k P 2 k
58 44 44 57 ltaddsubd P 2 P 1 k 2 P 1 k P 1 + 1 < 2 k 1 < 2 k 1
59 56 58 mpbid P 2 P 1 k 2 P 1 k P 1 < 2 k 1
60 43 44 41 46 59 lttrd P 2 P 1 k 2 P 1 k P 0 < 2 k 1
61 elnnz 2 k 1 2 k 1 0 < 2 k 1
62 40 60 61 sylanbrc P 2 P 1 k 2 P 1 k P 2 k 1
63 62 nnne0d P 2 P 1 k 2 P 1 k P 2 k 1 0
64 29 42 63 divcan2d P 2 P 1 k 2 P 1 k P 2 k 1 2 P 1 2 k 1 = 2 P 1
65 64 26 eqeltrd P 2 P 1 k 2 P 1 k P 2 k 1 2 P 1 2 k 1
66 eluz2b2 2 k 1 2 2 k 1 1 < 2 k 1
67 62 59 66 sylanbrc P 2 P 1 k 2 P 1 k P 2 k 1 2
68 37 nncnd P 2 P 1 k 2 P 1 k P 2 k
69 ax-1cn 1
70 subeq0 2 k 1 2 k 1 = 0 2 k = 1
71 68 69 70 sylancl P 2 P 1 k 2 P 1 k P 2 k 1 = 0 2 k = 1
72 71 necon3bid P 2 P 1 k 2 P 1 k P 2 k 1 0 2 k 1
73 63 72 mpbid P 2 P 1 k 2 P 1 k P 2 k 1
74 simpr P 2 P 1 k 2 P 1 k P k P
75 eluz2nn P 2 P
76 25 75 syl P 2 P 1 P
77 76 ad2antrr P 2 P 1 k 2 P 1 k P P
78 nndivdvds P k k P P k
79 77 34 78 syl2anc P 2 P 1 k 2 P 1 k P k P P k
80 74 79 mpbid P 2 P 1 k 2 P 1 k P P k
81 80 nnnn0d P 2 P 1 k 2 P 1 k P P k 0
82 68 73 81 geoser P 2 P 1 k 2 P 1 k P n = 0 P k 1 2 k n = 1 2 k P k 1 2 k
83 15 ad2antrr P 2 P 1 k 2 P 1 k P 2 P
84 83 recnd P 2 P 1 k 2 P 1 k P 2 P
85 negsubdi2 2 P 1 2 P 1 = 1 2 P
86 84 69 85 sylancl P 2 P 1 k 2 P 1 k P 2 P 1 = 1 2 P
87 77 nncnd P 2 P 1 k 2 P 1 k P P
88 34 nncnd P 2 P 1 k 2 P 1 k P k
89 34 nnne0d P 2 P 1 k 2 P 1 k P k 0
90 87 88 89 divcan2d P 2 P 1 k 2 P 1 k P k P k = P
91 90 oveq2d P 2 P 1 k 2 P 1 k P 2 k P k = 2 P
92 49 recnd P 2 P 1 k 2 P 1 k P 2
93 92 81 35 expmuld P 2 P 1 k 2 P 1 k P 2 k P k = 2 k P k
94 91 93 eqtr3d P 2 P 1 k 2 P 1 k P 2 P = 2 k P k
95 94 oveq2d P 2 P 1 k 2 P 1 k P 1 2 P = 1 2 k P k
96 86 95 eqtrd P 2 P 1 k 2 P 1 k P 2 P 1 = 1 2 k P k
97 negsubdi2 2 k 1 2 k 1 = 1 2 k
98 68 69 97 sylancl P 2 P 1 k 2 P 1 k P 2 k 1 = 1 2 k
99 96 98 oveq12d P 2 P 1 k 2 P 1 k P 2 P 1 2 k 1 = 1 2 k P k 1 2 k
100 29 42 63 div2negd P 2 P 1 k 2 P 1 k P 2 P 1 2 k 1 = 2 P 1 2 k 1
101 82 99 100 3eqtr2d P 2 P 1 k 2 P 1 k P n = 0 P k 1 2 k n = 2 P 1 2 k 1
102 fzfid P 2 P 1 k 2 P 1 k P 0 P k 1 Fin
103 elfznn0 n 0 P k 1 n 0
104 zexpcl 2 k n 0 2 k n
105 38 103 104 syl2an P 2 P 1 k 2 P 1 k P n 0 P k 1 2 k n
106 102 105 fsumzcl P 2 P 1 k 2 P 1 k P n = 0 P k 1 2 k n
107 101 106 eqeltrrd P 2 P 1 k 2 P 1 k P 2 P 1 2 k 1
108 42 mulid2d P 2 P 1 k 2 P 1 k P 1 2 k 1 = 2 k 1
109 2z 2
110 elfzm11 2 P k 2 P 1 k 2 k k < P
111 109 1 110 sylancr P 2 P 1 k 2 P 1 k 2 k k < P
112 111 biimpa P 2 P 1 k 2 P 1 k 2 k k < P
113 112 simp3d P 2 P 1 k 2 P 1 k < P
114 113 adantr P 2 P 1 k 2 P 1 k P k < P
115 1 ad2antrr P 2 P 1 k 2 P 1 k P P
116 49 52 115 53 ltexp2d P 2 P 1 k 2 P 1 k P k < P 2 k < 2 P
117 114 116 mpbid P 2 P 1 k 2 P 1 k P 2 k < 2 P
118 57 83 44 117 ltsub1dd P 2 P 1 k 2 P 1 k P 2 k 1 < 2 P 1
119 108 118 eqbrtrd P 2 P 1 k 2 P 1 k P 1 2 k 1 < 2 P 1
120 28 nnred P 2 P 1 k 2 P 1 k P 2 P 1
121 ltmuldiv 1 2 P 1 2 k 1 0 < 2 k 1 1 2 k 1 < 2 P 1 1 < 2 P 1 2 k 1
122 44 120 41 60 121 syl112anc P 2 P 1 k 2 P 1 k P 1 2 k 1 < 2 P 1 1 < 2 P 1 2 k 1
123 119 122 mpbid P 2 P 1 k 2 P 1 k P 1 < 2 P 1 2 k 1
124 eluz2b1 2 P 1 2 k 1 2 2 P 1 2 k 1 1 < 2 P 1 2 k 1
125 107 123 124 sylanbrc P 2 P 1 k 2 P 1 k P 2 P 1 2 k 1 2
126 nprm 2 k 1 2 2 P 1 2 k 1 2 ¬ 2 k 1 2 P 1 2 k 1
127 67 125 126 syl2anc P 2 P 1 k 2 P 1 k P ¬ 2 k 1 2 P 1 2 k 1
128 65 127 pm2.65da P 2 P 1 k 2 P 1 ¬ k P
129 128 ralrimiva P 2 P 1 k 2 P 1 ¬ k P
130 isprm3 P P 2 k 2 P 1 ¬ k P
131 25 129 130 sylanbrc P 2 P 1 P