Metamath Proof Explorer


Theorem lighneallem4

Description: Lemma 3 for lighneal . (Contributed by AV, 16-Aug-2021)

Ref Expression
Assertion lighneallem4 P 2 M N ¬ 2 N ¬ 2 M 2 N 1 = P M M = 1

Proof

Step Hyp Ref Expression
1 2cnd N 2
2 nnnn0 N N 0
3 1 2 expcld N 2 N
4 3 3ad2ant3 P 2 M N 2 N
5 1cnd P 2 M N 1
6 eldifi P 2 P
7 prmnn P P
8 nncn P P
9 6 7 8 3syl P 2 P
10 9 3ad2ant1 P 2 M N P
11 nnnn0 M M 0
12 11 3ad2ant2 P 2 M N M 0
13 10 12 expcld P 2 M N P M
14 4 5 13 3jca P 2 M N 2 N 1 P M
15 14 adantr P 2 M N ¬ 2 M 2 N 1 P M
16 subadd2 2 N 1 P M 2 N 1 = P M P M + 1 = 2 N
17 15 16 syl P 2 M N ¬ 2 M 2 N 1 = P M P M + 1 = 2 N
18 10 adantr P 2 M N ¬ 2 M P
19 simpl2 P 2 M N ¬ 2 M M
20 simpr P 2 M N ¬ 2 M ¬ 2 M
21 18 19 20 oddpwp1fsum P 2 M N ¬ 2 M P M + 1 = P + 1 k = 0 M 1 1 k P k
22 21 eqeq1d P 2 M N ¬ 2 M P M + 1 = 2 N P + 1 k = 0 M 1 1 k P k = 2 N
23 peano2nn P P + 1
24 23 nnzd P P + 1
25 6 7 24 3syl P 2 P + 1
26 25 3ad2ant1 P 2 M N P + 1
27 fzfid P 2 M N 0 M 1 Fin
28 neg1z 1
29 28 a1i P 2 M N 1
30 elfznn0 k 0 M 1 k 0
31 zexpcl 1 k 0 1 k
32 29 30 31 syl2an P 2 M N k 0 M 1 1 k
33 nnz P P
34 6 7 33 3syl P 2 P
35 34 3ad2ant1 P 2 M N P
36 zexpcl P k 0 P k
37 35 30 36 syl2an P 2 M N k 0 M 1 P k
38 32 37 zmulcld P 2 M N k 0 M 1 1 k P k
39 27 38 fsumzcl P 2 M N k = 0 M 1 1 k P k
40 26 39 jca P 2 M N P + 1 k = 0 M 1 1 k P k
41 40 ad2antrr P 2 M N ¬ 2 M P + 1 k = 0 M 1 1 k P k = 2 N P + 1 k = 0 M 1 1 k P k
42 dvdsmul2 P + 1 k = 0 M 1 1 k P k k = 0 M 1 1 k P k P + 1 k = 0 M 1 1 k P k
43 41 42 syl P 2 M N ¬ 2 M P + 1 k = 0 M 1 1 k P k = 2 N k = 0 M 1 1 k P k P + 1 k = 0 M 1 1 k P k
44 breq2 P + 1 k = 0 M 1 1 k P k = 2 N k = 0 M 1 1 k P k P + 1 k = 0 M 1 1 k P k k = 0 M 1 1 k P k 2 N
45 44 adantl P 2 M N ¬ 2 M P + 1 k = 0 M 1 1 k P k = 2 N k = 0 M 1 1 k P k P + 1 k = 0 M 1 1 k P k k = 0 M 1 1 k P k 2 N
46 2a1 M = 1 P 2 M N ¬ 2 M k = 0 M 1 1 k P k 2 N M = 1
47 2prm 2
48 prmuz2 P P 2
49 6 48 syl P 2 P 2
50 49 3ad2ant1 P 2 M N P 2
51 50 adantr P 2 M N ¬ M = 1 ¬ 2 M P 2
52 df-ne M 1 ¬ M = 1
53 eluz2b3 M 2 M M 1
54 53 simplbi2 M M 1 M 2
55 52 54 syl5bir M ¬ M = 1 M 2
56 55 3ad2ant2 P 2 M N ¬ M = 1 M 2
57 56 com12 ¬ M = 1 P 2 M N M 2
58 57 adantr ¬ M = 1 ¬ 2 M P 2 M N M 2
59 58 impcom P 2 M N ¬ M = 1 ¬ 2 M M 2
60 simprr P 2 M N ¬ M = 1 ¬ 2 M ¬ 2 M
61 lighneallem4b P 2 M 2 ¬ 2 M k = 0 M 1 1 k P k 2
62 51 59 60 61 syl3anc P 2 M N ¬ M = 1 ¬ 2 M k = 0 M 1 1 k P k 2
63 2 3ad2ant3 P 2 M N N 0
64 63 adantr P 2 M N ¬ M = 1 ¬ 2 M N 0
65 dvdsprmpweqnn 2 k = 0 M 1 1 k P k 2 N 0 k = 0 M 1 1 k P k 2 N n k = 0 M 1 1 k P k = 2 n
66 47 62 64 65 mp3an2i P 2 M N ¬ M = 1 ¬ 2 M k = 0 M 1 1 k P k 2 N n k = 0 M 1 1 k P k = 2 n
67 2z 2
68 67 a1i P 2 M N ¬ M = 1 ¬ 2 M 2
69 iddvdsexp 2 n 2 2 n
70 68 69 sylan P 2 M N ¬ M = 1 ¬ 2 M n 2 2 n
71 breq2 k = 0 M 1 1 k P k = 2 n 2 k = 0 M 1 1 k P k 2 2 n
72 71 adantl P 2 M N ¬ M = 1 ¬ 2 M n k = 0 M 1 1 k P k = 2 n 2 k = 0 M 1 1 k P k 2 2 n
73 fzfid P 2 M N ¬ M = 1 ¬ 2 M n 0 M 1 Fin
74 28 a1i P 1
75 74 31 sylan P k 0 1 k
76 nnnn0 P P 0
77 76 adantr P k 0 P 0
78 simpr P k 0 k 0
79 77 78 nn0expcld P k 0 P k 0
80 79 nn0zd P k 0 P k
81 75 80 zmulcld P k 0 1 k P k
82 81 ex P k 0 1 k P k
83 6 7 82 3syl P 2 k 0 1 k P k
84 83 3ad2ant1 P 2 M N k 0 1 k P k
85 84 ad2antrr P 2 M N ¬ M = 1 ¬ 2 M n k 0 1 k P k
86 85 30 impel P 2 M N ¬ M = 1 ¬ 2 M n k 0 M 1 1 k P k
87 nn0z k 0 k
88 m1expcl2 k 1 k 1 1
89 87 88 syl k 0 1 k 1 1
90 ovex 1 k V
91 90 elpr 1 k 1 1 1 k = 1 1 k = 1
92 n2dvdsm1 ¬ 2 -1
93 breq2 1 k = 1 2 1 k 2 -1
94 92 93 mtbiri 1 k = 1 ¬ 2 1 k
95 n2dvds1 ¬ 2 1
96 breq2 1 k = 1 2 1 k 2 1
97 95 96 mtbiri 1 k = 1 ¬ 2 1 k
98 94 97 jaoi 1 k = 1 1 k = 1 ¬ 2 1 k
99 98 a1d 1 k = 1 1 k = 1 k 0 ¬ 2 1 k
100 91 99 sylbi 1 k 1 1 k 0 ¬ 2 1 k
101 89 100 mpcom k 0 ¬ 2 1 k
102 101 adantl P 2 k 0 ¬ 2 1 k
103 elnn0 k 0 k k = 0
104 oddn2prm P 2 ¬ 2 P
105 104 adantr P 2 k ¬ 2 P
106 simpr P 2 k k
107 prmdvdsexp 2 P k 2 P k 2 P
108 47 34 106 107 mp3an2ani P 2 k 2 P k 2 P
109 105 108 mtbird P 2 k ¬ 2 P k
110 109 expcom k P 2 ¬ 2 P k
111 oveq2 k = 0 P k = P 0
112 111 adantr k = 0 P 2 P k = P 0
113 9 adantl k = 0 P 2 P
114 113 exp0d k = 0 P 2 P 0 = 1
115 112 114 eqtrd k = 0 P 2 P k = 1
116 115 breq2d k = 0 P 2 2 P k 2 1
117 95 116 mtbiri k = 0 P 2 ¬ 2 P k
118 117 ex k = 0 P 2 ¬ 2 P k
119 110 118 jaoi k k = 0 P 2 ¬ 2 P k
120 103 119 sylbi k 0 P 2 ¬ 2 P k
121 120 impcom P 2 k 0 ¬ 2 P k
122 ioran ¬ 2 1 k 2 P k ¬ 2 1 k ¬ 2 P k
123 102 121 122 sylanbrc P 2 k 0 ¬ 2 1 k 2 P k
124 28 31 mpan k 0 1 k
125 124 adantl P 2 k 0 1 k
126 6 7 76 3syl P 2 P 0
127 126 adantr P 2 k 0 P 0
128 simpr P 2 k 0 k 0
129 127 128 nn0expcld P 2 k 0 P k 0
130 129 nn0zd P 2 k 0 P k
131 euclemma 2 1 k P k 2 1 k P k 2 1 k 2 P k
132 47 125 130 131 mp3an2i P 2 k 0 2 1 k P k 2 1 k 2 P k
133 123 132 mtbird P 2 k 0 ¬ 2 1 k P k
134 133 ex P 2 k 0 ¬ 2 1 k P k
135 134 3ad2ant1 P 2 M N k 0 ¬ 2 1 k P k
136 135 ad2antrr P 2 M N ¬ M = 1 ¬ 2 M n k 0 ¬ 2 1 k P k
137 136 30 impel P 2 M N ¬ M = 1 ¬ 2 M n k 0 M 1 ¬ 2 1 k P k
138 nnm1nn0 M M 1 0
139 hashfz0 M 1 0 0 M 1 = M - 1 + 1
140 138 139 syl M 0 M 1 = M - 1 + 1
141 nncn M M
142 npcan1 M M - 1 + 1 = M
143 141 142 syl M M - 1 + 1 = M
144 140 143 eqtr2d M M = 0 M 1
145 144 3ad2ant2 P 2 M N M = 0 M 1
146 145 adantr P 2 M N ¬ M = 1 M = 0 M 1
147 146 breq2d P 2 M N ¬ M = 1 2 M 2 0 M 1
148 147 notbid P 2 M N ¬ M = 1 ¬ 2 M ¬ 2 0 M 1
149 148 biimpd P 2 M N ¬ M = 1 ¬ 2 M ¬ 2 0 M 1
150 149 impr P 2 M N ¬ M = 1 ¬ 2 M ¬ 2 0 M 1
151 150 adantr P 2 M N ¬ M = 1 ¬ 2 M n ¬ 2 0 M 1
152 73 86 137 151 oddsumodd P 2 M N ¬ M = 1 ¬ 2 M n ¬ 2 k = 0 M 1 1 k P k
153 152 pm2.21d P 2 M N ¬ M = 1 ¬ 2 M n 2 k = 0 M 1 1 k P k M = 1
154 153 adantr P 2 M N ¬ M = 1 ¬ 2 M n k = 0 M 1 1 k P k = 2 n 2 k = 0 M 1 1 k P k M = 1
155 72 154 sylbird P 2 M N ¬ M = 1 ¬ 2 M n k = 0 M 1 1 k P k = 2 n 2 2 n M = 1
156 155 ex P 2 M N ¬ M = 1 ¬ 2 M n k = 0 M 1 1 k P k = 2 n 2 2 n M = 1
157 70 156 mpid P 2 M N ¬ M = 1 ¬ 2 M n k = 0 M 1 1 k P k = 2 n M = 1
158 157 rexlimdva P 2 M N ¬ M = 1 ¬ 2 M n k = 0 M 1 1 k P k = 2 n M = 1
159 66 158 syld P 2 M N ¬ M = 1 ¬ 2 M k = 0 M 1 1 k P k 2 N M = 1
160 159 exp32 P 2 M N ¬ M = 1 ¬ 2 M k = 0 M 1 1 k P k 2 N M = 1
161 160 com12 ¬ M = 1 P 2 M N ¬ 2 M k = 0 M 1 1 k P k 2 N M = 1
162 161 impd ¬ M = 1 P 2 M N ¬ 2 M k = 0 M 1 1 k P k 2 N M = 1
163 46 162 pm2.61i P 2 M N ¬ 2 M k = 0 M 1 1 k P k 2 N M = 1
164 163 adantr P 2 M N ¬ 2 M P + 1 k = 0 M 1 1 k P k = 2 N k = 0 M 1 1 k P k 2 N M = 1
165 45 164 sylbid P 2 M N ¬ 2 M P + 1 k = 0 M 1 1 k P k = 2 N k = 0 M 1 1 k P k P + 1 k = 0 M 1 1 k P k M = 1
166 43 165 mpd P 2 M N ¬ 2 M P + 1 k = 0 M 1 1 k P k = 2 N M = 1
167 166 ex P 2 M N ¬ 2 M P + 1 k = 0 M 1 1 k P k = 2 N M = 1
168 22 167 sylbid P 2 M N ¬ 2 M P M + 1 = 2 N M = 1
169 17 168 sylbid P 2 M N ¬ 2 M 2 N 1 = P M M = 1
170 169 ex P 2 M N ¬ 2 M 2 N 1 = P M M = 1
171 170 adantld P 2 M N ¬ 2 N ¬ 2 M 2 N 1 = P M M = 1
172 171 3imp P 2 M N ¬ 2 N ¬ 2 M 2 N 1 = P M M = 1