Metamath Proof Explorer


Theorem dchrisumlem1

Description: Lemma for dchrisum . Lemma 9.4.1 of Shapiro, p. 377. (Contributed by Mario Carneiro, 2-May-2016)

Ref Expression
Hypotheses rpvmasum.z Z = /N
rpvmasum.l L = ℤRHom Z
rpvmasum.a φ N
rpvmasum.g G = DChr N
rpvmasum.d D = Base G
rpvmasum.1 1 ˙ = 0 G
dchrisum.b φ X D
dchrisum.n1 φ X 1 ˙
dchrisum.2 n = x A = B
dchrisum.3 φ M
dchrisum.4 φ n + A
dchrisum.5 φ n + x + M n n x B A
dchrisum.6 φ n + A 0
dchrisum.7 F = n X L n A
dchrisum.9 φ R
dchrisum.10 φ u 0 ..^ N n 0 ..^ u X L n R
Assertion dchrisumlem1 φ U 0 n 0 ..^ U X L n R

Proof

Step Hyp Ref Expression
1 rpvmasum.z Z = /N
2 rpvmasum.l L = ℤRHom Z
3 rpvmasum.a φ N
4 rpvmasum.g G = DChr N
5 rpvmasum.d D = Base G
6 rpvmasum.1 1 ˙ = 0 G
7 dchrisum.b φ X D
8 dchrisum.n1 φ X 1 ˙
9 dchrisum.2 n = x A = B
10 dchrisum.3 φ M
11 dchrisum.4 φ n + A
12 dchrisum.5 φ n + x + M n n x B A
13 dchrisum.6 φ n + A 0
14 dchrisum.7 F = n X L n A
15 dchrisum.9 φ R
16 dchrisum.10 φ u 0 ..^ N n 0 ..^ u X L n R
17 fzodisj 0 ..^ N U N N U N ..^ U =
18 17 a1i φ U 0 0 ..^ N U N N U N ..^ U =
19 3 nnnn0d φ N 0
20 19 adantr φ U 0 N 0
21 nn0re U 0 U
22 21 adantl φ U 0 U
23 3 adantr φ U 0 N
24 22 23 nndivred φ U 0 U N
25 23 nnrpd φ U 0 N +
26 nn0ge0 U 0 0 U
27 26 adantl φ U 0 0 U
28 22 25 27 divge0d φ U 0 0 U N
29 flge0nn0 U N 0 U N U N 0
30 24 28 29 syl2anc φ U 0 U N 0
31 20 30 nn0mulcld φ U 0 N U N 0
32 flle U N U N U N
33 24 32 syl φ U 0 U N U N
34 reflcl U N U N
35 24 34 syl φ U 0 U N
36 35 22 25 lemuldiv2d φ U 0 N U N U U N U N
37 33 36 mpbird φ U 0 N U N U
38 fznn0 U 0 N U N 0 U N U N 0 N U N U
39 38 adantl φ U 0 N U N 0 U N U N 0 N U N U
40 31 37 39 mpbir2and φ U 0 N U N 0 U
41 fzosplit N U N 0 U 0 ..^ U = 0 ..^ N U N N U N ..^ U
42 40 41 syl φ U 0 0 ..^ U = 0 ..^ N U N N U N ..^ U
43 fzofi 0 ..^ U Fin
44 43 a1i φ U 0 0 ..^ U Fin
45 7 ad2antrr φ U 0 n 0 ..^ U X D
46 elfzoelz n 0 ..^ U n
47 46 adantl φ U 0 n 0 ..^ U n
48 4 1 5 2 45 47 dchrzrhcl φ U 0 n 0 ..^ U X L n
49 18 42 44 48 fsumsplit φ U 0 n 0 ..^ U X L n = n 0 ..^ N U N X L n + n N U N ..^ U X L n
50 oveq2 k = 0 N k = N 0
51 50 oveq2d k = 0 0 ..^ N k = 0 ..^ N 0
52 51 sumeq1d k = 0 n 0 ..^ N k X L n = n 0 ..^ N 0 X L n
53 52 eqeq1d k = 0 n 0 ..^ N k X L n = 0 n 0 ..^ N 0 X L n = 0
54 53 imbi2d k = 0 φ n 0 ..^ N k X L n = 0 φ n 0 ..^ N 0 X L n = 0
55 oveq2 k = m N k = N m
56 55 oveq2d k = m 0 ..^ N k = 0 ..^ N m
57 56 sumeq1d k = m n 0 ..^ N k X L n = n 0 ..^ N m X L n
58 57 eqeq1d k = m n 0 ..^ N k X L n = 0 n 0 ..^ N m X L n = 0
59 58 imbi2d k = m φ n 0 ..^ N k X L n = 0 φ n 0 ..^ N m X L n = 0
60 oveq2 k = m + 1 N k = N m + 1
61 60 oveq2d k = m + 1 0 ..^ N k = 0 ..^ N m + 1
62 61 sumeq1d k = m + 1 n 0 ..^ N k X L n = n 0 ..^ N m + 1 X L n
63 62 eqeq1d k = m + 1 n 0 ..^ N k X L n = 0 n 0 ..^ N m + 1 X L n = 0
64 63 imbi2d k = m + 1 φ n 0 ..^ N k X L n = 0 φ n 0 ..^ N m + 1 X L n = 0
65 oveq2 k = U N N k = N U N
66 65 oveq2d k = U N 0 ..^ N k = 0 ..^ N U N
67 66 sumeq1d k = U N n 0 ..^ N k X L n = n 0 ..^ N U N X L n
68 67 eqeq1d k = U N n 0 ..^ N k X L n = 0 n 0 ..^ N U N X L n = 0
69 68 imbi2d k = U N φ n 0 ..^ N k X L n = 0 φ n 0 ..^ N U N X L n = 0
70 3 nncnd φ N
71 70 mul01d φ N 0 = 0
72 71 oveq2d φ 0 ..^ N 0 = 0 ..^ 0
73 fzo0 0 ..^ 0 =
74 72 73 eqtrdi φ 0 ..^ N 0 =
75 74 sumeq1d φ n 0 ..^ N 0 X L n = n X L n
76 sum0 n X L n = 0
77 75 76 eqtrdi φ n 0 ..^ N 0 X L n = 0
78 oveq1 n 0 ..^ N m X L n = 0 n 0 ..^ N m X L n + n N m ..^ N m + 1 X L n = 0 + n N m ..^ N m + 1 X L n
79 fzodisj 0 ..^ N m N m ..^ N m + 1 =
80 79 a1i φ m 0 0 ..^ N m N m ..^ N m + 1 =
81 nn0re m 0 m
82 81 adantl φ m 0 m
83 82 lep1d φ m 0 m m + 1
84 peano2re m m + 1
85 82 84 syl φ m 0 m + 1
86 3 adantr φ m 0 N
87 86 nnred φ m 0 N
88 86 nngt0d φ m 0 0 < N
89 lemul2 m m + 1 N 0 < N m m + 1 N m N m + 1
90 82 85 87 88 89 syl112anc φ m 0 m m + 1 N m N m + 1
91 83 90 mpbid φ m 0 N m N m + 1
92 nn0mulcl N 0 m 0 N m 0
93 19 92 sylan φ m 0 N m 0
94 nn0uz 0 = 0
95 93 94 eleqtrdi φ m 0 N m 0
96 nn0p1nn m 0 m + 1
97 nnmulcl N m + 1 N m + 1
98 3 96 97 syl2an φ m 0 N m + 1
99 98 nnzd φ m 0 N m + 1
100 elfz5 N m 0 N m + 1 N m 0 N m + 1 N m N m + 1
101 95 99 100 syl2anc φ m 0 N m 0 N m + 1 N m N m + 1
102 91 101 mpbird φ m 0 N m 0 N m + 1
103 fzosplit N m 0 N m + 1 0 ..^ N m + 1 = 0 ..^ N m N m ..^ N m + 1
104 102 103 syl φ m 0 0 ..^ N m + 1 = 0 ..^ N m N m ..^ N m + 1
105 fzofi 0 ..^ N m + 1 Fin
106 105 a1i φ m 0 0 ..^ N m + 1 Fin
107 7 ad2antrr φ m 0 n 0 ..^ N m + 1 X D
108 elfzoelz n 0 ..^ N m + 1 n
109 108 adantl φ m 0 n 0 ..^ N m + 1 n
110 4 1 5 2 107 109 dchrzrhcl φ m 0 n 0 ..^ N m + 1 X L n
111 80 104 106 110 fsumsplit φ m 0 n 0 ..^ N m + 1 X L n = n 0 ..^ N m X L n + n N m ..^ N m + 1 X L n
112 86 nncnd φ m 0 N
113 82 recnd φ m 0 m
114 1cnd φ m 0 1
115 112 113 114 adddid φ m 0 N m + 1 = N m + N 1
116 112 mulid1d φ m 0 N 1 = N
117 116 oveq2d φ m 0 N m + N 1 = N m + N
118 115 117 eqtrd φ m 0 N m + 1 = N m + N
119 118 oveq2d φ m 0 N m ..^ N m + 1 = N m ..^ N m + N
120 119 sumeq1d φ m 0 n N m ..^ N m + 1 X L n = n N m ..^ N m + N X L n
121 oveq2 k = N N m + k = N m + N
122 121 oveq2d k = N N m ..^ N m + k = N m ..^ N m + N
123 122 sumeq1d k = N n N m ..^ N m + k X L n = n N m ..^ N m + N X L n
124 oveq2 k = N 0 ..^ k = 0 ..^ N
125 124 sumeq1d k = N n 0 ..^ k X L n = n 0 ..^ N X L n
126 123 125 eqeq12d k = N n N m ..^ N m + k X L n = n 0 ..^ k X L n n N m ..^ N m + N X L n = n 0 ..^ N X L n
127 93 nn0zd φ m 0 N m
128 127 adantr φ m 0 k 0 N m
129 nn0z k 0 k
130 zaddcl N m k N m + k
131 127 129 130 syl2an φ m 0 k 0 N m + k
132 peano2zm N m + k N m + k - 1
133 131 132 syl φ m 0 k 0 N m + k - 1
134 7 ad3antrrr φ m 0 k 0 n N m N m + k - 1 X D
135 elfzelz n N m N m + k - 1 n
136 135 adantl φ m 0 k 0 n N m N m + k - 1 n
137 4 1 5 2 134 136 dchrzrhcl φ m 0 k 0 n N m N m + k - 1 X L n
138 2fveq3 n = i + N m X L n = X L i + N m
139 128 128 133 137 138 fsumshftm φ m 0 k 0 n = N m N m + k - 1 X L n = i = N m N m N m + k - 1 - N m X L i + N m
140 fzoval N m + k N m ..^ N m + k = N m N m + k - 1
141 131 140 syl φ m 0 k 0 N m ..^ N m + k = N m N m + k - 1
142 141 sumeq1d φ m 0 k 0 n N m ..^ N m + k X L n = n = N m N m + k - 1 X L n
143 129 adantl φ m 0 k 0 k
144 fzoval k 0 ..^ k = 0 k 1
145 143 144 syl φ m 0 k 0 0 ..^ k = 0 k 1
146 128 zcnd φ m 0 k 0 N m
147 146 subidd φ m 0 k 0 N m N m = 0
148 131 zcnd φ m 0 k 0 N m + k
149 1cnd φ m 0 k 0 1
150 148 149 146 sub32d φ m 0 k 0 N m + k - 1 - N m = N m + k - N m - 1
151 nn0cn k 0 k
152 151 adantl φ m 0 k 0 k
153 146 152 pncan2d φ m 0 k 0 N m + k - N m = k
154 153 oveq1d φ m 0 k 0 N m + k - N m - 1 = k 1
155 150 154 eqtrd φ m 0 k 0 N m + k - 1 - N m = k 1
156 147 155 oveq12d φ m 0 k 0 N m N m N m + k - 1 - N m = 0 k 1
157 145 156 eqtr4d φ m 0 k 0 0 ..^ k = N m N m N m + k - 1 - N m
158 157 sumeq1d φ m 0 k 0 i 0 ..^ k X L i + N m = i = N m N m N m + k - 1 - N m X L i + N m
159 139 142 158 3eqtr4d φ m 0 k 0 n N m ..^ N m + k X L n = i 0 ..^ k X L i + N m
160 3 nnzd φ N
161 nn0z m 0 m
162 dvdsmul1 N m N N m
163 160 161 162 syl2an φ m 0 N N m
164 163 ad2antrr φ m 0 k 0 i 0 ..^ k N N m
165 elfzoelz i 0 ..^ k i
166 165 adantl φ m 0 k 0 i 0 ..^ k i
167 166 zcnd φ m 0 k 0 i 0 ..^ k i
168 146 adantr φ m 0 k 0 i 0 ..^ k N m
169 167 168 pncan2d φ m 0 k 0 i 0 ..^ k i + N m - i = N m
170 164 169 breqtrrd φ m 0 k 0 i 0 ..^ k N i + N m - i
171 86 nnnn0d φ m 0 N 0
172 171 ad2antrr φ m 0 k 0 i 0 ..^ k N 0
173 zaddcl i N m i + N m
174 165 128 173 syl2anr φ m 0 k 0 i 0 ..^ k i + N m
175 1 2 zndvds N 0 i + N m i L i + N m = L i N i + N m - i
176 172 174 166 175 syl3anc φ m 0 k 0 i 0 ..^ k L i + N m = L i N i + N m - i
177 170 176 mpbird φ m 0 k 0 i 0 ..^ k L i + N m = L i
178 177 fveq2d φ m 0 k 0 i 0 ..^ k X L i + N m = X L i
179 178 sumeq2dv φ m 0 k 0 i 0 ..^ k X L i + N m = i 0 ..^ k X L i
180 2fveq3 i = n X L i = X L n
181 180 cbvsumv i 0 ..^ k X L i = n 0 ..^ k X L n
182 179 181 eqtrdi φ m 0 k 0 i 0 ..^ k X L i + N m = n 0 ..^ k X L n
183 159 182 eqtrd φ m 0 k 0 n N m ..^ N m + k X L n = n 0 ..^ k X L n
184 183 ralrimiva φ m 0 k 0 n N m ..^ N m + k X L n = n 0 ..^ k X L n
185 126 184 171 rspcdva φ m 0 n N m ..^ N m + N X L n = n 0 ..^ N X L n
186 fveq2 k = L n X k = X L n
187 3 nnne0d φ N 0
188 ifnefalse N 0 if N = 0 0 ..^ N = 0 ..^ N
189 187 188 syl φ if N = 0 0 ..^ N = 0 ..^ N
190 fzofi 0 ..^ N Fin
191 189 190 eqeltrdi φ if N = 0 0 ..^ N Fin
192 eqid Base Z = Base Z
193 2 reseq1i L if N = 0 0 ..^ N = ℤRHom Z if N = 0 0 ..^ N
194 eqid if N = 0 0 ..^ N = if N = 0 0 ..^ N
195 1 192 193 194 znf1o N 0 L if N = 0 0 ..^ N : if N = 0 0 ..^ N 1-1 onto Base Z
196 19 195 syl φ L if N = 0 0 ..^ N : if N = 0 0 ..^ N 1-1 onto Base Z
197 fvres n if N = 0 0 ..^ N L if N = 0 0 ..^ N n = L n
198 197 adantl φ n if N = 0 0 ..^ N L if N = 0 0 ..^ N n = L n
199 4 1 5 192 7 dchrf φ X : Base Z
200 199 ffvelrnda φ k Base Z X k
201 186 191 196 198 200 fsumf1o φ k Base Z X k = n if N = 0 0 ..^ N X L n
202 4 1 5 6 7 192 dchrsum φ k Base Z X k = if X = 1 ˙ ϕ N 0
203 ifnefalse X 1 ˙ if X = 1 ˙ ϕ N 0 = 0
204 8 203 syl φ if X = 1 ˙ ϕ N 0 = 0
205 202 204 eqtrd φ k Base Z X k = 0
206 189 sumeq1d φ n if N = 0 0 ..^ N X L n = n 0 ..^ N X L n
207 201 205 206 3eqtr3rd φ n 0 ..^ N X L n = 0
208 207 adantr φ m 0 n 0 ..^ N X L n = 0
209 120 185 208 3eqtrd φ m 0 n N m ..^ N m + 1 X L n = 0
210 209 oveq2d φ m 0 0 + n N m ..^ N m + 1 X L n = 0 + 0
211 00id 0 + 0 = 0
212 210 211 eqtr2di φ m 0 0 = 0 + n N m ..^ N m + 1 X L n
213 111 212 eqeq12d φ m 0 n 0 ..^ N m + 1 X L n = 0 n 0 ..^ N m X L n + n N m ..^ N m + 1 X L n = 0 + n N m ..^ N m + 1 X L n
214 78 213 syl5ibr φ m 0 n 0 ..^ N m X L n = 0 n 0 ..^ N m + 1 X L n = 0
215 214 expcom m 0 φ n 0 ..^ N m X L n = 0 n 0 ..^ N m + 1 X L n = 0
216 215 a2d m 0 φ n 0 ..^ N m X L n = 0 φ n 0 ..^ N m + 1 X L n = 0
217 54 59 64 69 77 216 nn0ind U N 0 φ n 0 ..^ N U N X L n = 0
218 217 impcom φ U N 0 n 0 ..^ N U N X L n = 0
219 30 218 syldan φ U 0 n 0 ..^ N U N X L n = 0
220 modval U N + U mod N = U N U N
221 22 25 220 syl2anc φ U 0 U mod N = U N U N
222 221 oveq2d φ U 0 N U N + U mod N = N U N + U - N U N
223 31 nn0cnd φ U 0 N U N
224 nn0cn U 0 U
225 224 adantl φ U 0 U
226 223 225 pncan3d φ U 0 N U N + U - N U N = U
227 222 226 eqtr2d φ U 0 U = N U N + U mod N
228 227 oveq2d φ U 0 N U N ..^ U = N U N ..^ N U N + U mod N
229 228 sumeq1d φ U 0 n N U N ..^ U X L n = n N U N ..^ N U N + U mod N X L n
230 nn0z U 0 U
231 zmodcl U N U mod N 0
232 230 3 231 syl2anr φ U 0 U mod N 0
233 184 ralrimiva φ m 0 k 0 n N m ..^ N m + k X L n = n 0 ..^ k X L n
234 233 adantr φ U 0 m 0 k 0 n N m ..^ N m + k X L n = n 0 ..^ k X L n
235 oveq2 m = U N N m = N U N
236 235 oveq1d m = U N N m + k = N U N + k
237 235 236 oveq12d m = U N N m ..^ N m + k = N U N ..^ N U N + k
238 237 sumeq1d m = U N n N m ..^ N m + k X L n = n N U N ..^ N U N + k X L n
239 238 eqeq1d m = U N n N m ..^ N m + k X L n = n 0 ..^ k X L n n N U N ..^ N U N + k X L n = n 0 ..^ k X L n
240 oveq2 k = U mod N N U N + k = N U N + U mod N
241 240 oveq2d k = U mod N N U N ..^ N U N + k = N U N ..^ N U N + U mod N
242 241 sumeq1d k = U mod N n N U N ..^ N U N + k X L n = n N U N ..^ N U N + U mod N X L n
243 oveq2 k = U mod N 0 ..^ k = 0 ..^ U mod N
244 243 sumeq1d k = U mod N n 0 ..^ k X L n = n 0 ..^ U mod N X L n
245 242 244 eqeq12d k = U mod N n N U N ..^ N U N + k X L n = n 0 ..^ k X L n n N U N ..^ N U N + U mod N X L n = n 0 ..^ U mod N X L n
246 239 245 rspc2va U N 0 U mod N 0 m 0 k 0 n N m ..^ N m + k X L n = n 0 ..^ k X L n n N U N ..^ N U N + U mod N X L n = n 0 ..^ U mod N X L n
247 30 232 234 246 syl21anc φ U 0 n N U N ..^ N U N + U mod N X L n = n 0 ..^ U mod N X L n
248 229 247 eqtrd φ U 0 n N U N ..^ U X L n = n 0 ..^ U mod N X L n
249 219 248 oveq12d φ U 0 n 0 ..^ N U N X L n + n N U N ..^ U X L n = 0 + n 0 ..^ U mod N X L n
250 fzofi 0 ..^ U mod N Fin
251 250 a1i φ U 0 0 ..^ U mod N Fin
252 7 ad2antrr φ U 0 n 0 ..^ U mod N X D
253 elfzoelz n 0 ..^ U mod N n
254 253 adantl φ U 0 n 0 ..^ U mod N n
255 4 1 5 2 252 254 dchrzrhcl φ U 0 n 0 ..^ U mod N X L n
256 251 255 fsumcl φ U 0 n 0 ..^ U mod N X L n
257 256 addid2d φ U 0 0 + n 0 ..^ U mod N X L n = n 0 ..^ U mod N X L n
258 49 249 257 3eqtrd φ U 0 n 0 ..^ U X L n = n 0 ..^ U mod N X L n
259 258 fveq2d φ U 0 n 0 ..^ U X L n = n 0 ..^ U mod N X L n
260 oveq2 u = U mod N 0 ..^ u = 0 ..^ U mod N
261 260 sumeq1d u = U mod N n 0 ..^ u X L n = n 0 ..^ U mod N X L n
262 261 fveq2d u = U mod N n 0 ..^ u X L n = n 0 ..^ U mod N X L n
263 262 breq1d u = U mod N n 0 ..^ u X L n R n 0 ..^ U mod N X L n R
264 16 adantr φ U 0 u 0 ..^ N n 0 ..^ u X L n R
265 zmodfzo U N U mod N 0 ..^ N
266 230 3 265 syl2anr φ U 0 U mod N 0 ..^ N
267 263 264 266 rspcdva φ U 0 n 0 ..^ U mod N X L n R
268 259 267 eqbrtrd φ U 0 n 0 ..^ U X L n R