-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathmeasure.v
4432 lines (3761 loc) · 179 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.
(******************************************************************************)
(* 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. *)
(* *)
(* References: *)
(* - Daniel Li, Intégration et applications, 2016 *)
(* - Achim Klenke, Probability Theory 2nd edition, 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. *)
(* 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 *)
(* <<r G >> := smallest setring G *)
(* <<r G >> is equipped with a structure of ring *)
(* of sets. *)
(* G.-ring.-measurable A == A belongs for the ring of sets <<r 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 >> *)
(* salgebraType 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 *)
(* (There are a few details about mixins/factories to highlight *)
(* implementations peculiarities.) *)
(* {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 a *)
(* numFieldType. *)
(* The HB class is Measure. *)
(* Content_SubSigmaAdditive_isMeasure == *)
(* mixin that extends a content to a measure with the *)
(* proof that it is semi_sigma_additive *)
(* Content_isMeasure == factory that extends a content to a measure with *)
(* the proof that it is sub_sigma_additive *)
(* isMeasure == factory 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 *)
(* Measure_isSFinite_subdef == mixin for s-finite measures *)
(* Measure_isSFinite == factory for s-finite measures *)
(* {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. *)
(* SigmaFinite_isFinite == mixin for finite measures *)
(* Measure_isFinite == factory for finite measures *)
(* subprobability T R == subprobability measure over the measurableType *)
(* T with values in \bar R with R : realType *)
(* The HB class is SubProbability. *)
(* probability T R == probability measure over the measurableType T *)
(* with values in \bar with R : realType *)
(* probability == type of probability measures *)
(* The HB class is Probability. *)
(* Measure_isProbability == factor for probability measures *)
(* mnormalize mu == normalization of a measure to a probability *)
(* {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. *)
(* *)
(* * Instances of measures *)
(* pushforward mf m == pushforward/image measure of m by f, where mf is a *)
(* proof that f is measurable *)
(* \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 *)
(* *)
(* 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 *)
(* trivIset_closed G == the set of sets G is closed under pairwise-disjoint *)
(* countable union *)
(* *)
(* * Hierarchy of s-finite, sigma-finite, finite measures: *)
(* sfinite_measure == predicate for s-finite measure functions *)
(* Measure_isSFinite_subdef == mixin for s-finite measures *)
(* SFiniteMeasure == structure of s-finite measures *)
(* {sfinite_measure set T -> \bar R} == type of s-finite measures *)
(* Measure_isSFinite == factory for s-finite measures *)
(* sfinite_measure_seq mu == the sequence of finite measures of the *)
(* s-finite measure mu *)
(* *)
(* sigma_finite A f == the measure function f is sigma-finite on the set *)
(* A : set T with T : semiRingOfSetsType *)
(* isSigmaFinite == mixin corresponding to sigma finiteness *)
(* {sigma_finite_content set T -> \bar R} == contents that are also sigma *)
(* finite *)
(* {sigma_finite_measure set T -> \bar R} == measures that are also sigma *)
(* finite *)
(* *)
(* fin_num_fun == predicate for finite function over measurable sets *)
(* SigmaFinite_isFinite == mixin for finite measures *)
(* FiniteMeasure == structure of finite measures *)
(* Measure_isFinite == factory for finite measures *)
(* *)
(* 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 *)
(* *)
(* FiniteMeasure_isSubProbability = mixin corresponding to subprobability *)
(* SubProbability = structure of subprobability *)
(* subprobability T R == subprobability measure over the measurableType T *)
(* with value in R : realType *)
(* Measure_isSubProbability == factory for subprobability measures *)
(* *)
(* isProbability == mixin corresponding to probability measures *)
(* Probability == structure of probability measures *)
(* probability T R == probability measure over the measurableType T with *)
(* value in R : realType *)
(* Measure_isProbability == factor for probability measures *)
(* *)
(* monotone_class D G == G is a monotone class of subsets of D *)
(* <<m D, G >> == monotone class generated by G on D *)
(* <<m G >> := <<m setT, G >> *)
(* dynkin G == G is a set of sets that form a Dynkin *)
(* (or a lambda) system *)
(* <<d G >> == Dynkin system generated by G, i.e., *)
(* smallest dynkin G *)
(* *)
(* 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 *)
(* *)
(* 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 *)
(* *)
(* * 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 *)
(* measurableType's *)
(* (d1, d2).-prod.-measurable A == A is measurable for the sigma-algebra *)
(* generated from T1 x T2, with T1 and T2 *)
(* measurableType's with resp. display d1 and d2 *)
(* *)
(* 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 *)
(* measurableType 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 "'<<m' D , G '>>'"
(at level 2, format "'<<m' D , G '>>'").
Reserved Notation "'<<m' G '>>'"
(at level 2, format "'<<m' 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 "{ '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].
Definition ndseq_closed :=
forall F, nondecreasing_seq F -> (forall i, G (F i)) -> G (\bigcup_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_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].
Definition monotone_class :=
[/\ forall A, G A -> A `<=` D, G D, setD_closed & ndseq_closed].
End classes.
Notation "'<<m' D , G '>>'" := (smallest (monotone_class D) G) :
classical_set_scope.
Notation "'<<m' G '>>'" := (<<m 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.
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 monotone_class_g_salgebra T (G : set (set T)) (D : set T) :
(forall X, <<s D, G >> X -> X `<=` D) -> G D ->
monotone_class D (<<s D, G >>).
Proof.
move=> sDGD GD; have := smallest_sigma_algebra D G.
by move=> /(sigma_algebraP sDGD) [sT sD snd sI]; split.
Qed.
Section smallest_monotone_classE.
Variables (T : Type) (G : set (set T)) (setIG : setI_closed G).
Variables (D : set T) (GD : G D).
Variables (H : set (set T)) (monoH : monotone_class D H) (GH : G `<=` H).
Lemma smallest_monotone_classE : (forall X, <<s D, G >> X -> X `<=` D) ->
(forall E, monotone_class D E -> G `<=` E -> H `<=` E) ->
H = <<s D, G >>.
Proof.
move=> sDGD smallestH; rewrite eqEsubset; split.
apply: (smallestH _ _ (@sub_sigma_algebra _ D G)).
exact: monotone_class_g_salgebra.
suff: setI_closed H.
move=> IH; apply: smallest_sub => //.
by apply/sigma_algebraP; by case: monoH.
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: monoH => 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: monoH => h _ _; apply => // => n; have [] := H_AF n.
rewrite setI_bigcupl; case: monoH => 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.
by move=> *; split; [exact: GH | apply: GH; exact: setIG].
have GHH_ X : G X -> H `<=` H_ X.
move=> CX; apply: smallestH; [split => //; last exact: GGH_|exact: GGH_].
by move=> ? [? ?]; case: monoH => + _ _ _; exact.
have HGH_ X : H X -> G `<=` H_ X.
by move=> *; split; [exact: GH|rewrite setIC; apply GHH_].
have HHH_ X : H X -> H `<=` H_ X.
move=> HX; apply: (smallestH _ _ (HGH_ _ HX)); split=> //.
- by move=> ? [? ?]; case: monoH => + _ _ _; exact.
- exact: HGH_.
by move=> *; apply HHH_.
Qed.
End smallest_monotone_classE.
Section monotone_class_subset.
Variables (T : Type) (G : set (set T)) (setIG : setI_closed G).
Variables (D : set T) (GD : G D).
Variables (H : set (set T)) (monoH : monotone_class D H) (GH : G `<=` H).
Lemma monotone_class_subset : (forall X, (<<s D, G >>) X -> X `<=` D) ->
<<s D, G >> `<=` H.
Proof.
move=> sDGD; set M := <<m D, G >>.
rewrite -(@smallest_monotone_classE _ _ setIG _ _ M) //.
- exact: smallest_sub.
- split => [A MA | E [monoE] | A B BA MA MB E [[EsubD ED setDE ndE] GE] |].
+ by case: monoH => + _ _ _; apply; exact: MA.
+ exact.
+ by apply setDE => //; [exact: MA|exact: MB].
+ by move=> F ndF MF E [[EsubD ED setDE ndE] CE]; apply ndE=> // n; exact: MF.
- exact: sub_smallest.
- by move=> ? ? ?; exact: smallest_sub.
Qed.
End monotone_class_subset.
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_monotone G : dynkin G <-> monotone_class 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 _ _ = \bigcup_i A i); last first.
rewrite predeqE => t; split => [[n _ Fn]|[n _]].
by exists n => //; rewrite /A -bigcup_mkord; exists n=> //=; rewrite ltnS.
by rewrite /A -bigcup_mkord => -[m /=]; rewrite ltnS => mn Fmt; exists m.
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 dynkin_g_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_gdynkin_salgebra G : setI_closed G -> <<d G >> = <<s G >>.
Proof.
move=> GI; rewrite eqEsubset; split.
by apply: sub_smallest2l; apply: 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: dynkin_g_dynkin.
Qed.
End dynkin_lemmas.
HB.mixin Record isSemiRingOfSets (d : measure_display) T := {
ptclass : Pointed.class_of T;
measurable : set (set T) ;
measurable0 : measurable set0 ;
measurableI : setI_closed measurable;
semi_measurableD : semi_setD_closed measurable;
}.
#[short(type=semiRingOfSetsType)]
HB.structure Definition SemiRingOfSets d := {T of isSemiRingOfSets d T}.
Canonical semiRingOfSets_eqType d (T : semiRingOfSetsType d) := EqType T ptclass.
Canonical semiRingOfSets_choiceType d (T : semiRingOfSetsType d) :=
ChoiceType T ptclass.
Canonical semiRingOfSets_ptType d (T : semiRingOfSetsType d) :=
PointedType T ptclass.
Lemma measurable_curry (T1 T2 : Type) d (T : semiRingOfSetsType d)
(G : T1 * T2 -> set T) (x : T1 * T2) :
measurable (G x) <-> measurable (curry G x.1 x.2).
Proof. by case: x. Qed.
Notation "d .-measurable" := (@measurable d%mdisp) : classical_set_scope.
Notation "'measurable" :=
(@measurable default_measure_display) : classical_set_scope.
HB.mixin Record SemiRingOfSets_isRingOfSets d T of isSemiRingOfSets d T := {
measurableU : setU_closed (@measurable d [the semiRingOfSetsType d of T]) }.
#[short(type=ringOfSetsType)]
HB.structure Definition RingOfSets d :=
{T of SemiRingOfSets_isRingOfSets d T & SemiRingOfSets d T}.
Canonical ringOfSets_eqType d (T : ringOfSetsType d) := EqType T ptclass.
Canonical ringOfSets_choiceType d (T : ringOfSetsType d) := ChoiceType T ptclass.
Canonical ringOfSets_ptType d (T : ringOfSetsType d) := PointedType T ptclass.
HB.mixin Record RingOfSets_isAlgebraOfSets d T of RingOfSets d T := {
measurableT : measurable [set: T]
}.
#[short(type=algebraOfSetsType)]
HB.structure Definition AlgebraOfSets d :=
{T of RingOfSets_isAlgebraOfSets d T & RingOfSets d T}.
Canonical algebraOfSets_eqType d (T : algebraOfSetsType d) := EqType T ptclass.
Canonical algebraOfSets_choiceType d (T : algebraOfSetsType d) :=
ChoiceType T ptclass.
Canonical algebraOfSets_ptType d (T : algebraOfSetsType d) :=
PointedType T ptclass.
HB.mixin Record AlgebraOfSets_isMeasurable d T of AlgebraOfSets d T := {
bigcupT_measurable : forall F : (set T)^nat, (forall i, measurable (F i)) ->
measurable (\bigcup_i (F i))
}.
#[short(type=measurableType)]
HB.structure Definition Measurable d :=
{T of AlgebraOfSets_isMeasurable d T & AlgebraOfSets d T}.
Canonical measurable_eqType d (T : measurableType d) := EqType T ptclass.
Canonical measurable_choiceType d (T : measurableType d) := ChoiceType T ptclass.
Canonical measurable_ptType d (T : measurableType d) := PointedType T ptclass.
HB.factory Record isRingOfSets (d : measure_display) T := {
ptclass : Pointed.class_of T;
measurable : set (set T) ;
measurable0 : measurable set0 ;
measurableU : setU_closed measurable;
measurableD : setDI_closed measurable;
}.
HB.builders Context d T of isRingOfSets d T.
Implicit Types (A B C D : set T).
Lemma mI : setI_closed measurable.
Proof. by move=> A B mA mB; rewrite -setDD; do ?apply: measurableD. Qed.
Lemma mD : semi_setD_closed measurable.
Proof.
move=> A B Am Bm; exists [set A `\` B]; split; rewrite ?bigcup_set1//.
by move=> C ->; apply: measurableD.
by move=> X Y -> ->.
Qed.
HB.instance Definition _ :=
@isSemiRingOfSets.Build d T ptclass measurable measurable0 mI mD.
HB.instance Definition _ := SemiRingOfSets_isRingOfSets.Build d T measurableU.
HB.end.
HB.factory Record isAlgebraOfSets (d : measure_display) T := {
ptclass : Pointed.class_of T;
measurable : set (set T) ;
measurable0 : measurable set0 ;
measurableU : setU_closed measurable;
measurableC : setC_closed measurable
}.
HB.builders Context d T of isAlgebraOfSets d T.
Lemma mD : setDI_closed measurable.
Proof.
move=> A B mA mB; rewrite setDE -[A]setCK -setCU.
by do ?[apply: measurableU | apply: measurableC].
Qed.
HB.instance Definition _ :=
@isRingOfSets.Build d T ptclass measurable measurable0 measurableU mD.
Lemma measurableT : measurable [set: T].
Proof. by rewrite -setC0; apply: measurableC; exact: measurable0. Qed.
HB.instance Definition _ := RingOfSets_isAlgebraOfSets.Build d T measurableT.
HB.end.
HB.factory Record isMeasurable (d : measure_display) T := {
ptclass : Pointed.class_of T;
measurable : set (set T) ;
measurable0 : measurable set0 ;
measurableC : forall A, measurable A -> measurable (~` A) ;
measurable_bigcup : forall F : (set T)^nat, (forall i, measurable (F i)) ->
measurable (\bigcup_i (F i))
}.
HB.builders Context d T of isMeasurable d T.
Obligation Tactic := idtac.
Lemma mU : setU_closed measurable.
Proof.
move=> A B mA mB; rewrite -bigcup2E.
by apply: measurable_bigcup => -[//|[//|i]]; exact: measurable0.
Qed.
Lemma mC : setC_closed measurable. Proof. by move=> *; apply: measurableC. Qed.
HB.instance Definition _ :=
@isAlgebraOfSets.Build d T ptclass measurable measurable0 mU mC.
HB.instance Definition _ :=
@AlgebraOfSets_isMeasurable.Build d T measurable_bigcup.
HB.end.
#[global] Hint Extern 0 (measurable set0) => solve [apply: measurable0] : core.
#[global] Hint Extern 0 (measurable setT) => solve [apply: measurableT] : core.
Section ringofsets_lemmas.
Context d (T : ringOfSetsType d).
Implicit Types A B : set T.
Lemma bigsetU_measurable I r (P : pred I) (F : I -> set T) :
(forall i, P i -> measurable (F i)) ->
measurable (\big[setU/set0]_(i <- r | P i) F i).
Proof. by move=> mF; elim/big_ind : _ => //; exact: measurableU. Qed.
Lemma fin_bigcup_measurable I (D : set I) (F : I -> set T) :
finite_set D ->
(forall i, D i -> measurable (F i)) ->
measurable (\bigcup_(i in D) F i).
Proof.
elim/Pchoice: I => I in D F * => Dfin Fm.
rewrite -bigsetU_fset_set// big_seq; apply: bigsetU_measurable => i.
by rewrite in_fset_set ?inE// => *; apply: Fm.
Qed.
Lemma measurableD : setDI_closed (@measurable d T).
Proof.
move=> A B mA mB; case: (semi_measurableD A B) => // [D [Dfin Dl -> _]].
by apply: fin_bigcup_measurable.
Qed.
End ringofsets_lemmas.
Section algebraofsets_lemmas.
Context d (T : algebraOfSetsType d).
Implicit Types A B : set T.
Lemma measurableC A : measurable A -> measurable (~` A).
Proof. by move=> mA; rewrite -setTD; exact: measurableD. Qed.
Lemma bigsetI_measurable I r (P : pred I) (F : I -> set T) :
(forall i, P i -> measurable (F i)) ->
measurable (\big[setI/setT]_(i <- r | P i) F i).
Proof.
move=> mF; rewrite -[X in measurable X]setCK setC_bigsetI; apply: measurableC.
by apply: bigsetU_measurable => i Pi; apply/measurableC/mF.
Qed.
Lemma fin_bigcap_measurable I (D : set I) (F : I -> set T) :
finite_set D ->
(forall i, D i -> measurable (F i)) ->
measurable (\bigcap_(i in D) F i).
Proof.
elim/Pchoice: I => I in D F * => Dfin Fm.
rewrite -bigsetI_fset_set// big_seq; apply: bigsetI_measurable => i.
by rewrite in_fset_set ?inE// => *; apply: Fm.
Qed.
End algebraofsets_lemmas.
Section measurable_lemmas.
Context d (T : measurableType d).
Implicit Types (A B : set T) (F : (set T)^nat) (P : set nat).
Lemma sigma_algebra_measurable : sigma_algebra setT (@measurable d T).
Proof. by split=> // [A|]; [exact: measurableD|exact: bigcupT_measurable]. Qed.
Lemma bigcup_measurable F P :
(forall k, P k -> measurable (F k)) -> measurable (\bigcup_(i in P) F i).
Proof.
move=> PF; rewrite bigcup_mkcond; apply: bigcupT_measurable => k.
by case: ifP => //; rewrite inE; exact: PF.
Qed.
Lemma bigcap_measurable F P :
(forall k, P k -> measurable (F k)) -> measurable (\bigcap_(i in P) F i).
Proof.
move=> PF; rewrite -[X in measurable X]setCK setC_bigcap; apply: measurableC.
by apply: bigcup_measurable => k Pk; exact/measurableC/PF.
Qed.
Lemma bigcapT_measurable F : (forall i, measurable (F i)) ->
measurable (\bigcap_i (F i)).
Proof. by move=> ?; exact: bigcap_measurable. Qed.
End measurable_lemmas.
Lemma bigcupT_measurable_rat d (T : measurableType d) (F : rat -> set T) :
(forall i, measurable (F i)) -> measurable (\bigcup_i F i).
Proof.
move=> Fm; have /ppcard_eqP[f] := card_rat.
by rewrite (reindex_bigcup f^-1%FUN setT)//=; exact: bigcupT_measurable.
Qed.
Section discrete_measurable_unit.
Definition discrete_measurable_unit : set (set unit) := [set: set unit].
Let discrete_measurable0 : discrete_measurable_unit set0. Proof. by []. Qed.
Let discrete_measurableC X :
discrete_measurable_unit X -> discrete_measurable_unit (~` X).
Proof. by []. Qed.
Let discrete_measurableU (F : (set unit)^nat) :
(forall i, discrete_measurable_unit (F i)) ->
discrete_measurable_unit (\bigcup_i F i).
Proof. by []. Qed.
HB.instance Definition _ := @isMeasurable.Build default_measure_display unit
(Pointed.class _) discrete_measurable_unit discrete_measurable0
discrete_measurableC discrete_measurableU.
End discrete_measurable_unit.
Section discrete_measurable_bool.
Definition discrete_measurable_bool : set (set bool) := [set: set bool].
Let discrete_measurable0 : discrete_measurable_bool set0. Proof. by []. Qed.
Let discrete_measurableC X :
discrete_measurable_bool X -> discrete_measurable_bool (~` X).
Proof. by []. Qed.
Let discrete_measurableU (F : (set bool)^nat) :
(forall i, discrete_measurable_bool (F i)) ->
discrete_measurable_bool (\bigcup_i F i).
Proof. by []. Qed.
HB.instance Definition _ := @isMeasurable.Build default_measure_display bool
(Pointed.class _) discrete_measurable_bool discrete_measurable0
discrete_measurableC discrete_measurableU.
End discrete_measurable_bool.
Section discrete_measurable_nat.
Definition discrete_measurable_nat : set (set nat) := [set: set nat].
Let discrete_measurable_nat0 : discrete_measurable_nat set0. Proof. by []. Qed.
Let discrete_measurable_natC X :
discrete_measurable_nat X -> discrete_measurable_nat (~` X).