-
Notifications
You must be signed in to change notification settings - Fork 1
/
coquelicotComplements.v
1536 lines (1312 loc) · 55.1 KB
/
coquelicotComplements.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
Require Import Reals Lra.
From Coquelicot Require Import Hierarchy Derive Continuity Rbar Lub
Rcomplements Lim_seq.
From mathcomp Require Import ssreflect ssrnat ssrbool ssrfun.
Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.
Reserved Notation "A `&` B" (at level 48, left associativity).
Reserved Notation "A `*` B" (at level 46, left associativity).
Reserved Notation "A `+` B" (at level 54, left associativity).
Reserved Notation "A +` B" (at level 54, left associativity).
Reserved Notation "A `|` B" (at level 52, left associativity).
Reserved Notation "a |` A" (at level 52, left associativity).
Reserved Notation "A `\` B" (at level 50, left associativity).
Reserved Notation "A `\ b" (at level 50, left associativity).
Import Classical_Pred_Type Classical_Prop List.
Axiom funext : forall T T' (f g : T -> T'), f =1 g -> f = g.
Axiom propext : forall (P Q : Prop), (P <-> Q) -> P = Q.
Definition set A := A -> Prop.
Bind Scope classical_set_scope with set.
Local Open Scope classical_set_scope.
Notation "[ 'set' x : T | P ]" := ((fun x => P) : set T)
(at level 0, x at level 99, only parsing) : classical_set_scope.
Notation "[ 'set' x | P ]" := [set x : _ | P]
(at level 0, x, P at level 99, format "[ 'set' x | P ]") :
classical_set_scope.
Notation "[ 'set' E | x 'in' A ]" := [set y | exists2 x, A x & E = y]
(at level 0, E, x at level 99,
format "[ '[hv' 'set' E '/ ' | x 'in' A ] ']'") : classical_set_scope.
Definition image A B (f : A -> B) (X : set A) : set B :=
[set f a | a in X].
Definition preimage A B (f : A -> B) (X : set B) : set A := [set a | X (f a)].
Arguments preimage A B f X / a.
Definition setT {A} := [set _ : A | True].
Definition set0 {A} := [set _ : A | False].
Definition set1 A (x : A) := [set a : A | a = x].
Definition setI A (X Y : set A) := [set a | X a /\ Y a].
Definition setU A (X Y : set A) := [set a | X a \/ Y a].
Definition nonempty A (X : set A) := exists x, X x.
Definition setC A (X : set A) := [set a | ~ X a].
Definition setD A (X Y : set A) := [set a | X a /\ ~ Y a].
Notation "[ 'set' a ]" := (set1 a)
(at level 0, a at level 99, format "[ 'set' a ]") : classical_set_scope.
Notation "[ 'set' a : T ]" := [set (a : T)]
(at level 0, a at level 99, format "[ 'set' a : T ]") : classical_set_scope.
Notation "A `|` B" := (setU A B) : classical_set_scope.
Notation "a |` A" := ([set a] `|` A) : classical_set_scope.
Notation "[ 'set' a1 ; a2 ; .. ; an ]" := (setU .. (a1 |` [set a2]) .. [set an])
(at level 0, a1 at level 99,
format "[ 'set' a1 ; a2 ; .. ; an ]") : classical_set_scope.
Notation "A `&` B" := (setI A B) : classical_set_scope.
Notation "~` A" := (setC A) (at level 35, right associativity) : classical_set_scope.
Notation "[ 'set' ~ a ]" := (~` [set a])
(at level 0, format "[ 'set' ~ a ]") : classical_set_scope.
Notation "A `\` B" := (setD A B) : classical_set_scope.
Notation "A `\ a" := (A `\` [set a]) : classical_set_scope.
Definition bigsetI A I (P : set I) (X : I -> set A) :=
[set a | forall i, P i -> X i a].
Definition bigsetU A I (P : set I) (X : I -> set A) :=
[set a | exists2 i, P i & X i a].
Notation "\bigcup_ ( i 'in' P ) F" :=
(bigsetU P (fun i => F))
(at level 41, F at level 41, i, P at level 50,
format "'[' \bigcup_ ( i 'in' P ) '/ ' F ']'")
: classical_set_scope.
Notation "\bigcup_ ( i : T ) F" :=
(\bigcup_(i in @setT T) F)
(at level 41, F at level 41, i at level 50,
format "'[' \bigcup_ ( i : T ) '/ ' F ']'")
: classical_set_scope.
Notation "\bigcup_ i F" :=
(\bigcup_(i : _) F)
(at level 41, F at level 41, i at level 0,
format "'[' \bigcup_ i '/ ' F ']'")
: classical_set_scope.
Notation "\bigcap_ ( i 'in' P ) F" :=
(bigsetI P (fun i => F))
(at level 41, F at level 41, i, P at level 50,
format "'[' \bigcap_ ( i 'in' P ) '/ ' F ']'")
: classical_set_scope.
Notation "\bigcap_ ( i : T ) F" :=
(\bigcap_(i in @setT T) F)
(at level 41, F at level 41, i at level 50,
format "'[' \bigcap_ ( i : T ) '/ ' F ']'")
: classical_set_scope.
Notation "\bigcap_ i F" :=
(\bigcap_(i : _) F)
(at level 41, F at level 41, i at level 0,
format "'[' \bigcap_ i '/ ' F ']'")
: classical_set_scope.
Definition subset A (X Y : set A) := forall a, X a -> Y a.
Notation "A `<=` B" := (subset A B) (at level 70, no associativity)
: classical_set_scope.
Notation "f @^-1` A" := (preimage f A) (at level 24) : classical_set_scope.
Notation "f @` A" := (image f A) (at level 24) : classical_set_scope.
Notation "A !=set0" := (nonempty A) (at level 80) : classical_set_scope.
Lemma preimage_image A B (f : A -> B) (X : set A) : X `<=` f@^-1` (f @` X).
Proof. by move=> a Xa; exists a. Qed.
Lemma image_preimage A B (f : A -> B) (X : set B) :
f @` setT = setT -> f @` (f @^-1` X) = X.
Proof.
move=> fsurj; apply/funext=> x; apply/propext; split; first by move=> [?? <-].
move=> Xx; have : setT x by [].
by rewrite -fsurj => - [y _ fy_eqx]; exists y => //; rewrite /preimage fy_eqx.
Qed.
Lemma preimage_setT A B (f : A -> B) : f @^-1` setT = setT.
Proof. by apply/funext=> ?; apply/propext. Qed.
Lemma preimage_setI A B (f : A -> B) (X Y : set B) :
f @^-1` (X `&` Y) = (f @^-1` X) `&` (f @^-1` Y).
Proof. by apply/funext=> ?; apply/propext; split=> [[]|[]]. Qed.
Lemma preimage_setC A B (f : A -> B) (X : set B) :
~` (f @^-1` X) = f @^-1` (~` X).
Proof.
apply/funext=> a; apply/propext.
by split=> npreimXa preimXa; apply: npreimXa.
Qed.
Lemma setIT A (X : set A) : X `&` setT = X.
Proof. by apply/funext=> a; apply/propext; split=> [[]|]. Qed.
Lemma setTI A (X : set A) : setT `&` X = X.
Proof. by apply/funext=> a; apply/propext; split=> [[]|]. Qed.
Lemma setIA A (X Y Z : set A) : X `&` Y `&` Z = X `&` (Y `&` Z).
Proof. by apply/funext=> a; apply/propext; split=> [[[]]|[? []]]. Qed.
Lemma setIC A (X Y : set A) : X `&` Y = Y `&` X.
Proof. by apply/funext => ?; apply/propext; apply: and_comm. Qed.
Lemma empty_setI A (X Y : set A) : X = set0 -> X `&` Y = set0.
Proof.
by move=> X0; apply/funext => a; apply/propext; split=> // - []; rewrite X0.
Qed.
Lemma bigcap_setI A I (F : set I) (f : I -> set A) (X : set A) i :
F i -> \bigcap_(i in F) f i `&` X = \bigcap_(i in F) (f i `&` X).
Proof.
move=> Fi; apply/funext => a; apply/propext; split.
by move=> [Ifa Xa] j Fj; split=> //; apply: Ifa.
move=> IfIXa; split; [by move=> j /IfIXa []|by have /IfIXa [] := Fi].
Qed.
Lemma setI_bigcap A I (F : set I) (f : I -> set A) (X : set A) i :
F i -> X `&` \bigcap_(i in F) f i = \bigcap_(i in F) (X `&` f i).
Proof.
move=> Fi; rewrite setIC (bigcap_setI _ _ Fi).
by apply/funext => a; apply/propext; split=> IfIXa j /IfIXa; rewrite setIC.
Qed.
Lemma setDE A (X Y : set A) : X `\` Y = X `&` ~` Y.
Proof. by []. Qed.
Lemma bigcap_setD A I (F : set I) (f : I -> set A) (X : set A) i :
F i -> \bigcap_(i in F) f i `\` X = \bigcap_(i in F) (f i `\` X).
Proof. by move=> Fi; rewrite setDE (bigcap_setI _ _ Fi). Qed.
Lemma imageP A B (f : A -> B) (X : set A) a : X a -> (f @` X) (f a).
Proof. by exists a. Qed.
Lemma sub_image_setI A B (f : A -> B) (X Y : set A) :
f @` (X `&` Y) `<=` f @` X `&` f @` Y.
Proof. by move=> b [x [Xa Ya <-]]; split; apply: imageP. Qed.
Arguments sub_image_setI {A B f X Y} a _.
Lemma nonempty_image A B (f : A -> B) (X : set A) :
f @` X !=set0 -> X !=set0.
Proof. by case=> b [a]; exists a. Qed.
Lemma nonempty_preimage A B (f : A -> B) (X : set B) :
f @^-1` X !=set0 -> X !=set0.
Proof. by case=> [a ?]; exists (f a). Qed.
Lemma subset_empty A (X Y : set A) : X `<=` Y -> X !=set0 -> Y !=set0.
Proof. by move=> sXY [x Xx]; exists x; apply: sXY. Qed.
Lemma subset_trans A (Y X Z : set A) : X `<=` Y -> Y `<=` Z -> X `<=` Z.
Proof. by move=> sXY sYZ ? ?; apply/sYZ/sXY. Qed.
Lemma subsetI_eq A (X Y : set A) : X `<=` Y -> X `&` Y = X.
Proof.
move=> sXY; apply/funext=> a; apply/propext; split; first by move=> [].
by move=> Xa; split=> //; apply: sXY.
Qed.
Lemma subsetIl A (X Y : set A) : X `&` Y `<=` X.
Proof. by move=> ? []. Qed.
Lemma subsetIr A (X Y : set A) : X `&` Y `<=` Y.
Proof. by move=> ? []. Qed.
Lemma nonempty_preimage_setI A B (f : A -> B) (X Y : set B) :
(f @^-1` (X `&` Y)) !=set0 <-> (f @^-1` X `&` f @^-1` Y) !=set0.
Proof. by rewrite preimage_setI. Qed.
Lemma subsetC A (X Y : set A) : X `<=` Y -> ~` Y `<=` ~` X.
Proof. by move=> sXY ? nYa ?; apply/nYa/sXY. Qed.
Lemma subsetU A (X Y Z : set A) : X `<=` Z -> Y `<=` Z -> X `|` Y `<=` Z.
Proof. by move=> sXZ sYZ a; apply: or_ind; [apply: sXZ|apply: sYZ]. Qed.
Lemma subset_Dempty A (X Y : set A) : X `<=` Y -> X `\` Y = set0.
Proof.
move=> sXY; apply/funext => a; apply/propext; split=> // - [Xa].
by apply; apply/sXY.
Qed.
Lemma Dempty_subset A (X Y : set A) : X `\` Y = set0 -> X `<=` Y.
Proof.
move=> XDY0 a Xa; apply: NNPP=> /(conj Xa).
by rewrite -[_ /\ _]/((_ `\` _) _) XDY0.
Qed.
Lemma bigcupI A I J (X : I -> set A) (Y : J -> set A) (KI : set I)
(KJ : set J) :
(\bigcup_(i in KI) X i) `&` (\bigcup_(j in KJ) Y j) =
\bigcup_(ij in [set ij | KI ij.1 /\ KJ ij.2]) (X ij.1 `&` Y ij.2).
Proof.
apply/funext=> a; apply/propext; split.
by move=> [[i KIi Xia] [j KJj Yja]]; exists (i, j).
by move=> [ij [KIij1 KJij2] [Xij1a Yij2a]]; split; [exists ij.1|exists ij.2].
Qed.
Lemma bigcapI A I J (X : I -> set A) (Y : J -> set A) (KI : set I)
(KJ : set J) :
(\bigcap_(i in KI) X i) `&` (\bigcap_(j in KJ) Y j) =
\bigcap_(ij in [set ij : I + J | match ij with | inl i => KI i
| inr j => KJ j end])
(match ij with | inl i => X i
| inr j => Y j end).
Proof.
apply/funext=> a; apply/propext; split.
by move=> [XIa YIa]; case=> ??; [apply: XIa|apply: YIa].
by move=> XYIa; split=> [i KIi|j KJj];
[apply: (XYIa (inl i))|apply: (XYIa (inr j))].
Qed.
Structure canonical_filter_on X Y := CanonicalFilterOn {
canonical_filter_term : X;
_ : set (set Y)
}.
Definition canonical_term_filter X Y (F : canonical_filter_on X Y) :=
let: CanonicalFilterOn x f := F in f.
Structure canonical_filter Y := CanonicalFilter {
canonical_filter_type :> Type;
_ : canonical_filter_type -> set (set Y)
}.
Definition canonical_type_filter Y (F : canonical_filter Y) :
F -> set (set Y) :=
let: CanonicalFilter X f := F in f.
Canonical default_filter_term Y (X : canonical_filter Y) (x : X) :=
@CanonicalFilterOn X Y x (canonical_type_filter x).
Structure canonical_filter_source Z Y := CanonicalFilterSource {
canonical_filter_source_type :> Type;
_ : (canonical_filter_source_type -> Z) -> set (set Y)
}.
Definition canonical_source_filter Z Y (F : canonical_filter_source Z Y) :
(F -> Z) -> set (set Y) :=
let: CanonicalFilterSource X f := F in f.
Canonical default_arrow_filter Y Z (X : canonical_filter_source Z Y) :=
@CanonicalFilter _ (X -> Z) (@canonical_source_filter _ _ X).
Canonical source_filter_filter Y :=
@CanonicalFilterSource Prop _ (_ -> Prop) (@id (set (set Y))).
Canonical filter_uniform_space (U : UniformSpace) :=
@CanonicalFilter _ U (@locally U).
Canonical filter_normed_module (K : AbsRing) (V : NormedModule K) :=
@CanonicalFilter _ V (@locally V).
Canonical filter_Rbar := CanonicalFilter (Rbar_locally).
Canonical filter_R := CanonicalFilter (fun x : R => locally x).
Definition filter_of X Y (F : canonical_filter_on X Y)
(x : X) (_ : phant_id x (canonical_filter_term F)) :=
canonical_term_filter F.
Notation "[ 'filter' 'of' x ]" := (@filter_of _ _ _ x idfun)
(format "[ 'filter' 'of' x ]").
Arguments filter_of _ _ _ _ _ _ /.
Notation "x @ F" := (filtermap x [filter of F])
(at level 60, format "x @ F") : classical_set_scope.
Notation "F --> G" := (filter_le [filter of F] [filter of G])
(at level 70, format "F --> G") : classical_set_scope.
Notation "'+oo'" := p_infty : classical_set_scope.
Notation "'-oo'" := m_infty : classical_set_scope.
Canonical eventually_filter X :=
@CanonicalFilterSource X _ nat (fun f => f @ eventually).
Definition cvg (U : UniformSpace) (F : set (set U)) : Prop :=
exists l : U, F --> l.
Notation "[ 'cvg' F ]" := (cvg [filter of F])
(format "[ 'cvg' F ]") : classical_set_scope.
(* missing notation *)
Definition normedModule_of (T : AbsRing) (_ : phantom Type (AbsRing.sort T)) :=
NormedModule T.
Notation "{ 'normedModule' T }" := (@normedModule_of _ (Phantom Type T))
(at level 0, format "{ 'normedModule' T }") : type_scope.
Section Auto_diff.
Variable (K : AbsRing).
Class diff (U V : NormedModule K) (f : U -> V) (F : set (set U))
(f' : U -> V) := diff_prf : filterdiff f F f'.
Class deriv (V : NormedModule K) (f : K -> V) x l :=
deriv_prf : is_derive f x l.
Variable (U V : NormedModule K) (F : set (set U)).
Global Instance diff_const (p : V) :
Filter F -> diff (fun _ => p) F (fun _ => zero).
Proof. by move=> ?; apply: filterdiff_const. Qed.
Global Instance deriv_const (p : V) x : deriv (fun _ => p) x zero.
Proof. exact: is_derive_const. Qed.
Global Instance diff_id : diff id F id.
Proof. exact: filterdiff_id. Qed.
Global Instance deriv_id x : deriv id x one.
Proof. exact: is_derive_id. Qed.
Global Instance diff_plus (f g lf lg : U -> V) :
Filter F -> diff f F lf -> diff g F lg ->
diff (fun p => plus (f p) (g p)) F (fun p => plus (lf p) (lg p)).
Proof. by move=> ?; apply: filterdiff_plus_fct. Qed.
Global Instance deriv_plus (f g : K -> V) x df dg :
deriv f x df -> deriv g x dg ->
deriv (fun y => plus (f y) (g y)) x (plus df dg).
Proof. exact: is_derive_plus. Qed.
Global Instance diff_opp (f lf : U -> V) :
Filter F -> diff f F lf -> diff (fun p => opp (f p)) F (fun p => opp (lf p)).
Proof. by move=> ?; apply: filterdiff_opp_fct. Qed.
Global Instance deriv_opp (f : K -> V) x df :
deriv f x df -> deriv (fun y => opp (f y)) x (opp df).
Proof. exact: is_derive_opp. Qed.
Global Instance diff_minus (f g lf lg : U -> V) :
Filter F -> diff f F lf -> diff g F lg ->
diff (fun p => minus (f p) (g p)) F (fun p => minus (lf p) (lg p)).
Proof. by move=> ?; apply: filterdiff_minus_fct. Qed.
Global Instance deriv_minus (f g : K -> V) x df dg :
deriv f x df -> deriv g x dg ->
deriv (fun y => minus (f y) (g y)) x (minus df dg).
Proof. exact: is_derive_minus. Qed.
Global Instance deriv_diff_comp (f : K -> U) (g : U -> V) x df dg :
deriv f x df -> diff g (locally (f x)) dg -> deriv (g \o f) x (dg df) | 999.
Proof.
move=> deriv_f diff_g.
have : forall y, dg (scal y df) = scal y (dg df).
by move=> ?; rewrite linear_scal => //; have [] := diff_g.
apply: filterdiff_ext_lin; apply: (filterdiff_comp f g); first exact: deriv_f.
(* it is not inferred… why? *)
have fx_proper : ProperFilter (filtermap f (locally x)).
exact: filtermap_proper_filter.
apply: filterdiff_locally diff_g.
by apply: ex_derive_continuous; exists df.
Qed.
Global Instance deriv_comp (f : K -> K) (g : K -> V) x df dg :
deriv f x df -> deriv g (f x) dg -> deriv (g \o f) x (scal df dg) | 999.
Proof. by move=> ??; apply: is_derive_comp. Qed.
Lemma diff_eq (f f' g : U -> V) :
diff f F f' -> f' = g -> diff f F g.
Proof. by move=> ? <-. Qed.
Lemma deriv_eq (f : K -> V) x df df' :
deriv f x df -> df = df' -> deriv f x df'.
Proof. by move=> ? <-. Qed.
Lemma ex_diff (f f' : U -> V) :
diff f F f' -> ex_filterdiff f F.
Proof. by exists f'. Qed.
Lemma ex_deriv (f : K -> V) x df :
deriv f x df -> ex_derive f x.
Proof. by exists df. Qed.
End Auto_diff.
Lemma deriv_unique (f : R -> R) x df df' :
deriv f x df -> deriv f x df' -> df = df'.
Proof. by move=> /is_derive_unique <- /is_derive_unique <-. Qed.
Global Instance diff_mult (U : NormedModule R_AbsRing) (f g lf lg : U -> R)
p : diff f (locally p) lf -> diff g (locally p) lg ->
diff (fun q => (f q) * (g q)) (locally p)
(fun q => ((lf q) * (g p)) + ((f p) * (lg q))).
Proof. exact: filterdiff_mult_fct Rmult_comm. Qed.
Global Instance deriv_mult (f g : R -> R) x df dg :
deriv f x df -> deriv g x dg ->
deriv (fun y => (f y) * (g y)) x (df * (g x) + (f x) * dg).
Proof. exact: is_derive_mult. Qed.
Coercion INR : nat >-> R.
Global Instance deriv_pow (f : R -> R) n x l :
deriv f x l -> deriv (fun y => (f y) ^ n) x (n * l * ((f x) ^ n.-1)).
Proof. exact: is_derive_pow. Qed.
(* frequent composition *)
Lemma is_derive_shift K (V : NormedModule K) (f : K -> V) (x : K) l
s :
deriv f (plus x s) l -> deriv (fun y => f (plus y s)) x l.
Proof.
move=> f'plus; apply: deriv_eq.
by rewrite plus_zero_r scal_one.
Qed.
Section Cvg_to_set.
Variable (U : UniformSpace).
Implicit Types (p : U) (A B : set U).
(* The extension of a set with a band of width eps *)
Definition ball_set (A : set U) (eps : posreal) :=
\bigcup_(p in A) ball p eps.
(* locally_set A P means that P holds for every point sufficiently near of A *)
Definition locally_set (A : set U) :=
[set B | exists eps, ball_set A eps `<=` B].
Canonical filter_set_uniform_space :=
@CanonicalFilterSource Prop _ U locally_set.
Lemma locally_set1P (p : U) A : locally p A <-> locally_set [set p] A.
Proof.
split=> - [eps peps_A]; exists eps.
by move=> q [r [-> /peps_A]].
by move=> q pq_eps; apply: peps_A; exists p.
Qed.
Lemma locally_set_filter_le (A B : set U) : A `<=` B -> A --> B.
Proof.
move=> sAB C [eps /= Beps_C]; exists eps.
by move=> p [q /sAB Bq qp_eps]; apply: Beps_C; exists q.
Qed.
Lemma locally_set_subset A B :
locally_set A B -> forall C, B `<=` C -> locally_set A C.
Proof. by move=> [eps Aeps_B] C sBC; exists eps; move=> y /Aeps_B /sBC. Qed.
Instance locally_set_filter (A : set U) : Filter (locally_set A).
Proof.
constructor; last 1 first.
- by move=> B C sBC nAB; apply: locally_set_subset sBC.
- by exists (mkposreal _ Rlt_0_1).
move=> B C [eps1 Aeps1_B] [eps2 Aeps2_C].
exists (mkposreal _ (Rmin_stable_in_posreal eps1 eps2)).
move=> p [q qinA q_near_p]; split.
apply: Aeps1_B; exists q => //.
exact: ball_le (Rmin_l _ _) _ q_near_p.
apply: Aeps2_C; exists q => //.
exact: ball_le (Rmin_r _ _) _ q_near_p.
Qed.
Lemma cvg_to_set1P (y : R -> U) p : y @ +oo --> [set p] <-> y @ +oo --> p.
Proof. by split=> hy P /locally_set1P; apply: hy. Qed.
Lemma cvg_to_superset A B y : A `<=` B ->
y @ +oo --> A -> y @ +oo --> B.
Proof.
move=> sAB ytoA C /= [eps Beps_C]; apply: ytoA => /=.
by exists eps; apply: subset_trans Beps_C => p [q /sAB]; exists q.
Qed.
End Cvg_to_set.
Section Closedness.
Variable (U : UniformSpace).
Definition closure (A : set U) :=
[set p | forall B, locally p B -> A `&` B !=set0].
Instance within_locally_proper (A : set U) p :
closure A p -> ProperFilter (within A (locally p)).
Proof.
move=> Abarp; apply: Build_ProperFilter => B.
by move=> /Abarp [q [Aq AqsoBq]]; exists q; apply: AqsoBq.
Qed.
Lemma subset_closure (A : set U) : A `<=` closure A.
Proof. by move=> p B Bp; exists p; split=> //; apply: locally_singleton. Qed.
Definition is_closed (A : set U) := closure A `<=` A.
Lemma closed_is_closed (A : set U) : closed A -> is_closed A.
Proof. by move=> Aclosed p Abarp; apply: Aclosed => /Abarp [? []]. Qed.
Lemma closedP (A : set U) : closed A <-> is_closed A.
Proof.
split; first exact: closed_is_closed .
move=> Aclosed p /not_ex_all_not npnA; apply: Aclosed.
move=> B [eps peps_B].
have /not_all_ex_not [q] := npnA eps.
(* Show Enrico: move/(@imply_to_and _ _). *)
by move=> /(imply_to_and (ball _ _ _)) [/peps_B Bq /NNPP Aq]; exists q.
Qed.
Lemma is_closed_closure (A : set U) : is_closed (closure A).
Proof.
move=> p hp B [eps peps_B].
have /= [q [Abarq pq_heps]] := hp (ball p (pos_div_2 eps)) (locally_ball _ _).
have /= [r [Ar qr_heps]] := Abarq (ball q (pos_div_2 eps)) (locally_ball _ _).
exists r; split=> //; apply/peps_B.
rewrite [X in ball _ X]double_var.
exact: ball_triangle qr_heps.
Qed.
Lemma closure_setI (A B : set U) :
closure (A `&` B) `<=` closure A `&` closure B.
Proof. by move=> p clABp; split=> ? /clABp [q [[]]]; exists q. Qed.
Lemma closure_bigcap I (F : set I) (f : I -> set U) :
closure (\bigcap_(A in F) f A) `<=` \bigcap_(A in F) closure (f A).
Proof.
move=> p IFbarp A FA B /IFbarp [q [IFq Bq]].
by exists q; split=> //; apply: IFq.
Qed.
Lemma is_closed_bigcap I (F : set I) (f : I -> set U) :
(forall A, F A -> is_closed (f A)) -> is_closed (\bigcap_(A in F) f A).
Proof.
move=> clfamF => p /closure_bigcap clFp A FA.
by apply: (clfamF _ FA); apply: clFp.
Qed.
Lemma is_closed_setI (A B : set U) :
is_closed A -> is_closed B -> is_closed (A `&` B).
Proof.
by move=> Acl Bcl p ABbarp; split; [apply: Acl|apply: Bcl];
move=> C /ABbarp [q [[]]]; exists q.
Qed.
Lemma is_closed_setC (A : set U) : open A -> is_closed (~` A).
Proof. by move=> Aop p ACbar_p /Aop /ACbar_p [? []]. Qed.
End Closedness.
Lemma continuous_closed_preimage (U V : UniformSpace) (f : U -> V) :
(forall p, continuous f p) -> forall A, is_closed A -> is_closed (f @^-1` A).
Proof.
by move=> fcont A Acl p clApreimp; apply: Acl => B /fcont /clApreimp [q []];
exists (f q).
Qed.
Section Openness.
Variable (U : UniformSpace).
Definition interior (A : set U) := locally^~ A.
Notation "A ^°" := (interior A) (at level 1, format "A ^°").
Lemma interior_subset (A : set U) : A^° `<=` A.
Proof. by move=> ? [?]; apply; apply: ball_center. Qed.
Lemma openP (A : set U) : open A <-> A `<=` A^°.
Proof. by split=> opA ? /opA. Qed.
Lemma subset_interior (A : set U) : open A -> A `<=` A^°.
Proof. by move/openP. Qed.
Lemma open_interior (A : set U) : open A^°.
Proof.
move=> p [eps peps_A]; exists (pos_div_2 eps) => q pheps_q.
exists (pos_div_2 eps) => r qheps_r.
by apply: peps_A; rewrite [_ eps]double_var; apply: ball_triangle qheps_r.
Qed.
Lemma interior_bigcup I (F : set I) (f : I -> set U) :
\bigcup_(A in F) (f A)^° `<=` (\bigcup_(A in F) f A)^°.
Proof. by move=> p [B ? [eps peps_fB]]; exists eps => q /peps_fB; exists B. Qed.
Lemma open_bigcup I (F : set I) (f : I -> set U) :
(forall A, F A -> open (f A)) -> open (\bigcup_(A in F) f A).
Proof.
move=> opfamF; apply/openP => p [i Fi fip]; apply: interior_bigcup.
by exists i => //; apply: subset_interior => //; apply: opfamF.
Qed.
End Openness.
Definition seg a b := Rle a `&` Rle^~ b.
Lemma seg_closed a b : is_closed (seg a b).
Proof.
apply: closed_is_closed; apply: closed_and; first exact: closed_ge.
exact: closed_le.
Qed.
(* Code adapted from Guillaume Cano's PhD *)
Section Ensemble.
Variable T : Type.
Definition in_set (p : T) (A : set T) := A p.
Notation "p \ins A" := (in_set p A) (at level 3).
Lemma insE p (A : set T) : p \ins A = A p.
Proof. done. Qed.
Definition eqset (A B : set T) : Prop := forall p, p \ins A <-> p \ins B.
End Ensemble.
Notation "p \ins A" := (in_set p A) (at level 3).
Notation "A `=` B" := (eqset A B) (at level 70, no associativity).
Section famille.
Variable T : Type.
Variable Ti : Type.
Structure family : Type := mkfamily {
ind : set Ti;
F :> Ti -> set T
}.
Definition finite_set (T1 : Type) (A : set T1) :=
exists l : list T1, A `=` (fun p => List.In p l).
Structure finite_family := Ff {
fam :> family;
hfam : finite_set (ind fam)
}.
Definition ffam (f : family) := finite_set (ind f).
Lemma finfam : forall (f : finite_family), ffam f.
Proof. by case. Qed.
Lemma finfam_empty F : ffam (mkfamily set0 F).
Proof. by exists nil. Qed.
Lemma finfamU (f g : finite_family) F :
ffam (mkfamily (ind f `|` ind g) F).
Proof.
have [l hl] := hfam f; have [l' hl'] := hfam g.
exists (l ++ l'); move=> j; apply: iff_trans; last apply iff_sym, in_app_iff.
apply: iff_trans; first exact/or_iff_compat_l/hl'.
exact/or_iff_compat_r/hl.
Qed.
Lemma finfam_sing i F : ffam (mkfamily (eq^~ i) F).
Proof.
exists (i :: nil).
move=> j; rewrite /in_set; split; first by move->; apply: in_eq.
by move/(@in_inv _ i j)=> hj; apply: or_ind hj.
Qed.
Lemma finfam_ext (f : finite_family) F : ffam (mkfamily (ind f) F).
Proof. by have [l] := finfam f; exists l. Qed.
Definition inter_fam (f : family) := \bigcap_(i in ind f) f i.
Definition union_fam (f : family) := \bigcup_(i in ind f) f i.
Definition cover (A : set T) (f : family) := A `<=` union_fam f.
Lemma cover_setI A (f g : family) :
ind g `=` ind f -> (forall i, i \ins (ind f) -> f i `=` A `&` g i) ->
cover A f <-> cover A g.
Proof.
move=> gieqfi fiAgi.
split.
move=> fcov p Ap.
have /fcov [j fij fjp] := Ap.
exists j; first exact/gieqfi.
apply: proj2.
exact/(fiAgi _ fij).
move=> gcov p Ap.
have /gcov [j /gieqfi fij gjp] := Ap.
exists j => //.
exact/fiAgi.
Qed.
Definition sub_family f g :=
ind g `<=` ind f /\ forall i, i \ins (ind g) -> f i `=` g i.
Definition finite_inter (f : family) :=
forall g : finite_family, sub_family f g -> inter_fam g !=set0.
Definition fixed (f : family) := inter_fam f !=set0.
Lemma cover_setC A (f : family) :
~ fixed f -> cover A (mkfamily (ind f) (fun i => ~` f i)).
Proof.
move=> /not_ex_all_not if0 p Ap.
have /not_all_ex_not [i] := if0 p.
move/(imply_to_and (i \ins (ind f)))=> [fii nfix].
by exists i.
Qed.
Lemma nfixed_setC A (f : family) j : ind f j ->
cover A f -> ~ fixed (mkfamily (ind f) (fun i => A `\` f i)).
Proof.
move=> fij fcov [q AnfIq]; have /AnfIq [Aq _] := fij.
by have /fcov [k fik fkq] := Aq; have /AnfIq [] := fik.
Qed.
End famille.
(* *)
Lemma filter_bigcap U I (G : set I) (f : I -> set U) (F : set (set U)) :
Filter F -> finite_set G -> (forall i, G i -> F (f i)) ->
F (\bigcap_(i in G) f i).
Proof.
move=> Ffilter [l Geql] sfGF.
have himp : forall p, (forall i, In i l -> f i p) -> (\bigcap_(i in G) f i) p.
by move=> p hp i /Geql /hp.
apply: filter_imp himp _.
have {sfGF} : forall i, In i l -> F (f i) by move=> i /Geql; apply: sfGF.
elim: l G Geql => [|a l ihl] G Geql sfGF; first exact: filter_imp filter_true.
apply: (filter_imp (f a `&` [set p|forall i, In i l -> f i p])).
by move=> p [fap flp] i; apply: or_ind; [move<-|apply: flp].
apply: filter_and; first by apply: sfGF; left.
by apply: (ihl (In(A:=I)^~ l))=> // i li; apply: sfGF; right.
Qed.
Lemma filter_finite_inter U (F : set (set U)) Ti (f : family U Ti) :
ProperFilter F -> (forall i, i \ins (ind f) -> F (f i)) -> finite_inter f.
Proof.
move=> Fproper sfF g [ind_sgf gieqfi]; apply: filter_ex.
suff : F (\bigcap_(i in ind g) f i).
apply: filter_imp => p If_indg_p j gij; apply/gieqfi => //.
exact: If_indg_p.
by apply: filter_bigcap (hfam _) _ => i /ind_sgf; apply: sfF.
Qed.
Section Compactness.
Variables (U : UniformSpace).
Definition cluster (F : set (set U)) p :=
forall A B, F A -> locally p B -> A `&` B !=set0.
Lemma clusterE F : cluster F = \bigcap_(A in F) (closure A).
Proof. by apply/funext=> p; apply/propext; split => cF ????; apply: cF. Qed.
Lemma filter_le_cluster F G : filter_le F G -> cluster F `<=` cluster G.
Proof. by move=> sGF p Fp P Q GP Qp; apply: Fp Qp; apply: sGF. Qed.
Definition compact A := forall (F : set (set U)), F A ->
ProperFilter F -> A `&` cluster F !=set0.
Lemma compact_set0 : compact set0.
Proof. by move=> F Fset0 Fproper; have /filter_ex [] := Fset0. Qed.
Lemma subclosed_compact (A B : set U) :
is_closed A -> compact B -> A `<=` B -> compact A.
Proof.
move=> Acl Bco sAB F FA Fproper.
have [|p [Bp Fp]] := Bco F; first exact: filter_imp FA.
by exists p; split=> //; apply: Acl=> C Cp; apply: Fp.
Qed.
Definition hausdorff := forall p q : U, cluster (locally p) q -> p = q.
Lemma hausdorffP : hausdorff <-> forall p q : U, p <> q -> exists A B,
locally p A /\ locally q B /\ forall r, ~ (A `&` B) r.
Proof.
split=> h p q; last first.
move=> hpq; apply: NNPP; move/h=> [A [B [pA [qB hAB]]]].
by have [] := hpq _ _ pA qB.
have : p <> q ->
~ (forall A B, locally p A -> locally q B -> A `&` B !=set0).
exact: impliesPn (Implies (h p q)).
move=> hpq /hpq /not_all_ex_not [A] /not_all_ex_not [B].
move/(imply_to_and (locally _ _))=> [pA].
move/(imply_to_and (locally _ _))=> [qB] /not_ex_all_not hAB.
by exists A; exists B.
Qed.
Lemma compact_closed (A : set U) : hausdorff -> compact A -> is_closed A.
Proof.
move=> hU Acompact p Abarp.
have pA : within A (locally p) A by exists (mkposreal _ Rlt_0_1).
have [q [Aq hq]] := Acompact _ pA (within_locally_proper Abarp).
rewrite (hU p q) //.
apply: filter_le_cluster hq.
exact: filter_le_within.
Qed.
(* Code adapted from Guillaume Cano's PhD *)
Definition open_family Ti (f : family U Ti) :=
forall i, i \ins (ind f) -> open (f i).
Definition closed_family Ti (f : family U Ti) :=
forall i, i \ins (ind f) -> is_closed (f i).
Definition quasi_compact (A : set U) :=
forall Ti (f : family U Ti),
open_family f -> cover A f ->
exists g : finite_family U Ti, sub_family f g /\ cover A g.
Definition closed_of_family A Ti (f : family U Ti) :=
exists g : family U Ti, closed_family g /\ ind g `=` ind f /\
forall i, i \ins (ind f) -> f i `=` A `&` g i.
Definition open_of_family A Ti (f : family U Ti) :=
exists g : family U Ti, open_family g /\ ind g `=` ind f /\
forall i, i \ins (ind f) -> f i `=` A `&` g i.
Lemma closed_of_setC A Ti (f : family U Ti) : open_of_family A f ->
closed_of_family A (mkfamily (ind f) (fun i => A `\` f i)).
Proof.
move=> [g [opg [gieqfi hgi]]].
exists (mkfamily (ind f) (fun i => ~` (g i))).
split; first by move=> j /gieqfi gij; apply/is_closed_setC/opg.
split=> // j /= fij p; split.
by move=> [Ap nfjp]; split=> // gjp; apply/nfjp/hgi.
move=> [Ap ngjp]; split=> // fjp.
apply/ngjp; apply: proj2; exact/hgi.
Qed.
Lemma open_of_setC A Ti (f : family U Ti) : closed_of_family A f ->
open_of_family A (mkfamily (ind f) (fun i => A `\` f i)).
Proof.
move=> [g [gclo [gieqfi hgi]]].
exists (mkfamily (ind f) (fun i => ~` (g i))).
split; first by move=> j /gieqfi gij; apply/open_not/closedP/gclo.
split=> // j /= fij p; split.
by move=> [Ap nfjp]; split=> // gjp; apply/nfjp/hgi.
move=> [Ap ngjp]; split=> // fjp.
apply/ngjp; apply: proj2; exact/hgi.
Qed.
(* *)
Lemma qcompactE A :
quasi_compact A <-> forall Ti (f : family U Ti) (j : Ti), ind f j ->
open_family f -> cover A f -> exists (g : finite_family U Ti) (k : Ti),
ind g k /\ sub_family f g /\ cover A g.
Proof.
split=> [coA Ti f j fij|coA Ti f] opf covf.
have [g [[ind_sgf fieqgi] gcov]] := coA _ _ opf covf.
exists (Ff (finfamU g (Ff (finfam_sing j (F f))) (F f))); exists j => /=.
split; first by right.
split; first by split=> // k; apply: or_ind => [|->] //; apply: ind_sgf.
by move=> p /gcov [k gik /(fieqgi _ gik) gkp]; exists k => //; left.
apply: or_ind (classic (ind f !=set0)).
by move=> [j fij]; have [g [_ [_ []]]] := coA _ _ _ fij opf covf; exists g.
move=> /not_ex_all_not ind_f0.
have finf : ffam f by exists nil; move=> j; split; [move/ind_f0|].
by exists (Ff finf); split=> //; split.
Qed.
Lemma qcompact_set A :
quasi_compact A <->
(forall Ti (f : family U Ti) (j : Ti), ind f j -> open_of_family A f ->
cover A f -> exists (g : finite_family U Ti) (k : Ti),
ind g k /\ sub_family f g /\ cover A g).
Proof.
apply: iff_trans (qcompactE A) _.
split=> [coA Ti f j fij [g [opg [ind_geqf fieqAgi]]]|coA Ti f j fij opf] fcov.
have gcov : cover A g by apply/(cover_setI ind_geqf fieqAgi).
have gij : ind g j by apply/ind_geqf.
have [h [k [hik [[ind_shg gieqhi] hcov]]]] := coA _ _ _ gij opg gcov.
exists (Ff (finfam_ext h f)); exists k; split=> //=.
split; first by split=> // l /ind_shg /ind_geqf.
move=> p Ap; have /hcov [l hil hlp] := Ap; exists l=> //=.
apply/fieqAgi; first exact/ind_geqf/ind_shg.
by split=> //; apply/gieqhi.
have Afcov : cover A (mkfamily (ind f) (fun i => A `&` f i)).
by apply/cover_setI; last exact: fcov.
have opAf : open_of_family A (mkfamily (ind f) (fun i => A `&` f i)).
by exists f.
have /(_ fij) [g [k [gik [[ind_sgAf Afieqgi] gcov]]]] := coA _ _ j _ opAf Afcov.
exists (Ff (finfam_ext g f)); exists k; split=> //=; split=> // p Ap.
by have /gcov [l gil /(Afieqgi _ gil) []] := Ap; exists l.
Qed.
Lemma qcompact_fixed (A : set U) :
quasi_compact A <->
(forall Ti (f : family U Ti) (j : Ti), ind f j -> closed_of_family A f ->
finite_inter f -> fixed f).
Proof.
apply: iff_trans (qcompact_set A) _.
split=> [coA Ti f j fij clf|fixA Ti f j fij opf fcov].
suff : ~ fixed f -> exists g : finite_family U Ti,
sub_family f g /\ ~ fixed g.
move=> contra; apply: NNPP.
move/(imply_to_and (finite_inter _))=> [finIf] /contra [h [sfh Ih0]].
by apply: Ih0; have /finIf [q] := sfh; exists q.
move=> If0.
have Anfcov : cover A (mkfamily (ind f) (fun i => A `\` (f i))).
by apply/cover_setI; last apply: cover_setC If0.
have /open_of_setC opAnf := clf.
have /(_ fij) := coA _ _ j _ opAnf Anfcov.
move=> [g [k [gik [[ind_sgAnf Anfieqgi] gcov]]]].
exists (Ff (finfam_ext g (fun i => A `&` ~` g i))).
split; last exact: nfixed_setC gik gcov.
split=> //= l gil q; split.
move=> flq; split; last by move=> /Anfieqgi - /(_ gil) [].
have fil : ind f l by apply/ind_sgAnf.
have [h [_ [_ fieqAhi]]] := clf.
by have /fieqAhi /(_ q) /proj1 /(_ flq) [] := fil.
move=> [Aq /Anfieqgi] /(_ gil) /not_and_or /or_to_imply /(_ Aq).
exact: NNPP.
apply: NNPP; move/not_ex_all_not=> sfncov; apply/(nfixed_setC fij fcov).
apply: (fixA _ _ j) (closed_of_setC opf) _; first exact: fij.
move=> h [ind_shf Anfieqhi].
have shf : sub_family f (mkfamily (ind h `|` eq^~ j) f).
by split=> //= k; apply: or_ind => [|->] //; apply: ind_shf.
have /= := sfncov (Ff (finfamU h (Ff (finfam_sing j (F f))) (F f))).
move=> /not_ex_all_not /(_ j) /not_and_or /or_to_imply /(_ (or_intror _)).
move=> /(_ eq_refl) /not_and_or /or_to_imply /(_ shf).
move=> /not_all_ex_not [q] /(imply_to_and (A _)) [Aq hq]; exists q => k hik.
by apply/Anfieqhi => //; split=> // fkq; apply: hq; exists k=> //; left.
Qed.
Lemma fin_inter_filter T Ti (f : family T Ti) :
finite_inter f -> Filter (fun A => exists g : finite_family T Ti,
sub_family f g /\ inter_fam g `<=` A).
Proof.
move=> ffin; split.
- by exists (Ff (finfam_empty (fun _ _ => True))); split=> //; split.
- move=> A B [g [[sigif sgf] sigA]] [h [[sihif shf] sihB]].
exists (Ff (finfamU g h
(fun i p => (ind g i -> g i p) /\ (ind h i -> h i p)))); split=> /=.
split; first exact: subsetU.
move=> /= j kij p; split.
move=> fjp.
split; first by move/sgf=> eqgfj; apply/eqgfj.
by move/shf=> eqhfj; apply/eqhfj.
move=> [gp hp].
apply: or_ind kij.
move=> gij; apply/sgf=> //; exact: gp.
move=> hij; apply/shf=> //; exact: hp.
move=> p ikp; split.
apply: sigA; move=> j gij.
by have [/(_ gij)] := ikp j (or_introl (ind h j) gij).
apply: sihB; move=> j hij.
by have [_ /(_ hij)] := ikp j (or_intror (ind g j) hij).
- move=> A B sAB [g [sgf sigA]].
by exists g; split=> //; apply: subset_trans sAB.
Qed.
Lemma fin_inter_proper T Ti (f : family T Ti) :
finite_inter f -> ProperFilter (fun A => exists g : finite_family T Ti,
sub_family f g /\ inter_fam g `<=` A).
Proof.
move=> ffin.
split; last exact: fin_inter_filter.
move=> A [g [sgf sigA]].
have /ffin [p igp] := sgf.
exists p.
exact: sigA.
Qed.
Lemma compact_fixed A :
compact A <-> forall Ti (f : family U Ti) (j : Ti), ind f j ->
closed_of_family A f -> finite_inter f -> fixed f.
Proof.