Metamath Proof Explorer


Theorem perfectlem2

Description: Lemma for perfect . (Contributed by Mario Carneiro, 17-May-2016) Replace OLD theorem. (Revised by Wolf Lammen, 17-Sep-2020)

Ref Expression
Hypotheses perfectlem.1 φ A
perfectlem.2 φ B
perfectlem.3 φ ¬ 2 B
perfectlem.4 φ 1 σ 2 A B = 2 2 A B
Assertion perfectlem2 φ B B = 2 A + 1 1

Proof

Step Hyp Ref Expression
1 perfectlem.1 φ A
2 perfectlem.2 φ B
3 perfectlem.3 φ ¬ 2 B
4 perfectlem.4 φ 1 σ 2 A B = 2 2 A B
5 1red φ 1
6 1 2 3 4 perfectlem1 φ 2 A + 1 2 A + 1 1 B 2 A + 1 1
7 6 simp3d φ B 2 A + 1 1
8 7 nnred φ B 2 A + 1 1
9 2 nnred φ B
10 7 nnge1d φ 1 B 2 A + 1 1
11 2cn 2
12 exp1 2 2 1 = 2
13 11 12 ax-mp 2 1 = 2
14 df-2 2 = 1 + 1
15 13 14 eqtri 2 1 = 1 + 1
16 2re 2
17 16 a1i φ 2
18 1zzd φ 1
19 1 peano2nnd φ A + 1
20 19 nnzd φ A + 1
21 1lt2 1 < 2
22 21 a1i φ 1 < 2
23 1re 1
24 1 nnrpd φ A +
25 ltaddrp 1 A + 1 < 1 + A
26 23 24 25 sylancr φ 1 < 1 + A
27 ax-1cn 1
28 1 nncnd φ A
29 addcom 1 A 1 + A = A + 1
30 27 28 29 sylancr φ 1 + A = A + 1
31 26 30 breqtrd φ 1 < A + 1
32 ltexp2a 2 1 A + 1 1 < 2 1 < A + 1 2 1 < 2 A + 1
33 17 18 20 22 31 32 syl32anc φ 2 1 < 2 A + 1
34 15 33 eqbrtrrid φ 1 + 1 < 2 A + 1
35 6 simp1d φ 2 A + 1
36 35 nnred φ 2 A + 1
37 5 5 36 ltaddsubd φ 1 + 1 < 2 A + 1 1 < 2 A + 1 1
38 34 37 mpbid φ 1 < 2 A + 1 1
39 0lt1 0 < 1
40 39 a1i φ 0 < 1
41 peano2rem 2 A + 1 2 A + 1 1
42 36 41 syl φ 2 A + 1 1
43 expgt1 2 A + 1 1 < 2 1 < 2 A + 1
44 16 19 22 43 mp3an2i φ 1 < 2 A + 1
45 posdif 1 2 A + 1 1 < 2 A + 1 0 < 2 A + 1 1
46 23 36 45 sylancr φ 1 < 2 A + 1 0 < 2 A + 1 1
47 44 46 mpbid φ 0 < 2 A + 1 1
48 2 nngt0d φ 0 < B
49 ltdiv2 1 0 < 1 2 A + 1 1 0 < 2 A + 1 1 B 0 < B 1 < 2 A + 1 1 B 2 A + 1 1 < B 1
50 5 40 42 47 9 48 49 syl222anc φ 1 < 2 A + 1 1 B 2 A + 1 1 < B 1
51 38 50 mpbid φ B 2 A + 1 1 < B 1
52 2 nncnd φ B
53 52 div1d φ B 1 = B
54 51 53 breqtrd φ B 2 A + 1 1 < B
55 5 8 9 10 54 lelttrd φ 1 < B
56 eluz2b2 B 2 B 1 < B
57 2 55 56 sylanbrc φ B 2
58 fzfid φ 1 B Fin
59 dvdsssfz1 B x | x B 1 B
60 2 59 syl φ x | x B 1 B
61 58 60 ssfid φ x | x B Fin
62 61 ad2antrr φ n n B ¬ n B 2 A + 1 1 B x | x B Fin
63 ssrab2 x | x B
64 63 a1i φ n n B ¬ n B 2 A + 1 1 B x | x B
65 64 sselda φ n n B ¬ n B 2 A + 1 1 B k x | x B k
66 65 nnred φ n n B ¬ n B 2 A + 1 1 B k x | x B k
67 65 nnnn0d φ n n B ¬ n B 2 A + 1 1 B k x | x B k 0
68 67 nn0ge0d φ n n B ¬ n B 2 A + 1 1 B k x | x B 0 k
69 df-tp B 2 A + 1 1 B n = B 2 A + 1 1 B n
70 7 2 prssd φ B 2 A + 1 1 B
71 70 ad2antrr φ n n B ¬ n B 2 A + 1 1 B B 2 A + 1 1 B
72 simplrl φ n n B ¬ n B 2 A + 1 1 B n
73 72 snssd φ n n B ¬ n B 2 A + 1 1 B n
74 71 73 unssd φ n n B ¬ n B 2 A + 1 1 B B 2 A + 1 1 B n
75 69 74 eqsstrid φ n n B ¬ n B 2 A + 1 1 B B 2 A + 1 1 B n
76 6 simp2d φ 2 A + 1 1
77 76 nnzd φ 2 A + 1 1
78 7 nnzd φ B 2 A + 1 1
79 dvdsmul2 2 A + 1 1 B 2 A + 1 1 B 2 A + 1 1 2 A + 1 1 B 2 A + 1 1
80 77 78 79 syl2anc φ B 2 A + 1 1 2 A + 1 1 B 2 A + 1 1
81 76 nncnd φ 2 A + 1 1
82 76 nnne0d φ 2 A + 1 1 0
83 52 81 82 divcan2d φ 2 A + 1 1 B 2 A + 1 1 = B
84 80 83 breqtrd φ B 2 A + 1 1 B
85 breq1 x = B 2 A + 1 1 x B B 2 A + 1 1 B
86 84 85 syl5ibrcom φ x = B 2 A + 1 1 x B
87 86 ad2antrr φ n n B ¬ n B 2 A + 1 1 B x = B 2 A + 1 1 x B
88 2 nnzd φ B
89 iddvds B B B
90 88 89 syl φ B B
91 breq1 x = B x B B B
92 90 91 syl5ibrcom φ x = B x B
93 92 ad2antrr φ n n B ¬ n B 2 A + 1 1 B x = B x B
94 simplrr φ n n B ¬ n B 2 A + 1 1 B n B
95 breq1 x = n x B n B
96 94 95 syl5ibrcom φ n n B ¬ n B 2 A + 1 1 B x = n x B
97 87 93 96 3jaod φ n n B ¬ n B 2 A + 1 1 B x = B 2 A + 1 1 x = B x = n x B
98 eltpi x B 2 A + 1 1 B n x = B 2 A + 1 1 x = B x = n
99 97 98 impel φ n n B ¬ n B 2 A + 1 1 B x B 2 A + 1 1 B n x B
100 75 99 ssrabdv φ n n B ¬ n B 2 A + 1 1 B B 2 A + 1 1 B n x | x B
101 62 66 68 100 fsumless φ n n B ¬ n B 2 A + 1 1 B k B 2 A + 1 1 B n k k x | x B k
102 simpr φ n n B ¬ n B 2 A + 1 1 B ¬ n B 2 A + 1 1 B
103 disjsn B 2 A + 1 1 B n = ¬ n B 2 A + 1 1 B
104 102 103 sylibr φ n n B ¬ n B 2 A + 1 1 B B 2 A + 1 1 B n =
105 69 a1i φ n n B ¬ n B 2 A + 1 1 B B 2 A + 1 1 B n = B 2 A + 1 1 B n
106 tpfi B 2 A + 1 1 B n Fin
107 106 a1i φ n n B ¬ n B 2 A + 1 1 B B 2 A + 1 1 B n Fin
108 75 sselda φ n n B ¬ n B 2 A + 1 1 B k B 2 A + 1 1 B n k
109 108 nncnd φ n n B ¬ n B 2 A + 1 1 B k B 2 A + 1 1 B n k
110 104 105 107 109 fsumsplit φ n n B ¬ n B 2 A + 1 1 B k B 2 A + 1 1 B n k = k B 2 A + 1 1 B k + k n k
111 7 nncnd φ B 2 A + 1 1
112 id k = B 2 A + 1 1 k = B 2 A + 1 1
113 112 sumsn B 2 A + 1 1 B 2 A + 1 1 k B 2 A + 1 1 k = B 2 A + 1 1
114 7 111 113 syl2anc φ k B 2 A + 1 1 k = B 2 A + 1 1
115 id k = B k = B
116 115 sumsn B B k B k = B
117 2 52 116 syl2anc φ k B k = B
118 114 117 oveq12d φ k B 2 A + 1 1 k + k B k = B 2 A + 1 1 + B
119 incom B B 2 A + 1 1 = B 2 A + 1 1 B
120 8 54 gtned φ B B 2 A + 1 1
121 disjsn2 B B 2 A + 1 1 B B 2 A + 1 1 =
122 120 121 syl φ B B 2 A + 1 1 =
123 119 122 eqtr3id φ B 2 A + 1 1 B =
124 df-pr B 2 A + 1 1 B = B 2 A + 1 1 B
125 124 a1i φ B 2 A + 1 1 B = B 2 A + 1 1 B
126 prfi B 2 A + 1 1 B Fin
127 126 a1i φ B 2 A + 1 1 B Fin
128 70 sselda φ k B 2 A + 1 1 B k
129 128 nncnd φ k B 2 A + 1 1 B k
130 123 125 127 129 fsumsplit φ k B 2 A + 1 1 B k = k B 2 A + 1 1 k + k B k
131 81 52 mulcld φ 2 A + 1 1 B
132 52 131 81 82 divdird φ B + 2 A + 1 1 B 2 A + 1 1 = B 2 A + 1 1 + 2 A + 1 1 B 2 A + 1 1
133 35 nncnd φ 2 A + 1
134 1cnd φ 1
135 133 134 52 subdird φ 2 A + 1 1 B = 2 A + 1 B 1 B
136 52 mulid2d φ 1 B = B
137 136 oveq2d φ 2 A + 1 B 1 B = 2 A + 1 B B
138 135 137 eqtrd φ 2 A + 1 1 B = 2 A + 1 B B
139 138 oveq2d φ B + 2 A + 1 1 B = B + 2 A + 1 B - B
140 133 52 mulcld φ 2 A + 1 B
141 52 140 pncan3d φ B + 2 A + 1 B - B = 2 A + 1 B
142 139 141 eqtrd φ B + 2 A + 1 1 B = 2 A + 1 B
143 142 oveq1d φ B + 2 A + 1 1 B 2 A + 1 1 = 2 A + 1 B 2 A + 1 1
144 133 52 81 82 divassd φ 2 A + 1 B 2 A + 1 1 = 2 A + 1 B 2 A + 1 1
145 143 144 eqtrd φ B + 2 A + 1 1 B 2 A + 1 1 = 2 A + 1 B 2 A + 1 1
146 52 81 82 divcan3d φ 2 A + 1 1 B 2 A + 1 1 = B
147 146 oveq2d φ B 2 A + 1 1 + 2 A + 1 1 B 2 A + 1 1 = B 2 A + 1 1 + B
148 132 145 147 3eqtr3d φ 2 A + 1 B 2 A + 1 1 = B 2 A + 1 1 + B
149 118 130 148 3eqtr4d φ k B 2 A + 1 1 B k = 2 A + 1 B 2 A + 1 1
150 149 ad2antrr φ n n B ¬ n B 2 A + 1 1 B k B 2 A + 1 1 B k = 2 A + 1 B 2 A + 1 1
151 72 nncnd φ n n B ¬ n B 2 A + 1 1 B n
152 id k = n k = n
153 152 sumsn n n k n k = n
154 151 151 153 syl2anc φ n n B ¬ n B 2 A + 1 1 B k n k = n
155 150 154 oveq12d φ n n B ¬ n B 2 A + 1 1 B k B 2 A + 1 1 B k + k n k = 2 A + 1 B 2 A + 1 1 + n
156 110 155 eqtrd φ n n B ¬ n B 2 A + 1 1 B k B 2 A + 1 1 B n k = 2 A + 1 B 2 A + 1 1 + n
157 1 nnnn0d φ A 0
158 expp1 2 A 0 2 A + 1 = 2 A 2
159 11 157 158 sylancr φ 2 A + 1 = 2 A 2
160 2nn 2
161 nnexpcl 2 A 0 2 A
162 160 157 161 sylancr φ 2 A
163 162 nncnd φ 2 A
164 mulcom 2 A 2 2 A 2 = 2 2 A
165 163 11 164 sylancl φ 2 A 2 = 2 2 A
166 159 165 eqtrd φ 2 A + 1 = 2 2 A
167 166 oveq1d φ 2 A + 1 B = 2 2 A B
168 2cnd φ 2
169 168 163 52 mulassd φ 2 2 A B = 2 2 A B
170 2prm 2
171 coprm 2 B ¬ 2 B 2 gcd B = 1
172 170 88 171 sylancr φ ¬ 2 B 2 gcd B = 1
173 3 172 mpbid φ 2 gcd B = 1
174 2z 2
175 rpexp1i 2 B A 0 2 gcd B = 1 2 A gcd B = 1
176 174 88 157 175 mp3an2i φ 2 gcd B = 1 2 A gcd B = 1
177 173 176 mpd φ 2 A gcd B = 1
178 sgmmul 1 2 A B 2 A gcd B = 1 1 σ 2 A B = 1 σ 2 A 1 σ B
179 134 162 2 177 178 syl13anc φ 1 σ 2 A B = 1 σ 2 A 1 σ B
180 pncan A 1 A + 1 - 1 = A
181 28 27 180 sylancl φ A + 1 - 1 = A
182 181 oveq2d φ 2 A + 1 - 1 = 2 A
183 182 oveq2d φ 1 σ 2 A + 1 - 1 = 1 σ 2 A
184 1sgm2ppw A + 1 1 σ 2 A + 1 - 1 = 2 A + 1 1
185 19 184 syl φ 1 σ 2 A + 1 - 1 = 2 A + 1 1
186 183 185 eqtr3d φ 1 σ 2 A = 2 A + 1 1
187 186 oveq1d φ 1 σ 2 A 1 σ B = 2 A + 1 1 1 σ B
188 179 4 187 3eqtr3d φ 2 2 A B = 2 A + 1 1 1 σ B
189 167 169 188 3eqtrd φ 2 A + 1 B = 2 A + 1 1 1 σ B
190 189 oveq1d φ 2 A + 1 B 2 A + 1 1 = 2 A + 1 1 1 σ B 2 A + 1 1
191 1nn0 1 0
192 sgmnncl 1 0 B 1 σ B
193 191 2 192 sylancr φ 1 σ B
194 193 nncnd φ 1 σ B
195 194 81 82 divcan3d φ 2 A + 1 1 1 σ B 2 A + 1 1 = 1 σ B
196 190 144 195 3eqtr3d φ 2 A + 1 B 2 A + 1 1 = 1 σ B
197 sgmval 1 B 1 σ B = k x | x B k 1
198 27 2 197 sylancr φ 1 σ B = k x | x B k 1
199 simpr φ k x | x B k x | x B
200 63 199 sselid φ k x | x B k
201 200 nncnd φ k x | x B k
202 201 cxp1d φ k x | x B k 1 = k
203 202 sumeq2dv φ k x | x B k 1 = k x | x B k
204 196 198 203 3eqtrrd φ k x | x B k = 2 A + 1 B 2 A + 1 1
205 204 ad2antrr φ n n B ¬ n B 2 A + 1 1 B k x | x B k = 2 A + 1 B 2 A + 1 1
206 101 156 205 3brtr3d φ n n B ¬ n B 2 A + 1 1 B 2 A + 1 B 2 A + 1 1 + n 2 A + 1 B 2 A + 1 1
207 36 8 remulcld φ 2 A + 1 B 2 A + 1 1
208 207 ad2antrr φ n n B ¬ n B 2 A + 1 1 B 2 A + 1 B 2 A + 1 1
209 72 nnrpd φ n n B ¬ n B 2 A + 1 1 B n +
210 208 209 ltaddrpd φ n n B ¬ n B 2 A + 1 1 B 2 A + 1 B 2 A + 1 1 < 2 A + 1 B 2 A + 1 1 + n
211 72 nnred φ n n B ¬ n B 2 A + 1 1 B n
212 208 211 readdcld φ n n B ¬ n B 2 A + 1 1 B 2 A + 1 B 2 A + 1 1 + n
213 208 212 ltnled φ n n B ¬ n B 2 A + 1 1 B 2 A + 1 B 2 A + 1 1 < 2 A + 1 B 2 A + 1 1 + n ¬ 2 A + 1 B 2 A + 1 1 + n 2 A + 1 B 2 A + 1 1
214 210 213 mpbid φ n n B ¬ n B 2 A + 1 1 B ¬ 2 A + 1 B 2 A + 1 1 + n 2 A + 1 B 2 A + 1 1
215 206 214 condan φ n n B n B 2 A + 1 1 B
216 elpri n B 2 A + 1 1 B n = B 2 A + 1 1 n = B
217 215 216 syl φ n n B n = B 2 A + 1 1 n = B
218 217 expr φ n n B n = B 2 A + 1 1 n = B
219 218 ralrimiva φ n n B n = B 2 A + 1 1 n = B
220 5 55 gtned φ B 1
221 220 necomd φ 1 B
222 1dvds B 1 B
223 88 222 syl φ 1 B
224 breq1 n = 1 n B 1 B
225 eqeq1 n = 1 n = B 2 A + 1 1 1 = B 2 A + 1 1
226 eqeq1 n = 1 n = B 1 = B
227 225 226 orbi12d n = 1 n = B 2 A + 1 1 n = B 1 = B 2 A + 1 1 1 = B
228 224 227 imbi12d n = 1 n B n = B 2 A + 1 1 n = B 1 B 1 = B 2 A + 1 1 1 = B
229 1nn 1
230 229 a1i φ 1
231 228 219 230 rspcdva φ 1 B 1 = B 2 A + 1 1 1 = B
232 223 231 mpd φ 1 = B 2 A + 1 1 1 = B
233 232 ord φ ¬ 1 = B 2 A + 1 1 1 = B
234 233 necon1ad φ 1 B 1 = B 2 A + 1 1
235 221 234 mpd φ 1 = B 2 A + 1 1
236 235 eqeq2d φ n = 1 n = B 2 A + 1 1
237 236 orbi1d φ n = 1 n = B n = B 2 A + 1 1 n = B
238 237 imbi2d φ n B n = 1 n = B n B n = B 2 A + 1 1 n = B
239 238 ralbidv φ n n B n = 1 n = B n n B n = B 2 A + 1 1 n = B
240 219 239 mpbird φ n n B n = 1 n = B
241 isprm2 B B 2 n n B n = 1 n = B
242 57 240 241 sylanbrc φ B
243 207 ltp1d φ 2 A + 1 B 2 A + 1 1 < 2 A + 1 B 2 A + 1 1 + 1
244 peano2re 2 A + 1 B 2 A + 1 1 2 A + 1 B 2 A + 1 1 + 1
245 207 244 syl φ 2 A + 1 B 2 A + 1 1 + 1
246 207 245 ltnled φ 2 A + 1 B 2 A + 1 1 < 2 A + 1 B 2 A + 1 1 + 1 ¬ 2 A + 1 B 2 A + 1 1 + 1 2 A + 1 B 2 A + 1 1
247 243 246 mpbid φ ¬ 2 A + 1 B 2 A + 1 1 + 1 2 A + 1 B 2 A + 1 1
248 200 nnred φ k x | x B k
249 200 nnnn0d φ k x | x B k 0
250 249 nn0ge0d φ k x | x B 0 k
251 df-tp B 2 A + 1 1 B 1 = B 2 A + 1 1 B 1
252 snssi 1 1
253 229 252 mp1i φ 1
254 70 253 unssd φ B 2 A + 1 1 B 1
255 251 254 eqsstrid φ B 2 A + 1 1 B 1
256 breq1 x = 1 x B 1 B
257 223 256 syl5ibrcom φ x = 1 x B
258 86 92 257 3jaod φ x = B 2 A + 1 1 x = B x = 1 x B
259 eltpi x B 2 A + 1 1 B 1 x = B 2 A + 1 1 x = B x = 1
260 258 259 impel φ x B 2 A + 1 1 B 1 x B
261 255 260 ssrabdv φ B 2 A + 1 1 B 1 x | x B
262 61 248 250 261 fsumless φ k B 2 A + 1 1 B 1 k k x | x B k
263 262 adantr φ B 2 A + 1 1 k B 2 A + 1 1 B 1 k k x | x B k
264 52 81 82 diveq1ad φ B 2 A + 1 1 = 1 B = 2 A + 1 1
265 264 necon3bid φ B 2 A + 1 1 1 B 2 A + 1 1
266 265 biimpar φ B 2 A + 1 1 B 2 A + 1 1 1
267 266 necomd φ B 2 A + 1 1 1 B 2 A + 1 1
268 221 adantr φ B 2 A + 1 1 1 B
269 267 268 nelprd φ B 2 A + 1 1 ¬ 1 B 2 A + 1 1 B
270 disjsn B 2 A + 1 1 B 1 = ¬ 1 B 2 A + 1 1 B
271 269 270 sylibr φ B 2 A + 1 1 B 2 A + 1 1 B 1 =
272 251 a1i φ B 2 A + 1 1 B 2 A + 1 1 B 1 = B 2 A + 1 1 B 1
273 tpfi B 2 A + 1 1 B 1 Fin
274 273 a1i φ B 2 A + 1 1 B 2 A + 1 1 B 1 Fin
275 255 adantr φ B 2 A + 1 1 B 2 A + 1 1 B 1
276 275 sselda φ B 2 A + 1 1 k B 2 A + 1 1 B 1 k
277 276 nncnd φ B 2 A + 1 1 k B 2 A + 1 1 B 1 k
278 271 272 274 277 fsumsplit φ B 2 A + 1 1 k B 2 A + 1 1 B 1 k = k B 2 A + 1 1 B k + k 1 k
279 id k = 1 k = 1
280 279 sumsn 1 1 k 1 k = 1
281 5 27 280 sylancl φ k 1 k = 1
282 149 281 oveq12d φ k B 2 A + 1 1 B k + k 1 k = 2 A + 1 B 2 A + 1 1 + 1
283 282 adantr φ B 2 A + 1 1 k B 2 A + 1 1 B k + k 1 k = 2 A + 1 B 2 A + 1 1 + 1
284 278 283 eqtrd φ B 2 A + 1 1 k B 2 A + 1 1 B 1 k = 2 A + 1 B 2 A + 1 1 + 1
285 204 adantr φ B 2 A + 1 1 k x | x B k = 2 A + 1 B 2 A + 1 1
286 263 284 285 3brtr3d φ B 2 A + 1 1 2 A + 1 B 2 A + 1 1 + 1 2 A + 1 B 2 A + 1 1
287 286 ex φ B 2 A + 1 1 2 A + 1 B 2 A + 1 1 + 1 2 A + 1 B 2 A + 1 1
288 287 necon1bd φ ¬ 2 A + 1 B 2 A + 1 1 + 1 2 A + 1 B 2 A + 1 1 B = 2 A + 1 1
289 247 288 mpd φ B = 2 A + 1 1
290 242 289 jca φ B B = 2 A + 1 1