Metamath Proof Explorer


Theorem prmreclem4

Description: Lemma for prmrec . Show by induction that the indexed (nondisjoint) union Wk is at most the size of the prime reciprocal series. The key counting lemma is hashdvds , to show that the number of numbers in 1 ... N that divide k is at most N / k . (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 prmreclem4 φ N K k = K + 1 N W k N k = K + 1 N if k 1 k 0

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 oveq2 x = K K + 1 x = K + 1 K
9 8 iuneq1d x = K k = K + 1 x W k = k = K + 1 K W k
10 9 fveq2d x = K k = K + 1 x W k = k = K + 1 K W k
11 8 sumeq1d x = K k = K + 1 x if k 1 k 0 = k = K + 1 K if k 1 k 0
12 11 oveq2d x = K N k = K + 1 x if k 1 k 0 = N k = K + 1 K if k 1 k 0
13 10 12 breq12d x = K k = K + 1 x W k N k = K + 1 x if k 1 k 0 k = K + 1 K W k N k = K + 1 K if k 1 k 0
14 13 imbi2d x = K φ k = K + 1 x W k N k = K + 1 x if k 1 k 0 φ k = K + 1 K W k N k = K + 1 K if k 1 k 0
15 oveq2 x = j K + 1 x = K + 1 j
16 15 iuneq1d x = j k = K + 1 x W k = k = K + 1 j W k
17 16 fveq2d x = j k = K + 1 x W k = k = K + 1 j W k
18 15 sumeq1d x = j k = K + 1 x if k 1 k 0 = k = K + 1 j if k 1 k 0
19 18 oveq2d x = j N k = K + 1 x if k 1 k 0 = N k = K + 1 j if k 1 k 0
20 17 19 breq12d x = j k = K + 1 x W k N k = K + 1 x if k 1 k 0 k = K + 1 j W k N k = K + 1 j if k 1 k 0
21 20 imbi2d x = j φ k = K + 1 x W k N k = K + 1 x if k 1 k 0 φ k = K + 1 j W k N k = K + 1 j if k 1 k 0
22 oveq2 x = j + 1 K + 1 x = K + 1 j + 1
23 22 iuneq1d x = j + 1 k = K + 1 x W k = k = K + 1 j + 1 W k
24 23 fveq2d x = j + 1 k = K + 1 x W k = k = K + 1 j + 1 W k
25 22 sumeq1d x = j + 1 k = K + 1 x if k 1 k 0 = k = K + 1 j + 1 if k 1 k 0
26 25 oveq2d x = j + 1 N k = K + 1 x if k 1 k 0 = N k = K + 1 j + 1 if k 1 k 0
27 24 26 breq12d x = j + 1 k = K + 1 x W k N k = K + 1 x if k 1 k 0 k = K + 1 j + 1 W k N k = K + 1 j + 1 if k 1 k 0
28 27 imbi2d x = j + 1 φ k = K + 1 x W k N k = K + 1 x if k 1 k 0 φ k = K + 1 j + 1 W k N k = K + 1 j + 1 if k 1 k 0
29 oveq2 x = N K + 1 x = K + 1 N
30 29 iuneq1d x = N k = K + 1 x W k = k = K + 1 N W k
31 30 fveq2d x = N k = K + 1 x W k = k = K + 1 N W k
32 29 sumeq1d x = N k = K + 1 x if k 1 k 0 = k = K + 1 N if k 1 k 0
33 32 oveq2d x = N N k = K + 1 x if k 1 k 0 = N k = K + 1 N if k 1 k 0
34 31 33 breq12d x = N k = K + 1 x W k N k = K + 1 x if k 1 k 0 k = K + 1 N W k N k = K + 1 N if k 1 k 0
35 34 imbi2d x = N φ k = K + 1 x W k N k = K + 1 x if k 1 k 0 φ k = K + 1 N W k N k = K + 1 N if k 1 k 0
36 0le0 0 0
37 3 nncnd φ N
38 37 mul01d φ N 0 = 0
39 36 38 breqtrrid φ 0 N 0
40 2 nnred φ K
41 40 ltp1d φ K < K + 1
42 2 nnzd φ K
43 42 peano2zd φ K + 1
44 fzn K + 1 K K < K + 1 K + 1 K =
45 43 42 44 syl2anc φ K < K + 1 K + 1 K =
46 41 45 mpbid φ K + 1 K =
47 46 iuneq1d φ k = K + 1 K W k = k W k
48 0iun k W k =
49 47 48 eqtrdi φ k = K + 1 K W k =
50 49 fveq2d φ k = K + 1 K W k =
51 hash0 = 0
52 50 51 eqtrdi φ k = K + 1 K W k = 0
53 46 sumeq1d φ k = K + 1 K if k 1 k 0 = k if k 1 k 0
54 sum0 k if k 1 k 0 = 0
55 53 54 eqtrdi φ k = K + 1 K if k 1 k 0 = 0
56 55 oveq2d φ N k = K + 1 K if k 1 k 0 = N 0
57 39 52 56 3brtr4d φ k = K + 1 K W k N k = K + 1 K if k 1 k 0
58 fzfi 1 N Fin
59 elfzuz k K + 1 j k K + 1
60 2 peano2nnd φ K + 1
61 eluznn K + 1 k K + 1 k
62 60 61 sylan φ k K + 1 k
63 eleq1 p = k p k
64 breq1 p = k p n k n
65 63 64 anbi12d p = k p p n k k n
66 65 rabbidv p = k n 1 N | p p n = n 1 N | k k n
67 ovex 1 N V
68 67 rabex n 1 N | k k n V
69 66 7 68 fvmpt k W k = n 1 N | k k n
70 69 adantl φ k W k = n 1 N | k k n
71 ssrab2 n 1 N | k k n 1 N
72 70 71 eqsstrdi φ k W k 1 N
73 62 72 syldan φ k K + 1 W k 1 N
74 59 73 sylan2 φ k K + 1 j W k 1 N
75 74 ralrimiva φ k K + 1 j W k 1 N
76 75 adantr φ j K k K + 1 j W k 1 N
77 iunss k = K + 1 j W k 1 N k K + 1 j W k 1 N
78 76 77 sylibr φ j K k = K + 1 j W k 1 N
79 ssfi 1 N Fin k = K + 1 j W k 1 N k = K + 1 j W k Fin
80 58 78 79 sylancr φ j K k = K + 1 j W k Fin
81 hashcl k = K + 1 j W k Fin k = K + 1 j W k 0
82 80 81 syl φ j K k = K + 1 j W k 0
83 82 nn0red φ j K k = K + 1 j W k
84 3 nnred φ N
85 84 adantr φ j K N
86 fzfid φ j K K + 1 j Fin
87 60 adantr φ j K K + 1
88 87 59 61 syl2an φ j K k K + 1 j k
89 nnrecre k 1 k
90 0re 0
91 ifcl 1 k 0 if k 1 k 0
92 89 90 91 sylancl k if k 1 k 0
93 88 92 syl φ j K k K + 1 j if k 1 k 0
94 86 93 fsumrecl φ j K k = K + 1 j if k 1 k 0
95 85 94 remulcld φ j K N k = K + 1 j if k 1 k 0
96 prmnn j + 1 j + 1
97 96 nnrecred j + 1 1 j + 1
98 97 adantl φ j K j + 1 1 j + 1
99 0red φ j K ¬ j + 1 0
100 98 99 ifclda φ j K if j + 1 1 j + 1 0
101 85 100 remulcld φ j K N if j + 1 1 j + 1 0
102 83 95 101 leadd1d φ j K k = K + 1 j W k N k = K + 1 j if k 1 k 0 k = K + 1 j W k + N if j + 1 1 j + 1 0 N k = K + 1 j if k 1 k 0 + N if j + 1 1 j + 1 0
103 eluzp1p1 j K j + 1 K + 1
104 103 adantl φ j K j + 1 K + 1
105 simpl φ j K φ
106 elfzuz k K + 1 j + 1 k K + 1
107 92 recnd k if k 1 k 0
108 62 107 syl φ k K + 1 if k 1 k 0
109 105 106 108 syl2an φ j K k K + 1 j + 1 if k 1 k 0
110 eleq1 k = j + 1 k j + 1
111 oveq2 k = j + 1 1 k = 1 j + 1
112 110 111 ifbieq1d k = j + 1 if k 1 k 0 = if j + 1 1 j + 1 0
113 104 109 112 fsumm1 φ j K k = K + 1 j + 1 if k 1 k 0 = k = K + 1 j + 1 - 1 if k 1 k 0 + if j + 1 1 j + 1 0
114 eluzelz j K j
115 114 adantl φ j K j
116 115 zcnd φ j K j
117 ax-1cn 1
118 pncan j 1 j + 1 - 1 = j
119 116 117 118 sylancl φ j K j + 1 - 1 = j
120 119 oveq2d φ j K K + 1 j + 1 - 1 = K + 1 j
121 120 sumeq1d φ j K k = K + 1 j + 1 - 1 if k 1 k 0 = k = K + 1 j if k 1 k 0
122 121 oveq1d φ j K k = K + 1 j + 1 - 1 if k 1 k 0 + if j + 1 1 j + 1 0 = k = K + 1 j if k 1 k 0 + if j + 1 1 j + 1 0
123 113 122 eqtrd φ j K k = K + 1 j + 1 if k 1 k 0 = k = K + 1 j if k 1 k 0 + if j + 1 1 j + 1 0
124 123 oveq2d φ j K N k = K + 1 j + 1 if k 1 k 0 = N k = K + 1 j if k 1 k 0 + if j + 1 1 j + 1 0
125 37 adantr φ j K N
126 94 recnd φ j K k = K + 1 j if k 1 k 0
127 100 recnd φ j K if j + 1 1 j + 1 0
128 125 126 127 adddid φ j K N k = K + 1 j if k 1 k 0 + if j + 1 1 j + 1 0 = N k = K + 1 j if k 1 k 0 + N if j + 1 1 j + 1 0
129 124 128 eqtrd φ j K N k = K + 1 j + 1 if k 1 k 0 = N k = K + 1 j if k 1 k 0 + N if j + 1 1 j + 1 0
130 129 breq2d φ j K k = K + 1 j W k + N if j + 1 1 j + 1 0 N k = K + 1 j + 1 if k 1 k 0 k = K + 1 j W k + N if j + 1 1 j + 1 0 N k = K + 1 j if k 1 k 0 + N if j + 1 1 j + 1 0
131 102 130 bitr4d φ j K k = K + 1 j W k N k = K + 1 j if k 1 k 0 k = K + 1 j W k + N if j + 1 1 j + 1 0 N k = K + 1 j + 1 if k 1 k 0
132 106 73 sylan2 φ k K + 1 j + 1 W k 1 N
133 132 ralrimiva φ k K + 1 j + 1 W k 1 N
134 133 adantr φ j K k K + 1 j + 1 W k 1 N
135 iunss k = K + 1 j + 1 W k 1 N k K + 1 j + 1 W k 1 N
136 134 135 sylibr φ j K k = K + 1 j + 1 W k 1 N
137 ssfi 1 N Fin k = K + 1 j + 1 W k 1 N k = K + 1 j + 1 W k Fin
138 58 136 137 sylancr φ j K k = K + 1 j + 1 W k Fin
139 hashcl k = K + 1 j + 1 W k Fin k = K + 1 j + 1 W k 0
140 138 139 syl φ j K k = K + 1 j + 1 W k 0
141 140 nn0red φ j K k = K + 1 j + 1 W k
142 fveq2 k = j + 1 W k = W j + 1
143 142 sseq1d k = j + 1 W k 1 N W j + 1 1 N
144 72 ralrimiva φ k W k 1 N
145 144 adantr φ j K k W k 1 N
146 eluznn K j K j
147 2 146 sylan φ j K j
148 147 peano2nnd φ j K j + 1
149 143 145 148 rspcdva φ j K W j + 1 1 N
150 ssfi 1 N Fin W j + 1 1 N W j + 1 Fin
151 58 149 150 sylancr φ j K W j + 1 Fin
152 hashcl W j + 1 Fin W j + 1 0
153 151 152 syl φ j K W j + 1 0
154 153 nn0red φ j K W j + 1
155 83 154 readdcld φ j K k = K + 1 j W k + W j + 1
156 83 101 readdcld φ j K k = K + 1 j W k + N if j + 1 1 j + 1 0
157 43 adantr φ j K K + 1
158 simpr φ j K j K
159 2 nncnd φ K
160 159 adantr φ j K K
161 pncan K 1 K + 1 - 1 = K
162 160 117 161 sylancl φ j K K + 1 - 1 = K
163 162 fveq2d φ j K K + 1 - 1 = K
164 158 163 eleqtrrd φ j K j K + 1 - 1
165 fzsuc2 K + 1 j K + 1 - 1 K + 1 j + 1 = K + 1 j j + 1
166 157 164 165 syl2anc φ j K K + 1 j + 1 = K + 1 j j + 1
167 166 iuneq1d φ j K k = K + 1 j + 1 W k = k K + 1 j j + 1 W k
168 iunxun k K + 1 j j + 1 W k = k = K + 1 j W k k j + 1 W k
169 ovex j + 1 V
170 169 142 iunxsn k j + 1 W k = W j + 1
171 170 uneq2i k = K + 1 j W k k j + 1 W k = k = K + 1 j W k W j + 1
172 168 171 eqtri k K + 1 j j + 1 W k = k = K + 1 j W k W j + 1
173 167 172 eqtrdi φ j K k = K + 1 j + 1 W k = k = K + 1 j W k W j + 1
174 173 fveq2d φ j K k = K + 1 j + 1 W k = k = K + 1 j W k W j + 1
175 hashun2 k = K + 1 j W k Fin W j + 1 Fin k = K + 1 j W k W j + 1 k = K + 1 j W k + W j + 1
176 80 151 175 syl2anc φ j K k = K + 1 j W k W j + 1 k = K + 1 j W k + W j + 1
177 174 176 eqbrtrd φ j K k = K + 1 j + 1 W k k = K + 1 j W k + W j + 1
178 85 148 nndivred φ j K N j + 1
179 flle N j + 1 N j + 1 N j + 1
180 178 179 syl φ j K N j + 1 N j + 1
181 elfznn n 1 N n
182 181 nncnd n 1 N n
183 182 subid1d n 1 N n 0 = n
184 183 breq2d n 1 N j + 1 n 0 j + 1 n
185 184 rabbiia n 1 N | j + 1 n 0 = n 1 N | j + 1 n
186 185 fveq2i n 1 N | j + 1 n 0 = n 1 N | j + 1 n
187 1zzd φ j K 1
188 3 nnnn0d φ N 0
189 nn0uz 0 = 0
190 1m1e0 1 1 = 0
191 190 fveq2i 1 1 = 0
192 189 191 eqtr4i 0 = 1 1
193 188 192 eleqtrdi φ N 1 1
194 193 adantr φ j K N 1 1
195 0zd φ j K 0
196 148 187 194 195 hashdvds φ j K n 1 N | j + 1 n 0 = N 0 j + 1 1 - 1 - 0 j + 1
197 125 subid1d φ j K N 0 = N
198 197 fvoveq1d φ j K N 0 j + 1 = N j + 1
199 190 oveq1i 1 - 1 - 0 = 0 0
200 0m0e0 0 0 = 0
201 199 200 eqtri 1 - 1 - 0 = 0
202 201 oveq1i 1 - 1 - 0 j + 1 = 0 j + 1
203 148 nncnd φ j K j + 1
204 148 nnne0d φ j K j + 1 0
205 203 204 div0d φ j K 0 j + 1 = 0
206 202 205 eqtrid φ j K 1 - 1 - 0 j + 1 = 0
207 206 fveq2d φ j K 1 - 1 - 0 j + 1 = 0
208 0z 0
209 flid 0 0 = 0
210 208 209 ax-mp 0 = 0
211 207 210 eqtrdi φ j K 1 - 1 - 0 j + 1 = 0
212 198 211 oveq12d φ j K N 0 j + 1 1 - 1 - 0 j + 1 = N j + 1 0
213 178 flcld φ j K N j + 1
214 213 zcnd φ j K N j + 1
215 214 subid1d φ j K N j + 1 0 = N j + 1
216 196 212 215 3eqtrd φ j K n 1 N | j + 1 n 0 = N j + 1
217 186 216 eqtr3id φ j K n 1 N | j + 1 n = N j + 1
218 125 203 204 divrecd φ j K N j + 1 = N 1 j + 1
219 218 eqcomd φ j K N 1 j + 1 = N j + 1
220 180 217 219 3brtr4d φ j K n 1 N | j + 1 n N 1 j + 1
221 220 adantr φ j K j + 1 n 1 N | j + 1 n N 1 j + 1
222 eleq1 p = j + 1 p j + 1
223 breq1 p = j + 1 p n j + 1 n
224 222 223 anbi12d p = j + 1 p p n j + 1 j + 1 n
225 224 rabbidv p = j + 1 n 1 N | p p n = n 1 N | j + 1 j + 1 n
226 67 rabex n 1 N | j + 1 j + 1 n V
227 225 7 226 fvmpt j + 1 W j + 1 = n 1 N | j + 1 j + 1 n
228 148 227 syl φ j K W j + 1 = n 1 N | j + 1 j + 1 n
229 228 adantr φ j K j + 1 W j + 1 = n 1 N | j + 1 j + 1 n
230 simpr φ j K j + 1 j + 1
231 230 biantrurd φ j K j + 1 j + 1 n j + 1 j + 1 n
232 231 rabbidv φ j K j + 1 n 1 N | j + 1 n = n 1 N | j + 1 j + 1 n
233 229 232 eqtr4d φ j K j + 1 W j + 1 = n 1 N | j + 1 n
234 233 fveq2d φ j K j + 1 W j + 1 = n 1 N | j + 1 n
235 iftrue j + 1 if j + 1 1 j + 1 0 = 1 j + 1
236 235 adantl φ j K j + 1 if j + 1 1 j + 1 0 = 1 j + 1
237 236 oveq2d φ j K j + 1 N if j + 1 1 j + 1 0 = N 1 j + 1
238 221 234 237 3brtr4d φ j K j + 1 W j + 1 N if j + 1 1 j + 1 0
239 36 a1i φ j K ¬ j + 1 0 0
240 simpl j + 1 j + 1 n j + 1
241 240 con3i ¬ j + 1 ¬ j + 1 j + 1 n
242 241 ralrimivw ¬ j + 1 n 1 N ¬ j + 1 j + 1 n
243 rabeq0 n 1 N | j + 1 j + 1 n = n 1 N ¬ j + 1 j + 1 n
244 242 243 sylibr ¬ j + 1 n 1 N | j + 1 j + 1 n =
245 228 244 sylan9eq φ j K ¬ j + 1 W j + 1 =
246 245 fveq2d φ j K ¬ j + 1 W j + 1 =
247 246 51 eqtrdi φ j K ¬ j + 1 W j + 1 = 0
248 iffalse ¬ j + 1 if j + 1 1 j + 1 0 = 0
249 248 oveq2d ¬ j + 1 N if j + 1 1 j + 1 0 = N 0
250 38 adantr φ j K N 0 = 0
251 249 250 sylan9eqr φ j K ¬ j + 1 N if j + 1 1 j + 1 0 = 0
252 239 247 251 3brtr4d φ j K ¬ j + 1 W j + 1 N if j + 1 1 j + 1 0
253 238 252 pm2.61dan φ j K W j + 1 N if j + 1 1 j + 1 0
254 154 101 83 253 leadd2dd φ j K k = K + 1 j W k + W j + 1 k = K + 1 j W k + N if j + 1 1 j + 1 0
255 141 155 156 177 254 letrd φ j K k = K + 1 j + 1 W k k = K + 1 j W k + N if j + 1 1 j + 1 0
256 fzfid φ j K K + 1 j + 1 Fin
257 62 92 syl φ k K + 1 if k 1 k 0
258 105 106 257 syl2an φ j K k K + 1 j + 1 if k 1 k 0
259 256 258 fsumrecl φ j K k = K + 1 j + 1 if k 1 k 0
260 85 259 remulcld φ j K N k = K + 1 j + 1 if k 1 k 0
261 letr k = K + 1 j + 1 W k k = K + 1 j W k + N if j + 1 1 j + 1 0 N k = K + 1 j + 1 if k 1 k 0 k = K + 1 j + 1 W k k = K + 1 j W k + N if j + 1 1 j + 1 0 k = K + 1 j W k + N if j + 1 1 j + 1 0 N k = K + 1 j + 1 if k 1 k 0 k = K + 1 j + 1 W k N k = K + 1 j + 1 if k 1 k 0
262 141 156 260 261 syl3anc φ j K k = K + 1 j + 1 W k k = K + 1 j W k + N if j + 1 1 j + 1 0 k = K + 1 j W k + N if j + 1 1 j + 1 0 N k = K + 1 j + 1 if k 1 k 0 k = K + 1 j + 1 W k N k = K + 1 j + 1 if k 1 k 0
263 255 262 mpand φ j K k = K + 1 j W k + N if j + 1 1 j + 1 0 N k = K + 1 j + 1 if k 1 k 0 k = K + 1 j + 1 W k N k = K + 1 j + 1 if k 1 k 0
264 131 263 sylbid φ j K k = K + 1 j W k N k = K + 1 j if k 1 k 0 k = K + 1 j + 1 W k N k = K + 1 j + 1 if k 1 k 0
265 264 expcom j K φ k = K + 1 j W k N k = K + 1 j if k 1 k 0 k = K + 1 j + 1 W k N k = K + 1 j + 1 if k 1 k 0
266 265 a2d j K φ k = K + 1 j W k N k = K + 1 j if k 1 k 0 φ k = K + 1 j + 1 W k N k = K + 1 j + 1 if k 1 k 0
267 14 21 28 35 57 266 uzind4i N K φ k = K + 1 N W k N k = K + 1 N if k 1 k 0
268 267 com12 φ N K k = K + 1 N W k N k = K + 1 N if k 1 k 0