Step |
Hyp |
Ref |
Expression |
1 |
|
breq1 |
|- ( P = 2 -> ( P || ( FermatNo ` N ) <-> 2 || ( FermatNo ` N ) ) ) |
2 |
1
|
adantr |
|- ( ( P = 2 /\ N e. NN ) -> ( P || ( FermatNo ` N ) <-> 2 || ( FermatNo ` N ) ) ) |
3 |
|
nnnn0 |
|- ( N e. NN -> N e. NN0 ) |
4 |
|
fmtnoodd |
|- ( N e. NN0 -> -. 2 || ( FermatNo ` N ) ) |
5 |
3 4
|
syl |
|- ( N e. NN -> -. 2 || ( FermatNo ` N ) ) |
6 |
5
|
adantl |
|- ( ( P = 2 /\ N e. NN ) -> -. 2 || ( FermatNo ` N ) ) |
7 |
6
|
pm2.21d |
|- ( ( P = 2 /\ N e. NN ) -> ( 2 || ( FermatNo ` N ) -> E. k e. NN P = ( ( k x. ( 2 ^ ( N + 1 ) ) ) + 1 ) ) ) |
8 |
2 7
|
sylbid |
|- ( ( P = 2 /\ N e. NN ) -> ( P || ( FermatNo ` N ) -> E. k e. NN P = ( ( k x. ( 2 ^ ( N + 1 ) ) ) + 1 ) ) ) |
9 |
8
|
a1d |
|- ( ( P = 2 /\ N e. NN ) -> ( P e. Prime -> ( P || ( FermatNo ` N ) -> E. k e. NN P = ( ( k x. ( 2 ^ ( N + 1 ) ) ) + 1 ) ) ) ) |
10 |
9
|
ex |
|- ( P = 2 -> ( N e. NN -> ( P e. Prime -> ( P || ( FermatNo ` N ) -> E. k e. NN P = ( ( k x. ( 2 ^ ( N + 1 ) ) ) + 1 ) ) ) ) ) |
11 |
10
|
3impd |
|- ( P = 2 -> ( ( N e. NN /\ P e. Prime /\ P || ( FermatNo ` N ) ) -> E. k e. NN P = ( ( k x. ( 2 ^ ( N + 1 ) ) ) + 1 ) ) ) |
12 |
|
simpr1 |
|- ( ( -. P = 2 /\ ( N e. NN /\ P e. Prime /\ P || ( FermatNo ` N ) ) ) -> N e. NN ) |
13 |
|
neqne |
|- ( -. P = 2 -> P =/= 2 ) |
14 |
13
|
anim2i |
|- ( ( P e. Prime /\ -. P = 2 ) -> ( P e. Prime /\ P =/= 2 ) ) |
15 |
|
eldifsn |
|- ( P e. ( Prime \ { 2 } ) <-> ( P e. Prime /\ P =/= 2 ) ) |
16 |
14 15
|
sylibr |
|- ( ( P e. Prime /\ -. P = 2 ) -> P e. ( Prime \ { 2 } ) ) |
17 |
16
|
ex |
|- ( P e. Prime -> ( -. P = 2 -> P e. ( Prime \ { 2 } ) ) ) |
18 |
17
|
3ad2ant2 |
|- ( ( N e. NN /\ P e. Prime /\ P || ( FermatNo ` N ) ) -> ( -. P = 2 -> P e. ( Prime \ { 2 } ) ) ) |
19 |
18
|
impcom |
|- ( ( -. P = 2 /\ ( N e. NN /\ P e. Prime /\ P || ( FermatNo ` N ) ) ) -> P e. ( Prime \ { 2 } ) ) |
20 |
|
simpr3 |
|- ( ( -. P = 2 /\ ( N e. NN /\ P e. Prime /\ P || ( FermatNo ` N ) ) ) -> P || ( FermatNo ` N ) ) |
21 |
|
fmtnoprmfac1lem |
|- ( ( N e. NN /\ P e. ( Prime \ { 2 } ) /\ P || ( FermatNo ` N ) ) -> ( ( odZ ` P ) ` 2 ) = ( 2 ^ ( N + 1 ) ) ) |
22 |
12 19 20 21
|
syl3anc |
|- ( ( -. P = 2 /\ ( N e. NN /\ P e. Prime /\ P || ( FermatNo ` N ) ) ) -> ( ( odZ ` P ) ` 2 ) = ( 2 ^ ( N + 1 ) ) ) |
23 |
|
prmnn |
|- ( P e. Prime -> P e. NN ) |
24 |
23
|
ad2antll |
|- ( ( -. P = 2 /\ ( N e. NN /\ P e. Prime ) ) -> P e. NN ) |
25 |
|
2z |
|- 2 e. ZZ |
26 |
25
|
a1i |
|- ( ( -. P = 2 /\ ( N e. NN /\ P e. Prime ) ) -> 2 e. ZZ ) |
27 |
13
|
necomd |
|- ( -. P = 2 -> 2 =/= P ) |
28 |
27
|
adantr |
|- ( ( -. P = 2 /\ ( N e. NN /\ P e. Prime ) ) -> 2 =/= P ) |
29 |
|
2prm |
|- 2 e. Prime |
30 |
29
|
a1i |
|- ( N e. NN -> 2 e. Prime ) |
31 |
30
|
anim1i |
|- ( ( N e. NN /\ P e. Prime ) -> ( 2 e. Prime /\ P e. Prime ) ) |
32 |
31
|
adantl |
|- ( ( -. P = 2 /\ ( N e. NN /\ P e. Prime ) ) -> ( 2 e. Prime /\ P e. Prime ) ) |
33 |
|
prmrp |
|- ( ( 2 e. Prime /\ P e. Prime ) -> ( ( 2 gcd P ) = 1 <-> 2 =/= P ) ) |
34 |
32 33
|
syl |
|- ( ( -. P = 2 /\ ( N e. NN /\ P e. Prime ) ) -> ( ( 2 gcd P ) = 1 <-> 2 =/= P ) ) |
35 |
28 34
|
mpbird |
|- ( ( -. P = 2 /\ ( N e. NN /\ P e. Prime ) ) -> ( 2 gcd P ) = 1 ) |
36 |
|
odzphi |
|- ( ( P e. NN /\ 2 e. ZZ /\ ( 2 gcd P ) = 1 ) -> ( ( odZ ` P ) ` 2 ) || ( phi ` P ) ) |
37 |
24 26 35 36
|
syl3anc |
|- ( ( -. P = 2 /\ ( N e. NN /\ P e. Prime ) ) -> ( ( odZ ` P ) ` 2 ) || ( phi ` P ) ) |
38 |
|
phiprm |
|- ( P e. Prime -> ( phi ` P ) = ( P - 1 ) ) |
39 |
38
|
ad2antll |
|- ( ( -. P = 2 /\ ( N e. NN /\ P e. Prime ) ) -> ( phi ` P ) = ( P - 1 ) ) |
40 |
39
|
breq2d |
|- ( ( -. P = 2 /\ ( N e. NN /\ P e. Prime ) ) -> ( ( ( odZ ` P ) ` 2 ) || ( phi ` P ) <-> ( ( odZ ` P ) ` 2 ) || ( P - 1 ) ) ) |
41 |
|
breq1 |
|- ( ( ( odZ ` P ) ` 2 ) = ( 2 ^ ( N + 1 ) ) -> ( ( ( odZ ` P ) ` 2 ) || ( P - 1 ) <-> ( 2 ^ ( N + 1 ) ) || ( P - 1 ) ) ) |
42 |
41
|
adantl |
|- ( ( ( -. P = 2 /\ ( N e. NN /\ P e. Prime ) ) /\ ( ( odZ ` P ) ` 2 ) = ( 2 ^ ( N + 1 ) ) ) -> ( ( ( odZ ` P ) ` 2 ) || ( P - 1 ) <-> ( 2 ^ ( N + 1 ) ) || ( P - 1 ) ) ) |
43 |
|
2nn |
|- 2 e. NN |
44 |
43
|
a1i |
|- ( N e. NN -> 2 e. NN ) |
45 |
|
peano2nn |
|- ( N e. NN -> ( N + 1 ) e. NN ) |
46 |
45
|
nnnn0d |
|- ( N e. NN -> ( N + 1 ) e. NN0 ) |
47 |
44 46
|
nnexpcld |
|- ( N e. NN -> ( 2 ^ ( N + 1 ) ) e. NN ) |
48 |
23
|
nnnn0d |
|- ( P e. Prime -> P e. NN0 ) |
49 |
|
prmuz2 |
|- ( P e. Prime -> P e. ( ZZ>= ` 2 ) ) |
50 |
|
eluzle |
|- ( P e. ( ZZ>= ` 2 ) -> 2 <_ P ) |
51 |
49 50
|
syl |
|- ( P e. Prime -> 2 <_ P ) |
52 |
|
nn0ge2m1nn |
|- ( ( P e. NN0 /\ 2 <_ P ) -> ( P - 1 ) e. NN ) |
53 |
48 51 52
|
syl2anc |
|- ( P e. Prime -> ( P - 1 ) e. NN ) |
54 |
47 53
|
anim12i |
|- ( ( N e. NN /\ P e. Prime ) -> ( ( 2 ^ ( N + 1 ) ) e. NN /\ ( P - 1 ) e. NN ) ) |
55 |
54
|
adantl |
|- ( ( -. P = 2 /\ ( N e. NN /\ P e. Prime ) ) -> ( ( 2 ^ ( N + 1 ) ) e. NN /\ ( P - 1 ) e. NN ) ) |
56 |
|
nndivides |
|- ( ( ( 2 ^ ( N + 1 ) ) e. NN /\ ( P - 1 ) e. NN ) -> ( ( 2 ^ ( N + 1 ) ) || ( P - 1 ) <-> E. k e. NN ( k x. ( 2 ^ ( N + 1 ) ) ) = ( P - 1 ) ) ) |
57 |
55 56
|
syl |
|- ( ( -. P = 2 /\ ( N e. NN /\ P e. Prime ) ) -> ( ( 2 ^ ( N + 1 ) ) || ( P - 1 ) <-> E. k e. NN ( k x. ( 2 ^ ( N + 1 ) ) ) = ( P - 1 ) ) ) |
58 |
|
eqcom |
|- ( ( k x. ( 2 ^ ( N + 1 ) ) ) = ( P - 1 ) <-> ( P - 1 ) = ( k x. ( 2 ^ ( N + 1 ) ) ) ) |
59 |
58
|
a1i |
|- ( ( ( -. P = 2 /\ ( N e. NN /\ P e. Prime ) ) /\ k e. NN ) -> ( ( k x. ( 2 ^ ( N + 1 ) ) ) = ( P - 1 ) <-> ( P - 1 ) = ( k x. ( 2 ^ ( N + 1 ) ) ) ) ) |
60 |
23
|
nncnd |
|- ( P e. Prime -> P e. CC ) |
61 |
60
|
adantl |
|- ( ( N e. NN /\ P e. Prime ) -> P e. CC ) |
62 |
61
|
adantr |
|- ( ( ( N e. NN /\ P e. Prime ) /\ k e. NN ) -> P e. CC ) |
63 |
|
1cnd |
|- ( ( ( N e. NN /\ P e. Prime ) /\ k e. NN ) -> 1 e. CC ) |
64 |
|
nncn |
|- ( k e. NN -> k e. CC ) |
65 |
64
|
adantl |
|- ( ( ( N e. NN /\ P e. Prime ) /\ k e. NN ) -> k e. CC ) |
66 |
|
peano2nn0 |
|- ( N e. NN0 -> ( N + 1 ) e. NN0 ) |
67 |
3 66
|
syl |
|- ( N e. NN -> ( N + 1 ) e. NN0 ) |
68 |
44 67
|
nnexpcld |
|- ( N e. NN -> ( 2 ^ ( N + 1 ) ) e. NN ) |
69 |
68
|
nncnd |
|- ( N e. NN -> ( 2 ^ ( N + 1 ) ) e. CC ) |
70 |
69
|
adantr |
|- ( ( N e. NN /\ P e. Prime ) -> ( 2 ^ ( N + 1 ) ) e. CC ) |
71 |
70
|
adantr |
|- ( ( ( N e. NN /\ P e. Prime ) /\ k e. NN ) -> ( 2 ^ ( N + 1 ) ) e. CC ) |
72 |
65 71
|
mulcld |
|- ( ( ( N e. NN /\ P e. Prime ) /\ k e. NN ) -> ( k x. ( 2 ^ ( N + 1 ) ) ) e. CC ) |
73 |
62 63 72
|
subadd2d |
|- ( ( ( N e. NN /\ P e. Prime ) /\ k e. NN ) -> ( ( P - 1 ) = ( k x. ( 2 ^ ( N + 1 ) ) ) <-> ( ( k x. ( 2 ^ ( N + 1 ) ) ) + 1 ) = P ) ) |
74 |
73
|
adantll |
|- ( ( ( -. P = 2 /\ ( N e. NN /\ P e. Prime ) ) /\ k e. NN ) -> ( ( P - 1 ) = ( k x. ( 2 ^ ( N + 1 ) ) ) <-> ( ( k x. ( 2 ^ ( N + 1 ) ) ) + 1 ) = P ) ) |
75 |
|
eqcom |
|- ( ( ( k x. ( 2 ^ ( N + 1 ) ) ) + 1 ) = P <-> P = ( ( k x. ( 2 ^ ( N + 1 ) ) ) + 1 ) ) |
76 |
75
|
a1i |
|- ( ( ( -. P = 2 /\ ( N e. NN /\ P e. Prime ) ) /\ k e. NN ) -> ( ( ( k x. ( 2 ^ ( N + 1 ) ) ) + 1 ) = P <-> P = ( ( k x. ( 2 ^ ( N + 1 ) ) ) + 1 ) ) ) |
77 |
59 74 76
|
3bitrd |
|- ( ( ( -. P = 2 /\ ( N e. NN /\ P e. Prime ) ) /\ k e. NN ) -> ( ( k x. ( 2 ^ ( N + 1 ) ) ) = ( P - 1 ) <-> P = ( ( k x. ( 2 ^ ( N + 1 ) ) ) + 1 ) ) ) |
78 |
77
|
rexbidva |
|- ( ( -. P = 2 /\ ( N e. NN /\ P e. Prime ) ) -> ( E. k e. NN ( k x. ( 2 ^ ( N + 1 ) ) ) = ( P - 1 ) <-> E. k e. NN P = ( ( k x. ( 2 ^ ( N + 1 ) ) ) + 1 ) ) ) |
79 |
78
|
biimpd |
|- ( ( -. P = 2 /\ ( N e. NN /\ P e. Prime ) ) -> ( E. k e. NN ( k x. ( 2 ^ ( N + 1 ) ) ) = ( P - 1 ) -> E. k e. NN P = ( ( k x. ( 2 ^ ( N + 1 ) ) ) + 1 ) ) ) |
80 |
57 79
|
sylbid |
|- ( ( -. P = 2 /\ ( N e. NN /\ P e. Prime ) ) -> ( ( 2 ^ ( N + 1 ) ) || ( P - 1 ) -> E. k e. NN P = ( ( k x. ( 2 ^ ( N + 1 ) ) ) + 1 ) ) ) |
81 |
80
|
adantr |
|- ( ( ( -. P = 2 /\ ( N e. NN /\ P e. Prime ) ) /\ ( ( odZ ` P ) ` 2 ) = ( 2 ^ ( N + 1 ) ) ) -> ( ( 2 ^ ( N + 1 ) ) || ( P - 1 ) -> E. k e. NN P = ( ( k x. ( 2 ^ ( N + 1 ) ) ) + 1 ) ) ) |
82 |
42 81
|
sylbid |
|- ( ( ( -. P = 2 /\ ( N e. NN /\ P e. Prime ) ) /\ ( ( odZ ` P ) ` 2 ) = ( 2 ^ ( N + 1 ) ) ) -> ( ( ( odZ ` P ) ` 2 ) || ( P - 1 ) -> E. k e. NN P = ( ( k x. ( 2 ^ ( N + 1 ) ) ) + 1 ) ) ) |
83 |
82
|
ex |
|- ( ( -. P = 2 /\ ( N e. NN /\ P e. Prime ) ) -> ( ( ( odZ ` P ) ` 2 ) = ( 2 ^ ( N + 1 ) ) -> ( ( ( odZ ` P ) ` 2 ) || ( P - 1 ) -> E. k e. NN P = ( ( k x. ( 2 ^ ( N + 1 ) ) ) + 1 ) ) ) ) |
84 |
83
|
com23 |
|- ( ( -. P = 2 /\ ( N e. NN /\ P e. Prime ) ) -> ( ( ( odZ ` P ) ` 2 ) || ( P - 1 ) -> ( ( ( odZ ` P ) ` 2 ) = ( 2 ^ ( N + 1 ) ) -> E. k e. NN P = ( ( k x. ( 2 ^ ( N + 1 ) ) ) + 1 ) ) ) ) |
85 |
40 84
|
sylbid |
|- ( ( -. P = 2 /\ ( N e. NN /\ P e. Prime ) ) -> ( ( ( odZ ` P ) ` 2 ) || ( phi ` P ) -> ( ( ( odZ ` P ) ` 2 ) = ( 2 ^ ( N + 1 ) ) -> E. k e. NN P = ( ( k x. ( 2 ^ ( N + 1 ) ) ) + 1 ) ) ) ) |
86 |
37 85
|
mpd |
|- ( ( -. P = 2 /\ ( N e. NN /\ P e. Prime ) ) -> ( ( ( odZ ` P ) ` 2 ) = ( 2 ^ ( N + 1 ) ) -> E. k e. NN P = ( ( k x. ( 2 ^ ( N + 1 ) ) ) + 1 ) ) ) |
87 |
86
|
3adantr3 |
|- ( ( -. P = 2 /\ ( N e. NN /\ P e. Prime /\ P || ( FermatNo ` N ) ) ) -> ( ( ( odZ ` P ) ` 2 ) = ( 2 ^ ( N + 1 ) ) -> E. k e. NN P = ( ( k x. ( 2 ^ ( N + 1 ) ) ) + 1 ) ) ) |
88 |
22 87
|
mpd |
|- ( ( -. P = 2 /\ ( N e. NN /\ P e. Prime /\ P || ( FermatNo ` N ) ) ) -> E. k e. NN P = ( ( k x. ( 2 ^ ( N + 1 ) ) ) + 1 ) ) |
89 |
88
|
ex |
|- ( -. P = 2 -> ( ( N e. NN /\ P e. Prime /\ P || ( FermatNo ` N ) ) -> E. k e. NN P = ( ( k x. ( 2 ^ ( N + 1 ) ) ) + 1 ) ) ) |
90 |
11 89
|
pm2.61i |
|- ( ( N e. NN /\ P e. Prime /\ P || ( FermatNo ` N ) ) -> E. k e. NN P = ( ( k x. ( 2 ^ ( N + 1 ) ) ) + 1 ) ) |