Metamath Proof Explorer


Theorem sqwvfoura

Description: Fourier coefficients for the square wave function. Since the square function is an odd function, there is no contribution from the A coefficients. (Contributed by Glauco Siliprandi, 11-Dec-2019)

Ref Expression
Hypotheses sqwvfoura.t T = 2 π
sqwvfoura.f F = x if x mod T < π 1 1
sqwvfoura.n φ N 0
Assertion sqwvfoura φ π π F x cos N x dx π = 0

Proof

Step Hyp Ref Expression
1 sqwvfoura.t T = 2 π
2 sqwvfoura.f F = x if x mod T < π 1 1
3 sqwvfoura.n φ N 0
4 pire π
5 4 renegcli π
6 5 a1i φ π
7 4 a1i φ π
8 0re 0
9 negpilt0 π < 0
10 5 8 9 ltleii π 0
11 pipos 0 < π
12 8 4 11 ltleii 0 π
13 5 4 elicc2i 0 π π 0 π 0 0 π
14 8 10 12 13 mpbir3an 0 π π
15 14 a1i φ 0 π π
16 1red x 1
17 16 renegcld x 1
18 16 17 ifcld x if x mod T < π 1 1
19 18 adantl φ x if x mod T < π 1 1
20 19 2 fmptd φ F :
21 20 adantr φ x π π F :
22 elioore x π π x
23 22 adantl φ x π π x
24 21 23 ffvelrnd φ x π π F x
25 3 nn0red φ N
26 25 adantr φ x π π N
27 26 23 remulcld φ x π π N x
28 27 recoscld φ x π π cos N x
29 24 28 remulcld φ x π π F x cos N x
30 29 recnd φ x π π F x cos N x
31 elioore x π 0 x
32 2 fvmpt2 x if x mod T < π 1 1 F x = if x mod T < π 1 1
33 31 18 32 syl2anc2 x π 0 F x = if x mod T < π 1 1
34 4 a1i x π 0 π
35 2rp 2 +
36 pirp π +
37 rpmulcl 2 + π + 2 π +
38 35 36 37 mp2an 2 π +
39 1 38 eqeltri T +
40 39 a1i x π 0 T +
41 31 40 modcld x π 0 x mod T
42 picn π
43 42 2timesi 2 π = π + π
44 1 43 eqtri T = π + π
45 44 oveq2i - π + T = π + π + π
46 5 recni π
47 46 42 42 addassi π + π + π = π + π + π
48 42 negidi π + π = 0
49 42 46 48 addcomli - π + π = 0
50 49 oveq1i π + π + π = 0 + π
51 42 addid2i 0 + π = π
52 50 51 eqtri π + π + π = π
53 45 47 52 3eqtr2ri π = - π + T
54 5 a1i x π 0 π
55 2re 2
56 55 4 remulcli 2 π
57 1 56 eqeltri T
58 57 a1i x π 0 T
59 5 rexri π *
60 59 a1i x π 0 π *
61 0red x π 0 0
62 61 rexrd x π 0 0 *
63 id x π 0 x π 0
64 ioogtlb π * 0 * x π 0 π < x
65 60 62 63 64 syl3anc x π 0 π < x
66 54 31 58 65 ltadd1dd x π 0 - π + T < x + T
67 53 66 eqbrtrid x π 0 π < x + T
68 57 recni T
69 68 mulid2i 1 T = T
70 69 eqcomi T = 1 T
71 70 oveq2i x + T = x + 1 T
72 71 oveq1i x + T mod T = x + 1 T mod T
73 31 58 readdcld x π 0 x + T
74 11 a1i x π 0 0 < π
75 61 34 73 74 67 lttrd x π 0 0 < x + T
76 61 73 75 ltled x π 0 0 x + T
77 iooltub π * 0 * x π 0 x < 0
78 60 62 63 77 syl3anc x π 0 x < 0
79 31 61 58 78 ltadd1dd x π 0 x + T < 0 + T
80 68 a1i x π 0 T
81 80 addid2d x π 0 0 + T = T
82 79 81 breqtrd x π 0 x + T < T
83 modid x + T T + 0 x + T x + T < T x + T mod T = x + T
84 73 40 76 82 83 syl22anc x π 0 x + T mod T = x + T
85 1zzd x π 0 1
86 modcyc x T + 1 x + 1 T mod T = x mod T
87 31 40 85 86 syl3anc x π 0 x + 1 T mod T = x mod T
88 72 84 87 3eqtr3a x π 0 x + T = x mod T
89 67 88 breqtrd x π 0 π < x mod T
90 34 41 89 ltnsymd x π 0 ¬ x mod T < π
91 90 iffalsed x π 0 if x mod T < π 1 1 = 1
92 33 91 eqtrd x π 0 F x = 1
93 92 oveq1d x π 0 F x cos N x = -1 cos N x
94 93 adantl φ x π 0 F x cos N x = -1 cos N x
95 94 mpteq2dva φ x π 0 F x cos N x = x π 0 -1 cos N x
96 1cnd φ 1
97 96 negcld φ 1
98 25 adantr φ x π 0 N
99 31 adantl φ x π 0 x
100 98 99 remulcld φ x π 0 N x
101 100 recoscld φ x π 0 cos N x
102 ioossicc π 0 π 0
103 102 a1i φ π 0 π 0
104 ioombl π 0 dom vol
105 104 a1i φ π 0 dom vol
106 25 adantr φ x π 0 N
107 iccssre π 0 π 0
108 5 8 107 mp2an π 0
109 108 sseli x π 0 x
110 109 adantl φ x π 0 x
111 106 110 remulcld φ x π 0 N x
112 111 recoscld φ x π 0 cos N x
113 0red φ 0
114 coscn cos : cn
115 114 a1i φ cos : cn
116 ax-resscn
117 108 116 sstri π 0
118 117 a1i φ π 0
119 25 recnd φ N
120 ssid
121 120 a1i φ
122 118 119 121 constcncfg φ x π 0 N : π 0 cn
123 118 121 idcncfg φ x π 0 x : π 0 cn
124 122 123 mulcncf φ x π 0 N x : π 0 cn
125 115 124 cncfmpt1f φ x π 0 cos N x : π 0 cn
126 cniccibl π 0 x π 0 cos N x : π 0 cn x π 0 cos N x 𝐿 1
127 6 113 125 126 syl3anc φ x π 0 cos N x 𝐿 1
128 103 105 112 127 iblss φ x π 0 cos N x 𝐿 1
129 97 101 128 iblmulc2 φ x π 0 -1 cos N x 𝐿 1
130 95 129 eqeltrd φ x π 0 F x cos N x 𝐿 1
131 elioore x 0 π x
132 131 18 32 syl2anc2 x 0 π F x = if x mod T < π 1 1
133 39 a1i x 0 π T +
134 0red x 0 π 0
135 134 rexrd x 0 π 0 *
136 4 rexri π *
137 136 a1i x 0 π π *
138 id x 0 π x 0 π
139 ioogtlb 0 * π * x 0 π 0 < x
140 135 137 138 139 syl3anc x 0 π 0 < x
141 134 131 140 ltled x 0 π 0 x
142 4 a1i x 0 π π
143 57 a1i x 0 π T
144 iooltub 0 * π * x 0 π x < π
145 135 137 138 144 syl3anc x 0 π x < π
146 2timesgt π + π < 2 π
147 36 146 ax-mp π < 2 π
148 147 1 breqtrri π < T
149 148 a1i x 0 π π < T
150 131 142 143 145 149 lttrd x 0 π x < T
151 modid x T + 0 x x < T x mod T = x
152 131 133 141 150 151 syl22anc x 0 π x mod T = x
153 152 145 eqbrtrd x 0 π x mod T < π
154 153 iftrued x 0 π if x mod T < π 1 1 = 1
155 132 154 eqtrd x 0 π F x = 1
156 155 oveq1d x 0 π F x cos N x = 1 cos N x
157 156 adantl φ x 0 π F x cos N x = 1 cos N x
158 157 mpteq2dva φ x 0 π F x cos N x = x 0 π 1 cos N x
159 25 adantr φ x 0 π N
160 131 adantl φ x 0 π x
161 159 160 remulcld φ x 0 π N x
162 161 recoscld φ x 0 π cos N x
163 ioossicc 0 π 0 π
164 163 a1i φ 0 π 0 π
165 ioombl 0 π dom vol
166 165 a1i φ 0 π dom vol
167 25 adantr φ x 0 π N
168 iccssre 0 π 0 π
169 8 4 168 mp2an 0 π
170 169 sseli x 0 π x
171 170 adantl φ x 0 π x
172 167 171 remulcld φ x 0 π N x
173 172 recoscld φ x 0 π cos N x
174 169 116 sstri 0 π
175 174 a1i φ 0 π
176 175 119 121 constcncfg φ x 0 π N : 0 π cn
177 175 121 idcncfg φ x 0 π x : 0 π cn
178 176 177 mulcncf φ x 0 π N x : 0 π cn
179 115 178 cncfmpt1f φ x 0 π cos N x : 0 π cn
180 cniccibl 0 π x 0 π cos N x : 0 π cn x 0 π cos N x 𝐿 1
181 113 7 179 180 syl3anc φ x 0 π cos N x 𝐿 1
182 164 166 173 181 iblss φ x 0 π cos N x 𝐿 1
183 96 162 182 iblmulc2 φ x 0 π 1 cos N x 𝐿 1
184 158 183 eqeltrd φ x 0 π F x cos N x 𝐿 1
185 6 7 15 30 130 184 itgsplitioo φ π π F x cos N x dx = π 0 F x cos N x dx + 0 π F x cos N x dx
186 185 oveq1d φ π π F x cos N x dx π = π 0 F x cos N x dx + 0 π F x cos N x dx π
187 94 itgeq2dv φ π 0 F x cos N x dx = π 0 -1 cos N x dx
188 97 101 128 itgmulc2 φ -1 π 0 cos N x dx = π 0 -1 cos N x dx
189 oveq1 N = 0 N x = 0 x
190 ioosscn π 0
191 190 sseli x π 0 x
192 191 mul02d x π 0 0 x = 0
193 189 192 sylan9eq N = 0 x π 0 N x = 0
194 193 fveq2d N = 0 x π 0 cos N x = cos 0
195 cos0 cos 0 = 1
196 194 195 eqtrdi N = 0 x π 0 cos N x = 1
197 196 adantll φ N = 0 x π 0 cos N x = 1
198 197 itgeq2dv φ N = 0 π 0 cos N x dx = π 0 1 dx
199 ioovolcl π 0 vol π 0
200 5 8 199 mp2an vol π 0
201 200 a1i φ vol π 0
202 itgconst π 0 dom vol vol π 0 1 π 0 1 dx = 1 vol π 0
203 105 201 96 202 syl3anc φ π 0 1 dx = 1 vol π 0
204 203 adantr φ N = 0 π 0 1 dx = 1 vol π 0
205 volioo π 0 π 0 vol π 0 = 0 π
206 5 8 10 205 mp3an vol π 0 = 0 π
207 0cn 0
208 207 42 subnegi 0 π = 0 + π
209 206 208 51 3eqtri vol π 0 = π
210 209 a1i φ vol π 0 = π
211 210 oveq2d φ 1 vol π 0 = 1 π
212 42 a1i φ π
213 212 mulid2d φ 1 π = π
214 211 213 eqtrd φ 1 vol π 0 = π
215 214 adantr φ N = 0 1 vol π 0 = π
216 198 204 215 3eqtrd φ N = 0 π 0 cos N x dx = π
217 216 oveq2d φ N = 0 -1 π 0 cos N x dx = -1 π
218 42 mulm1i -1 π = π
219 218 a1i φ N = 0 -1 π = π
220 iftrue N = 0 if N = 0 π 0 = π
221 220 eqcomd N = 0 π = if N = 0 π 0
222 221 adantl φ N = 0 π = if N = 0 π 0
223 217 219 222 3eqtrd φ N = 0 -1 π 0 cos N x dx = if N = 0 π 0
224 25 adantr φ ¬ N = 0 N
225 3 nn0ge0d φ 0 N
226 225 adantr φ ¬ N = 0 0 N
227 neqne ¬ N = 0 N 0
228 227 adantl φ ¬ N = 0 N 0
229 224 226 228 ne0gt0d φ ¬ N = 0 0 < N
230 1cnd φ 0 < N 1
231 230 negcld φ 0 < N 1
232 231 mul01d φ 0 < N -1 0 = 0
233 119 adantr φ 0 < N N
234 5 a1i φ 0 < N π
235 0red φ 0 < N 0
236 10 a1i φ 0 < N π 0
237 simpr φ 0 < N 0 < N
238 237 gt0ne0d φ 0 < N N 0
239 233 234 235 236 238 itgcoscmulx φ 0 < N π 0 cos N x dx = sin N 0 sin N π N
240 119 mul01d φ N 0 = 0
241 240 fveq2d φ sin N 0 = sin 0
242 sin0 sin 0 = 0
243 241 242 eqtrdi φ sin N 0 = 0
244 119 212 mulneg2d φ N π = N π
245 244 fveq2d φ sin N π = sin N π
246 119 212 mulcld φ N π
247 sinneg N π sin N π = sin N π
248 246 247 syl φ sin N π = sin N π
249 245 248 eqtrd φ sin N π = sin N π
250 243 249 oveq12d φ sin N 0 sin N π = 0 sin N π
251 0cnd φ 0
252 246 sincld φ sin N π
253 251 252 subnegd φ 0 sin N π = 0 + sin N π
254 252 addid2d φ 0 + sin N π = sin N π
255 250 253 254 3eqtrd φ sin N 0 sin N π = sin N π
256 255 adantr φ 0 < N sin N 0 sin N π = sin N π
257 256 oveq1d φ 0 < N sin N 0 sin N π N = sin N π N
258 3 nn0zd φ N
259 sinkpi N sin N π = 0
260 258 259 syl φ sin N π = 0
261 260 oveq1d φ sin N π N = 0 N
262 261 adantr φ 0 < N sin N π N = 0 N
263 233 238 div0d φ 0 < N 0 N = 0
264 262 263 eqtrd φ 0 < N sin N π N = 0
265 239 257 264 3eqtrd φ 0 < N π 0 cos N x dx = 0
266 265 oveq2d φ 0 < N -1 π 0 cos N x dx = -1 0
267 238 neneqd φ 0 < N ¬ N = 0
268 267 iffalsed φ 0 < N if N = 0 π 0 = 0
269 232 266 268 3eqtr4d φ 0 < N -1 π 0 cos N x dx = if N = 0 π 0
270 229 269 syldan φ ¬ N = 0 -1 π 0 cos N x dx = if N = 0 π 0
271 223 270 pm2.61dan φ -1 π 0 cos N x dx = if N = 0 π 0
272 187 188 271 3eqtr2d φ π 0 F x cos N x dx = if N = 0 π 0
273 157 itgeq2dv φ 0 π F x cos N x dx = 0 π 1 cos N x dx
274 96 162 182 itgmulc2 φ 1 0 π cos N x dx = 0 π 1 cos N x dx
275 162 182 itgcl φ 0 π cos N x dx
276 275 mulid2d φ 1 0 π cos N x dx = 0 π cos N x dx
277 simpl N = 0 x 0 π N = 0
278 277 oveq1d N = 0 x 0 π N x = 0 x
279 131 recnd x 0 π x
280 279 adantl N = 0 x 0 π x
281 280 mul02d N = 0 x 0 π 0 x = 0
282 278 281 eqtrd N = 0 x 0 π N x = 0
283 282 fveq2d N = 0 x 0 π cos N x = cos 0
284 283 195 eqtrdi N = 0 x 0 π cos N x = 1
285 284 adantll φ N = 0 x 0 π cos N x = 1
286 285 itgeq2dv φ N = 0 0 π cos N x dx = 0 π 1 dx
287 ioovolcl 0 π vol 0 π
288 8 4 287 mp2an vol 0 π
289 ax-1cn 1
290 itgconst 0 π dom vol vol 0 π 1 0 π 1 dx = 1 vol 0 π
291 165 288 289 290 mp3an 0 π 1 dx = 1 vol 0 π
292 291 a1i φ N = 0 0 π 1 dx = 1 vol 0 π
293 42 mulid2i 1 π = π
294 volioo 0 π 0 π vol 0 π = π 0
295 8 4 12 294 mp3an vol 0 π = π 0
296 42 subid1i π 0 = π
297 295 296 eqtri vol 0 π = π
298 297 oveq2i 1 vol 0 π = 1 π
299 298 a1i N = 0 1 vol 0 π = 1 π
300 iftrue N = 0 if N = 0 π 0 = π
301 293 299 300 3eqtr4a N = 0 1 vol 0 π = if N = 0 π 0
302 301 adantl φ N = 0 1 vol 0 π = if N = 0 π 0
303 286 292 302 3eqtrd φ N = 0 0 π cos N x dx = if N = 0 π 0
304 260 243 oveq12d φ sin N π sin N 0 = 0 0
305 251 subidd φ 0 0 = 0
306 304 305 eqtrd φ sin N π sin N 0 = 0
307 306 oveq1d φ sin N π sin N 0 N = 0 N
308 307 adantr φ 0 < N sin N π sin N 0 N = 0 N
309 308 263 eqtrd φ 0 < N sin N π sin N 0 N = 0
310 4 a1i φ 0 < N π
311 12 a1i φ 0 < N 0 π
312 233 235 310 311 238 itgcoscmulx φ 0 < N 0 π cos N x dx = sin N π sin N 0 N
313 267 iffalsed φ 0 < N if N = 0 π 0 = 0
314 309 312 313 3eqtr4d φ 0 < N 0 π cos N x dx = if N = 0 π 0
315 229 314 syldan φ ¬ N = 0 0 π cos N x dx = if N = 0 π 0
316 303 315 pm2.61dan φ 0 π cos N x dx = if N = 0 π 0
317 276 316 eqtrd φ 1 0 π cos N x dx = if N = 0 π 0
318 273 274 317 3eqtr2d φ 0 π F x cos N x dx = if N = 0 π 0
319 272 318 oveq12d φ π 0 F x cos N x dx + 0 π F x cos N x dx = if N = 0 π 0 + if N = 0 π 0
320 319 oveq1d φ π 0 F x cos N x dx + 0 π F x cos N x dx π = if N = 0 π 0 + if N = 0 π 0 π
321 220 300 oveq12d N = 0 if N = 0 π 0 + if N = 0 π 0 = - π + π
322 321 49 eqtrdi N = 0 if N = 0 π 0 + if N = 0 π 0 = 0
323 iffalse ¬ N = 0 if N = 0 π 0 = 0
324 iffalse ¬ N = 0 if N = 0 π 0 = 0
325 323 324 oveq12d ¬ N = 0 if N = 0 π 0 + if N = 0 π 0 = 0 + 0
326 00id 0 + 0 = 0
327 325 326 eqtrdi ¬ N = 0 if N = 0 π 0 + if N = 0 π 0 = 0
328 322 327 pm2.61i if N = 0 π 0 + if N = 0 π 0 = 0
329 328 oveq1i if N = 0 π 0 + if N = 0 π 0 π = 0 π
330 8 11 gtneii π 0
331 42 330 div0i 0 π = 0
332 329 331 eqtri if N = 0 π 0 + if N = 0 π 0 π = 0
333 332 a1i φ if N = 0 π 0 + if N = 0 π 0 π = 0
334 186 320 333 3eqtrd φ π π F x cos N x dx π = 0