-
Notifications
You must be signed in to change notification settings - Fork 45
/
MoreFunSeries.v
1123 lines (955 loc) · 32.2 KB
/
MoreFunSeries.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
(* Copyright © 1998-2006
* Henk Barendregt
* Luís Cruz-Filipe
* Herman Geuvers
* Mariusz Giero
* Rik van Ginneken
* Dimitri Hendriks
* Sébastien Hinderer
* Bart Kirkels
* Pierre Letouzey
* Iris Loeb
* Lionel Mamane
* Milad Niqui
* Russell O’Connor
* Randy Pollack
* Nickolay V. Shmyrev
* Bas Spitters
* Dan Synek
* Freek Wiedijk
* Jan Zwanenburg
*
* This work is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This work is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this work; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*)
Require Export CoRN.ftc.FunctSeries.
Require Export CoRN.ftc.MoreFunctions.
(** printing FSeries_Sum %\ensuremath{\sum_{\infty}}% #∑'<sub>∞</sub># *)
Section Definitions.
(**
* More on Sequences and Series
We will now extend our convergence definitions and results for
sequences and series of functions defined in compact intervals to
arbitrary intervals.
%\begin{convention}% Throughout this file, [J] will be an interval,
[f, g] will be sequences of continuous (in [J]) functions and [F,G]
will be continuous (in [J]) functions.
%\end{convention}%
** Sequences
First we will consider the case of sequences.
*** Definitions
Some of the definitions do not make sense in this more general setting
(for instance, because the norm of a function is no longer defined),
but the ones which do we simply adapt in the usual way.
*)
Variable J : interval.
Variable f : nat -> PartIR.
Variable F : PartIR.
Hypothesis contf : forall n : nat, Continuous J (f n).
Hypothesis contF : Continuous J F.
Definition Cauchy_fun_seq_IR := forall a b Hab (Hinc : included (compact a b Hab) J),
Cauchy_fun_seq _ _ _ f (fun n => included_imp_Continuous _ _ (contf n) _ _ _ Hinc).
Definition conv_fun_seq_IR := forall a b Hab (Hinc : included (Compact Hab) J),
conv_fun_seq a b Hab f (fun n => included_imp_Continuous _ _ (contf n) _ _ _ Hinc).
Definition conv_fun_seq'_IR := forall a b Hab (Hinc : included (Compact Hab) J),
conv_fun_seq' a b Hab f F
(fun n => included_imp_Continuous _ _ (contf n) _ _ _ Hinc)
(included_imp_Continuous _ _ contF _ _ _ Hinc).
Definition Cauchy_fun_seq2_IR := forall a b Hab (Hinc : included (compact a b Hab) J),
Cauchy_fun_seq2 _ _ _ f (fun n => included_imp_Continuous _ _ (contf n) _ _ _ Hinc).
(**
The equivalences between these definitions still hold.
*)
Lemma conv_Cauchy_fun_seq'_IR : conv_fun_seq'_IR -> Cauchy_fun_seq_IR.
Proof.
intro H.
red in |- *; red in H.
intros.
apply conv_Cauchy_fun_seq' with F (included_imp_Continuous _ _ contF _ _ _ Hinc); auto.
Qed.
Lemma Cauchy_fun_seq_seq2_IR : Cauchy_fun_seq_IR -> Cauchy_fun_seq2_IR.
Proof.
intro H.
red in |- *; red in H.
intros.
apply Cauchy_fun_seq_seq2; auto.
Qed.
Lemma Cauchy_fun_seq2_seq_IR : Cauchy_fun_seq2_IR -> Cauchy_fun_seq_IR.
Proof.
intro H.
red in |- *; red in H.
intros.
apply Cauchy_fun_seq2_seq; auto.
Qed.
Lemma Cauchy_fun_real_IR : Cauchy_fun_seq_IR -> forall x Hx,
Cauchy_prop (fun n => Part _ _ (Continuous_imp_inc _ _ (contf n) x Hx)).
Proof.
intros H x Hx.
red in H.
cut (included (compact_single x) J). intro H0.
set (contf' := fun i : nat => included_imp_Continuous J (f i) (contf i) _ _ (leEq_reflexive _ x) H0)
in *.
apply Cauchy_prop_wd with (fun n : nat => Part (f n) x ((fun i : nat =>
contin_imp_inc _ _ (leEq_reflexive _ x) (f i) (contf' i)) n x (compact_single_prop x))).
apply Cauchy_fun_real.
unfold contf' in |- *; simpl in |- *; apply H.
intro; simpl in |- *; algebra.
apply compact_single_iprop; auto.
Qed.
End Definitions.
Section More_Definitions.
(**
Limit is defined and works in the same way as before.
*)
Variable J : interval.
Variable f : nat -> PartIR.
Hypothesis contf : forall n : nat, Continuous J (f n).
(* begin show *)
Hypothesis conv : Cauchy_fun_seq_IR J f contf.
(* end show *)
Definition Cauchy_fun_seq_Lim_IR : PartIR.
Proof.
apply Build_PartFunct with (pfpfun := fun (x : IR) (Hx : J x) =>
Lim (Build_CauchySeq _ _ (Cauchy_fun_real_IR _ _ _ conv x Hx))).
apply iprop_wd.
intros x y Hx Hy H.
elim (Lim_strext _ _ H).
intros n Hn.
simpl in Hn.
exact (pfstrx _ _ _ _ _ _ Hn).
Defined.
Lemma Cauchy_fun_seq_Lim_char : forall a b Hab (Hinc : included (Compact Hab) J),
Feq (Compact Hab) Cauchy_fun_seq_Lim_IR
(Cauchy_fun_seq_Lim _ _ _ _ _ (conv a b Hab Hinc)).
Proof.
intros.
FEQ.
simpl in |- *.
apply Lim_wd'; intros; simpl in |- *; algebra.
Qed.
End More_Definitions.
Section Irrelevance_of_Proofs.
(**
*** Basic Properties
Proofs are irrelevant as before---they just have to be present.
*)
Variable J : interval.
Variable f : nat -> PartIR.
(* begin show *)
Hypotheses contf contf0 : forall n : nat, Continuous J (f n).
(* end show *)
Variable F : PartIR.
(* begin show *)
Hypotheses contF contF0 : Continuous J F.
(* end show *)
Lemma conv_fun_seq'_wd_IR : conv_fun_seq'_IR _ _ _ contf contF ->
conv_fun_seq'_IR _ _ _ contf0 contF0.
intro H.
red in |- *; intros.
eapply conv_fun_seq'_wd.
apply (H a b Hab Hinc).
Qed.
Lemma Cauchy_fun_seq2_wd_IR : Cauchy_fun_seq2_IR _ _ contf ->
Cauchy_fun_seq2_IR _ _ contf0.
Proof.
intro H.
red in |- *; intros.
eapply Cauchy_fun_seq2_wd.
apply (H a b Hab Hinc).
Qed.
Lemma conv_fun_seq_wd_IR : conv_fun_seq_IR _ _ contf ->
conv_fun_seq_IR _ _ contf0.
Proof.
intro H.
red in |- *; intros.
eapply conv_fun_seq_wd.
apply (H a b Hab Hinc).
Qed.
End Irrelevance_of_Proofs.
Opaque Cauchy_fun_seq_Lim_IR.
Section More_Properties.
Variable J : interval.
Variables f g : nat -> PartIR.
(* begin show *)
Hypotheses contf contf0 : forall n : nat, Continuous J (f n).
Hypotheses contg contg0 : forall n : nat, Continuous J (g n).
(* end show *)
Lemma Cauchy_conv_fun_seq'_IR : forall H contf',
conv_fun_seq'_IR _ _ (Cauchy_fun_seq_Lim_IR _ _ contf H) contf contf'.
Proof.
intros.
red in |- *; intros.
eapply conv_fun_seq'_wdr.
apply Feq_symmetric.
apply (Cauchy_fun_seq_Lim_char J f contf H a b Hab Hinc).
apply Cauchy_conv_fun_seq' with (H := H a b Hab Hinc)
(contf' := Cauchy_cont_Lim _ _ _ _ _ (H a b Hab Hinc)).
Qed.
Variables F G : PartIR.
(* begin show *)
Hypotheses contF contF0 : Continuous J F.
Hypotheses contG contG0 : Continuous J G.
(* end show *)
Lemma conv_fun_seq'_wdl_IR : (forall n, Feq J (f n) (g n)) ->
conv_fun_seq'_IR _ _ _ contf contF -> conv_fun_seq'_IR _ _ _ contg contF0.
Proof.
intros H H0 a b Hab Hinc.
eapply conv_fun_seq'_wdl with (f := f).
2: apply (H0 a b Hab Hinc).
intro; elim (H n); intros.
inversion_clear b0.
apply eq_imp_Feq; Included.
Qed.
Lemma conv_fun_seq'_wdr_IR : Feq J F G ->
conv_fun_seq'_IR _ _ _ contf contF -> conv_fun_seq'_IR _ _ _ contf0 contG.
Proof.
intros H H0 a b Hab Hinc.
eapply conv_fun_seq'_wdr with (F := F).
2: apply (H0 a b Hab Hinc).
apply included_Feq with J; auto.
Qed.
Lemma conv_fun_seq'_wdl'_IR : (forall n, Feq J (f n) (g n)) ->
conv_fun_seq'_IR _ _ _ contf contF -> conv_fun_seq'_IR _ _ _ contg contF.
Proof.
intros H H0 a b Hab Hinc.
eapply conv_fun_seq'_wdl' with (f := f); auto.
intro; elim (H n); intros.
inversion_clear b0.
apply eq_imp_Feq; Included.
Qed.
Lemma conv_fun_seq'_wdr'_IR : Feq J F G ->
conv_fun_seq'_IR _ _ _ contf contF -> conv_fun_seq'_IR _ _ _ contf contG.
Proof.
intros H H0 a b Hab Hinc.
eapply conv_fun_seq'_wdr' with (F := F).
2: apply (H0 a b Hab Hinc).
apply included_Feq with J; auto.
Qed.
Lemma Cauchy_cont_Lim_IR : forall H, Continuous J (Cauchy_fun_seq_Lim_IR _ _ contf H).
Proof.
intros.
split; Included.
intros a b Hab H0; eapply Continuous_I_wd.
apply Feq_symmetric.
apply (Cauchy_fun_seq_Lim_char J f contf H a b Hab H0).
Contin.
Qed.
Lemma Cauchy_conv_fun_seq_IR : Cauchy_fun_seq_IR _ _ contf ->
conv_fun_seq_IR _ _ contf.
Proof.
intros H a b Hab Hinc.
eapply Cauchy_conv_fun_seq.
apply (H a b Hab Hinc).
Qed.
Lemma conv_Cauchy_fun_seq_IR : conv_fun_seq_IR _ _ contf ->
Cauchy_fun_seq_IR _ _ contf.
Proof.
intros H a b Hab Hinc.
eapply conv_Cauchy_fun_seq.
apply (H a b Hab Hinc).
Qed.
End More_Properties.
#[global]
Hint Resolve Cauchy_cont_Lim_IR: continuous.
Section Algebraic_Properties.
(**
*** Algebraic Properties
Algebraic operations still work well.
*)
Variable J : interval.
Variables f g : nat -> PartIR.
Hypothesis contf : forall n : nat, Continuous J (f n).
Hypothesis contg : forall n : nat, Continuous J (g n).
Lemma FLim_unique_IR : forall F G HF HG,
conv_fun_seq'_IR J f F contf HF -> conv_fun_seq'_IR J f G contf HG -> Feq J F G.
Proof.
intros F G HF HG H H0.
apply included_Feq'.
intros a b Hab H1.
apply FLim_unique with f (fun n : nat => included_imp_Continuous _ _ (contf n) _ _ _ H1)
(included_imp_Continuous _ _ HF _ _ _ H1) (included_imp_Continuous _ _ HG _ _ _ H1); auto.
Qed.
Lemma Cauchy_fun_seq_wd_IR : (forall n, Feq J (f n) (g n)) ->
Cauchy_fun_seq_IR _ _ contf -> Cauchy_fun_seq_IR _ _ contg.
Proof.
intros H H0 a b Hab Hinc.
eapply Cauchy_fun_seq_wd with (f := f).
2: apply (H0 a b Hab Hinc).
intro; apply included_Feq with J; auto.
Qed.
Lemma fun_Lim_seq_const_IR : forall H contH contH',
conv_fun_seq'_IR J (fun n => H) H contH contH'.
Proof.
exists 0; intros.
eapply leEq_wdl.
2: eapply eq_transitive_unfolded.
2: apply eq_symmetric_unfolded; apply AbsIRz_isz.
apply less_leEq; assumption.
apply AbsIR_wd; rational.
Qed.
Lemma fun_Cauchy_prop_const_IR : forall H (contH:Continuous J H), Cauchy_fun_seq_IR J (fun n => H) (fun n => contH).
Proof.
intros.
apply conv_Cauchy_fun_seq'_IR with H (contH).
apply fun_Lim_seq_const_IR.
Qed.
Variables F G : PartIR.
Hypothesis contF : Continuous J F.
Hypothesis contG : Continuous J G.
(* begin show *)
Hypothesis convF : conv_fun_seq'_IR _ _ _ contf contF.
Hypothesis convG : conv_fun_seq'_IR _ _ _ contg contG.
(* end show *)
Lemma fun_Lim_seq_plus'_IR : forall H H',
conv_fun_seq'_IR J (fun n => f n{+}g n) (F{+}G) H H'.
Proof.
intros.
red in |- *; intros.
eapply fun_Lim_seq_plus'.
apply (convF a b Hab Hinc).
apply (convG a b Hab Hinc).
Qed.
Lemma fun_Lim_seq_minus'_IR : forall H H',
conv_fun_seq'_IR J (fun n => f n{-}g n) (F{-}G) H H'.
Proof.
intros.
red in |- *; intros.
eapply fun_Lim_seq_minus'.
apply (convF a b Hab Hinc).
apply (convG a b Hab Hinc).
Qed.
Lemma fun_Lim_seq_mult'_IR : forall H H',
conv_fun_seq'_IR J (fun n => f n{*}g n) (F{*}G) H H'.
Proof.
intros.
red in |- *; intros.
eapply fun_Lim_seq_mult'.
apply (convF a b Hab Hinc).
apply (convG a b Hab Hinc).
Qed.
End Algebraic_Properties.
Section More_Algebraic_Properties.
(**
If we work with the limit function things fit in just as well.
*)
Variable J : interval.
Variables f g : nat -> PartIR.
Hypothesis contf : forall n : nat, Continuous J (f n).
Hypothesis contg : forall n : nat, Continuous J (g n).
(* begin show *)
Hypothesis Hf : Cauchy_fun_seq_IR _ _ contf.
Hypothesis Hg : Cauchy_fun_seq_IR _ _ contg.
(* end show *)
Lemma fun_Lim_seq_plus_IR : forall H H', conv_fun_seq'_IR J (fun n => f n{+}g n)
(Cauchy_fun_seq_Lim_IR _ _ _ Hf{+}Cauchy_fun_seq_Lim_IR _ _ _ Hg) H H'.
Proof.
intros.
red in |- *; intros.
cut (Continuous_I Hab (Cauchy_fun_seq_Lim _ _ _ _ _ (Hf a b Hab Hinc))); [ intro H0 | Contin ].
cut (Continuous_I Hab (Cauchy_fun_seq_Lim _ _ _ _ _ (Hg a b Hab Hinc))); [ intro H1 | Contin ].
eapply conv_fun_seq'_wdr with (contF := Continuous_I_plus _ _ _ _ _ H0 H1).
apply Feq_symmetric; apply Feq_plus; apply Cauchy_fun_seq_Lim_char.
apply fun_Lim_seq_plus with (Hf := Hf a b Hab Hinc) (Hg := Hg a b Hab Hinc)
(H := fun n : nat => included_imp_Continuous _ _ (H n) _ _ _ Hinc).
Qed.
Lemma fun_Cauchy_prop_plus : forall H, Cauchy_fun_seq_IR J (fun n => f n{+}g n) H.
Proof.
intro.
cut (Continuous J (Cauchy_fun_seq_Lim_IR _ _ _ Hf{+}Cauchy_fun_seq_Lim_IR _ _ _ Hg));
[ intro H0 | Contin ].
apply conv_Cauchy_fun_seq'_IR
with (Cauchy_fun_seq_Lim_IR _ _ _ Hf{+}Cauchy_fun_seq_Lim_IR _ _ _ Hg) H0.
apply fun_Lim_seq_plus_IR.
Qed.
Lemma fun_Lim_seq_inv_IR : forall H H',
conv_fun_seq'_IR J (fun n => {--} (f n)) {--} (Cauchy_fun_seq_Lim_IR _ _ _ Hf) H H'.
Proof.
intros.
red in |- *; intros.
cut (Continuous_I Hab (Cauchy_fun_seq_Lim _ _ _ _ _ (Hf a b Hab Hinc))); [ intro H0 | Contin ].
intros.
eapply conv_fun_seq'_wdr with (contF := Continuous_I_inv _ _ _ _ H0).
apply Feq_symmetric; apply Feq_inv; apply Cauchy_fun_seq_Lim_char.
apply fun_Lim_seq_inv with (Hf := Hf a b Hab Hinc)
(H := fun n : nat => included_imp_Continuous _ _ (H n) _ _ _ Hinc).
Qed.
Lemma fun_Cauchy_prop_inv : forall H, Cauchy_fun_seq_IR J (fun n => {--} (f n)) H.
Proof.
intro.
cut (Continuous J {--} (Cauchy_fun_seq_Lim_IR _ _ _ Hf)); [ intro H0 | Contin ].
apply conv_Cauchy_fun_seq'_IR with ( {--} (Cauchy_fun_seq_Lim_IR _ _ _ Hf)) H0.
apply fun_Lim_seq_inv_IR.
Qed.
Lemma fun_Lim_seq_minus_IR : forall H H', conv_fun_seq'_IR J (fun n => f n{-}g n)
(Cauchy_fun_seq_Lim_IR _ _ _ Hf{-}Cauchy_fun_seq_Lim_IR _ _ _ Hg) H H'.
Proof.
intros.
red in |- *; intros.
cut (Continuous_I Hab (Cauchy_fun_seq_Lim _ _ _ _ _ (Hf a b Hab Hinc))); [ intro H0 | Contin ].
cut (Continuous_I Hab (Cauchy_fun_seq_Lim _ _ _ _ _ (Hg a b Hab Hinc))); [ intro H1 | Contin ].
intros.
eapply conv_fun_seq'_wdr with (contF := Continuous_I_minus _ _ _ _ _ H0 H1).
apply Feq_symmetric; apply Feq_minus; apply Cauchy_fun_seq_Lim_char.
apply fun_Lim_seq_minus with (Hf := Hf a b Hab Hinc) (Hg := Hg a b Hab Hinc)
(H := fun n : nat => included_imp_Continuous _ _ (H n) _ _ _ Hinc).
Qed.
Lemma fun_Cauchy_prop_minus : forall H, Cauchy_fun_seq_IR J (fun n => f n{-}g n) H.
Proof.
intro.
cut (Continuous J (Cauchy_fun_seq_Lim_IR _ _ _ Hf{-}Cauchy_fun_seq_Lim_IR _ _ _ Hg));
[ intro H0 | Contin ].
apply conv_Cauchy_fun_seq'_IR
with (Cauchy_fun_seq_Lim_IR _ _ _ Hf{-}Cauchy_fun_seq_Lim_IR _ _ _ Hg) H0.
apply fun_Lim_seq_minus_IR.
Qed.
Lemma fun_Lim_seq_mult_IR : forall H H', conv_fun_seq'_IR J (fun n => f n{*}g n)
(Cauchy_fun_seq_Lim_IR _ _ _ Hf{*}Cauchy_fun_seq_Lim_IR _ _ _ Hg) H H'.
Proof.
intros.
red in |- *; intros.
cut (Continuous_I Hab (Cauchy_fun_seq_Lim _ _ _ _ _ (Hf a b Hab Hinc))); [ intro H0 | Contin ].
cut (Continuous_I Hab (Cauchy_fun_seq_Lim _ _ _ _ _ (Hg a b Hab Hinc))); [ intro H1 | Contin ].
intros.
eapply conv_fun_seq'_wdr with (contF := Continuous_I_mult _ _ _ _ _ H0 H1).
apply Feq_symmetric; apply Feq_mult; apply Cauchy_fun_seq_Lim_char.
apply fun_Lim_seq_mult with (Hf := Hf a b Hab Hinc) (Hg := Hg a b Hab Hinc)
(H := fun n : nat => included_imp_Continuous _ _ (H n) _ _ _ Hinc).
Qed.
Lemma fun_Cauchy_prop_mult : forall H, Cauchy_fun_seq_IR J (fun n => f n{*}g n) H.
Proof.
intro.
cut (Continuous J (Cauchy_fun_seq_Lim_IR _ _ _ Hf{*}Cauchy_fun_seq_Lim_IR _ _ _ Hg));
[ intro H0 | Contin ].
apply conv_Cauchy_fun_seq'_IR
with (Cauchy_fun_seq_Lim_IR _ _ _ Hf{*}Cauchy_fun_seq_Lim_IR _ _ _ Hg) H0.
apply fun_Lim_seq_mult_IR.
Qed.
End More_Algebraic_Properties.
Section Other.
(**
*** Miscellaneous
Finally, we define a mapping between sequences of real numbers and sequences of (constant) functions and prove that convergence is preserved.
*)
Definition seq_to_funseq (x : nat -> IR) n : PartIR := [-C-] (x n).
Lemma funseq_conv : forall J x y, nonvoid J -> conv_fun_seq'_IR J
(seq_to_funseq x) [-C-]y (fun n => Continuous_const _ _) (Continuous_const _ _) ->
Cauchy_Lim_prop2 x y.
Proof.
intros J x y H H0 eps H1.
elim (nonvoid_point J H); intros x0 Hx0.
cut (included (compact_single x0) J).
2: apply compact_single_iprop; auto.
intro H2.
elim (H0 _ _ (leEq_reflexive _ _) H2 eps).
intros N HN.
exists N; intros.
simpl in HN.
apply AbsIR_imp_AbsSmall.
apply HN with x0.
auto.
fold (compact_single x0) in |- *.
apply compact_single_prop.
auto.
Qed.
(**
Another interesting fact: if a sequence of constant functions converges then it must converge to a constant function.
*)
Lemma fun_const_Lim : forall J f F contf contF, proper J ->
conv_fun_seq'_IR J f F contf contF -> (forall n, {c : IR | Feq J (f n) [-C-]c}) ->
{c : IR | Feq J F [-C-]c}.
Proof.
intros J f F contf contF pJ H H0.
set (incF := Continuous_imp_inc _ _ contF) in *.
set (incf := fun n : nat => Continuous_imp_inc _ _ (contf n)) in *.
elim (nonvoid_point _ (proper_nonvoid _ pJ)); intros x0 Hx0.
exists (Part F x0 (incF x0 Hx0)).
FEQ. rename X into H1.
simpl in |- *.
apply cg_inv_unique_2; apply AbsIR_approach_zero.
intros e H2.
cut (included (Compact (Min_leEq_Max x x0)) J).
2: apply included_interval; auto.
intro Hinc.
elim (H _ _ _ Hinc _ (pos_div_two _ _ H2)); intros N HN.
set (Fx := Part _ _ Hx) in *.
set (Fa := Part _ _ (incF x0 Hx0)) in *.
set (fx := Part _ _ (incf N x H1)) in *.
set (fa := Part _ _ (incf N x0 Hx0)) in *.
apply leEq_wdl with (AbsIR (Fx[-]fx[+] (fx[-]fa) [+] (fa[-]Fa))).
2: apply AbsIR_wd; rational.
rstepr (e [/]TwoNZ[+][0][+]e [/]TwoNZ).
eapply leEq_transitive.
apply triangle_IR.
apply plus_resp_leEq_both.
eapply leEq_transitive.
apply triangle_IR.
apply plus_resp_leEq_both.
eapply leEq_wdl.
2: apply AbsIR_minus.
eapply leEq_wdl.
apply (HN N (le_n N) x (compact_Min_lft _ _ _)).
unfold Fx, fx in |- *; apply AbsIR_wd; rational.
elim (H0 N); intros c Hc.
apply eq_imp_leEq.
eapply eq_transitive_unfolded.
2: apply AbsIRz_isz.
elim Hc; clear Hc; intros H5 H3.
elim H3; clear H3; intros H6 H4.
apply AbsIR_wd; unfold fx, fa in |- *; astepr (c[-]c).
apply cg_minus_wd; simpl in H4; apply H4; auto.
eapply leEq_wdl.
apply (HN N (le_n N) x0 (compact_Min_rht _ _ _)).
unfold Fa, fa in |- *; apply AbsIR_wd; rational.
Qed.
End Other.
Section Series_Definitions.
(**
** Series
We now consider series of functions defined in arbitrary intervals.
Convergence is defined as expected---through convergence in every compact interval.
*)
Variable J : interval.
Variable f : nat -> PartIR.
Definition fun_series_convergent_IR := forall a b Hab (Hinc : included (Compact Hab) J),
fun_series_convergent a b Hab f.
Lemma fun_series_conv_imp_conv_IR : fun_series_convergent_IR ->
forall x, J x -> forall Hx, convergent (fun n : nat => f n x (Hx n)).
Proof.
intros H x H0 Hx.
apply fun_series_conv_imp_conv with (Hab := leEq_reflexive _ x).
apply H.
fold (compact_single x) in |- *; apply compact_single_iprop; auto.
apply compact_single_prop.
Qed.
(* begin show *)
Hypothesis H : fun_series_convergent_IR.
(* end show *)
Lemma fun_series_inc_IR : forall x, J x -> forall n, Dom (f n) x.
Proof.
intros x H0 n.
elim (H _ _ (leEq_reflexive _ x) (compact_single_iprop J x H0)).
intros contF CauchyF.
apply (contin_imp_inc _ _ _ _ (contF n)).
apply compact_single_prop.
Qed.
(** Assume [h(x)] is the pointwise series of [f(x)] *)
(* begin hide *)
Let h (x : IR) (Hx : J x) := series_sum _
(fun_series_conv_imp_conv _ _ _ _
(H _ _ (leEq_reflexive _ x) (compact_single_iprop J x Hx)) x
(compact_single_prop x) (fun_series_inc_IR x Hx)).
(* end hide *)
Lemma FSeries_Sum_strext_IR : forall x y Hx Hy, h x Hx [#] h y Hy -> x [#] y.
Proof.
unfold h in |- *; clear h; intros x y Hx Hy H0.
unfold series_sum in H0.
elim (Lim_strext _ _ H0); intros N HN.
simpl in HN; unfold seq_part_sum in HN.
elim (Sum0_strext _ _ _ _ HN); intros.
exact (pfstrx _ _ _ _ _ _ q).
Qed.
Definition FSeries_Sum : PartIR.
Proof.
apply Build_PartFunct with (pfpfun := h).
apply iprop_wd.
exact FSeries_Sum_strext_IR.
Defined.
Lemma FSeries_Sum_char : forall a b Hab (Hinc : included (Compact Hab) J),
Feq (Compact Hab) FSeries_Sum (Fun_Series_Sum (H a b Hab Hinc)).
Proof.
intros; FEQ.
simpl in |- *; Included.
simpl in |- *; unfold h in |- *.
apply series_sum_wd; intros; algebra.
Qed.
End Series_Definitions.
Arguments FSeries_Sum [J f].
Section More_Series_Definitions.
Variable J : interval.
Variable f : nat -> PartIR.
(**
Absolute convergence still exists.
*)
Definition fun_series_abs_convergent_IR :=
fun_series_convergent_IR J (fun n => FAbs (f n)).
End More_Series_Definitions.
Section Convergence_Results.
(**
As before, any series converges to its sum.
*)
Variable J : interval.
Variable f : nat -> PartIR.
Lemma FSeries_conv : forall (convF : fun_series_convergent_IR J f) H H',
conv_fun_seq'_IR J (fun n => FSum0 n f) (FSeries_Sum convF) H H'.
Proof.
intros.
red in |- *; intros.
elim (convF _ _ _ Hinc); intros Hcont Hconv.
apply conv_fun_seq'_wdr with (f := fun n : nat => FSum0 n f)
(contf := fun n : nat => included_imp_Continuous _ _ (H n) _ _ _ Hinc)
(contF := Fun_Series_Sum_cont _ _ _ _ (convF _ _ _ Hinc)).
apply Feq_symmetric; apply FSeries_Sum_char.
apply conv_fun_seq'_wdl with (f := fun_seq_part_sum f)
(contf := fun n : nat => included_imp_Continuous _ _ (H n) _ _ _ Hinc)
(contF := Fun_Series_Sum_cont _ _ _ _ (convF _ _ _ Hinc)).
intro; apply Feq_reflexive.
red in |- *; intros.
simpl in |- *; intros.
apply (contin_imp_inc _ _ _ _ (Hcont n0)); auto.
apply fun_series_conv.
Qed.
Lemma convergent_imp_inc : fun_series_convergent_IR J f -> forall n, included J (Dom (f n)).
Proof.
intros H n.
apply included_imp_inc.
intros a b Hab H0.
red in H.
elim (H _ _ _ H0); intros.
apply contin_imp_inc; auto.
Qed.
Lemma convergent_imp_Continuous : fun_series_convergent_IR J f -> forall n,
Continuous J (f n).
Proof.
intros H n.
split.
exact (convergent_imp_inc H n).
intros a b Hab H0; auto.
elim (H a b Hab H0); auto.
Qed.
Lemma Continuous_FSeries_Sum : forall H, Continuous J (FSeries_Sum (J:=J) (f:=f) H).
Proof.
intros.
split; Included.
intros a b Hab H0.
eapply Continuous_I_wd.
apply Feq_symmetric; apply (FSeries_Sum_char _ _ H _ _ _ H0).
eapply Continuous_I_wd.
apply Fun_Series_Sum_char.
apply Cauchy_cont_Lim.
Qed.
End Convergence_Results.
#[global]
Hint Resolve convergent_imp_inc: included.
#[global]
Hint Resolve convergent_imp_Continuous Continuous_FSeries_Sum: continuous.
Section Operations.
(**
** Algebraic Operations
Convergence is well defined and preserved by operations.
*)
Variable J : interval.
Lemma conv_fun_const_series_IR : forall x : nat -> IR, convergent x ->
fun_series_convergent_IR J (fun n => [-C-] (x n)).
Proof.
intros.
red in |- *; intros.
apply conv_fun_const_series; auto.
Qed.
Lemma fun_const_series_Sum_IR : forall y H
(H' : fun_series_convergent_IR J (fun n => [-C-] (y n))) x Hx, FSeries_Sum H' x Hx [=] series_sum y H.
Proof.
intros.
simpl in |- *.
apply series_sum_wd.
algebra.
Qed.
Lemma conv_zero_fun_series_IR : fun_series_convergent_IR J (fun n => [-C-][0]).
Proof.
apply conv_fun_const_series_IR with (x := fun n : nat => ZeroR).
apply conv_zero_series.
Qed.
Lemma FSeries_Sum_zero_IR : forall (H : fun_series_convergent_IR J (fun n => [-C-][0]))
x Hx, FSeries_Sum H x Hx [=] [0].
Proof.
intros.
simpl in |- *.
apply series_sum_zero.
Qed.
Variables f g : nat -> PartIR.
Lemma fun_series_convergent_wd_IR : (forall n, Feq J (f n) (g n)) ->
fun_series_convergent_IR J f -> fun_series_convergent_IR J g.
Proof.
intros.
red in |- *; intros.
apply fun_series_convergent_wd with f.
intros; apply included_Feq with J; auto.
auto.
Qed.
(* begin show *)
Hypothesis convF : fun_series_convergent_IR J f.
Hypothesis convG : fun_series_convergent_IR J g.
(* end show *)
Lemma FSeries_Sum_wd' : (forall n, Feq J (f n) (g n)) -> Feq J (FSeries_Sum convF) (FSeries_Sum convG).
Proof.
intros H.
apply included_Feq'; intros a b Hab H0.
eapply Feq_transitive.
apply (FSeries_Sum_char _ _ convF a b Hab H0).
eapply Feq_transitive.
2: apply Feq_symmetric; apply (FSeries_Sum_char _ _ convG a b Hab H0).
apply Fun_Series_Sum_wd'.
intro; apply included_Feq with J; auto.
Qed.
Lemma FSeries_Sum_plus_conv : fun_series_convergent_IR J (fun n => f n{+}g n).
Proof.
red in |- *; intros.
apply conv_fun_series_plus; auto.
Qed.
Lemma FSeries_Sum_plus : forall H : fun_series_convergent_IR J (fun n => f n{+}g n),
Feq J (FSeries_Sum H) (FSeries_Sum convF{+}FSeries_Sum convG).
Proof.
intros.
apply included_Feq'; intros a b Hab H0.
eapply Feq_transitive.
apply (FSeries_Sum_char _ _ H a b Hab H0).
eapply Feq_transitive.
apply Fun_Series_Sum_plus with (convF := convF a b Hab H0) (convG := convG a b Hab H0).
apply Feq_symmetric; apply Feq_plus; apply FSeries_Sum_char.
Qed.
Lemma FSeries_Sum_inv_conv : fun_series_convergent_IR J (fun n => {--} (f n)).
Proof.
red in |- *; intros.
apply conv_fun_series_inv; auto.
Qed.
Lemma FSeries_Sum_inv : forall H : fun_series_convergent_IR J (fun n => {--} (f n)),
Feq J (FSeries_Sum H) {--} (FSeries_Sum convF).
Proof.
intros.
apply included_Feq'; intros a b Hab H0.
eapply Feq_transitive.
apply (FSeries_Sum_char _ _ H a b Hab H0).
eapply Feq_transitive.
apply Fun_Series_Sum_inv with (convF := convF a b Hab H0).
apply Feq_symmetric; apply Feq_inv; apply FSeries_Sum_char.
Qed.
Lemma FSeries_Sum_minus_conv : fun_series_convergent_IR J (fun n => f n{-}g n).
Proof.
red in |- *; intros.
apply conv_fun_series_minus; auto.
Qed.
Lemma FSeries_Sum_minus : forall H : fun_series_convergent_IR J (fun n => f n{-}g n),
Feq J (FSeries_Sum H) (FSeries_Sum convF{-}FSeries_Sum convG).
Proof.
intros.
apply included_Feq'; intros a b Hab H0.
eapply Feq_transitive.
apply (FSeries_Sum_char _ _ H a b Hab H0).
eapply Feq_transitive.
apply Fun_Series_Sum_min with (convF := convF a b Hab H0) (convG := convG a b Hab H0).
apply Feq_symmetric; apply Feq_minus; apply FSeries_Sum_char.
Qed.
(**
%\begin{convention}% Let [c:IR] and [H:PartIR] be continuous in [J].
%\end{convention}%
*)
Variable c : IR.
Variable H : PartIR.
Hypothesis contH : Continuous J H.
Lemma FSeries_Sum_scal_conv : fun_series_convergent_IR J (fun n => H{*}f n).
Proof.
red in |- *; intros.
apply conv_fun_series_scal; auto.
eapply included_imp_Continuous.
apply contH.
auto.
Qed.
Lemma FSeries_Sum_scal : forall H' : fun_series_convergent_IR J (fun n => H{*}f n),
Feq J (FSeries_Sum H') (H{*}FSeries_Sum convF).
Proof.
intros.
apply included_Feq'; intros a b Hab H0.
cut (Continuous_I Hab H). intro H1.
eapply Feq_transitive.
apply (FSeries_Sum_char _ _ H' a b Hab H0).
eapply Feq_transitive.
apply Fun_Series_Sum_scal with (convF := convF a b Hab H0).
auto.
apply Feq_symmetric; apply Feq_mult.
apply Feq_reflexive; Included.
apply FSeries_Sum_char.
eapply included_imp_Continuous.
apply contH.
auto.
Qed.
End Operations.
Section Convergence_Criteria.
(**
*** Convergence Criteria
The most important tests for convergence of series still apply: the
comparison test (in both versions) and the ratio test.
*)
Variable J : interval.
Variable f : nat -> PartIR.
Hypothesis contF : forall n, Continuous J (f n).
Lemma fun_str_comparison_IR : forall g : nat -> PartIR, fun_series_convergent_IR J g ->
{k : nat | forall n, k <= n -> forall x, J x -> forall Hx Hx', AbsIR (f n x Hx) [<=] g n x Hx'} ->
fun_series_convergent_IR J f.
Proof.
intros g H H0 a b Hab H1.
apply fun_str_comparison with g.
intro; apply included_imp_Continuous with J; auto.
auto.
elim H0; clear H0; intros k Hk.
exists k; intros.
apply Hk; auto.
Qed.
Lemma fun_comparison_IR : forall g : nat -> PartIR, fun_series_convergent_IR J g ->
(forall n x, J x -> forall Hx Hx', AbsIR (f n x Hx) [<=] g n x Hx') ->
fun_series_convergent_IR J f.
Proof.
intros g H H0.
apply fun_str_comparison_IR with g; auto.
exists 0; intros; apply H0; auto.
Qed.
Lemma abs_imp_conv_IR : fun_series_abs_convergent_IR J f ->
fun_series_convergent_IR J f.
Proof.
intro H.
apply fun_comparison_IR with (fun n => FAbs (f n)).
apply H.
intros; apply eq_imp_leEq; apply eq_symmetric_unfolded; apply FAbs_char.
Qed.
Lemma fun_ratio_test_conv_IR : {N : nat | {c : IR | c [<] [1] | [0] [<=] c /\ (forall x,
J x -> forall n, N <= n -> forall Hx Hx', AbsIR (f (S n) x Hx') [<=] c[*]AbsIR (f n x Hx))}} ->
fun_series_convergent_IR J f.
Proof.
intro H.
red in |- *; intros.
apply fun_ratio_test_conv.
intro; apply included_imp_Continuous with J; auto.
elim H; intros N HN.
elim HN; clear H HN; intros c Hc H.
inversion_clear H.
exists N; exists c; repeat split; auto.
Qed.
End Convergence_Criteria.
Section Power_Series.
(** ***Power Series
The geometric series converges on the open interval (-1, 1)
*)
Lemma fun_power_series_conv_IR : fun_series_convergent_IR (olor ([--][1]) [1]) (fun (i:nat) => Fid IR{^}i).
Proof.
intros a b Hab H.
apply fun_ratio_test_conv.