Metamath Proof Explorer


Theorem prmreclem5

Description: Lemma for prmrec . Here we show the inequality N / 2 < # M by decomposing the set ( 1 ... N ) into the disjoint union of the set M of those numbers that are not divisible by any "large" primes (above K ) and the indexed union over K < k of the numbers Wk that divide the prime k . By prmreclem4 the second of these has size less than N times the prime reciprocal series, which is less than 1 / 2 by assumption, we find that the complementary part M must be at least N / 2 large. (Contributed by Mario Carneiro, 6-Aug-2014)

Ref Expression
Hypotheses prmrec.1 F = n if n 1 n 0
prmrec.2 φ K
prmrec.3 φ N
prmrec.4 M = n 1 N | p 1 K ¬ p n
prmrec.5 φ seq 1 + F dom
prmrec.6 φ k K + 1 if k 1 k 0 < 1 2
prmrec.7 W = p n 1 N | p p n
Assertion prmreclem5 φ N 2 < 2 K N

Proof

Step Hyp Ref Expression
1 prmrec.1 F = n if n 1 n 0
2 prmrec.2 φ K
3 prmrec.3 φ N
4 prmrec.4 M = n 1 N | p 1 K ¬ p n
5 prmrec.5 φ seq 1 + F dom
6 prmrec.6 φ k K + 1 if k 1 k 0 < 1 2
7 prmrec.7 W = p n 1 N | p p n
8 3 nnred φ N
9 8 rehalfcld φ N 2
10 fzfi 1 N Fin
11 4 ssrab3 M 1 N
12 ssfi 1 N Fin M 1 N M Fin
13 10 11 12 mp2an M Fin
14 hashcl M Fin M 0
15 13 14 ax-mp M 0
16 15 nn0rei M
17 16 a1i φ M
18 2nn 2
19 2 nnnn0d φ K 0
20 nnexpcl 2 K 0 2 K
21 18 19 20 sylancr φ 2 K
22 21 nnred φ 2 K
23 3 nnrpd φ N +
24 23 rpsqrtcld φ N +
25 24 rpred φ N
26 22 25 remulcld φ 2 K N
27 8 recnd φ N
28 27 2halvesd φ N 2 + N 2 = N
29 11 a1i φ M 1 N
30 2 peano2nnd φ K + 1
31 elfzuz k K + 1 N k K + 1
32 eluznn K + 1 k K + 1 k
33 30 31 32 syl2an φ k K + 1 N k
34 eleq1w p = k p k
35 breq1 p = k p n k n
36 34 35 anbi12d p = k p p n k k n
37 36 rabbidv p = k n 1 N | p p n = n 1 N | k k n
38 ovex 1 N V
39 38 rabex n 1 N | k k n V
40 37 7 39 fvmpt k W k = n 1 N | k k n
41 40 adantl φ k W k = n 1 N | k k n
42 ssrab2 n 1 N | k k n 1 N
43 41 42 eqsstrdi φ k W k 1 N
44 33 43 syldan φ k K + 1 N W k 1 N
45 44 ralrimiva φ k K + 1 N W k 1 N
46 iunss k = K + 1 N W k 1 N k K + 1 N W k 1 N
47 45 46 sylibr φ k = K + 1 N W k 1 N
48 29 47 unssd φ M k = K + 1 N W k 1 N
49 breq1 p = q p n q n
50 49 notbid p = q ¬ p n ¬ q n
51 50 cbvralvw p 1 K ¬ p n q 1 K ¬ q n
52 breq2 n = x q n q x
53 52 notbid n = x ¬ q n ¬ q x
54 53 ralbidv n = x q 1 K ¬ q n q 1 K ¬ q x
55 51 54 syl5bb n = x p 1 K ¬ p n q 1 K ¬ q x
56 55 4 elrab2 x M x 1 N q 1 K ¬ q x
57 elun1 x M x M k = K + 1 N W k
58 56 57 sylbir x 1 N q 1 K ¬ q x x M k = K + 1 N W k
59 58 ex x 1 N q 1 K ¬ q x x M k = K + 1 N W k
60 59 adantl φ x 1 N q 1 K ¬ q x x M k = K + 1 N W k
61 dfrex2 q 1 K q x ¬ q 1 K ¬ q x
62 2 nnzd φ K
63 62 peano2zd φ K + 1
64 63 ad2antrr φ x 1 N q 1 K q x K + 1
65 3 nnzd φ N
66 65 ad2antrr φ x 1 N q 1 K q x N
67 eldifi q 1 K q
68 67 ad2antrl φ x 1 N q 1 K q x q
69 prmz q q
70 68 69 syl φ x 1 N q 1 K q x q
71 eldifn q 1 K ¬ q 1 K
72 71 ad2antrl φ x 1 N q 1 K q x ¬ q 1 K
73 prmnn q q
74 68 73 syl φ x 1 N q 1 K q x q
75 nnuz = 1
76 74 75 eleqtrdi φ x 1 N q 1 K q x q 1
77 62 ad2antrr φ x 1 N q 1 K q x K
78 elfz5 q 1 K q 1 K q K
79 76 77 78 syl2anc φ x 1 N q 1 K q x q 1 K q K
80 72 79 mtbid φ x 1 N q 1 K q x ¬ q K
81 2 nnred φ K
82 81 ad2antrr φ x 1 N q 1 K q x K
83 74 nnred φ x 1 N q 1 K q x q
84 82 83 ltnled φ x 1 N q 1 K q x K < q ¬ q K
85 80 84 mpbird φ x 1 N q 1 K q x K < q
86 zltp1le K q K < q K + 1 q
87 77 70 86 syl2anc φ x 1 N q 1 K q x K < q K + 1 q
88 85 87 mpbid φ x 1 N q 1 K q x K + 1 q
89 elfznn x 1 N x
90 89 ad2antlr φ x 1 N q 1 K q x x
91 90 nnred φ x 1 N q 1 K q x x
92 8 ad2antrr φ x 1 N q 1 K q x N
93 simprr φ x 1 N q 1 K q x q x
94 dvdsle q x q x q x
95 70 90 94 syl2anc φ x 1 N q 1 K q x q x q x
96 93 95 mpd φ x 1 N q 1 K q x q x
97 elfzle2 x 1 N x N
98 97 ad2antlr φ x 1 N q 1 K q x x N
99 83 91 92 96 98 letrd φ x 1 N q 1 K q x q N
100 64 66 70 88 99 elfzd φ x 1 N q 1 K q x q K + 1 N
101 52 anbi2d n = x q q n q q x
102 simplr φ x 1 N q 1 K q x x 1 N
103 68 93 jca φ x 1 N q 1 K q x q q x
104 101 102 103 elrabd φ x 1 N q 1 K q x x n 1 N | q q n
105 eleq1w p = q p q
106 105 49 anbi12d p = q p p n q q n
107 106 rabbidv p = q n 1 N | p p n = n 1 N | q q n
108 38 rabex n 1 N | q q n V
109 107 7 108 fvmpt q W q = n 1 N | q q n
110 74 109 syl φ x 1 N q 1 K q x W q = n 1 N | q q n
111 104 110 eleqtrrd φ x 1 N q 1 K q x x W q
112 fveq2 k = q W k = W q
113 112 eliuni q K + 1 N x W q x k = K + 1 N W k
114 100 111 113 syl2anc φ x 1 N q 1 K q x x k = K + 1 N W k
115 elun2 x k = K + 1 N W k x M k = K + 1 N W k
116 114 115 syl φ x 1 N q 1 K q x x M k = K + 1 N W k
117 116 rexlimdvaa φ x 1 N q 1 K q x x M k = K + 1 N W k
118 61 117 syl5bir φ x 1 N ¬ q 1 K ¬ q x x M k = K + 1 N W k
119 60 118 pm2.61d φ x 1 N x M k = K + 1 N W k
120 48 119 eqelssd φ M k = K + 1 N W k = 1 N
121 120 fveq2d φ M k = K + 1 N W k = 1 N
122 3 nnnn0d φ N 0
123 hashfz1 N 0 1 N = N
124 122 123 syl φ 1 N = N
125 121 124 eqtr2d φ N = M k = K + 1 N W k
126 13 a1i φ M Fin
127 ssfi 1 N Fin k = K + 1 N W k 1 N k = K + 1 N W k Fin
128 10 47 127 sylancr φ k = K + 1 N W k Fin
129 breq1 p = k p x k x
130 129 notbid p = k ¬ p x ¬ k x
131 breq2 n = x p n p x
132 131 notbid n = x ¬ p n ¬ p x
133 132 ralbidv n = x p 1 K ¬ p n p 1 K ¬ p x
134 133 4 elrab2 x M x 1 N p 1 K ¬ p x
135 134 simprbi x M p 1 K ¬ p x
136 135 ad2antlr φ x M k K + 1 N k p 1 K ¬ p x
137 simprr φ x M k K + 1 N k k
138 noel ¬ k
139 simprl φ x M k K + 1 N k k K + 1 N
140 139 biantrud φ x M k K + 1 N k k 1 K k 1 K k K + 1 N
141 elin k 1 K K + 1 N k 1 K k K + 1 N
142 140 141 bitr4di φ x M k K + 1 N k k 1 K k 1 K K + 1 N
143 81 ltp1d φ K < K + 1
144 fzdisj K < K + 1 1 K K + 1 N =
145 143 144 syl φ 1 K K + 1 N =
146 145 ad2antrr φ x M k K + 1 N k 1 K K + 1 N =
147 146 eleq2d φ x M k K + 1 N k k 1 K K + 1 N k
148 142 147 bitrd φ x M k K + 1 N k k 1 K k
149 138 148 mtbiri φ x M k K + 1 N k ¬ k 1 K
150 137 149 eldifd φ x M k K + 1 N k k 1 K
151 130 136 150 rspcdva φ x M k K + 1 N k ¬ k x
152 151 expr φ x M k K + 1 N k ¬ k x
153 imnan k ¬ k x ¬ k k x
154 152 153 sylib φ x M k K + 1 N ¬ k k x
155 33 adantlr φ x M k K + 1 N k
156 155 40 syl φ x M k K + 1 N W k = n 1 N | k k n
157 156 eleq2d φ x M k K + 1 N x W k x n 1 N | k k n
158 breq2 n = x k n k x
159 158 anbi2d n = x k k n k k x
160 159 elrab x n 1 N | k k n x 1 N k k x
161 160 simprbi x n 1 N | k k n k k x
162 157 161 syl6bi φ x M k K + 1 N x W k k k x
163 154 162 mtod φ x M k K + 1 N ¬ x W k
164 163 nrexdv φ x M ¬ k K + 1 N x W k
165 eliun x k = K + 1 N W k k K + 1 N x W k
166 164 165 sylnibr φ x M ¬ x k = K + 1 N W k
167 166 ex φ x M ¬ x k = K + 1 N W k
168 imnan x M ¬ x k = K + 1 N W k ¬ x M x k = K + 1 N W k
169 167 168 sylib φ ¬ x M x k = K + 1 N W k
170 elin x M k = K + 1 N W k x M x k = K + 1 N W k
171 169 170 sylnibr φ ¬ x M k = K + 1 N W k
172 171 eq0rdv φ M k = K + 1 N W k =
173 hashun M Fin k = K + 1 N W k Fin M k = K + 1 N W k = M k = K + 1 N W k = M + k = K + 1 N W k
174 126 128 172 173 syl3anc φ M k = K + 1 N W k = M + k = K + 1 N W k
175 28 125 174 3eqtrd φ N 2 + N 2 = M + k = K + 1 N W k
176 hashcl k = K + 1 N W k Fin k = K + 1 N W k 0
177 128 176 syl φ k = K + 1 N W k 0
178 177 nn0red φ k = K + 1 N W k
179 fzfid φ K + 1 N Fin
180 30 32 sylan φ k K + 1 k
181 nnrecre k 1 k
182 0re 0
183 ifcl 1 k 0 if k 1 k 0
184 181 182 183 sylancl k if k 1 k 0
185 180 184 syl φ k K + 1 if k 1 k 0
186 31 185 sylan2 φ k K + 1 N if k 1 k 0
187 179 186 fsumrecl φ k = K + 1 N if k 1 k 0
188 8 187 remulcld φ N k = K + 1 N if k 1 k 0
189 1 2 3 4 5 6 7 prmreclem4 φ N K k = K + 1 N W k N k = K + 1 N if k 1 k 0
190 eluz N K K N N K
191 65 62 190 syl2anc φ K N N K
192 nnleltp1 N K N K N < K + 1
193 3 2 192 syl2anc φ N K N < K + 1
194 fzn K + 1 N N < K + 1 K + 1 N =
195 63 65 194 syl2anc φ N < K + 1 K + 1 N =
196 191 193 195 3bitrd φ K N K + 1 N =
197 0le0 0 0
198 27 mul01d φ N 0 = 0
199 197 198 breqtrrid φ 0 N 0
200 iuneq1 K + 1 N = k = K + 1 N W k = k W k
201 0iun k W k =
202 200 201 eqtrdi K + 1 N = k = K + 1 N W k =
203 202 fveq2d K + 1 N = k = K + 1 N W k =
204 hash0 = 0
205 203 204 eqtrdi K + 1 N = k = K + 1 N W k = 0
206 sumeq1 K + 1 N = k = K + 1 N if k 1 k 0 = k if k 1 k 0
207 sum0 k if k 1 k 0 = 0
208 206 207 eqtrdi K + 1 N = k = K + 1 N if k 1 k 0 = 0
209 208 oveq2d K + 1 N = N k = K + 1 N if k 1 k 0 = N 0
210 205 209 breq12d K + 1 N = k = K + 1 N W k N k = K + 1 N if k 1 k 0 0 N 0
211 199 210 syl5ibrcom φ K + 1 N = k = K + 1 N W k N k = K + 1 N if k 1 k 0
212 196 211 sylbid φ K N k = K + 1 N W k N k = K + 1 N if k 1 k 0
213 uztric K N N K K N
214 62 65 213 syl2anc φ N K K N
215 189 212 214 mpjaod φ k = K + 1 N W k N k = K + 1 N if k 1 k 0
216 eqid K + 1 = K + 1
217 eleq1w n = k n k
218 oveq2 n = k 1 n = 1 k
219 217 218 ifbieq1d n = k if n 1 n 0 = if k 1 k 0
220 ovex 1 k V
221 c0ex 0 V
222 220 221 ifex if k 1 k 0 V
223 219 1 222 fvmpt k F k = if k 1 k 0
224 180 223 syl φ k K + 1 F k = if k 1 k 0
225 184 recnd k if k 1 k 0
226 223 225 eqeltrd k F k
227 226 adantl φ k F k
228 75 30 227 iserex φ seq 1 + F dom seq K + 1 + F dom
229 5 228 mpbid φ seq K + 1 + F dom
230 216 63 224 185 229 isumrecl φ k K + 1 if k 1 k 0
231 halfre 1 2
232 231 a1i φ 1 2
233 fzssuz K + 1 N K + 1
234 233 a1i φ K + 1 N K + 1
235 nnrp k k +
236 235 rpreccld k 1 k +
237 236 rpge0d k 0 1 k
238 breq2 1 k = if k 1 k 0 0 1 k 0 if k 1 k 0
239 breq2 0 = if k 1 k 0 0 0 0 if k 1 k 0
240 238 239 ifboth 0 1 k 0 0 0 if k 1 k 0
241 237 197 240 sylancl k 0 if k 1 k 0
242 180 241 syl φ k K + 1 0 if k 1 k 0
243 216 63 179 234 224 185 242 229 isumless φ k = K + 1 N if k 1 k 0 k K + 1 if k 1 k 0
244 187 230 232 243 6 lelttrd φ k = K + 1 N if k 1 k 0 < 1 2
245 3 nngt0d φ 0 < N
246 ltmul2 k = K + 1 N if k 1 k 0 1 2 N 0 < N k = K + 1 N if k 1 k 0 < 1 2 N k = K + 1 N if k 1 k 0 < N 1 2
247 187 232 8 245 246 syl112anc φ k = K + 1 N if k 1 k 0 < 1 2 N k = K + 1 N if k 1 k 0 < N 1 2
248 244 247 mpbid φ N k = K + 1 N if k 1 k 0 < N 1 2
249 2cn 2
250 2ne0 2 0
251 divrec N 2 2 0 N 2 = N 1 2
252 249 250 251 mp3an23 N N 2 = N 1 2
253 27 252 syl φ N 2 = N 1 2
254 248 253 breqtrrd φ N k = K + 1 N if k 1 k 0 < N 2
255 178 188 9 215 254 lelttrd φ k = K + 1 N W k < N 2
256 178 9 17 255 ltadd2dd φ M + k = K + 1 N W k < M + N 2
257 175 256 eqbrtrd φ N 2 + N 2 < M + N 2
258 9 17 9 ltadd1d φ N 2 < M N 2 + N 2 < M + N 2
259 257 258 mpbird φ N 2 < M
260 oveq1 k = r k 2 = r 2
261 260 breq1d k = r k 2 x r 2 x
262 261 cbvrabv k | k 2 x = r | r 2 x
263 breq2 x = n r 2 x r 2 n
264 263 rabbidv x = n r | r 2 x = r | r 2 n
265 262 264 eqtrid x = n k | k 2 x = r | r 2 n
266 265 supeq1d x = n sup k | k 2 x < = sup r | r 2 n <
267 266 cbvmptv x sup k | k 2 x < = n sup r | r 2 n <
268 1 2 3 4 267 prmreclem3 φ M 2 K N
269 9 17 26 259 268 ltletrd φ N 2 < 2 K N