-
Notifications
You must be signed in to change notification settings - Fork 341
/
Basic.lean
1008 lines (896 loc) · 49.5 KB
/
Basic.lean
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/-
Copyright (c) 2022 Sébastien Gouëzel. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Sébastien Gouëzel, Felix Weilacher
-/
import Mathlib.MeasureTheory.Constructions.BorelSpace.Metric
import Mathlib.Topology.CountableSeparatingOn
import Mathlib.Topology.MetricSpace.Perfect
/-!
# The Borel sigma-algebra on Polish spaces
We discuss several results pertaining to the relationship between the topology and the Borel
structure on Polish spaces.
## Main definitions and results
First, we define standard Borel spaces.
* A `StandardBorelSpace α` is a typeclass for measurable spaces which arise as the Borel sets
of some Polish topology.
Next, we define the class of analytic sets and establish its basic properties.
* `MeasureTheory.AnalyticSet s`: a set in a topological space is analytic if it is the continuous
image of a Polish space. Equivalently, it is empty, or the image of `ℕ → ℕ`.
* `MeasureTheory.AnalyticSet.image_of_continuous`: a continuous image of an analytic set is
analytic.
* `MeasurableSet.analyticSet`: in a Polish space, any Borel-measurable set is analytic.
Then, we show Lusin's theorem that two disjoint analytic sets can be separated by Borel sets.
* `MeasurablySeparable s t` states that there exists a measurable set containing `s` and disjoint
from `t`.
* `AnalyticSet.measurablySeparable` shows that two disjoint analytic sets are separated by a
Borel set.
We then prove the Lusin-Souslin theorem that a continuous injective image of a Borel subset of
a Polish space is Borel. The proof of this nontrivial result relies on the above results on
analytic sets.
* `MeasurableSet.image_of_continuousOn_injOn` asserts that, if `s` is a Borel measurable set in
a Polish space, then the image of `s` under a continuous injective map is still Borel measurable.
* `Continuous.measurableEmbedding` states that a continuous injective map on a Polish space
is a measurable embedding for the Borel sigma-algebra.
* `ContinuousOn.measurableEmbedding` is the same result for a map restricted to a measurable set
on which it is continuous.
* `Measurable.measurableEmbedding` states that a measurable injective map from
a standard Borel space to a second-countable topological space is a measurable embedding.
* `isClopenable_iff_measurableSet`: in a Polish space, a set is clopenable (i.e., it can be made
open and closed by using a finer Polish topology) if and only if it is Borel-measurable.
We use this to prove several versions of the Borel isomorphism theorem.
* `PolishSpace.measurableEquivOfNotCountable` : Any two uncountable standard Borel spaces
are Borel isomorphic.
* `PolishSpace.Equiv.measurableEquiv` : Any two standard Borel spaces of the same cardinality
are Borel isomorphic.
-/
open Set Function PolishSpace PiNat TopologicalSpace Bornology Metric Filter Topology MeasureTheory
/-! ### Standard Borel Spaces -/
variable (α : Type*)
/-- A standard Borel space is a measurable space arising as the Borel sets of some Polish topology.
This is useful in situations where a space has no natural topology or
the natural topology in a space is non-Polish.
To endow a standard Borel space `α` with a compatible Polish topology, use
`letI := upgradeStandardBorel α`. One can then use `eq_borel_upgradeStandardBorel α` to
rewrite the `MeasurableSpace α` instance to `borel α t`, where `t` is the new topology. -/
class StandardBorelSpace [MeasurableSpace α] : Prop where
/-- There exists a compatible Polish topology. -/
polish : ∃ _ : TopologicalSpace α, BorelSpace α ∧ PolishSpace α
/-- A convenience class similar to `UpgradedPolishSpace`. No instance should be registered.
Instead one should use `letI := upgradeStandardBorel α`. -/
class UpgradedStandardBorel extends MeasurableSpace α, TopologicalSpace α,
BorelSpace α, PolishSpace α
/-- Use as `letI := upgradeStandardBorel α` to endow a standard Borel space `α` with
a compatible Polish topology.
Warning: following this with `borelize α` will cause an error. Instead, one can
rewrite with `eq_borel_upgradeStandardBorel α`.
TODO: fix the corresponding bug in `borelize`. -/
noncomputable
def upgradeStandardBorel [MeasurableSpace α] [h : StandardBorelSpace α] :
UpgradedStandardBorel α := by
choose τ hb hp using h.polish
constructor
/-- The `MeasurableSpace α` instance on a `StandardBorelSpace` `α` is equal to
the borel sets of `upgradeStandardBorel α`. -/
theorem eq_borel_upgradeStandardBorel [MeasurableSpace α] [StandardBorelSpace α] :
‹MeasurableSpace α› = @borel _ (upgradeStandardBorel α).toTopologicalSpace :=
@BorelSpace.measurable_eq _ (upgradeStandardBorel α).toTopologicalSpace _
(upgradeStandardBorel α).toBorelSpace
variable {α}
section
variable [MeasurableSpace α]
instance standardBorel_of_polish [τ : TopologicalSpace α]
[BorelSpace α] [PolishSpace α] : StandardBorelSpace α := by exists τ
instance countablyGenerated_of_standardBorel [StandardBorelSpace α] :
MeasurableSpace.CountablyGenerated α :=
letI := upgradeStandardBorel α
inferInstance
instance measurableSingleton_of_standardBorel [StandardBorelSpace α] : MeasurableSingletonClass α :=
letI := upgradeStandardBorel α
inferInstance
namespace StandardBorelSpace
variable {β : Type*} [MeasurableSpace β]
section instances
/-- A product of two standard Borel spaces is standard Borel. -/
instance prod [StandardBorelSpace α] [StandardBorelSpace β] : StandardBorelSpace (α × β) :=
letI := upgradeStandardBorel α
letI := upgradeStandardBorel β
inferInstance
/-- A product of countably many standard Borel spaces is standard Borel. -/
instance pi_countable {ι : Type*} [Countable ι] {α : ι → Type*} [∀ n, MeasurableSpace (α n)]
[∀ n, StandardBorelSpace (α n)] : StandardBorelSpace (∀ n, α n) :=
letI := fun n => upgradeStandardBorel (α n)
inferInstance
end instances
end StandardBorelSpace
end
variable {ι : Type*}
namespace MeasureTheory
variable [TopologicalSpace α]
/-! ### Analytic sets -/
/-- An analytic set is a set which is the continuous image of some Polish space. There are several
equivalent characterizations of this definition. For the definition, we pick one that avoids
universe issues: a set is analytic if and only if it is a continuous image of `ℕ → ℕ` (or if it
is empty). The above more usual characterization is given
in `analyticSet_iff_exists_polishSpace_range`.
Warning: these are analytic sets in the context of descriptive set theory (which is why they are
registered in the namespace `MeasureTheory`). They have nothing to do with analytic sets in the
context of complex analysis. -/
irreducible_def AnalyticSet (s : Set α) : Prop :=
s = ∅ ∨ ∃ f : (ℕ → ℕ) → α, Continuous f ∧ range f = s
theorem analyticSet_empty : AnalyticSet (∅ : Set α) := by
rw [AnalyticSet]
exact Or.inl rfl
theorem analyticSet_range_of_polishSpace {β : Type*} [TopologicalSpace β] [PolishSpace β]
{f : β → α} (f_cont : Continuous f) : AnalyticSet (range f) := by
cases isEmpty_or_nonempty β
· rw [range_eq_empty]
exact analyticSet_empty
· rw [AnalyticSet]
obtain ⟨g, g_cont, hg⟩ : ∃ g : (ℕ → ℕ) → β, Continuous g ∧ Surjective g :=
exists_nat_nat_continuous_surjective β
refine Or.inr ⟨f ∘ g, f_cont.comp g_cont, ?_⟩
rw [hg.range_comp]
/-- The image of an open set under a continuous map is analytic. -/
theorem _root_.IsOpen.analyticSet_image {β : Type*} [TopologicalSpace β] [PolishSpace β]
{s : Set β} (hs : IsOpen s) {f : β → α} (f_cont : Continuous f) : AnalyticSet (f '' s) := by
rw [image_eq_range]
haveI : PolishSpace s := hs.polishSpace
exact analyticSet_range_of_polishSpace (f_cont.comp continuous_subtype_val)
/-- A set is analytic if and only if it is the continuous image of some Polish space. -/
theorem analyticSet_iff_exists_polishSpace_range {s : Set α} :
AnalyticSet s ↔
∃ (β : Type) (h : TopologicalSpace β) (_ : @PolishSpace β h) (f : β → α),
@Continuous _ _ h _ f ∧ range f = s := by
constructor
· intro h
rw [AnalyticSet] at h
cases' h with h h
· refine ⟨Empty, inferInstance, inferInstance, Empty.elim, continuous_bot, ?_⟩
rw [h]
exact range_eq_empty _
· exact ⟨ℕ → ℕ, inferInstance, inferInstance, h⟩
· rintro ⟨β, h, h', f, f_cont, f_range⟩
rw [← f_range]
exact analyticSet_range_of_polishSpace f_cont
/-- The continuous image of an analytic set is analytic -/
theorem AnalyticSet.image_of_continuousOn {β : Type*} [TopologicalSpace β] {s : Set α}
(hs : AnalyticSet s) {f : α → β} (hf : ContinuousOn f s) : AnalyticSet (f '' s) := by
rcases analyticSet_iff_exists_polishSpace_range.1 hs with ⟨γ, γtop, γpolish, g, g_cont, gs⟩
have : f '' s = range (f ∘ g) := by rw [range_comp, gs]
rw [this]
apply analyticSet_range_of_polishSpace
apply hf.comp_continuous g_cont fun x => _
rw [← gs]
exact mem_range_self
theorem AnalyticSet.image_of_continuous {β : Type*} [TopologicalSpace β] {s : Set α}
(hs : AnalyticSet s) {f : α → β} (hf : Continuous f) : AnalyticSet (f '' s) :=
hs.image_of_continuousOn hf.continuousOn
/-- A countable intersection of analytic sets is analytic. -/
theorem AnalyticSet.iInter [hι : Nonempty ι] [Countable ι] [T2Space α] {s : ι → Set α}
(hs : ∀ n, AnalyticSet (s n)) : AnalyticSet (⋂ n, s n) := by
rcases hι with ⟨i₀⟩
/- For the proof, write each `s n` as the continuous image under a map `f n` of a
Polish space `β n`. The product space `γ = Π n, β n` is also Polish, and so is the subset
`t` of sequences `x n` for which `f n (x n)` is independent of `n`. The set `t` is Polish, and
the range of `x ↦ f 0 (x 0)` on `t` is exactly `⋂ n, s n`, so this set is analytic. -/
choose β hβ h'β f f_cont f_range using fun n =>
analyticSet_iff_exists_polishSpace_range.1 (hs n)
let γ := ∀ n, β n
let t : Set γ := ⋂ n, { x | f n (x n) = f i₀ (x i₀) }
have t_closed : IsClosed t := by
apply isClosed_iInter
intro n
exact
isClosed_eq ((f_cont n).comp (continuous_apply n)) ((f_cont i₀).comp (continuous_apply i₀))
haveI : PolishSpace t := t_closed.polishSpace
let F : t → α := fun x => f i₀ ((x : γ) i₀)
have F_cont : Continuous F := (f_cont i₀).comp ((continuous_apply i₀).comp continuous_subtype_val)
have F_range : range F = ⋂ n : ι, s n := by
apply Subset.antisymm
· rintro y ⟨x, rfl⟩
refine mem_iInter.2 fun n => ?_
have : f n ((x : γ) n) = F x := (mem_iInter.1 x.2 n : _)
rw [← this, ← f_range n]
exact mem_range_self _
· intro y hy
have A : ∀ n, ∃ x : β n, f n x = y := by
intro n
rw [← mem_range, f_range n]
exact mem_iInter.1 hy n
choose x hx using A
have xt : x ∈ t := by
refine mem_iInter.2 fun n => ?_
simp [hx]
refine ⟨⟨x, xt⟩, ?_⟩
exact hx i₀
rw [← F_range]
exact analyticSet_range_of_polishSpace F_cont
/-- A countable union of analytic sets is analytic. -/
theorem AnalyticSet.iUnion [Countable ι] {s : ι → Set α} (hs : ∀ n, AnalyticSet (s n)) :
AnalyticSet (⋃ n, s n) := by
/- For the proof, write each `s n` as the continuous image under a map `f n` of a
Polish space `β n`. The union space `γ = Σ n, β n` is also Polish, and the map `F : γ → α` which
coincides with `f n` on `β n` sends it to `⋃ n, s n`. -/
choose β hβ h'β f f_cont f_range using fun n =>
analyticSet_iff_exists_polishSpace_range.1 (hs n)
let γ := Σn, β n
let F : γ → α := fun ⟨n, x⟩ ↦ f n x
have F_cont : Continuous F := continuous_sigma f_cont
have F_range : range F = ⋃ n, s n := by
simp only [γ, range_sigma_eq_iUnion_range, f_range]
rw [← F_range]
exact analyticSet_range_of_polishSpace F_cont
theorem _root_.IsClosed.analyticSet [PolishSpace α] {s : Set α} (hs : IsClosed s) :
AnalyticSet s := by
haveI : PolishSpace s := hs.polishSpace
rw [← @Subtype.range_val α s]
exact analyticSet_range_of_polishSpace continuous_subtype_val
/-- Given a Borel-measurable set in a Polish space, there exists a finer Polish topology making
it clopen. This is in fact an equivalence, see `isClopenable_iff_measurableSet`. -/
theorem _root_.MeasurableSet.isClopenable [PolishSpace α] [MeasurableSpace α] [BorelSpace α]
{s : Set α} (hs : MeasurableSet s) : IsClopenable s := by
revert s
apply MeasurableSet.induction_on_open
· exact fun u hu => hu.isClopenable
· exact fun u _ h'u => h'u.compl
· exact fun f _ _ hf => IsClopenable.iUnion hf
/-- A Borel-measurable set in a Polish space is analytic. -/
theorem _root_.MeasurableSet.analyticSet {α : Type*} [t : TopologicalSpace α] [PolishSpace α]
[MeasurableSpace α] [BorelSpace α] {s : Set α} (hs : MeasurableSet s) : AnalyticSet s := by
/- For a short proof (avoiding measurable induction), one sees `s` as a closed set for a finer
topology `t'`. It is analytic for this topology. As the identity from `t'` to `t` is continuous
and the image of an analytic set is analytic, it follows that `s` is also analytic for `t`. -/
obtain ⟨t', t't, t'_polish, s_closed, _⟩ :
∃ t' : TopologicalSpace α, t' ≤ t ∧ @PolishSpace α t' ∧ IsClosed[t'] s ∧ IsOpen[t'] s :=
hs.isClopenable
have A := @IsClosed.analyticSet α t' t'_polish s s_closed
convert @AnalyticSet.image_of_continuous α t' α t s A id (continuous_id_of_le t't)
simp only [id, image_id']
/-- Given a Borel-measurable function from a Polish space to a second-countable space, there exists
a finer Polish topology on the source space for which the function is continuous. -/
theorem _root_.Measurable.exists_continuous {α β : Type*} [t : TopologicalSpace α] [PolishSpace α]
[MeasurableSpace α] [BorelSpace α] [tβ : TopologicalSpace β] [MeasurableSpace β]
[OpensMeasurableSpace β] {f : α → β} [SecondCountableTopology (range f)] (hf : Measurable f) :
∃ t' : TopologicalSpace α, t' ≤ t ∧ @Continuous α β t' tβ f ∧ @PolishSpace α t' := by
obtain ⟨b, b_count, -, hb⟩ :
∃ b : Set (Set (range f)), b.Countable ∧ ∅ ∉ b ∧ IsTopologicalBasis b :=
exists_countable_basis (range f)
haveI : Countable b := b_count.to_subtype
have : ∀ s : b, IsClopenable (rangeFactorization f ⁻¹' s) := fun s ↦ by
apply MeasurableSet.isClopenable
exact hf.subtype_mk (hb.isOpen s.2).measurableSet
choose T Tt Tpolish _ Topen using this
obtain ⟨t', t'T, t't, t'_polish⟩ :
∃ t' : TopologicalSpace α, (∀ i, t' ≤ T i) ∧ t' ≤ t ∧ @PolishSpace α t' :=
exists_polishSpace_forall_le (t := t) T Tt Tpolish
refine ⟨t', t't, ?_, t'_polish⟩
have : Continuous[t', _] (rangeFactorization f) :=
hb.continuous_iff.2 fun s hs => t'T ⟨s, hs⟩ _ (Topen ⟨s, hs⟩)
exact continuous_subtype_val.comp this
/-- The image of a measurable set in a standard Borel space under a measurable map
is an analytic set. -/
theorem _root_.MeasurableSet.analyticSet_image {X Y : Type*} [MeasurableSpace X]
[StandardBorelSpace X] [TopologicalSpace Y] [MeasurableSpace Y]
[OpensMeasurableSpace Y] {f : X → Y} [SecondCountableTopology (range f)] {s : Set X}
(hs : MeasurableSet s) (hf : Measurable f) : AnalyticSet (f '' s) := by
letI := upgradeStandardBorel X
rw [eq_borel_upgradeStandardBorel X] at hs
rcases hf.exists_continuous with ⟨τ', hle, hfc, hτ'⟩
letI m' : MeasurableSpace X := @borel _ τ'
haveI b' : BorelSpace X := ⟨rfl⟩
have hle := borel_anti hle
exact (hle _ hs).analyticSet.image_of_continuous hfc
/-- Preimage of an analytic set is an analytic set. -/
protected lemma AnalyticSet.preimage {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y]
[PolishSpace X] [T2Space Y] {s : Set Y} (hs : AnalyticSet s) {f : X → Y} (hf : Continuous f) :
AnalyticSet (f ⁻¹' s) := by
rcases analyticSet_iff_exists_polishSpace_range.1 hs with ⟨Z, _, _, g, hg, rfl⟩
have : IsClosed {x : X × Z | f x.1 = g x.2} := isClosed_diagonal.preimage (hf.prod_map hg)
convert this.analyticSet.image_of_continuous continuous_fst
ext x
simp [eq_comm]
/-! ### Separating sets with measurable sets -/
/-- Two sets `u` and `v` in a measurable space are measurably separable if there
exists a measurable set containing `u` and disjoint from `v`.
This is mostly interesting for Borel-separable sets. -/
def MeasurablySeparable {α : Type*} [MeasurableSpace α] (s t : Set α) : Prop :=
∃ u, s ⊆ u ∧ Disjoint t u ∧ MeasurableSet u
theorem MeasurablySeparable.iUnion [Countable ι] {α : Type*} [MeasurableSpace α] {s t : ι → Set α}
(h : ∀ m n, MeasurablySeparable (s m) (t n)) : MeasurablySeparable (⋃ n, s n) (⋃ m, t m) := by
choose u hsu htu hu using h
refine ⟨⋃ m, ⋂ n, u m n, ?_, ?_, ?_⟩
· refine iUnion_subset fun m => subset_iUnion_of_subset m ?_
exact subset_iInter fun n => hsu m n
· simp_rw [disjoint_iUnion_left, disjoint_iUnion_right]
intro n m
apply Disjoint.mono_right _ (htu m n)
apply iInter_subset
· refine MeasurableSet.iUnion fun m => ?_
exact MeasurableSet.iInter fun n => hu m n
/-- The hard part of the Lusin separation theorem saying that two disjoint analytic sets are
contained in disjoint Borel sets (see the full statement in `AnalyticSet.measurablySeparable`).
Here, we prove this when our analytic sets are the ranges of functions from `ℕ → ℕ`.
-/
theorem measurablySeparable_range_of_disjoint [T2Space α] [MeasurableSpace α]
[OpensMeasurableSpace α] {f g : (ℕ → ℕ) → α} (hf : Continuous f) (hg : Continuous g)
(h : Disjoint (range f) (range g)) : MeasurablySeparable (range f) (range g) := by
/- We follow [Kechris, *Classical Descriptive Set Theory* (Theorem 14.7)][kechris1995].
If the ranges are not Borel-separated, then one can find two cylinders of length one whose
images are not Borel-separated, and then two smaller cylinders of length two whose images are
not Borel-separated, and so on. One thus gets two sequences of cylinders, that decrease to two
points `x` and `y`. Their images are different by the disjointness assumption, hence contained
in two disjoint open sets by the T2 property. By continuity, long enough cylinders around `x`
and `y` have images which are separated by these two disjoint open sets, a contradiction.
-/
by_contra hfg
have I : ∀ n x y, ¬MeasurablySeparable (f '' cylinder x n) (g '' cylinder y n) →
∃ x' y', x' ∈ cylinder x n ∧ y' ∈ cylinder y n ∧
¬MeasurablySeparable (f '' cylinder x' (n + 1)) (g '' cylinder y' (n + 1)) := by
intro n x y
contrapose!
intro H
rw [← iUnion_cylinder_update x n, ← iUnion_cylinder_update y n, image_iUnion, image_iUnion]
refine MeasurablySeparable.iUnion fun i j => ?_
exact H _ _ (update_mem_cylinder _ _ _) (update_mem_cylinder _ _ _)
-- consider the set of pairs of cylinders of some length whose images are not Borel-separated
let A :=
{ p : ℕ × (ℕ → ℕ) × (ℕ → ℕ) //
¬MeasurablySeparable (f '' cylinder p.2.1 p.1) (g '' cylinder p.2.2 p.1) }
-- for each such pair, one can find longer cylinders whose images are not Borel-separated either
have : ∀ p : A, ∃ q : A,
q.1.1 = p.1.1 + 1 ∧ q.1.2.1 ∈ cylinder p.1.2.1 p.1.1 ∧ q.1.2.2 ∈ cylinder p.1.2.2 p.1.1 := by
rintro ⟨⟨n, x, y⟩, hp⟩
rcases I n x y hp with ⟨x', y', hx', hy', h'⟩
exact ⟨⟨⟨n + 1, x', y'⟩, h'⟩, rfl, hx', hy'⟩
choose F hFn hFx hFy using this
let p0 : A := ⟨⟨0, fun _ => 0, fun _ => 0⟩, by simp [hfg]⟩
-- construct inductively decreasing sequences of cylinders whose images are not separated
let p : ℕ → A := fun n => F^[n] p0
have prec : ∀ n, p (n + 1) = F (p n) := fun n => by simp only [p, iterate_succ', Function.comp]
-- check that at the `n`-th step we deal with cylinders of length `n`
have pn_fst : ∀ n, (p n).1.1 = n := by
intro n
induction' n with n IH
· rfl
· simp only [prec, hFn, IH]
-- check that the cylinders we construct are indeed decreasing, by checking that the coordinates
-- are stationary.
have Ix : ∀ m n, m + 1 ≤ n → (p n).1.2.1 m = (p (m + 1)).1.2.1 m := by
intro m
apply Nat.le_induction
· rfl
intro n hmn IH
have I : (F (p n)).val.snd.fst m = (p n).val.snd.fst m := by
apply hFx (p n) m
rw [pn_fst]
exact hmn
rw [prec, I, IH]
have Iy : ∀ m n, m + 1 ≤ n → (p n).1.2.2 m = (p (m + 1)).1.2.2 m := by
intro m
apply Nat.le_induction
· rfl
intro n hmn IH
have I : (F (p n)).val.snd.snd m = (p n).val.snd.snd m := by
apply hFy (p n) m
rw [pn_fst]
exact hmn
rw [prec, I, IH]
-- denote by `x` and `y` the limit points of these two sequences of cylinders.
set x : ℕ → ℕ := fun n => (p (n + 1)).1.2.1 n with hx
set y : ℕ → ℕ := fun n => (p (n + 1)).1.2.2 n with hy
-- by design, the cylinders around these points have images which are not Borel-separable.
have M : ∀ n, ¬MeasurablySeparable (f '' cylinder x n) (g '' cylinder y n) := by
intro n
convert (p n).2 using 3
· rw [pn_fst, ← mem_cylinder_iff_eq, mem_cylinder_iff]
intro i hi
rw [hx]
exact (Ix i n hi).symm
· rw [pn_fst, ← mem_cylinder_iff_eq, mem_cylinder_iff]
intro i hi
rw [hy]
exact (Iy i n hi).symm
-- consider two open sets separating `f x` and `g y`.
obtain ⟨u, v, u_open, v_open, xu, yv, huv⟩ :
∃ u v : Set α, IsOpen u ∧ IsOpen v ∧ f x ∈ u ∧ g y ∈ v ∧ Disjoint u v := by
apply t2_separation
exact disjoint_iff_forall_ne.1 h (mem_range_self _) (mem_range_self _)
letI : MetricSpace (ℕ → ℕ) := metricSpaceNatNat
obtain ⟨εx, εxpos, hεx⟩ : ∃ (εx : ℝ), εx > 0 ∧ Metric.ball x εx ⊆ f ⁻¹' u := by
apply Metric.mem_nhds_iff.1
exact hf.continuousAt.preimage_mem_nhds (u_open.mem_nhds xu)
obtain ⟨εy, εypos, hεy⟩ : ∃ (εy : ℝ), εy > 0 ∧ Metric.ball y εy ⊆ g ⁻¹' v := by
apply Metric.mem_nhds_iff.1
exact hg.continuousAt.preimage_mem_nhds (v_open.mem_nhds yv)
obtain ⟨n, hn⟩ : ∃ n : ℕ, (1 / 2 : ℝ) ^ n < min εx εy :=
exists_pow_lt_of_lt_one (lt_min εxpos εypos) (by norm_num)
-- for large enough `n`, these open sets separate the images of long cylinders around `x` and `y`
have B : MeasurablySeparable (f '' cylinder x n) (g '' cylinder y n) := by
refine ⟨u, ?_, ?_, u_open.measurableSet⟩
· rw [image_subset_iff]
apply Subset.trans _ hεx
intro z hz
rw [mem_cylinder_iff_dist_le] at hz
exact hz.trans_lt (hn.trans_le (min_le_left _ _))
· refine Disjoint.mono_left ?_ huv.symm
change g '' cylinder y n ⊆ v
rw [image_subset_iff]
apply Subset.trans _ hεy
intro z hz
rw [mem_cylinder_iff_dist_le] at hz
exact hz.trans_lt (hn.trans_le (min_le_right _ _))
-- this is a contradiction.
exact M n B
/-- The **Lusin separation theorem**: if two analytic sets are disjoint, then they are contained in
disjoint Borel sets. -/
theorem AnalyticSet.measurablySeparable [T2Space α] [MeasurableSpace α] [OpensMeasurableSpace α]
{s t : Set α} (hs : AnalyticSet s) (ht : AnalyticSet t) (h : Disjoint s t) :
MeasurablySeparable s t := by
rw [AnalyticSet] at hs ht
rcases hs with (rfl | ⟨f, f_cont, rfl⟩)
· refine ⟨∅, Subset.refl _, by simp, MeasurableSet.empty⟩
rcases ht with (rfl | ⟨g, g_cont, rfl⟩)
· exact ⟨univ, subset_univ _, by simp, MeasurableSet.univ⟩
exact measurablySeparable_range_of_disjoint f_cont g_cont h
/-- **Suslin's Theorem**: in a Hausdorff topological space, an analytic set with an analytic
complement is measurable. -/
theorem AnalyticSet.measurableSet_of_compl [T2Space α] [MeasurableSpace α] [OpensMeasurableSpace α]
{s : Set α} (hs : AnalyticSet s) (hsc : AnalyticSet sᶜ) : MeasurableSet s := by
rcases hs.measurablySeparable hsc disjoint_compl_right with ⟨u, hsu, hdu, hmu⟩
obtain rfl : s = u := hsu.antisymm (disjoint_compl_left_iff_subset.1 hdu)
exact hmu
end MeasureTheory
/-!
### Measurability of preimages under measurable maps
-/
namespace Measurable
open MeasurableSpace
variable {X Y Z β : Type*} [MeasurableSpace X] [StandardBorelSpace X]
[TopologicalSpace Y] [T0Space Y] [MeasurableSpace Y] [OpensMeasurableSpace Y] [MeasurableSpace β]
[MeasurableSpace Z]
/-- If `f : X → Z` is a surjective Borel measurable map from a standard Borel space
to a countably separated measurable space, then the preimage of a set `s`
is measurable if and only if the set is measurable.
One implication is the definition of measurability, the other one heavily relies on `X` being a
standard Borel space. -/
theorem measurableSet_preimage_iff_of_surjective [CountablySeparated Z]
{f : X → Z} (hf : Measurable f) (hsurj : Surjective f) {s : Set Z} :
MeasurableSet (f ⁻¹' s) ↔ MeasurableSet s := by
refine ⟨fun h => ?_, fun h => hf h⟩
rcases exists_opensMeasurableSpace_of_countablySeparated Z with ⟨τ, _, _, _⟩
apply AnalyticSet.measurableSet_of_compl
· rw [← image_preimage_eq s hsurj]
exact h.analyticSet_image hf
· rw [← image_preimage_eq sᶜ hsurj]
exact h.compl.analyticSet_image hf
theorem map_measurableSpace_eq [CountablySeparated Z]
{f : X → Z} (hf : Measurable f)
(hsurj : Surjective f) : MeasurableSpace.map f ‹MeasurableSpace X› = ‹MeasurableSpace Z› :=
MeasurableSpace.ext fun _ => hf.measurableSet_preimage_iff_of_surjective hsurj
theorem map_measurableSpace_eq_borel [SecondCountableTopology Y] {f : X → Y} (hf : Measurable f)
(hsurj : Surjective f) : MeasurableSpace.map f ‹MeasurableSpace X› = borel Y := by
have d := hf.mono le_rfl OpensMeasurableSpace.borel_le
letI := borel Y; haveI : BorelSpace Y := ⟨rfl⟩
exact d.map_measurableSpace_eq hsurj
theorem borelSpace_codomain [SecondCountableTopology Y] {f : X → Y} (hf : Measurable f)
(hsurj : Surjective f) : BorelSpace Y :=
⟨(hf.map_measurableSpace_eq hsurj).symm.trans <| hf.map_measurableSpace_eq_borel hsurj⟩
/-- If `f : X → Z` is a Borel measurable map from a standard Borel space to a
countably separated measurable space then the preimage of a set `s` is measurable
if and only if the set is measurable in `Set.range f`. -/
theorem measurableSet_preimage_iff_preimage_val {f : X → Z} [CountablySeparated (range f)]
(hf : Measurable f) {s : Set Z} :
MeasurableSet (f ⁻¹' s) ↔ MeasurableSet ((↑) ⁻¹' s : Set (range f)) :=
have hf' : Measurable (rangeFactorization f) := hf.subtype_mk
hf'.measurableSet_preimage_iff_of_surjective (s := Subtype.val ⁻¹' s) surjective_onto_range
/-- If `f : X → Z` is a Borel measurable map from a standard Borel space to a
countably separated measurable space and the range of `f` is measurable,
then the preimage of a set `s` is measurable
if and only if the intersection with `Set.range f` is measurable. -/
theorem measurableSet_preimage_iff_inter_range {f : X → Z} [CountablySeparated (range f)]
(hf : Measurable f) (hr : MeasurableSet (range f)) {s : Set Z} :
MeasurableSet (f ⁻¹' s) ↔ MeasurableSet (s ∩ range f) := by
rw [hf.measurableSet_preimage_iff_preimage_val, inter_comm,
← (MeasurableEmbedding.subtype_coe hr).measurableSet_image, Subtype.image_preimage_coe]
/-- If `f : X → Z` is a Borel measurable map from a standard Borel space
to a countably separated measurable space,
then for any measurable space `β` and `g : Z → β`, the composition `g ∘ f` is
measurable if and only if the restriction of `g` to the range of `f` is measurable. -/
theorem measurable_comp_iff_restrict {f : X → Z}
[CountablySeparated (range f)]
(hf : Measurable f) {g : Z → β} : Measurable (g ∘ f) ↔ Measurable (restrict (range f) g) :=
forall₂_congr fun s _ => measurableSet_preimage_iff_preimage_val hf (s := g ⁻¹' s)
/-- If `f : X → Z` is a surjective Borel measurable map from a standard Borel space
to a countably separated measurable space,
then for any measurable space `α` and `g : Z → α`, the composition
`g ∘ f` is measurable if and only if `g` is measurable. -/
theorem measurable_comp_iff_of_surjective [CountablySeparated Z]
{f : X → Z} (hf : Measurable f) (hsurj : Surjective f)
{g : Z → β} : Measurable (g ∘ f) ↔ Measurable g :=
forall₂_congr fun s _ => measurableSet_preimage_iff_of_surjective hf hsurj (s := g ⁻¹' s)
end Measurable
theorem Continuous.map_eq_borel {X Y : Type*} [TopologicalSpace X] [PolishSpace X]
[MeasurableSpace X] [BorelSpace X] [TopologicalSpace Y] [T0Space Y] [SecondCountableTopology Y]
{f : X → Y} (hf : Continuous f) (hsurj : Surjective f) :
MeasurableSpace.map f ‹MeasurableSpace X› = borel Y := by
borelize Y
exact hf.measurable.map_measurableSpace_eq hsurj
theorem Continuous.map_borel_eq {X Y : Type*} [TopologicalSpace X] [PolishSpace X]
[TopologicalSpace Y] [T0Space Y] [SecondCountableTopology Y] {f : X → Y} (hf : Continuous f)
(hsurj : Surjective f) : MeasurableSpace.map f (borel X) = borel Y := by
borelize X
exact hf.map_eq_borel hsurj
instance Quotient.borelSpace {X : Type*} [TopologicalSpace X] [PolishSpace X] [MeasurableSpace X]
[BorelSpace X] {s : Setoid X} [T0Space (Quotient s)] [SecondCountableTopology (Quotient s)] :
BorelSpace (Quotient s) :=
⟨continuous_quotient_mk'.map_eq_borel (surjective_quotient_mk' _)⟩
/-- When the subgroup `N < G` is not necessarily `Normal`, we have a `CosetSpace` as opposed
to `QuotientGroup` (the next `instance`).
TODO: typeclass inference should normally find this, but currently doesn't.
E.g., `MeasurableSMul G (G ⧸ Γ)` fails to synthesize, even though `G ⧸ Γ` is the quotient
of `G` by the action of `Γ`; it seems unable to pick up the `BorelSpace` instance. -/
@[to_additive AddCosetSpace.borelSpace]
instance CosetSpace.borelSpace {G : Type*} [TopologicalSpace G] [PolishSpace G] [Group G]
[MeasurableSpace G] [BorelSpace G] {N : Subgroup G} [T2Space (G ⧸ N)]
[SecondCountableTopology (G ⧸ N)] : BorelSpace (G ⧸ N) := Quotient.borelSpace
@[to_additive]
instance QuotientGroup.borelSpace {G : Type*} [TopologicalSpace G] [PolishSpace G] [Group G]
[TopologicalGroup G] [MeasurableSpace G] [BorelSpace G] {N : Subgroup G} [N.Normal]
[IsClosed (N : Set G)] : BorelSpace (G ⧸ N) :=
-- Porting note: 1st and 3rd `haveI`s were not needed in Lean 3
haveI := Subgroup.t3_quotient_of_isClosed N
haveI := QuotientGroup.secondCountableTopology (Γ := N)
Quotient.borelSpace
namespace MeasureTheory
/-! ### Injective images of Borel sets -/
variable {γ : Type*}
/-- The **Lusin-Souslin theorem**: the range of a continuous injective function defined on a Polish
space is Borel-measurable. -/
theorem measurableSet_range_of_continuous_injective {β : Type*} [TopologicalSpace γ]
[PolishSpace γ] [TopologicalSpace β] [T2Space β] [MeasurableSpace β] [OpensMeasurableSpace β]
{f : γ → β} (f_cont : Continuous f) (f_inj : Injective f) :
MeasurableSet (range f) := by
/- We follow [Fremlin, *Measure Theory* (volume 4, 423I)][fremlin_vol4].
Let `b = {s i}` be a countable basis for `α`. When `s i` and `s j` are disjoint, their images
are disjoint analytic sets, hence by the separation theorem one can find a Borel-measurable set
`q i j` separating them.
Let `E i = closure (f '' s i) ∩ ⋂ j, q i j \ q j i`. It contains `f '' (s i)` and it is
measurable. Let `F n = ⋃ E i`, where the union is taken over those `i` for which `diam (s i)`
is bounded by some number `u n` tending to `0` with `n`.
We claim that `range f = ⋂ F n`, from which the measurability is obvious. The inclusion `⊆` is
straightforward. To show `⊇`, consider a point `x` in the intersection. For each `n`, it belongs
to some `E i` with `diam (s i) ≤ u n`. Pick a point `y i ∈ s i`. We claim that for such `i`
and `j`, the intersection `s i ∩ s j` is nonempty: if it were empty, then thanks to the
separating set `q i j` in the definition of `E i` one could not have `x ∈ E i ∩ E j`.
Since these two sets have small diameter, it follows that `y i` and `y j` are close.
Thus, `y` is a Cauchy sequence, converging to a limit `z`. We claim that `f z = x`, completing
the proof.
Otherwise, one could find open sets `v` and `w` separating `f z` from `x`. Then, for large `n`,
the image `f '' (s i)` would be included in `v` by continuity of `f`, so its closure would be
contained in the closure of `v`, and therefore it would be disjoint from `w`. This is a
contradiction since `x` belongs both to this closure and to `w`. -/
letI := upgradePolishSpace γ
obtain ⟨b, b_count, b_nonempty, hb⟩ :
∃ b : Set (Set γ), b.Countable ∧ ∅ ∉ b ∧ IsTopologicalBasis b := exists_countable_basis γ
haveI : Encodable b := b_count.toEncodable
let A := { p : b × b // Disjoint (p.1 : Set γ) p.2 }
-- for each pair of disjoint sets in the topological basis `b`, consider Borel sets separating
-- their images, by injectivity of `f` and the Lusin separation theorem.
have : ∀ p : A, ∃ q : Set β,
f '' (p.1.1 : Set γ) ⊆ q ∧ Disjoint (f '' (p.1.2 : Set γ)) q ∧ MeasurableSet q := by
intro p
apply
AnalyticSet.measurablySeparable ((hb.isOpen p.1.1.2).analyticSet_image f_cont)
((hb.isOpen p.1.2.2).analyticSet_image f_cont)
exact Disjoint.image p.2 f_inj.injOn (subset_univ _) (subset_univ _)
choose q hq1 hq2 q_meas using this
-- define sets `E i` and `F n` as in the proof sketch above
let E : b → Set β := fun s =>
closure (f '' s) ∩ ⋂ (t : b) (ht : Disjoint s.1 t.1), q ⟨(s, t), ht⟩ \ q ⟨(t, s), ht.symm⟩
obtain ⟨u, u_anti, u_pos, u_lim⟩ :
∃ u : ℕ → ℝ, StrictAnti u ∧ (∀ n : ℕ, 0 < u n) ∧ Tendsto u atTop (𝓝 0) :=
exists_seq_strictAnti_tendsto (0 : ℝ)
let F : ℕ → Set β := fun n => ⋃ (s : b) (_ : IsBounded s.1 ∧ diam s.1 ≤ u n), E s
-- it is enough to show that `range f = ⋂ F n`, as the latter set is obviously measurable.
suffices range f = ⋂ n, F n by
have E_meas : ∀ s : b, MeasurableSet (E s) := by
intro b
refine isClosed_closure.measurableSet.inter ?_
refine MeasurableSet.iInter fun s => ?_
exact MeasurableSet.iInter fun hs => (q_meas _).diff (q_meas _)
have F_meas : ∀ n, MeasurableSet (F n) := by
intro n
refine MeasurableSet.iUnion fun s => ?_
exact MeasurableSet.iUnion fun _ => E_meas _
rw [this]
exact MeasurableSet.iInter fun n => F_meas n
-- we check both inclusions.
apply Subset.antisymm
-- we start with the easy inclusion `range f ⊆ ⋂ F n`. One just needs to unfold the definitions.
· rintro x ⟨y, rfl⟩
refine mem_iInter.2 fun n => ?_
obtain ⟨s, sb, ys, hs⟩ : ∃ (s : Set γ), s ∈ b ∧ y ∈ s ∧ s ⊆ ball y (u n / 2) := by
apply hb.mem_nhds_iff.1
exact ball_mem_nhds _ (half_pos (u_pos n))
have diam_s : diam s ≤ u n := by
apply (diam_mono hs isBounded_ball).trans
convert diam_ball (x := y) (half_pos (u_pos n)).le
ring
refine mem_iUnion.2 ⟨⟨s, sb⟩, ?_⟩
refine mem_iUnion.2 ⟨⟨isBounded_ball.subset hs, diam_s⟩, ?_⟩
apply mem_inter (subset_closure (mem_image_of_mem _ ys))
refine mem_iInter.2 fun t => mem_iInter.2 fun ht => ⟨?_, ?_⟩
· apply hq1
exact mem_image_of_mem _ ys
· apply disjoint_left.1 (hq2 ⟨(t, ⟨s, sb⟩), ht.symm⟩)
exact mem_image_of_mem _ ys
-- Now, let us prove the harder inclusion `⋂ F n ⊆ range f`.
· intro x hx
-- pick for each `n` a good set `s n` of small diameter for which `x ∈ E (s n)`.
have C1 : ∀ n, ∃ (s : b) (_ : IsBounded s.1 ∧ diam s.1 ≤ u n), x ∈ E s := fun n => by
simpa only [F, mem_iUnion] using mem_iInter.1 hx n
choose s hs hxs using C1
have C2 : ∀ n, (s n).1.Nonempty := by
intro n
rw [nonempty_iff_ne_empty]
intro hn
have := (s n).2
rw [hn] at this
exact b_nonempty this
-- choose a point `y n ∈ s n`.
choose y hy using C2
have I : ∀ m n, ((s m).1 ∩ (s n).1).Nonempty := by
intro m n
rw [← not_disjoint_iff_nonempty_inter]
by_contra! h
have A : x ∈ q ⟨(s m, s n), h⟩ \ q ⟨(s n, s m), h.symm⟩ :=
haveI := mem_iInter.1 (hxs m).2 (s n)
(mem_iInter.1 this h : _)
have B : x ∈ q ⟨(s n, s m), h.symm⟩ \ q ⟨(s m, s n), h⟩ :=
haveI := mem_iInter.1 (hxs n).2 (s m)
(mem_iInter.1 this h.symm : _)
exact A.2 B.1
-- the points `y n` are nearby, and therefore they form a Cauchy sequence.
have cauchy_y : CauchySeq y := by
have : Tendsto (fun n => 2 * u n) atTop (𝓝 0) := by
simpa only [mul_zero] using u_lim.const_mul 2
refine cauchySeq_of_le_tendsto_0' (fun n => 2 * u n) (fun m n hmn => ?_) this
rcases I m n with ⟨z, zsm, zsn⟩
calc
dist (y m) (y n) ≤ dist (y m) z + dist z (y n) := dist_triangle _ _ _
_ ≤ u m + u n :=
(add_le_add ((dist_le_diam_of_mem (hs m).1 (hy m) zsm).trans (hs m).2)
((dist_le_diam_of_mem (hs n).1 zsn (hy n)).trans (hs n).2))
_ ≤ 2 * u m := by linarith [u_anti.antitone hmn]
haveI : Nonempty γ := ⟨y 0⟩
-- let `z` be its limit.
let z := limUnder atTop y
have y_lim : Tendsto y atTop (𝓝 z) := cauchy_y.tendsto_limUnder
suffices f z = x by
rw [← this]
exact mem_range_self _
-- assume for a contradiction that `f z ≠ x`.
by_contra! hne
-- introduce disjoint open sets `v` and `w` separating `f z` from `x`.
obtain ⟨v, w, v_open, w_open, fzv, xw, hvw⟩ := t2_separation hne
obtain ⟨δ, δpos, hδ⟩ : ∃ δ > (0 : ℝ), ball z δ ⊆ f ⁻¹' v := by
apply Metric.mem_nhds_iff.1
exact f_cont.continuousAt.preimage_mem_nhds (v_open.mem_nhds fzv)
obtain ⟨n, hn⟩ : ∃ n, u n + dist (y n) z < δ :=
haveI : Tendsto (fun n => u n + dist (y n) z) atTop (𝓝 0) := by
simpa only [add_zero] using u_lim.add (tendsto_iff_dist_tendsto_zero.1 y_lim)
((tendsto_order.1 this).2 _ δpos).exists
-- for large enough `n`, the image of `s n` is contained in `v`, by continuity of `f`.
have fsnv : f '' s n ⊆ v := by
rw [image_subset_iff]
apply Subset.trans _ hδ
intro a ha
calc
dist a z ≤ dist a (y n) + dist (y n) z := dist_triangle _ _ _
_ ≤ u n + dist (y n) z :=
(add_le_add_right ((dist_le_diam_of_mem (hs n).1 ha (hy n)).trans (hs n).2) _)
_ < δ := hn
-- as `x` belongs to the closure of `f '' (s n)`, it belongs to the closure of `v`.
have : x ∈ closure v := closure_mono fsnv (hxs n).1
-- this is a contradiction, as `x` is supposed to belong to `w`, which is disjoint from
-- the closure of `v`.
exact disjoint_left.1 (hvw.closure_left w_open) this xw
theorem _root_.IsClosed.measurableSet_image_of_continuousOn_injOn
[TopologicalSpace γ] [PolishSpace γ] {β : Type*} [TopologicalSpace β] [T2Space β]
[MeasurableSpace β] [OpensMeasurableSpace β] {s : Set γ} (hs : IsClosed s) {f : γ → β}
(f_cont : ContinuousOn f s) (f_inj : InjOn f s) : MeasurableSet (f '' s) := by
rw [image_eq_range]
haveI : PolishSpace s := IsClosed.polishSpace hs
apply measurableSet_range_of_continuous_injective
· rwa [continuousOn_iff_continuous_restrict] at f_cont
· rwa [injOn_iff_injective] at f_inj
variable {α β : Type*} [MeasurableSpace β]
section
variable [tβ : TopologicalSpace β] [T2Space β] [MeasurableSpace α] {s : Set γ} {f : γ → β}
/-- The Lusin-Souslin theorem: if `s` is Borel-measurable in a Polish space, then its image under
a continuous injective map is also Borel-measurable. -/
theorem _root_.MeasurableSet.image_of_continuousOn_injOn [OpensMeasurableSpace β]
[tγ : TopologicalSpace γ] [PolishSpace γ] [MeasurableSpace γ] [BorelSpace γ]
(hs : MeasurableSet s)
(f_cont : ContinuousOn f s) (f_inj : InjOn f s) : MeasurableSet (f '' s) := by
obtain ⟨t', t't, t'_polish, s_closed, _⟩ :
∃ t' : TopologicalSpace γ, t' ≤ tγ ∧ @PolishSpace γ t' ∧ IsClosed[t'] s ∧ IsOpen[t'] s :=
hs.isClopenable
exact
@IsClosed.measurableSet_image_of_continuousOn_injOn γ t' t'_polish β _ _ _ _ s s_closed f
(f_cont.mono_dom t't) f_inj
/-- The Lusin-Souslin theorem: if `s` is Borel-measurable in a standard Borel space,
then its image under a measurable injective map taking values in a
countably separate measurable space is also Borel-measurable. -/
theorem _root_.MeasurableSet.image_of_measurable_injOn {f : γ → α}
[MeasurableSpace.CountablySeparated α]
[MeasurableSpace γ] [StandardBorelSpace γ]
(hs : MeasurableSet s) (f_meas : Measurable f) (f_inj : InjOn f s) :
MeasurableSet (f '' s) := by
letI := upgradeStandardBorel γ
let tγ : TopologicalSpace γ := inferInstance
rcases exists_opensMeasurableSpace_of_countablySeparated α with ⟨τ, _, _, _⟩
-- for a finer Polish topology, `f` is continuous. Therefore, one may apply the corresponding
-- result for continuous maps.
obtain ⟨t', t't, f_cont, t'_polish⟩ :
∃ t' : TopologicalSpace γ, t' ≤ tγ ∧ @Continuous γ _ t' _ f ∧ @PolishSpace γ t' :=
f_meas.exists_continuous
have M : MeasurableSet[@borel γ t'] s :=
@Continuous.measurable γ γ t' (@borel γ t')
(@BorelSpace.opensMeasurable γ t' (@borel γ t') (@BorelSpace.mk _ _ (borel γ) rfl))
tγ _ _ _ (continuous_id_of_le t't) s hs
exact
@MeasurableSet.image_of_continuousOn_injOn γ
_ _ _ _ s f _ t' t'_polish (@borel γ t') (@BorelSpace.mk _ _ (borel γ) rfl)
M (@Continuous.continuousOn γ _ t' _ f s f_cont) f_inj
/-- An injective continuous function on a Polish space is a measurable embedding. -/
theorem _root_.Continuous.measurableEmbedding [BorelSpace β]
[TopologicalSpace γ] [PolishSpace γ] [MeasurableSpace γ] [BorelSpace γ]
(f_cont : Continuous f) (f_inj : Injective f) :
MeasurableEmbedding f :=
{ injective := f_inj
measurable := f_cont.measurable
measurableSet_image' := fun _u hu =>
hu.image_of_continuousOn_injOn f_cont.continuousOn f_inj.injOn }
/-- If `s` is Borel-measurable in a Polish space and `f` is continuous injective on `s`, then
the restriction of `f` to `s` is a measurable embedding. -/
theorem _root_.ContinuousOn.measurableEmbedding [BorelSpace β]
[TopologicalSpace γ] [PolishSpace γ] [MeasurableSpace γ] [BorelSpace γ]
(hs : MeasurableSet s) (f_cont : ContinuousOn f s)
(f_inj : InjOn f s) : MeasurableEmbedding (s.restrict f) :=
{ injective := injOn_iff_injective.1 f_inj
measurable := (continuousOn_iff_continuous_restrict.1 f_cont).measurable
measurableSet_image' := by
intro u hu
have A : MeasurableSet (((↑) : s → γ) '' u) :=
(MeasurableEmbedding.subtype_coe hs).measurableSet_image.2 hu
have B : MeasurableSet (f '' (((↑) : s → γ) '' u)) :=
A.image_of_continuousOn_injOn (f_cont.mono (Subtype.coe_image_subset s u))
(f_inj.mono (Subtype.coe_image_subset s u))
rwa [← image_comp] at B }
/-- An injective measurable function from a standard Borel space to a
countably separated measurable space is a measurable embedding. -/
theorem _root_.Measurable.measurableEmbedding {f : γ → α}
[MeasurableSpace.CountablySeparated α]
[MeasurableSpace γ] [StandardBorelSpace γ]
(f_meas : Measurable f) (f_inj : Injective f) : MeasurableEmbedding f :=
{ injective := f_inj
measurable := f_meas
measurableSet_image' := fun _u hu => hu.image_of_measurable_injOn f_meas f_inj.injOn }
/-- If one Polish topology on a type refines another, they have the same Borel sets. -/
theorem borel_eq_borel_of_le {t t' : TopologicalSpace γ}
(ht : PolishSpace (h := t)) (ht' : PolishSpace (h := t')) (hle : t ≤ t') :
@borel _ t = @borel _ t' := by
refine le_antisymm ?_ (borel_anti hle)
intro s hs
have e := @Continuous.measurableEmbedding
_ _ (@borel _ t') t' _ _ (@BorelSpace.mk _ _ (borel γ) rfl)
t _ (@borel _ t) (@BorelSpace.mk _ t (@borel _ t) rfl) (continuous_id_of_le hle) injective_id
convert e.measurableSet_image.2 hs
simp only [id_eq, image_id']
/-- In a Polish space, a set is clopenable if and only if it is Borel-measurable. -/
theorem isClopenable_iff_measurableSet
[tγ : TopologicalSpace γ] [PolishSpace γ] [MeasurableSpace γ] [BorelSpace γ] :
IsClopenable s ↔ MeasurableSet s := by
-- we already know that a measurable set is clopenable. Conversely, assume that `s` is clopenable.
refine ⟨fun hs => ?_, fun hs => hs.isClopenable⟩
borelize γ
-- consider a finer topology `t'` in which `s` is open and closed.
obtain ⟨t', t't, t'_polish, _, s_open⟩ :
∃ t' : TopologicalSpace γ, t' ≤ tγ ∧ @PolishSpace γ t' ∧ IsClosed[t'] s ∧ IsOpen[t'] s := hs
rw [← borel_eq_borel_of_le t'_polish _ t't]
· exact MeasurableSpace.measurableSet_generateFrom s_open
infer_instance
end
/-- The set of points for which a sequence of measurable functions converges to a given function
is measurable. -/
@[measurability]
lemma measurableSet_tendsto_fun [MeasurableSpace γ] [Countable ι]
{l : Filter ι} [l.IsCountablyGenerated]
[TopologicalSpace γ] [SecondCountableTopology γ] [PseudoMetrizableSpace γ]
[OpensMeasurableSpace γ]
{f : ι → β → γ} (hf : ∀ i, Measurable (f i)) {g : β → γ} (hg : Measurable g) :
MeasurableSet { x | Tendsto (fun n ↦ f n x) l (𝓝 (g x)) } := by
letI := TopologicalSpace.pseudoMetrizableSpacePseudoMetric γ
simp_rw [tendsto_iff_dist_tendsto_zero (f := fun n ↦ f n _)]
exact measurableSet_tendsto (𝓝 0) (fun n ↦ (hf n).dist hg)
/-- The set of points for which a measurable sequence of functions converges is measurable. -/
@[measurability]
theorem measurableSet_exists_tendsto [TopologicalSpace γ] [PolishSpace γ] [MeasurableSpace γ]
[hγ : OpensMeasurableSpace γ] [Countable ι] {l : Filter ι}
[l.IsCountablyGenerated] {f : ι → β → γ} (hf : ∀ i, Measurable (f i)) :
MeasurableSet { x | ∃ c, Tendsto (fun n => f n x) l (𝓝 c) } := by
rcases l.eq_or_neBot with rfl | hl
· simp
letI := upgradePolishSpace γ
rcases l.exists_antitone_basis with ⟨u, hu⟩
simp_rw [← cauchy_map_iff_exists_tendsto]
change MeasurableSet { x | _ ∧ _ }
have : ∀ x, (map (f · x) l ×ˢ map (f · x) l).HasAntitoneBasis fun n =>
((f · x) '' u n) ×ˢ ((f · x) '' u n) := fun x => (hu.map _).prod (hu.map _)
simp_rw [and_iff_right (hl.map _),
Filter.HasBasis.le_basis_iff (this _).toHasBasis Metric.uniformity_basis_dist_inv_nat_succ,
Set.setOf_forall]
refine MeasurableSet.biInter Set.countable_univ fun K _ => ?_
simp_rw [Set.setOf_exists, true_and]
refine MeasurableSet.iUnion fun N => ?_
simp_rw [prod_image_image_eq, image_subset_iff, prod_subset_iff, Set.setOf_forall]
exact
MeasurableSet.biInter (to_countable (u N)) fun i _ =>
MeasurableSet.biInter (to_countable (u N)) fun j _ =>
measurableSet_lt (Measurable.dist (hf i) (hf j)) measurable_const
end MeasureTheory
namespace StandardBorelSpace
variable [MeasurableSpace α] [StandardBorelSpace α]
/-- If `s` is a measurable set in a standard Borel space, there is a compatible Polish topology
making `s` clopen. -/
theorem _root_.MeasurableSet.isClopenable' {s : Set α} (hs : MeasurableSet s) :
∃ _ : TopologicalSpace α, BorelSpace α ∧ PolishSpace α ∧ IsClosed s ∧ IsOpen s := by
letI := upgradeStandardBorel α
obtain ⟨t, hle, ht, s_clopen⟩ := hs.isClopenable
refine ⟨t, ?_, ht, s_clopen⟩
constructor
rw [eq_borel_upgradeStandardBorel α, borel_eq_borel_of_le ht _ hle]
infer_instance
/-- A measurable subspace of a standard Borel space is standard Borel. -/
theorem _root_.MeasurableSet.standardBorel {s : Set α} (hs : MeasurableSet s) :
StandardBorelSpace s := by
obtain ⟨_, _, _, s_closed, _⟩ := hs.isClopenable'
haveI := s_closed.polishSpace
infer_instance
end StandardBorelSpace
/-! ### The Borel Isomorphism Theorem -/
namespace PolishSpace
variable {β : Type*}
variable [MeasurableSpace α] [MeasurableSpace β] [StandardBorelSpace α] [StandardBorelSpace β]
/-- If two standard Borel spaces admit Borel measurable injections to one another,
then they are Borel isomorphic. -/
noncomputable def borelSchroederBernstein {f : α → β} {g : β → α} (fmeas : Measurable f)
(finj : Function.Injective f) (gmeas : Measurable g) (ginj : Function.Injective g) : α ≃ᵐ β :=
letI := upgradeStandardBorel α
letI := upgradeStandardBorel β
(fmeas.measurableEmbedding finj).schroederBernstein (gmeas.measurableEmbedding ginj)
/-- Any uncountable standard Borel space is Borel isomorphic to the Cantor space `ℕ → Bool`. -/
noncomputable def measurableEquivNatBoolOfNotCountable (h : ¬Countable α) : α ≃ᵐ (ℕ → Bool) := by
apply Nonempty.some
letI := upgradeStandardBorel α
obtain ⟨f, -, fcts, finj⟩ :=
isClosed_univ.exists_nat_bool_injection_of_not_countable (α := α)
(by rwa [← countable_coe_iff, (Equiv.Set.univ _).countable_iff])
obtain ⟨g, gmeas, ginj⟩ :=
MeasurableSpace.measurable_injection_nat_bool_of_countablySeparated α
exact ⟨borelSchroederBernstein gmeas ginj fcts.measurable finj⟩
/-- The **Borel Isomorphism Theorem**: Any two uncountable standard Borel spaces are
Borel isomorphic. -/
noncomputable def measurableEquivOfNotCountable (hα : ¬Countable α) (hβ : ¬Countable β) : α ≃ᵐ β :=
(measurableEquivNatBoolOfNotCountable hα).trans (measurableEquivNatBoolOfNotCountable hβ).symm
/-- The **Borel Isomorphism Theorem**: If two standard Borel spaces have the same cardinality,
they are Borel isomorphic. -/