-
Notifications
You must be signed in to change notification settings - Fork 45
/
measure.v
5077 lines (4309 loc) · 206 KB
/
measure.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
(* mathcomp analysis (c) 2017 Inria and AIST. License: CeCILL-C. *)
From mathcomp Require Import all_ssreflect all_algebra finmap.
From mathcomp Require Import mathcomp_extra boolp classical_sets functions.
From mathcomp Require Import cardinality fsbigop.
Require Import reals ereal signed topology normedtype sequences esum numfun.
From HB Require Import structures.
(**md**************************************************************************)
(* # Measure Theory *)
(* *)
(* NB: See CONTRIBUTING.md for an introduction to HB concepts and commands. *)
(* *)
(* This files provides a formalization of the basics of measure theory. This *)
(* includes the formalization of mathematical structures and of measures, as *)
(* well as standard theorems such as the Measure Extension theorem that *)
(* builds a measure given a function defined over a semiring of sets, the *)
(* intermediate outer measure being *)
(* $\inf_F\{ \sum_{k=0}^\infty \mu(F_k) | X \subseteq \bigcup_k F_k\}.$ *)
(* *)
(* References: *)
(* - R. Affeldt, C. Cohen. Measure construction by extension in dependent *)
(* type theory with application to integration. JAR 2023 *)
(* - Daniel Li. Intégration et applications. 2016 *)
(* - Achim Klenke. Probability Theory. 2014 *)
(* *)
(* ## Mathematical structures *)
(* ``` *)
(* semiRingOfSetsType d == the type of semirings of sets *)
(* The carrier is a set of sets A_i such that *)
(* "measurable A_i" holds. *)
(* "measurable A" is printed as "d.-measurable A" *)
(* where d is a "display parameter" whose purpose *)
(* is to distinguish different "measurable" *)
(* predicates in the same context. *)
(* The HB class is SemiRingOfSets. *)
(* ringOfSetsType d == the type of rings of sets *)
(* The HB class is RingOfSets. *)
(* sigmaRingType d == the type of sigma-rings (of sets) *)
(* The HB class is SigmaRing. *)
(* algebraOfSetsType d == the type of algebras of sets *)
(* The HB class is AlgebraOfsets. *)
(* measurableType == the type of sigma-algebras *)
(* The HB class is Measurable. *)
(* ``` *)
(* *)
(* ## Instances of mathematical structures *)
(* ``` *)
(* discrete_measurable_unit == the measurableType corresponding to *)
(* [set: set unit] *)
(* discrete_measurable_bool == the measurableType corresponding to *)
(* [set: set bool] *)
(* discrete_measurable_nat == the measurableType corresponding to *)
(* [set: set nat] *)
(* setring G == the set of sets G contains the empty set, is *)
(* closed by union, and difference (it is a ring *)
(* of sets in the sense of ringOfSetsType) *)
(* <<r G >> := smallest setring G *)
(* <<r G >> is equipped with a structure of ring *)
(* of sets. *)
(* G.-ring.-measurable A == A belongs to the ring of sets <<r G >> *)
(* sigma_ring G == the set of sets G forms a sigma-ring *)
(* <<sr G >> == sigma-ring generated by G *)
(* := smallest sigma_ring G *)
(* sigma_algebra D G == the set of sets G forms a sigma-algebra on D *)
(* <<s D, G >> == sigma-algebra generated by G on D *)
(* := smallest (sigma_algebra D) G *)
(* <<s G >> := <<s setT, G >> *)
(* <<s G >> is equipped with a structure of *)
(* sigma-algebra *)
(* G.-sigma.-measurable A == A is measurable for the sigma-algebra <<s G >> *)
(* g_sigma_algebraType G == the measurableType corresponding to <<s G >> *)
(* This is an HB alias. *)
(* mu .-cara.-measurable == sigma-algebra of Caratheodory measurable sets *)
(* ``` *)
(* *)
(* ## Structures for functions on classes of sets *)
(* *)
(* Hierarchy of contents, measures, s-finite/sigma-finite/finite measures, *)
(* etc. Also contains a number of details about its implementation. *)
(* ``` *)
(* {content set T -> \bar R} == type of contents *)
(* T is expected to be a semiring of sets and R *)
(* a numFieldType. *)
(* The HB class is Content. *)
(* {measure set T -> \bar R} == type of (non-negative) measures *)
(* T is expected to be a semiring of sets and *)
(* R is expected to be a numFieldType. *)
(* The HB class is Measure. *)
(* Content_isMeasure == interface that extends a content to a measure *)
(* with the proof that it is semi_sigma_additive *)
(* Content_SubSigmaAdditive_isMeasure == interface that extends a content to *)
(* a measure with the proof that it is *)
(* sigma_sub_additive *)
(* isMeasure == interface corresponding to the "textbook *)
(* definition" of measures *)
(* sfinite_measure == predicate for s-finite measure functions *)
(* {sfinite_measure set T -> \bar R} == type of s-finite measures *)
(* The HB class is SFiniteMeasure. *)
(* sfinite_measure_seq mu == the sequence of finite measures of the *)
(* s-finite measure mu *)
(* isSFinite == interface for functions that satisfy the *)
(* sfinite_measure predicate *)
(* s-finite measure using a sequence of finite *)
(* measures *)
(* Measure_isSFinite == interface that extends a measure to an *)
(* s-finite measure using a sequence of finite *)
(* measures *)
(* isSigmaFinite == interface for functions that satisfy *)
(* sigma finiteness *)
(* {sigma_finite_content set T -> \bar R} == contents that are also sigma *)
(* finite *)
(* The HB class is SigmaFiniteContent. *)
(* {sigma_finite_measure set T -> \bar R} == measures that are also sigma *)
(* finite *)
(* The HB class is SigmaFiniteMeasure. *)
(* sigma_finite A f == the measure function f is sigma-finite on the *)
(* A : set T with T a semiring of sets *)
(* fin_num_fun == predicate for finite function over measurable *)
(* sets *)
(* FinNumFun.type == type of functions over semiring of sets *)
(* returning a fin_num *)
(* The HB class is FinNumFun. *)
(* {finite_measure set T -> \bar R} == finite measures *)
(* The HB class is FiniteMeasure. *)
(* isFinite == interface for functions that satisfy the *)
(* fin_num_fun predicate *)
(* Measure_isFinite == interface that extends a measure to a finite *)
(* measure using a proof of fin_num_fun *)
(* isSubProbability == interface for functions that satisfy the *)
(* property of subprobability *)
(* The HB class is SubProbability. *)
(* subprobability T R == subprobability measure over the *)
(* measurableType T with values in \bar R with *)
(* R : realType *)
(* The HB class is SubProbability. *)
(* Measure_isSubProbability == interface that extends measures to *)
(* subprobability measures *)
(* isProbability == interface for functions that satisfy the *)
(* property of probability measures *)
(* The HB class is Probability. *)
(* probability T R == type of probability measure over the *)
(* measurableType T with values in \bar R *)
(* with R : realType *)
(* Measure_isProbability == interface that extends measures to *)
(* probability measures *)
(* mnormalize mu == normalization of a measure to a probability *)
(* mset U r == the set of probability measures mu such that *)
(* mu U < r *)
(* pset == the sets mset U r with U measurable and *)
(* r \in [0,1] *)
(* pprobability == the measurable type generated by pset *)
(* {outer_measure set T -> \bar R} == type of an outer measure over sets *)
(* of elements of type T : Type where R is *)
(* expected to be a numFieldType *)
(* The HB class is OuterMeasure. *)
(* interfaces: isOuterMeasure, *)
(* isSubsetOuterMeasure *)
(* ``` *)
(* *)
(* ## Instances of measures *)
(* ``` *)
(* pushforward mf m == pushforward/image measure of m by f, where mf is a *)
(* proof that f is measurable *)
(* m has type set T -> \bar R. *)
(* \d_a == Dirac measure *)
(* msum mu n == the measure corresponding to the sum of the measures *)
(* mu_0, ..., mu_{n-1} *)
(* @mzero T R == the zero measure *)
(* measure_add m1 m2 == the measure corresponding to the sum of the *)
(* measures m1 and m2 *)
(* mscale r m == the measure of corresponding to fun A => r * m A *)
(* where r has type {nonneg R} *)
(* mseries mu n == the measure corresponding to the sum of the *)
(* measures mu_n, mu_{n+1}, ... *)
(* mrestr mu mD == restriction of the measure mu to a set D; mD is a *)
(* proof that D is measurable *)
(* counting T R == counting measure *)
(* mfrestr mD muDoo == finite measure corresponding to the restriction of *)
(* the measure mu over D with mu D < +oo, *)
(* mD : measurable D, muDoo : mu D < +oo *)
(* ``` *)
(* *)
(* ## About sets of sets *)
(* ``` *)
(* setI_closed G == the set of sets G is closed under finite *)
(* intersection *)
(* setU_closed G == the set of sets G is closed under finite union *)
(* setC_closed G == the set of sets G is closed under complement *)
(* setD_closed G == the set of sets G is closed under difference *)
(* ndseq_closed G == the set of sets G is closed under non-decreasing *)
(* countable union *)
(* niseq_closed G == the set of sets G is closed under non-increasing *)
(* countable intersection *)
(* trivIset_closed G == the set of sets G is closed under pairwise-disjoint *)
(* countable union *)
(* lambda_system D G == G is a lambda_system of subsets of D *)
(* <<l D, G >> == lambda-system generated by G on D *)
(* <<l G >> := <<m setT, G >> *)
(* monotone G == G is a monotone class *)
(* <<M G >> == monotone class generated by G *)
(* := smallest monotone G *)
(* dynkin G == G is a set of sets that form a Dynkin *)
(* system (or a d-system) *)
(* <<d G >> == Dynkin system generated by G, i.e., *)
(* smallest dynkin G *)
(* strace G D := [set x `&` D | x in G] *)
(* ``` *)
(* ## Other measure-theoretic definitions *)
(* *)
(* ``` *)
(* measurable_fun D f == the function f with domain D is measurable *)
(* preimage_class D f G == class of the preimages by f of sets in G *)
(* image_class D f G == class of the sets with a preimage by f in G *)
(* sigma_subadditive mu == predicate defining sigma-subadditivity *)
(* subset_sigma_subadditive mu == alternative predicate defining *)
(* sigma-subadditivity *)
(* mu.-negligible A == A is mu negligible *)
(* measure_is_complete mu == the measure mu is complete *)
(* {ae mu, forall x, P x} == P holds almost everywhere for the measure mu, *)
(* declared as an instance of the type of filters *)
(* ae_eq D f g == f is equal to g almost everywhere *)
(* ``` *)
(* *)
(* ## Measure extension theorem *)
(* *)
(* From a premeasure to an outer measure (Measure Extension Theorem part 1): *)
(* ``` *)
(* measurable_cover X == the set of sequences F such that *)
(* - forall k, F k is measurable *)
(* - X `<=` \bigcup_k (F k) *)
(* mu^* == extension of the measure mu over a semiring of *)
(* sets (it is an outer measure) *)
(* ``` *)
(* From an outer measure to a measure (Measure Extension Theorem part 2): *)
(* ``` *)
(* mu.-caratheodory == the set of Caratheodory measurable sets for the *)
(* outer measure mu, i.e., sets A such that *)
(* forall B, mu A = mu (A `&` B) + mu (A `&` ~` B) *)
(* caratheodory_type mu := T, where mu : {outer_measure set T -> \bar R} *)
(* It is a canonical mesurableType copy of T. *)
(* The restriction of the outer measure mu to the *)
(* sigma algebra of Caratheodory measurable sets is a *)
(* measure. *)
(* Remark: sets that are negligible for *)
(* this measure are Caratheodory measurable. *)
(* ``` *)
(* Measure Extension Theorem: *)
(* ``` *)
(* measure_extension mu == extension of the content mu over a semiring of *)
(* sets to a measure over the generated *)
(* sigma algebra (requires a proof of *)
(* sigma-sub-additivity) *)
(* ``` *)
(* *)
(* ## Product of measurable spaces *)
(* ``` *)
(* preimage_classes f1 f2 == sigma-algebra generated by the union of *)
(* the preimages by f1 and the preimages by *)
(* f2 with f1 : T -> T1 and f : T -> T2, T1 *)
(* and T2 being semiRingOfSetsType's *)
(* (d1, d2).-prod.-measurable A == A is measurable for the sigma-algebra *)
(* generated from T1 x T2, with T1 and T2 *)
(* semiRingOfSetsType's with resp. display *)
(* d1 and d2 *)
(* ``` *)
(* *)
(* ## More measure-theoretic definitions *)
(* ``` *)
(* m1 `<< m2 == m1 is absolutely continuous w.r.t. m2 or m2 dominates m1 *)
(* ess_sup f == essential supremum of the function f : T -> R where T is a *)
(* semiRingOfSetsType and R is a realType *)
(* ``` *)
(* *)
(******************************************************************************)
Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.
Import Order.TTheory GRing.Theory Num.Def Num.Theory.
Reserved Notation "'s<|' D , G '|>'" (at level 40, G, D at next level).
Reserved Notation "'s<<' A '>>'".
Reserved Notation "'d<<' D '>>'".
Reserved Notation "mu .-negligible" (at level 2, format "mu .-negligible").
Reserved Notation "{ 'ae' m , P }" (at level 0, format "{ 'ae' m , P }").
Reserved Notation "mu .-measurable" (at level 2, format "mu .-measurable").
Reserved Notation "'\d_' a" (at level 8, a at level 2, format "'\d_' a").
Reserved Notation "G .-sigma" (at level 1, format "G .-sigma").
Reserved Notation "G .-sigma.-measurable"
(at level 2, format "G .-sigma.-measurable").
Reserved Notation "d .-ring" (at level 1, format "d .-ring").
Reserved Notation "d .-ring.-measurable"
(at level 2, format "d .-ring.-measurable").
Reserved Notation "mu .-cara" (at level 1, format "mu .-cara").
Reserved Notation "mu .-cara.-measurable"
(at level 2, format "mu .-cara.-measurable").
Reserved Notation "mu .-caratheodory"
(at level 2, format "mu .-caratheodory").
Reserved Notation "'<<l' D , G '>>'"
(at level 2, format "'<<l' D , G '>>'").
Reserved Notation "'<<l' G '>>'"
(at level 2, format "'<<l' G '>>'").
Reserved Notation "'<<d' G '>>'"
(at level 2, format "'<<d' G '>>'").
Reserved Notation "'<<s' D , G '>>'"
(at level 2, format "'<<s' D , G '>>'").
Reserved Notation "'<<s' G '>>'"
(at level 2, format "'<<s' G '>>'").
Reserved Notation "'<<r' G '>>'"
(at level 2, format "'<<r' G '>>'").
Reserved Notation "'<<sr' G '>>'"
(at level 2, format "'<<sr' G '>>'").
Reserved Notation "'<<M' G '>>'"
(at level 2, format "'<<M' G '>>'").
Reserved Notation "{ 'content' fUV }" (at level 0, format "{ 'content' fUV }").
Reserved Notation "[ 'content' 'of' f 'as' g ]"
(at level 0, format "[ 'content' 'of' f 'as' g ]").
Reserved Notation "[ 'content' 'of' f ]"
(at level 0, format "[ 'content' 'of' f ]").
Reserved Notation "{ 'measure' fUV }"
(at level 0, format "{ 'measure' fUV }").
Reserved Notation "[ 'measure' 'of' f 'as' g ]"
(at level 0, format "[ 'measure' 'of' f 'as' g ]").
Reserved Notation "[ 'measure' 'of' f ]"
(at level 0, format "[ 'measure' 'of' f ]").
Reserved Notation "{ 'outer_measure' fUV }"
(at level 0, format "{ 'outer_measure' fUV }").
Reserved Notation "[ 'outer_measure' 'of' f 'as' g ]"
(at level 0, format "[ 'outer_measure' 'of' f 'as' g ]").
Reserved Notation "[ 'outer_measure' 'of' f ]"
(at level 0, format "[ 'outer_measure' 'of' f ]").
Reserved Notation "p .-prod" (at level 1, format "p .-prod").
Reserved Notation "p .-prod.-measurable"
(at level 2, format "p .-prod.-measurable").
Reserved Notation "m1 `<< m2" (at level 51).
Inductive measure_display := default_measure_display.
Declare Scope measure_display_scope.
Delimit Scope measure_display_scope with mdisp.
Bind Scope measure_display_scope with measure_display.
Local Open Scope classical_set_scope.
Local Open Scope ring_scope.
Section classes.
Context {T} (C : set (set T) -> Prop) (D : set T) (G : set (set T)).
Definition setC_closed := forall A, G A -> G (~` A).
Definition setI_closed := forall A B, G A -> G B -> G (A `&` B).
Definition setU_closed := forall A B, G A -> G B -> G (A `|` B).
Definition setD_closed := forall A B, B `<=` A -> G A -> G B -> G (A `\` B).
Definition setDI_closed := forall A B, G A -> G B -> G (A `\` B).
Definition fin_bigcap_closed :=
forall I (D : set I) A_, finite_set D -> (forall i, D i -> G (A_ i)) ->
G (\bigcap_(i in D) (A_ i)).
Definition finN0_bigcap_closed :=
forall I (D : set I) A_, finite_set D -> D !=set0 ->
(forall i, D i -> G (A_ i)) ->
G (\bigcap_(i in D) (A_ i)).
Definition fin_bigcup_closed :=
forall I (D : set I) A_, finite_set D -> (forall i, D i -> G (A_ i)) ->
G (\bigcup_(i in D) (A_ i)).
Definition semi_setD_closed := forall A B, G A -> G B -> exists D,
[/\ finite_set D, D `<=` G, A `\` B = \bigcup_(X in D) X & trivIset D id].
Lemma setDI_semi_setD_closed : setDI_closed -> semi_setD_closed.
Proof.
move=> mD A B Am Bm; exists [set A `\` B]; split; rewrite ?bigcup_set1//.
by move=> X ->; apply: mD.
by move=> X Y -> ->.
Qed.
Definition ndseq_closed :=
forall F, nondecreasing_seq F -> (forall i, G (F i)) -> G (\bigcup_i (F i)).
Definition niseq_closed :=
forall F, nonincreasing_seq F -> (forall i, G (F i)) -> G (\bigcap_i (F i)).
Definition trivIset_closed :=
forall F : (set T)^nat, trivIset setT F -> (forall n, G (F n)) ->
G (\bigcup_k F k).
Definition fin_trivIset_closed :=
forall I (D : set I) (F : I -> set T), finite_set D -> trivIset D F ->
(forall i, D i -> G (F i)) -> G (\bigcup_(k in D) F k).
Definition setring := [/\ G set0, setU_closed & setDI_closed].
Definition sigma_ring := [/\ G set0, setDI_closed &
(forall A : (set T)^nat, (forall n, G (A n)) -> G (\bigcup_k A k))].
Definition sigma_algebra :=
[/\ G set0, (forall A, G A -> G (D `\` A)) &
(forall A : (set T)^nat, (forall n, G (A n)) -> G (\bigcup_k A k))].
Definition dynkin := [/\ G setT, setC_closed & trivIset_closed].
(**md Until MathComp-Analysis 1.1.0, the identifier was `monotone_class`
because this definition corresponds to "classe monotone" in several
French references, e.g., the definition of "classe monotone" on the French wikipedia. *)
Definition lambda_system :=
[/\ forall A, G A -> A `<=` D, G D, setD_closed & ndseq_closed].
Definition monotone := ndseq_closed /\ niseq_closed.
End classes.
#[deprecated(since="mathcomp-analysis 1.2.0", note="renamed `lambda_system`")]
Notation monotone_class := lambda_system (only parsing).
Lemma powerset_sigma_ring (T : Type) (D : set T) :
sigma_ring [set X | X `<=` D].
Proof.
split => //; last first.
by move=> F FA/=; apply: bigcup_sub => i _; exact: FA.
by move=> U V + VA; apply: subset_trans; exact: subDsetl.
Qed.
Lemma powerset_lambda_system (T : Type) (D : set T) :
lambda_system D [set X | X `<=` D].
Proof.
split => //.
- by move=> A B BA + BD; apply: subset_trans; exact: subDsetl.
- by move=> /= F _ FD; exact: bigcup_sub.
Qed.
Notation "'<<l' D , G '>>'" := (smallest (lambda_system D) G) :
classical_set_scope.
Notation "'<<l' G '>>'" := (<<l setT, G>>) : classical_set_scope.
Notation "'<<d' G '>>'" := (smallest dynkin G) : classical_set_scope.
Notation "'<<s' D , G '>>'" := (smallest (sigma_algebra D) G) :
classical_set_scope.
Notation "'<<s' G '>>'" := (<<s setT, G>>) : classical_set_scope.
Notation "'<<r' G '>>'" := (smallest setring G) : classical_set_scope.
Notation "'<<sr' G '>>'" := (smallest sigma_ring G) : classical_set_scope.
Notation "'<<M' G '>>'" := (smallest monotone G) : classical_set_scope.
Section lambda_system_smallest.
Variables (T : Type) (D : set T) (G : set (set T)).
Hypothesis GD : forall A, G A -> A `<=` D.
Lemma lambda_system_smallest : lambda_system D <<l D , G >>.
Proof.
split => [A MA | E [monoE] | A B BA MA MB E [[EsubD ED setDE ndE] GE] |].
- have monoH := powerset_lambda_system D.
by case: (monoH) => + _ _ _; apply; exact: MA.
- by case: monoE.
- by apply setDE => //; [exact: MA|exact: MB].
- by move=> F ndF MF E [[EsubD ED setDE ndE] CE]; apply ndE=> // n; exact: MF.
Qed.
End lambda_system_smallest.
Lemma fin_bigcup_closedP T (G : set (set T)) :
(G set0 /\ setU_closed G) <-> fin_bigcup_closed G.
Proof.
split=> [[G0 GU] I D A DF GA|GU]; last first.
have G0 : G set0 by have := GU void set0 point; rewrite bigcup0//; apply.
by split=> // A B GA GB; rewrite -bigcup2inE; apply: GU => // -[|[|[]]].
elim/Pchoice: I => I in D DF A GA *; rewrite -bigsetU_fset_set// big_seq.
by elim/big_ind: _ => // i; rewrite in_fset_set// inE => /GA.
Qed.
Lemma finN0_bigcap_closedP T (G : set (set T)) :
setI_closed G <-> finN0_bigcap_closed G.
Proof.
split=> [GI I D A DF [i Di] GA|GI A B GA GB]; last first.
by rewrite -bigcap2inE; apply: GI => // [|[|[|[]]]]; first by exists 0%N.
elim/Pchoice: I => I in D DF i Di A GA *.
have finDDi : finite_set (D `\ i) by exact: finite_setD.
rewrite (bigcap_setD1 i)// -bigsetI_fset_set// big_seq.
elim/big_rec: _ => // [|j B]; first by rewrite setIT; apply: GA.
rewrite in_fset_set// inE => -[Dj /eqP nij] GAB.
by rewrite setICA; apply: GI => //; apply: GA.
Qed.
Lemma sedDI_closedP T (G : set (set T)) :
setDI_closed G <-> (setI_closed G /\ setD_closed G).
Proof.
split=> [GDI|[GI GD]].
by split=> A B => [|AB] => GA GB; rewrite -?setDD//; do ?apply: (GDI).
move=> A B GA GB; suff <- : A `\` (A `&` B) = A `\` B.
by apply: GD => //; apply: GI.
by rewrite setDE setCI setIUr -setDE setDv set0U.
Qed.
Lemma sigma_algebra_bigcap T (I : choiceType) (D : set T)
(F : I -> set (set T)) (J : set I) :
(forall n, J n -> sigma_algebra D (F n)) ->
sigma_algebra D (\bigcap_(i in J) F i).
Proof.
move=> mG; split=> [i Ji|A AJ i Ji|H GH i Ji]; first by have [] := mG i.
- by have [_ mGiC _] := mG i Ji; exact/mGiC/AJ.
- by have [_ _ mGiU] := mG i Ji; apply: mGiU => j; exact: GH.
Qed.
Lemma sigma_algebraP T U (C : set (set T)) :
(forall X, C X -> X `<=` U) ->
sigma_algebra U C <->
[/\ C U, setD_closed C, ndseq_closed C & setI_closed C].
Proof.
move=> C_subU; split => [[C0 CD CU]|[DT DC DU DI]]; split.
- by rewrite -(setD0 U); apply: CD.
- move=> A B BA CA CB; rewrite (_ : A `\` B = U `\` ((U `\` A) `|` B)).
by apply CD; rewrite -bigcup2E; apply: CU => -[|[|[|]]] //=; exact: CD.
rewrite setDUr setDD [in RHS]setDE setIACA setIid -setDE setIidr//.
by rewrite setDE; apply: subIset; left; apply: C_subU.
- by move=> F ndF DF; exact: CU.
- move=> A B DA DB; rewrite (_ : A `&` B = U `\` ((U `\` A) `|` (U `\` B))).
by apply CD; rewrite -bigcup2E; apply: CU => -[|[|[|]]] //; exact: CD.
rewrite setDUr !setDD setIACA setIid (@setIidr _ U)//.
by apply: subIset; left; exact: C_subU.
- by rewrite -(setDv U); exact: DC.
- by move=> A CA; apply: DC => //; exact: C_subU.
- move=> F DF.
rewrite [X in C X](_ : _ = \bigcup_i \big[setU/set0]_(j < i.+1) F j).
apply: DU; first by move=> *; exact/subsetPset/subset_bigsetU.
elim=> [|n ih]; first by rewrite big_ord_recr /= big_ord0 set0U; exact: DF.
have CU : setU_closed C.
move=> A B DA DB; rewrite (_ : A `|` B = U `\` ((U `\` A) `&` (U `\` B))).
apply DC => //; last by apply: DI; apply: DC => //; exact: C_subU.
by apply: subIset; left; apply: subIset; left.
by rewrite setDIr// !setDD (setIidr (C_subU _ DA)) (setIidr (C_subU _ _)).
by rewrite big_ord_recr; exact: CU.
rewrite predeqE => x; split => [[n _ Fnx]|[n _]].
by exists n => //; rewrite big_ord_recr /=; right.
by rewrite -bigcup_mkord => -[m /=]; rewrite ltnS => _ Fmx; exists m.
Qed.
Section generated_sigma_algebra.
Context {T : Type} (D : set T) (G : set (set T)).
Implicit Types (M : set (set T)).
Lemma smallest_sigma_algebra : sigma_algebra D <<s D, G >>.
Proof.
split=> [|A GA|A GA] P [[P0 PD PU]] GP //.
by apply: (PD); apply: GA.
by apply: (PU) => n; apply: GA.
Qed.
Hint Resolve smallest_sigma_algebra : core.
Lemma sub_sigma_algebra2 M : M `<=` G -> <<s D, M >> `<=` <<s D, G >>.
Proof. exact: sub_smallest2r. Qed.
Lemma sigma_algebra_id : sigma_algebra D G -> <<s D, G >> = G.
Proof. by move=> /smallest_id->. Qed.
Lemma sub_sigma_algebra : G `<=` <<s D, G >>. Proof. exact: sub_smallest. Qed.
Lemma sigma_algebra0 : <<s D, G >> set0.
Proof. by case: smallest_sigma_algebra. Qed.
Lemma sigma_algebraCD : forall A, <<s D, G >> A -> <<s D, G >> (D `\` A).
Proof. by case: smallest_sigma_algebra. Qed.
Lemma sigma_algebra_bigcup (A : (set T)^nat) :
(forall i, <<s D, G >> (A i)) -> <<s D, G >> (\bigcup_i (A i)).
Proof. by case: smallest_sigma_algebra A. Qed.
End generated_sigma_algebra.
#[global] Hint Resolve smallest_sigma_algebra : core.
Section generated_setring.
Context {T : Type} (G : set (set T)).
Implicit Types (M : set (set T)).
Lemma smallest_setring : setring <<r G >>.
Proof.
split=> [|A B GA GB|A B GA GB] P [[P0 PU PDI]] GP //.
by apply: (PU); [apply: GA|apply: GB].
by apply: (PDI); [apply: GA|apply: GB].
Qed.
Hint Resolve smallest_setring : core.
Lemma sub_setring2 M : M `<=` G -> <<r M >> `<=` <<r G >>.
Proof. exact: sub_smallest2r. Qed.
Lemma setring_id : setring G -> <<r G >> = G.
Proof. by move=> /smallest_id->. Qed.
Lemma sub_setring : G `<=` <<r G >>. Proof. exact: sub_smallest. Qed.
Lemma setring0 : <<r G >> set0.
Proof. by case: smallest_setring. Qed.
Lemma setringDI : setDI_closed <<r G>>.
Proof. by case: smallest_setring. Qed.
Lemma setringU : setU_closed <<r G>>.
Proof. by case: smallest_setring. Qed.
Lemma setring_fin_bigcup : fin_bigcup_closed <<r G>>.
Proof.
by apply/fin_bigcup_closedP; split; [apply: setring0|apply: setringU].
Qed.
End generated_setring.
#[global] Hint Resolve smallest_setring setring0 : core.
Lemma g_sigma_algebra_lambda_system T (G : set (set T)) (D : set T) :
(forall X, <<s D, G >> X -> X `<=` D) ->
lambda_system D <<s D, G >>.
Proof.
move=> sDGD; have := smallest_sigma_algebra D G.
by move=> /(sigma_algebraP sDGD) [sT sD snd sI]; split.
Qed.
#[deprecated(since="mathcomp-analysis 1.2.0", note="renamed `g_sigma_algebra_lambda_system`")]
Notation monotone_class_g_salgebra := g_sigma_algebra_lambda_system (only parsing).
Lemma smallest_sigma_ring T (G : set (set T)) : sigma_ring <<sr G >>.
Proof.
split=> [B [[]]//|A B GA GB C [[? CDI ?]] GC|A GA C [[? ? CU]] GC] /=.
- by apply: (CDI); [exact: GA|exact: GB].
- by apply: (CU) => n; exact: GA.
Qed.
(**md see Paul Halmos' Measure Theory, Ch.1, sec.6, thm.A(1), p.27 *)
Lemma sigma_ring_monotone T (G : set (set T)) : sigma_ring G -> monotone G.
Proof.
move=> [G0 GDI GU]; split => [F ndF GF|F icF GF]; first exact: GU.
rewrite -(@setD_bigcup _ _ F _ O)//; apply: (GDI); first exact: GF.
by rewrite bigcup_mkcond; apply: GU => n; case: ifPn => // _; exact: GDI.
Qed.
Lemma g_sigma_ring_monotone T (G : set (set T)) : monotone <<sr G >>.
Proof. by apply: sigma_ring_monotone => //; exact: smallest_sigma_ring. Qed.
Lemma sub_g_sigma_ring T (G : set (set T)) : G `<=` <<sr G >>.
Proof. exact: sub_smallest. Qed.
(**md see Paul Halmos' Measure Theory, Ch.1, sec.6, thm.A(2), p.27 *)
Lemma setring_monotone_sigma_ring T (G : set (set T)) :
setring G -> monotone G -> sigma_ring G.
Proof.
move=> [G0 GU GD] [ndG niG]; split => // F GF.
rewrite -bigcup_bigsetU_bigcup; apply: ndG.
by move=> *; exact/subsetPset/subset_bigsetU.
by elim=> [|n ih]; rewrite big_ord_recr/= ?big_ord0 ?set0U//; exact: GU.
Qed.
Lemma g_monotone_monotone T (G : set (set T)) : monotone <<M G>>.
Proof.
split=> /= F ndF GF C [[ndC niC] GC];
have {}GC : <<M G >> `<=` C by exact: smallest_sub.
- by apply: (ndC) => // i; apply: (GC); exact: GF.
- by apply: (niC) => // i; apply: (GC); exact: GF.
Qed.
Section g_monotone_g_sigma_ring.
Variables (T : Type) (G : set (set T)).
Hypothesis ringG : setring G.
(**md see Paul Halmos' Measure Theory, Ch.1, sec.6, thm.B, p.27 *)
Lemma g_monotone_setring : setring <<M G>>.
Proof.
pose M := <<M G>>.
pose K F := [set E | [/\ M (E `\` F), M (F `\` E) & M (E `|` F)] ].
have KP E F : K(F) E -> K(E) F by move=> [] *; split; rewrite 1?setUC.
have K_monotone F : monotone (K(F)).
split.
move=> /= H ndH KFH; split.
- rewrite setD_bigcupl; apply: (g_monotone_monotone G).1.
by move=> m n mn; apply/subsetPset; apply: setSD; exact/subsetPset/ndH.
by move=> i; have [] := KFH i.
- rewrite setDE setC_bigcup -bigcapIr//; apply: (g_monotone_monotone G).2.
move=> m n mn; apply/subsetPset.
by apply: setDS; exact/subsetPset/ndH.
by move=> i; have [] := KFH i.
- rewrite -bigcupUl//; apply: (g_monotone_monotone G).1.
move=> m n mn; apply/subsetPset.
by apply: setSU; exact/subsetPset/ndH.
by move=> i; have [] := KFH i.
move=> /= H niH KFH; split.
- rewrite setDE -bigcapIl//; apply: (g_monotone_monotone G).2.
move=> m n mn; apply/subsetPset; apply: setSI; exact/subsetPset/niH.
by move=> i; have [] := KFH i.
- rewrite setDE setC_bigcap setI_bigcupr; apply: (g_monotone_monotone G).1.
move=> m n mn; apply/subsetPset.
by apply: setIS; apply: subsetC; exact/subsetPset/niH.
by move=> i; have [] := KFH i.
- rewrite setU_bigcapl//; apply: (g_monotone_monotone G).2.
move=> m n mn; apply/subsetPset.
by apply: setSU; exact/subsetPset/niH.
by move=> i; have [] := KFH i.
have G_KF F : G F -> G `<=` K(F).
case: ringG => _ GU GDI GF A GA; split.
- by apply: sub_gen_smallest; exact: GDI.
- by apply: sub_gen_smallest; exact: GDI.
- by apply: sub_gen_smallest; exact: GU.
have GM_KF F : G F -> M `<=` K(F).
by move=> GF; apply: smallest_sub => //; exact: G_KF.
have MG_KF F : M F -> G `<=` K(F).
by move=> MF A GA; rewrite /K/=; split; have /KP[] := GM_KF _ GA _ MF.
have MM_KF F : M F -> M `<=` K(F).
by move=> MF; apply: smallest_sub => //; exact: MG_KF.
split.
- by apply: sub_gen_smallest; case: ringG.
- by move=> A B GA GB; have [] := MM_KF _ GB _ GA.
- by move=> A B GA GB; have [] := MM_KF _ GB _ GA.
Qed.
Lemma g_monotone_g_sigma_ring : <<M G >> = <<sr G >>.
Proof.
rewrite eqEsubset; split.
by apply: smallest_sub; [exact: g_sigma_ring_monotone|
exact: sub_g_sigma_ring].
apply: smallest_sub; last exact: sub_smallest.
apply: setring_monotone_sigma_ring; last exact: g_monotone_monotone.
exact: g_monotone_setring.
Qed.
End g_monotone_g_sigma_ring.
Corollary monotone_setring_sub_g_sigma_ring T (G R : set (set T)) : monotone G ->
setring R -> R `<=` G -> <<sr R>> `<=` G.
Proof.
by move=> mG rR RG; rewrite -g_monotone_g_sigma_ring//; exact: smallest_sub.
Qed.
Section smallest_lambda_system.
Variables (T : Type) (G : set (set T)) (setIG : setI_closed G) (D : set T).
Hypothesis lambdaDG : lambda_system D <<l D, G >>.
Lemma smallest_lambda_system : (forall X, <<s D, G >> X -> X `<=` D) ->
<<l D, G >> = <<s D, G >>.
Proof.
move=> sDGD; rewrite eqEsubset; split.
apply: smallest_sub; first exact: g_sigma_algebra_lambda_system.
exact: sub_sigma_algebra.
suff: setI_closed <<l D, G >>.
move=> IH; apply: smallest_sub => //.
by apply/sigma_algebraP; case: lambdaDG.
pose H := <<l D, G >>.
pose H_ A := [set X | H X /\ H (X `&` A)].
have setDH_ A : setD_closed (H_ A).
move=> X Y XY [HX HXA] [HY HYA]; case: lambdaDG => h _ setDH _; split.
exact: setDH.
rewrite (_ : _ `&` _ = (X `&` A) `\` (Y `&` A)); last first.
rewrite predeqE => x; split=> [[[? ?] ?]|]; first by split => // -[].
by move=> [[? ?] YAx]; split => //; split => //; apply: contra_not YAx.
by apply: setDH => //; exact: setSI.
have ndH_ A : ndseq_closed (H_ A).
move=> F ndF H_AF; split.
by case: lambdaDG => h _ _; apply => // => n; have [] := H_AF n.
rewrite setI_bigcupl; case: lambdaDG => h _ _; apply => //.
by move=> m n mn; apply/subsetPset; apply: setSI; apply/subsetPset/ndF.
by move=> n; have [] := H_AF n.
have GGH_ X : G X -> G `<=` H_ X.
move=> GX; rewrite /H_ => A GA; split; first exact: sub_smallest GA.
by apply: (@sub_smallest _ _ _ G) => //; exact: setIG.
have HD X : H X -> X `<=` D by move=> ?; case: lambdaDG => + _ _ _; apply.
have GHH_ X : G X -> H `<=` H_ X.
move=> GX; apply: smallest_sub; last exact: GGH_.
split => //; first by move=> A [HA _]; case: lambdaDG => + _ _ _; exact.
have XD : X `<=` D by apply: HD; exact: (@sub_smallest _ _ _ G).
rewrite /H_ /= setIidr//; split; [by case: lambdaDG|].
exact: (@sub_smallest _ _ _ G).
have HGH_ X : H X -> G `<=` H_ X.
move=> *; split; [|by rewrite setIC; apply GHH_].
exact: (@sub_smallest _ _ _ G).
have HHH_ X : H X -> H `<=` H_ X.
move=> HX; apply: smallest_sub; last exact: HGH_.
split=> //.
- by move=> ? [? ?]; case: lambdaDG => + _ _ _; exact.
- have XD : X `<=` D := HD _ HX.
by rewrite /H_/= setIidr//; split => //; case: lambdaDG.
by move=> *; apply HHH_.
Qed.
End smallest_lambda_system.
#[deprecated(since="mathcomp-analysis 1.2.0", note="renamed `smallest_lambda_system`")]
Notation smallest_monotone_classE := smallest_lambda_system (only parsing).
Section lambda_system_subset.
Variables (T : Type) (G : set (set T)) (setIG : setI_closed G) (D : set T).
Variables (H : set (set T)) (DH : lambda_system D H) (GH : G `<=` H).
(**md a.k.a. Sierpiński–Dynkin's pi-lambda theorem *)
Lemma lambda_system_subset : (forall X, (<<s D, G >>) X -> X `<=` D) ->
<<s D, G >> `<=` H.
Proof.
move=> sDGD; set M := <<l D, G >>.
rewrite -(@smallest_lambda_system _ _ setIG D) //.
- exact: smallest_sub.
- apply: lambda_system_smallest => A GA.
by apply: sDGD; exact: sub_sigma_algebra.
Qed.
End lambda_system_subset.
#[deprecated(since="mathcomp-analysis 1.2.0", note="renamed `lambda_system_subset`")]
Notation monotone_class_subset := lambda_system_subset (only parsing).
Section dynkin.
Variable T : Type.
Implicit Types G D : set (set T).
Lemma dynkinT G : dynkin G -> G setT. Proof. by case. Qed.
Lemma dynkinC G : dynkin G -> setC_closed G. Proof. by case. Qed.
Lemma dynkinU G : dynkin G -> (forall F : (set T)^nat, trivIset setT F ->
(forall n, G (F n)) -> G (\bigcup_k F k)). Proof. by case. Qed.
End dynkin.
Section dynkin_lemmas.
Variable T : Type.
Implicit Types D G : set (set T).
Lemma dynkin_lambda_system G : dynkin G <-> lambda_system setT G.
Proof.
split => [[GT setCG trG]|[_ GT setDG ndG]]; split => //.
- move=> A B BA GA GB; rewrite setDE -(setCK (_ `&` _)) setCI; apply: (setCG).
rewrite setCK -bigcup2E; apply trG.
+ by rewrite -trivIset_bigcup2 setIC; apply subsets_disjoint.
+ by move=> [|[//|n]]; [exact: setCG|rewrite /bigcup2 -setCT; apply: setCG].
- move=> F ndF GF; rewrite -eq_bigcup_seqD; apply: (trG).
exact: trivIset_seqD.
move=> [/=|n]; first exact: GF.
rewrite /seqD setDE -(setCK (_ `&` _)) setCI; apply: (setCG).
rewrite setCK -bigcup2E; apply: trG.
+ rewrite -trivIset_bigcup2 setIC; apply subsets_disjoint.
exact/subsetPset/ndF/ltnW.
+ move=> [|[|]]; rewrite /bigcup2 /=; [exact/setCG/GF|exact/GF|].
by move=> _; rewrite -setCT; apply: setCG.
- by move=> A B; rewrite -setTD; apply: setDG.
- move=> F tF GF; pose A i := \big[setU/set0]_(k < i.+1) F k.
rewrite -bigcup_bigsetU_bigcup.
apply: ndG; first by move=> a b ab; exact/subsetPset/subset_bigsetU.
elim=> /= => [|n ih].
by rewrite /A big_ord_recr /= big_ord0 set0U; exact: GF.
rewrite /A /= big_ord_recr /= -/(A n).
rewrite (_ : _ `|` _ = ~` (~` A n `\` F n.+1)); last first.
by rewrite setDE setCI !setCK.
rewrite -setTD; apply: (setDG) => //; apply: (setDG) => //; last first.
by rewrite -setTD; apply: setDG.
apply/disjoints_subset; rewrite setIC.
by apply: (@trivIset_bigsetUI _ predT) => //; rewrite /predT /= trueE.
Qed.
Lemma g_dynkin_dynkin G : dynkin <<d G >>.
Proof.
split=> [D /= [] []//| | ].
- by move=> Y sGY D /= [dD GD]; exact/(dynkinC dD)/(sGY D).
- by move=> F tF gGF D /= [dD GD]; apply dD => // k; exact: gGF.
Qed.
Lemma sigma_algebra_dynkin G : sigma_algebra setT G -> dynkin G.
Proof.
case=> ? DC DU; split => [| |? ? ?]; last exact: DU.
- by rewrite -setC0 -setTD; exact: DC.
- by move=> A GA; rewrite -setTD; apply: DC.
Qed.
Lemma dynkin_setI_bigsetI G (F : (set T)^nat) : dynkin G -> setI_closed G ->
(forall n, G (F n)) -> forall n, G (\big[setI/setT]_(i < n) F i).
Proof.
move=> dG GI GF; elim => [|n ih]; last by rewrite big_ord_recr /=; apply: GI.
by rewrite big_ord0; exact: (dynkinT dG).
Qed.
Lemma dynkin_setI_sigma_algebra G : dynkin G -> setI_closed G ->
sigma_algebra setT G.
Proof.
move=> dG GI; split => [|//|F DF].
- by rewrite -setCT; exact/(dynkinC dG)/(dynkinT dG).
- by move=> A GA; rewrite setTD; exact: (dynkinC dG).
- rewrite seqDU_bigcup_eq; apply/(dynkinU dG) => //.
move=> n; rewrite /seqDU setDE; apply GI => //.
rewrite -bigcup_mkord setC_bigcup bigcap_mkord.
by apply: (@dynkin_setI_bigsetI _ (fun x => ~` F x)) => // ?; exact/(dynkinC dG).
Qed.
Lemma setI_closed_g_dynkin_g_sigma_algebra G :
setI_closed G -> <<d G >> = <<s G >>.
Proof.
move=> GI; rewrite eqEsubset; split.
by apply: sub_smallest2l; exact: sigma_algebra_dynkin.
pose delta (D : set T) := [set E | <<d G >> (E `&` D)].
have ddelta (D : set T) : <<d G >> D -> dynkin (delta D).
move=> dGD; split; first by rewrite /delta /= setTI.
- move=> E DE; rewrite /delta /=.
have -> : (~` E) `&` D = ~` ((E `&` D) `|` (~` D)).
by rewrite -[LHS]setU0 -(setICl D) -setIUl -setCI -{2}(setCK D) -setCU.
have : <<d G >> ((E `&` D) `|` ~` D).
rewrite -bigcup2E => S [dS GS]; apply: (dynkinU dS).
move=> [|[|i]] [|[|j]] => // _ _; rewrite /bigcup2 /=.
+ by rewrite -setIA setICr setI0 => /set0P; rewrite eqxx.
+ by rewrite setI0 => /set0P; rewrite eqxx.
+ by rewrite setICA setICl setI0 => /set0P; rewrite eqxx.
+ by rewrite setI0 => /set0P; rewrite eqxx.
+ by rewrite set0I => /set0P; rewrite eqxx.
+ by rewrite set0I => /set0P; rewrite eqxx.
+ by rewrite set0I => /set0P; rewrite eqxx.
move=> [|[|n]] //; rewrite /bigcup2 /=; [exact: DE| |].
+ suff: <<d G >> (~` D) by exact.
by move=> F [dF GF]; apply: (dynkinC dF) => //; exact: dGD.
+ by rewrite -setCT; apply/(dynkinC dS)/(dynkinT dS).
by move=> dGEDD S /= [+ GS] => dS; apply/(dynkinC dS); exact: dGEDD.
- move=> F tF deltaDF; rewrite /delta /= => S /= [dS GS].
rewrite setI_bigcupl; apply: (dynkinU dS) => //.
by under eq_fun do rewrite setIC; exact: trivIset_setIl.
by move=> n; exact: deltaDF.
have GdG : G `<=` <<d G >> by move=> ? ? ? [_]; apply.
have Gdelta A : G A -> G `<=` delta A.
by move=> ? ? ?; rewrite /delta /= => ? [?]; apply; exact/GI.
have GdGdelta A : G A -> <<d G >> `<=` delta A.
move=> ?; apply: smallest_sub => //; last exact: Gdelta.
by apply/ddelta; exact: GdG.
have dGGI A B : <<d G >> A -> G B -> <<d G >> (A `&` B).
by move=> ? ?; apply: GdGdelta.
have dGGdelta A : <<d G >> A -> G `<=` delta A.
by move=> ? ? ?; rewrite /delta /= setIC; exact: dGGI.
have dGdGdelta A : <<d G >> A -> <<d G >> `<=` delta A.
by move=> ?; exact: smallest_sub (ddelta _ _) (dGGdelta _ _).
have dGdGdG A B : <<d G >> A -> <<d G >> B -> <<d G >> (A `&` B).
by move=> ? ?; exact: dGdGdelta.
apply: smallest_sub => //; apply: dynkin_setI_sigma_algebra => //.
exact: g_dynkin_dynkin.
Qed.
End dynkin_lemmas.
#[deprecated(since="mathcomp-analysis 1.2.0", note="renamed into `setI_closed_g_dynkin_g_sigma_algebra`")]
Notation setI_closed_gdynkin_salgebra := setI_closed_g_dynkin_g_sigma_algebra (only parsing).
#[deprecated(since="mathcomp-analysis 1.2.0", note="renamed into `g_dynkin_dynkin`")]
Notation dynkin_g_dynkin := g_dynkin_dynkin (only parsing).
#[deprecated(since="mathcomp-analysis 1.2.0", note="renamed into `dynkin_lambda_system`")]
Notation dynkin_monotone := dynkin_lambda_system (only parsing).
Section trace.
Variable (T : Type).
Implicit Types (G : set (set T)) (A D : set T).
Definition strace G D := [set x `&` D | x in G].
Lemma subset_strace G C : G `<=` C -> forall D, strace G D `<=` strace C D.
Proof. by move=> GC D _ [A GA <-]; exists A => //; exact: GC. Qed.
Lemma g_sigma_ring_strace G A B : <<sr strace G A >> B -> B `<=` A.
Proof.
move=> H; apply H => /=; split; first exact: powerset_sigma_ring.
by move=> X [A0 GA0 <-]; exact: subIsetr.
Qed.
Lemma strace_sigma_ring G A : sigma_ring (strace <<sr G>> A).
Proof.
split.
- by exists set0; rewrite ?set0I//; have [] := smallest_sigma_ring G.
- move=> _ _ [A0 GA0] <- [A1 GA1] <-.
exists (A0 `\` A1); first by have [_ + _] := smallest_sigma_ring G; exact.
by rewrite -setIDA setDIr setDv setU0 setIDAC setIDA.
- move=> F GAF.
pose f n := sval (cid2 (GAF n)).
pose Hf n := (svalP (cid2 (GAF n))).1.
pose H n := (svalP (cid2 (GAF n))).2.
exists (\bigcup_k f k).
by have [_ _] := smallest_sigma_ring G; apply => n; exact: Hf.
by rewrite setI_bigcupl; apply: eq_bigcupr => i _; exact: H.
Qed.
(**md see Paul Halmos' Measure Theory, Ch.1, sec.5, thm.E, p.25 *)
Lemma setI_g_sigma_ring G A : strace <<sr G >> A = <<sr strace G A >>.
Proof.
pose D := [set B `|` (C `\` A) | B in <<sr strace G A>> & C in <<sr G >>].
have D_sigma_ring : sigma_ring D.
split.
- exists set0; first by have [] := smallest_sigma_ring (strace G A).
exists set0; first by have [] := smallest_sigma_ring G.
by rewrite set0D setU0.
- move=> _ _ [B0 GAB0] [C0 GC0] <- [B1 GAB1] [C1 GC1] <-.
exists (B0 `\` B1).
by have [_ + _] := smallest_sigma_ring (strace G A); exact.
exists (C0 `\` C1); first by have [_ + _] := smallest_sigma_ring G; exact.
apply/esym; rewrite setDUD.
transitivity (((B0 `\` B1) `&` (B0 `\` (C1 `\` A))) `|`
((C0 `\` (A `|` B1)) `&` (C0 `\` C1))).
congr setU; first by rewrite setDUr.
apply/seteqP; split => [x [[C0x Ax]]|x].
move=> /not_orP[B1x /not_andP[C1x|//]].
by split=> //; split => // -[].
move=> [[C0x /not_orP[Ax B1x] [_ C1x]]].
by split=> // -[//|[]].
transitivity (((B0 `\` B1) `&` B0) `|`
((C0 `\` A ) `&` (C0 `\` C1))).
apply/seteqP; split => [x [[[B0x B1x] [_ /not_andP[C1x|]]]|
[[C0x /not_orP[Ax B1x]] [_ C1x]]]|
x [[[B0x B1x] _]|[[C0x Ax] [_ C1x]]]].
+ by left; split.
+ by move=> /contrapT Ax; left.
+ by right; split.
+ left; split => //; split => // -[] _; apply.
exact: (g_sigma_ring_strace GAB0).
+ right; split => //; split => // -[//|B1x]; apply: Ax.
exact: (g_sigma_ring_strace GAB1).
+ congr setU; first by rewrite setDE setIAC setIid.
by rewrite setDDl setDUr setIC.
- move=> F DF.