11/-
22Copyright (c) 2024 Eric Wieser. All rights reserved.
33Released under Apache 2.0 license as described in the file LICENSE.
4- Authors: Eric Wieser
4+ Authors: Eric Wieser, Gaëtan Serré
55-/
66import Mathlib.Topology.UnitInterval
77import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic
@@ -12,7 +12,9 @@ import Mathlib.MeasureTheory.Measure.Lebesgue.Basic
1212# The canonical measure on the unit interval
1313
1414This file provides a `MeasureTheory.MeasureSpace` instance on `unitInterval`,
15- and shows it is a probability measure.
15+ and shows it is a probability measure with no atoms.
16+
17+ It also contains some basic results on the volume of various interval sets.
1618-/
1719open scoped unitInterval
1820open MeasureTheory
@@ -28,7 +30,73 @@ instance : IsProbabilityMeasure (volume : Measure I) where
2830 rw [Measure.Subtype.volume_univ nullMeasurableSet_Icc, Real.volume_Icc, sub_zero,
2931 ENNReal.ofReal_one]
3032
33+ lemma measurableEmbedding_coe : MeasurableEmbedding ((↑) : I → ℝ) where
34+ injective := Subtype.val_injective
35+ measurable := measurable_subtype_coe
36+ measurableSet_image' _ := measurableSet_Icc.subtype_image
37+
38+ lemma volume_apply {s : Set I} : volume s = volume (Subtype.val '' s) :=
39+ measurableEmbedding_coe.comap_apply ..
40+
41+ instance : NoAtoms (volume : Measure I) where
42+ measure_singleton x := by simp only [volume_apply, Set.image_singleton, measure_singleton]
43+
3144@[measurability]
3245theorem measurable_symm : Measurable symm := continuous_symm.measurable
3346
47+ open Set
48+
49+ variable (x : I)
50+
51+ @[simp]
52+ lemma volume_Iic : volume (Iic x) = .ofReal x := by
53+ simp only [volume_apply, image_subtype_val_Icc_Iic, Real.volume_Icc, sub_zero]
54+
55+ @[simp]
56+ lemma volume_Iio : volume (Iio x) = .ofReal x := by
57+ simp only [← volume_image_subtype_coe measurableSet_Icc, image_subtype_val_Icc_Iio,
58+ Real.volume_Ico, sub_zero]
59+
60+ @[simp]
61+ lemma volume_Ici : volume (Ici x) = .ofReal (1 - x) := by
62+ simp only [volume_apply, image_subtype_val_Icc_Ici, Real.volume_Icc]
63+
64+ @[simp]
65+ lemma volume_Ioi : volume (Ioi x) = .ofReal (1 - x) := by
66+ simp only [volume_apply, image_subtype_val_Icc_Ioi, Real.volume_Ioc]
67+
68+ variable (y : I)
69+
70+ @[simp]
71+ lemma volume_Icc : volume (Icc x y) = .ofReal (y - x) := by
72+ simp only [volume_apply, image_subtype_val_Icc, Real.volume_Icc]
73+
74+ @[simp]
75+ lemma volume_uIcc : volume (uIcc x y) = edist y x := by
76+ simp only [uIcc, volume_apply, image_subtype_val_Icc, Icc.coe_inf, Icc.coe_sup, Real.volume_Icc,
77+ max_sub_min_eq_abs, edist_dist, Subtype.dist_eq, Real.dist_eq]
78+
79+ @[simp]
80+ lemma volume_Ico : volume (Ico x y) = .ofReal (y - x) := by
81+ simp only [volume_apply, image_subtype_val_Ico, Real.volume_Ico]
82+
83+ @[simp]
84+ lemma volume_Ioc : volume (Ioc x y) = .ofReal (y - x) := by
85+ simp only [volume_apply, image_subtype_val_Ioc, Real.volume_Ioc]
86+
87+ @[simp]
88+ lemma volume_uIoc : volume (uIoc x y) = edist y x := by
89+ simp only [uIoc, volume_apply, image_subtype_val_Ioc, Icc.coe_inf, Icc.coe_sup, Real.volume_Ioc,
90+ max_sub_min_eq_abs, edist_dist, Subtype.dist_eq, Real.dist_eq]
91+
92+
93+ @[simp]
94+ lemma volume_Ioo : volume (Ioo x y) = .ofReal (y - x) := by
95+ simp only [volume_apply, image_subtype_val_Ioo, Real.volume_Ioo]
96+
97+ @[simp]
98+ lemma volume_uIoo : volume (uIoo x y) = edist y x := by
99+ simp only [uIoo, volume_apply, image_subtype_val_Ioo, Icc.coe_inf, Icc.coe_sup, Real.volume_Ioo,
100+ max_sub_min_eq_abs, edist_dist, Subtype.dist_eq, Real.dist_eq]
101+
34102end unitInterval
0 commit comments