Metamath Proof Explorer


Theorem perfectALTVlem2

Description: Lemma for perfectALTV . (Contributed by Mario Carneiro, 17-May-2016) (Revised by AV, 1-Jul-2020)

Ref Expression
Hypotheses perfectALTVlem.1 φ A
perfectALTVlem.2 φ B
perfectALTVlem.3 φ B Odd
perfectALTVlem.4 φ 1 σ 2 A B = 2 2 A B
Assertion perfectALTVlem2 φ B B = 2 A + 1 1

Proof

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