Metamath Proof Explorer


Theorem ppiub

Description: An upper bound on the prime-counting function ppi , which counts the number of primes less than N . (Contributed by Mario Carneiro, 13-Mar-2014)

Ref Expression
Assertion ppiub N 0 N π _ N N 3 + 2

Proof

Step Hyp Ref Expression
1 3re 3
2 1 a1i N 0 N 3
3 simpl N 0 N N
4 ppicl N π _ N 0
5 4 nn0red N π _ N
6 5 adantr N 3 N π _ N
7 2re 2
8 resubcl π _ N 2 π _ N 2
9 6 7 8 sylancl N 3 N π _ N 2
10 fzfi 4 N Fin
11 ssrab2 k 4 N | k mod 6 1 5 4 N
12 ssfi 4 N Fin k 4 N | k mod 6 1 5 4 N k 4 N | k mod 6 1 5 Fin
13 10 11 12 mp2an k 4 N | k mod 6 1 5 Fin
14 hashcl k 4 N | k mod 6 1 5 Fin k 4 N | k mod 6 1 5 0
15 13 14 ax-mp k 4 N | k mod 6 1 5 0
16 15 nn0rei k 4 N | k mod 6 1 5
17 16 a1i N 3 N k 4 N | k mod 6 1 5
18 3nn 3
19 nndivre N 3 N 3
20 18 19 mpan2 N N 3
21 20 adantr N 3 N N 3
22 ppifl N π _ N = π _ N
23 22 adantr N 3 N π _ N = π _ N
24 ppi3 π _ 3 = 2
25 24 a1i N 3 N π _ 3 = 2
26 23 25 oveq12d N 3 N π _ N π _ 3 = π _ N 2
27 3z 3
28 27 a1i N 3 N 3
29 flcl N N
30 29 adantr N 3 N N
31 flge N 3 3 N 3 N
32 27 31 mpan2 N 3 N 3 N
33 32 biimpa N 3 N 3 N
34 eluz2 N 3 3 N 3 N
35 28 30 33 34 syl3anbrc N 3 N N 3
36 ppidif N 3 π _ N π _ 3 = 3 + 1 N
37 35 36 syl N 3 N π _ N π _ 3 = 3 + 1 N
38 df-4 4 = 3 + 1
39 38 oveq1i 4 N = 3 + 1 N
40 39 ineq1i 4 N = 3 + 1 N
41 40 fveq2i 4 N = 3 + 1 N
42 37 41 eqtr4di N 3 N π _ N π _ 3 = 4 N
43 26 42 eqtr3d N 3 N π _ N 2 = 4 N
44 dfin5 4 N = k 4 N | k
45 elfzle1 k 4 N 4 k
46 ppiublem2 k 4 k k mod 6 1 5
47 46 expcom 4 k k k mod 6 1 5
48 45 47 syl k 4 N k k mod 6 1 5
49 48 ss2rabi k 4 N | k k 4 N | k mod 6 1 5
50 44 49 eqsstri 4 N k 4 N | k mod 6 1 5
51 ssdomg k 4 N | k mod 6 1 5 Fin 4 N k 4 N | k mod 6 1 5 4 N k 4 N | k mod 6 1 5
52 13 50 51 mp2 4 N k 4 N | k mod 6 1 5
53 inss1 4 N 4 N
54 ssfi 4 N Fin 4 N 4 N 4 N Fin
55 10 53 54 mp2an 4 N Fin
56 hashdom 4 N Fin k 4 N | k mod 6 1 5 Fin 4 N k 4 N | k mod 6 1 5 4 N k 4 N | k mod 6 1 5
57 55 13 56 mp2an 4 N k 4 N | k mod 6 1 5 4 N k 4 N | k mod 6 1 5
58 52 57 mpbir 4 N k 4 N | k mod 6 1 5
59 43 58 eqbrtrdi N 3 N π _ N 2 k 4 N | k mod 6 1 5
60 reflcl N N
61 60 adantr N 3 N N
62 peano2rem N N 1
63 61 62 syl N 3 N N 1
64 6nn 6
65 nndivre N 1 6 N 1 6
66 63 64 65 sylancl N 3 N N 1 6
67 reflcl N 1 6 N 1 6
68 66 67 syl N 3 N N 1 6
69 5re 5
70 resubcl N 5 N 5
71 61 69 70 sylancl N 3 N N 5
72 nndivre N 5 6 N 5 6
73 71 64 72 sylancl N 3 N N 5 6
74 reflcl N 5 6 N 5 6
75 73 74 syl N 3 N N 5 6
76 peano2re N 5 6 N 5 6 + 1
77 75 76 syl N 3 N N 5 6 + 1
78 peano2rem N N 1
79 78 adantr N 3 N N 1
80 nndivre N 1 6 N 1 6
81 79 64 80 sylancl N 3 N N 1 6
82 simpl N 3 N N
83 resubcl N 5 N 5
84 82 69 83 sylancl N 3 N N 5
85 nndivre N 5 6 N 5 6
86 84 64 85 sylancl N 3 N N 5 6
87 peano2re N 5 6 N 5 6 + 1
88 86 87 syl N 3 N N 5 6 + 1
89 flle N 1 6 N 1 6 N 1 6
90 66 89 syl N 3 N N 1 6 N 1 6
91 1re 1
92 91 a1i N 3 N 1
93 flle N N N
94 93 adantr N 3 N N N
95 61 82 92 94 lesub1dd N 3 N N 1 N 1
96 6re 6
97 96 a1i N 3 N 6
98 6pos 0 < 6
99 98 a1i N 3 N 0 < 6
100 lediv1 N 1 N 1 6 0 < 6 N 1 N 1 N 1 6 N 1 6
101 63 79 97 99 100 syl112anc N 3 N N 1 N 1 N 1 6 N 1 6
102 95 101 mpbid N 3 N N 1 6 N 1 6
103 68 66 81 90 102 letrd N 3 N N 1 6 N 1 6
104 flle N 5 6 N 5 6 N 5 6
105 73 104 syl N 3 N N 5 6 N 5 6
106 69 a1i N 3 N 5
107 61 82 106 94 lesub1dd N 3 N N 5 N 5
108 lediv1 N 5 N 5 6 0 < 6 N 5 N 5 N 5 6 N 5 6
109 71 84 97 99 108 syl112anc N 3 N N 5 N 5 N 5 6 N 5 6
110 107 109 mpbid N 3 N N 5 6 N 5 6
111 75 73 86 105 110 letrd N 3 N N 5 6 N 5 6
112 75 86 92 111 leadd1dd N 3 N N 5 6 + 1 N 5 6 + 1
113 68 77 81 88 103 112 le2addd N 3 N N 1 6 + N 5 6 + 1 N 1 6 + N 5 6 + 1
114 ovex k mod 6 V
115 114 elpr k mod 6 1 5 k mod 6 = 1 k mod 6 = 5
116 115 rabbii k 4 N | k mod 6 1 5 = k 4 N | k mod 6 = 1 k mod 6 = 5
117 unrab k 4 N | k mod 6 = 1 k 4 N | k mod 6 = 5 = k 4 N | k mod 6 = 1 k mod 6 = 5
118 116 117 eqtr4i k 4 N | k mod 6 1 5 = k 4 N | k mod 6 = 1 k 4 N | k mod 6 = 5
119 118 fveq2i k 4 N | k mod 6 1 5 = k 4 N | k mod 6 = 1 k 4 N | k mod 6 = 5
120 ssrab2 k 4 N | k mod 6 = 1 4 N
121 ssfi 4 N Fin k 4 N | k mod 6 = 1 4 N k 4 N | k mod 6 = 1 Fin
122 10 120 121 mp2an k 4 N | k mod 6 = 1 Fin
123 ssrab2 k 4 N | k mod 6 = 5 4 N
124 ssfi 4 N Fin k 4 N | k mod 6 = 5 4 N k 4 N | k mod 6 = 5 Fin
125 10 123 124 mp2an k 4 N | k mod 6 = 5 Fin
126 inrab k 4 N | k mod 6 = 1 k 4 N | k mod 6 = 5 = k 4 N | k mod 6 = 1 k mod 6 = 5
127 rabeq0 k 4 N | k mod 6 = 1 k mod 6 = 5 = k 4 N ¬ k mod 6 = 1 k mod 6 = 5
128 1lt5 1 < 5
129 91 128 ltneii 1 5
130 eqtr2 k mod 6 = 1 k mod 6 = 5 1 = 5
131 130 necon3ai 1 5 ¬ k mod 6 = 1 k mod 6 = 5
132 129 131 ax-mp ¬ k mod 6 = 1 k mod 6 = 5
133 132 a1i k 4 N ¬ k mod 6 = 1 k mod 6 = 5
134 127 133 mprgbir k 4 N | k mod 6 = 1 k mod 6 = 5 =
135 126 134 eqtri k 4 N | k mod 6 = 1 k 4 N | k mod 6 = 5 =
136 hashun k 4 N | k mod 6 = 1 Fin k 4 N | k mod 6 = 5 Fin k 4 N | k mod 6 = 1 k 4 N | k mod 6 = 5 = k 4 N | k mod 6 = 1 k 4 N | k mod 6 = 5 = k 4 N | k mod 6 = 1 + k 4 N | k mod 6 = 5
137 122 125 135 136 mp3an k 4 N | k mod 6 = 1 k 4 N | k mod 6 = 5 = k 4 N | k mod 6 = 1 + k 4 N | k mod 6 = 5
138 119 137 eqtri k 4 N | k mod 6 1 5 = k 4 N | k mod 6 = 1 + k 4 N | k mod 6 = 5
139 elfzelz k 4 N k
140 nnrp 6 6 +
141 64 140 ax-mp 6 +
142 0le1 0 1
143 1lt6 1 < 6
144 modid 1 6 + 0 1 1 < 6 1 mod 6 = 1
145 91 141 142 143 144 mp4an 1 mod 6 = 1
146 145 eqeq2i k mod 6 = 1 mod 6 k mod 6 = 1
147 1z 1
148 moddvds 6 k 1 k mod 6 = 1 mod 6 6 k 1
149 64 147 148 mp3an13 k k mod 6 = 1 mod 6 6 k 1
150 146 149 bitr3id k k mod 6 = 1 6 k 1
151 139 150 syl k 4 N k mod 6 = 1 6 k 1
152 151 rabbiia k 4 N | k mod 6 = 1 = k 4 N | 6 k 1
153 152 fveq2i k 4 N | k mod 6 = 1 = k 4 N | 6 k 1
154 64 a1i N 3 N 6
155 4z 4
156 155 a1i N 3 N 4
157 4m1e3 4 1 = 3
158 157 fveq2i 4 1 = 3
159 35 158 eleqtrrdi N 3 N N 4 1
160 147 a1i N 3 N 1
161 154 156 159 160 hashdvds N 3 N k 4 N | 6 k 1 = N 1 6 4 - 1 - 1 6
162 153 161 syl5eq N 3 N k 4 N | k mod 6 = 1 = N 1 6 4 - 1 - 1 6
163 2cn 2
164 ax-1cn 1
165 df-3 3 = 2 + 1
166 157 165 eqtri 4 1 = 2 + 1
167 163 164 166 mvrraddi 4 - 1 - 1 = 2
168 167 oveq1i 4 - 1 - 1 6 = 2 6
169 168 fveq2i 4 - 1 - 1 6 = 2 6
170 0re 0
171 64 nnne0i 6 0
172 7 96 171 redivcli 2 6
173 2pos 0 < 2
174 7 96 173 98 divgt0ii 0 < 2 6
175 170 172 174 ltleii 0 2 6
176 2lt6 2 < 6
177 6cn 6
178 177 mulid1i 6 1 = 6
179 176 178 breqtrri 2 < 6 1
180 96 98 pm3.2i 6 0 < 6
181 ltdivmul 2 1 6 0 < 6 2 6 < 1 2 < 6 1
182 7 91 180 181 mp3an 2 6 < 1 2 < 6 1
183 179 182 mpbir 2 6 < 1
184 1e0p1 1 = 0 + 1
185 183 184 breqtri 2 6 < 0 + 1
186 0z 0
187 flbi 2 6 0 2 6 = 0 0 2 6 2 6 < 0 + 1
188 172 186 187 mp2an 2 6 = 0 0 2 6 2 6 < 0 + 1
189 175 185 188 mpbir2an 2 6 = 0
190 169 189 eqtri 4 - 1 - 1 6 = 0
191 190 oveq2i N 1 6 4 - 1 - 1 6 = N 1 6 0
192 66 flcld N 3 N N 1 6
193 192 zcnd N 3 N N 1 6
194 193 subid1d N 3 N N 1 6 0 = N 1 6
195 191 194 syl5eq N 3 N N 1 6 4 - 1 - 1 6 = N 1 6
196 162 195 eqtrd N 3 N k 4 N | k mod 6 = 1 = N 1 6
197 5pos 0 < 5
198 170 69 197 ltleii 0 5
199 5lt6 5 < 6
200 modid 5 6 + 0 5 5 < 6 5 mod 6 = 5
201 69 141 198 199 200 mp4an 5 mod 6 = 5
202 201 eqeq2i k mod 6 = 5 mod 6 k mod 6 = 5
203 5nn 5
204 203 nnzi 5
205 moddvds 6 k 5 k mod 6 = 5 mod 6 6 k 5
206 64 204 205 mp3an13 k k mod 6 = 5 mod 6 6 k 5
207 202 206 bitr3id k k mod 6 = 5 6 k 5
208 139 207 syl k 4 N k mod 6 = 5 6 k 5
209 208 rabbiia k 4 N | k mod 6 = 5 = k 4 N | 6 k 5
210 209 fveq2i k 4 N | k mod 6 = 5 = k 4 N | 6 k 5
211 204 a1i N 3 N 5
212 154 156 159 211 hashdvds N 3 N k 4 N | 6 k 5 = N 5 6 4 - 1 - 5 6
213 210 212 syl5eq N 3 N k 4 N | k mod 6 = 5 = N 5 6 4 - 1 - 5 6
214 157 oveq1i 4 - 1 - 5 = 3 5
215 5cn 5
216 3cn 3
217 215 216 negsubdi2i 5 3 = 3 5
218 3p2e5 3 + 2 = 5
219 218 oveq1i 3 + 2 - 3 = 5 3
220 pncan2 3 2 3 + 2 - 3 = 2
221 216 163 220 mp2an 3 + 2 - 3 = 2
222 219 221 eqtr3i 5 3 = 2
223 222 negeqi 5 3 = 2
224 214 217 223 3eqtr2i 4 - 1 - 5 = 2
225 224 oveq1i 4 - 1 - 5 6 = 2 6
226 divneg 2 6 6 0 2 6 = 2 6
227 163 177 171 226 mp3an 2 6 = 2 6
228 225 227 eqtr4i 4 - 1 - 5 6 = 2 6
229 228 fveq2i 4 - 1 - 5 6 = 2 6
230 172 91 183 ltleii 2 6 1
231 172 91 lenegi 2 6 1 1 2 6
232 230 231 mpbi 1 2 6
233 170 172 ltnegi 0 < 2 6 2 6 < 0
234 174 233 mpbi 2 6 < 0
235 neg0 0 = 0
236 1pneg1e0 1 + -1 = 0
237 235 236 eqtr4i 0 = 1 + -1
238 neg1cn 1
239 238 164 addcomi - 1 + 1 = 1 + -1
240 237 239 eqtr4i 0 = - 1 + 1
241 234 240 breqtri 2 6 < - 1 + 1
242 172 renegcli 2 6
243 neg1z 1
244 flbi 2 6 1 2 6 = 1 1 2 6 2 6 < - 1 + 1
245 242 243 244 mp2an 2 6 = 1 1 2 6 2 6 < - 1 + 1
246 232 241 245 mpbir2an 2 6 = 1
247 229 246 eqtri 4 - 1 - 5 6 = 1
248 247 oveq2i N 5 6 4 - 1 - 5 6 = N 5 6 -1
249 73 flcld N 3 N N 5 6
250 249 zcnd N 3 N N 5 6
251 subneg N 5 6 1 N 5 6 -1 = N 5 6 + 1
252 250 164 251 sylancl N 3 N N 5 6 -1 = N 5 6 + 1
253 248 252 syl5eq N 3 N N 5 6 4 - 1 - 5 6 = N 5 6 + 1
254 213 253 eqtrd N 3 N k 4 N | k mod 6 = 5 = N 5 6 + 1
255 196 254 oveq12d N 3 N k 4 N | k mod 6 = 1 + k 4 N | k mod 6 = 5 = N 1 6 + N 5 6 + 1
256 138 255 syl5eq N 3 N k 4 N | k mod 6 1 5 = N 1 6 + N 5 6 + 1
257 82 recnd N 3 N N
258 257 2timesd N 3 N 2 N = N + N
259 df-6 6 = 5 + 1
260 215 164 addcomi 5 + 1 = 1 + 5
261 259 260 eqtri 6 = 1 + 5
262 261 a1i N 3 N 6 = 1 + 5
263 258 262 oveq12d N 3 N 2 N 6 = N + N - 1 + 5
264 addsub4 N N 1 5 N + N - 1 + 5 = N 1 + N - 5
265 164 215 264 mpanr12 N N N + N - 1 + 5 = N 1 + N - 5
266 257 257 265 syl2anc N 3 N N + N - 1 + 5 = N 1 + N - 5
267 263 266 eqtrd N 3 N 2 N 6 = N 1 + N - 5
268 267 oveq1d N 3 N 2 N 6 6 = N 1 + N - 5 6
269 mulcl 2 N 2 N
270 163 257 269 sylancr N 3 N 2 N
271 177 171 pm3.2i 6 6 0
272 divsubdir 2 N 6 6 6 0 2 N 6 6 = 2 N 6 6 6
273 177 271 272 mp3an23 2 N 2 N 6 6 = 2 N 6 6 6
274 270 273 syl N 3 N 2 N 6 6 = 2 N 6 6 6
275 3t2e6 3 2 = 6
276 216 163 mulcomi 3 2 = 2 3
277 275 276 eqtr3i 6 = 2 3
278 277 oveq2i 2 N 6 = 2 N 2 3
279 3ne0 3 0
280 216 279 pm3.2i 3 3 0
281 2cnne0 2 2 0
282 divcan5 N 3 3 0 2 2 0 2 N 2 3 = N 3
283 280 281 282 mp3an23 N 2 N 2 3 = N 3
284 257 283 syl N 3 N 2 N 2 3 = N 3
285 278 284 syl5eq N 3 N 2 N 6 = N 3
286 177 171 dividi 6 6 = 1
287 286 a1i N 3 N 6 6 = 1
288 285 287 oveq12d N 3 N 2 N 6 6 6 = N 3 1
289 274 288 eqtrd N 3 N 2 N 6 6 = N 3 1
290 79 recnd N 3 N N 1
291 84 recnd N 3 N N 5
292 divdir N 1 N 5 6 6 0 N 1 + N - 5 6 = N 1 6 + N 5 6
293 271 292 mp3an3 N 1 N 5 N 1 + N - 5 6 = N 1 6 + N 5 6
294 290 291 293 syl2anc N 3 N N 1 + N - 5 6 = N 1 6 + N 5 6
295 268 289 294 3eqtr3d N 3 N N 3 1 = N 1 6 + N 5 6
296 295 oveq1d N 3 N N 3 - 1 + 1 = N 1 6 + N 5 6 + 1
297 21 recnd N 3 N N 3
298 npcan N 3 1 N 3 - 1 + 1 = N 3
299 297 164 298 sylancl N 3 N N 3 - 1 + 1 = N 3
300 81 recnd N 3 N N 1 6
301 86 recnd N 3 N N 5 6
302 164 a1i N 3 N 1
303 300 301 302 addassd N 3 N N 1 6 + N 5 6 + 1 = N 1 6 + N 5 6 + 1
304 296 299 303 3eqtr3d N 3 N N 3 = N 1 6 + N 5 6 + 1
305 113 256 304 3brtr4d N 3 N k 4 N | k mod 6 1 5 N 3
306 9 17 21 59 305 letrd N 3 N π _ N 2 N 3
307 7 a1i N 3 N 2
308 6 307 21 lesubaddd N 3 N π _ N 2 N 3 π _ N N 3 + 2
309 306 308 mpbid N 3 N π _ N N 3 + 2
310 309 adantlr N 0 N 3 N π _ N N 3 + 2
311 5 ad2antrr N 0 N N 3 π _ N
312 7 a1i N 0 N N 3 2
313 20 ad2antrr N 0 N N 3 N 3
314 readdcl N 3 2 N 3 + 2
315 313 7 314 sylancl N 0 N N 3 N 3 + 2
316 ppiwordi N 3 N 3 π _ N π _ 3
317 1 316 mp3an2 N N 3 π _ N π _ 3
318 317 adantlr N 0 N N 3 π _ N π _ 3
319 318 24 breqtrdi N 0 N N 3 π _ N 2
320 3pos 0 < 3
321 divge0 N 0 N 3 0 < 3 0 N 3
322 1 320 321 mpanr12 N 0 N 0 N 3
323 322 adantr N 0 N N 3 0 N 3
324 addge02 2 N 3 0 N 3 2 N 3 + 2
325 7 313 324 sylancr N 0 N N 3 0 N 3 2 N 3 + 2
326 323 325 mpbid N 0 N N 3 2 N 3 + 2
327 311 312 315 319 326 letrd N 0 N N 3 π _ N N 3 + 2
328 2 3 310 327 lecasei N 0 N π _ N N 3 + 2