Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 9988193

Browse files
committed
feat(measure_theory): various additions (#5389)
Some computations of measures on non-measurable sets Some more measurability lemmas for pi-types Cleanup in `measure_space`
1 parent f1d2bc6 commit 9988193

File tree

5 files changed

+349
-237
lines changed

5 files changed

+349
-237
lines changed

src/data/equiv/list.lean

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ def trunc_encodable_of_fintype (α : Type*) [decidable_eq α] [fintype α] : tru
8888
(λ l H, trunc.mk $ encodable_of_list l H)
8989
finset.mem_univ
9090

91+
/-- A noncomputable way to arbitrarily choose an ordering on a finite type.
92+
It is not made into a global instance, since it involves an arbitrary choice.
93+
This can be locally made into an instance with `local attribute [instance] fintype.encodable`. -/
94+
noncomputable def fintype.encodable (α : Type*) [fintype α] : encodable α :=
95+
by { classical, exact (encodable.trunc_encodable_of_fintype α).out }
96+
9197
instance vector [encodable α] {n} : encodable (vector α n) :=
9298
encodable.subtype
9399

src/measure_theory/borel_space.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ begin
248248
rw [borel_eq_generate_from_of_subbasis this],
249249
apply generate_from_le,
250250
rintros _ ⟨s, i, hi, rfl⟩,
251-
refine is_measurable_pi i.countable_to_set (λ a ha, is_open.is_measurable _),
251+
refine is_measurable.pi i.countable_to_set (λ a ha, is_open.is_measurable _),
252252
rw [hinst],
253253
exact generate_open.basic _ (hi a ha)
254254
end

src/measure_theory/measurable_space.lean

Lines changed: 94 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ measurable space, σ-algebra, measurable function, measurable equivalence, dynki
6767
π-λ theorem, π-system
6868
-/
6969

70-
open set encodable function
70+
open set encodable function equiv
7171
open_locale classical filter
7272

7373

@@ -157,6 +157,20 @@ lemma is_measurable.Inter [encodable β] {f : β → set α} (h : ∀ b, is_meas
157157
is_measurable.compl_iff.1 $
158158
by { rw compl_Inter, exact is_measurable.Union (λ b, (h b).compl) }
159159

160+
section fintype
161+
162+
local attribute [instance] fintype.encodable
163+
164+
lemma is_measurable.Union_fintype [fintype β] {f : β → set α} (h : ∀ b, is_measurable (f b)) :
165+
is_measurable (⋃ b, f b) :=
166+
is_measurable.Union h
167+
168+
lemma is_measurable.Inter_fintype [fintype β] {f : β → set α} (h : ∀ b, is_measurable (f b)) :
169+
is_measurable (⋂ b, f b) :=
170+
is_measurable.Inter h
171+
172+
end fintype
173+
160174
lemma is_measurable.bInter {f : β → set α} {s : set β} (hs : countable s)
161175
(h : ∀ b ∈ s, is_measurable (f b)) : is_measurable (⋂ b ∈ s, f b) :=
162176
is_measurable.compl_iff.1 $
@@ -201,6 +215,10 @@ disjointed_induct (h n) (assume t i ht, is_measurable.diff ht $ h _)
201215
@[simp] lemma is_measurable.const (p : Prop) : is_measurable {a : α | p} :=
202216
by { by_cases p; simp [h, is_measurable.empty]; apply is_measurable.univ }
203217

218+
/-- Every set has a measurable superset. Declare this as local instance as needed. -/
219+
lemma nonempty_measurable_superset (s : set α) : nonempty { t // s ⊆ t ∧ is_measurable t} :=
220+
⟨⟨univ, subset_univ s, is_measurable.univ⟩⟩
221+
204222
end
205223

206224
@[ext] lemma measurable_space.ext : ∀ {m₁ m₂ : measurable_space α},
@@ -527,7 +545,7 @@ section constructions
527545
variables [measurable_space α] [measurable_space β] [measurable_space γ]
528546

529547
instance : measurable_space empty := ⊤
530-
instance : measurable_space unit := ⊤
548+
instance : measurable_space punit := ⊤ -- this also works for `unit`
531549
instance : measurable_space bool := ⊤
532550
instance : measurable_space ℕ := ⊤
533551
instance : measurable_space ℤ := ⊤
@@ -716,21 +734,68 @@ instance measurable_space.pi [m : Π a, measurable_space (π a)] : measurable_sp
716734

717735
variables [Π a, measurable_space (π a)] [measurable_space γ]
718736

737+
lemma measurable_pi_iff {g : α → Π a, π a} :
738+
measurable g ↔ ∀ a, measurable (λ x, g x a) :=
739+
by simp_rw [measurable_iff_comap_le, measurable_space.pi, measurable_space.comap_supr,
740+
measurable_space.comap_comp, function.comp, supr_le_iff]
741+
719742
lemma measurable_pi_apply (a : δ) : measurable (λ f : Π a, π a, f a) :=
720743
measurable.of_comap_le $ le_supr _ a
721744

745+
lemma measurable.eval {a : δ} {g : α → Π a, π a}
746+
(hg : measurable g) : measurable (λ x, g x a) :=
747+
(measurable_pi_apply a).comp hg
748+
722749
lemma measurable_pi_lambda (f : α → Π a, π a) (hf : ∀ a, measurable (λ c, f c a)) :
723750
measurable f :=
724-
measurable.of_le_map $ supr_le $ assume a, measurable_space.comap_le_iff_le_map.2 (hf a)
751+
measurable_pi_iff.mpr hf
725752

726-
lemma is_measurable_pi {s : set δ} {t : Π i : δ, set (π i)} (hs : countable s)
753+
/-- The function `update f a : π a → Π a, π a` is always measurable.
754+
This doesn't require `f` to be measurable.
755+
This should not be confused with the statement that `update f a x` is measurable. -/
756+
lemma measurable_update (f : Π (a : δ), π a) {a : δ} : measurable (update f a) :=
757+
begin
758+
apply measurable_pi_lambda,
759+
intro x, by_cases hx : x = a,
760+
{ cases hx, convert measurable_id, ext, simp },
761+
simp_rw [update_noteq hx], apply measurable_const,
762+
end
763+
764+
/- Even though we cannot use projection notation, we still keep a dot to be consistent with similar
765+
lemmas, like `is_measurable.prod`. -/
766+
lemma is_measurable.pi {s : set δ} {t : Π i : δ, set (π i)} (hs : countable s)
727767
(ht : ∀ i ∈ s, is_measurable (t i)) :
728768
is_measurable (s.pi t) :=
769+
by { rw [pi_def], exact is_measurable.bInter hs (λ i hi, measurable_pi_apply _ (ht i hi)) }
770+
771+
lemma is_measurable.pi_univ [encodable δ] {t : Π i : δ, set (π i)}
772+
(ht : ∀ i, is_measurable (t i)) : is_measurable (pi univ t) :=
773+
is_measurable.pi (countable_encodable _) (λ i _, ht i)
774+
775+
lemma is_measurable_pi_of_nonempty {s : set δ} {t : Π i, set (π i)} (hs : countable s)
776+
(h : (pi s t).nonempty) : is_measurable (pi s t) ↔ ∀ i ∈ s, is_measurable (t i) :=
777+
begin
778+
rcases h with ⟨f, hf⟩, refine ⟨λ hst i hi, _, is_measurable.pi hs⟩,
779+
convert measurable_update f hst, rw [update_preimage_pi hi], exact λ j hj _, hf j hj
780+
end
781+
782+
lemma is_measurable_pi {s : set δ} {t : Π i, set (π i)} (hs : countable s) :
783+
is_measurable (pi s t) ↔ (∀ i ∈ s, is_measurable (t i)) ∨ pi s t = ∅ :=
729784
begin
730-
rw [pi_def],
731-
exact is_measurable.bInter hs (λ i hi, measurable_pi_apply _ (ht i hi))
785+
cases (pi s t).eq_empty_or_nonempty with h h,
786+
{ simp [h] },
787+
{ simp [is_measurable_pi_of_nonempty hs, h, ← not_nonempty_iff_eq_empty] }
732788
end
733789

790+
section fintype
791+
792+
local attribute [instance] fintype.encodable
793+
794+
lemma is_measurable.pi_fintype [fintype δ] {s : set δ} {t : Π i, set (π i)}
795+
(ht : ∀ i ∈ s, is_measurable (t i)) : is_measurable (pi s t) :=
796+
is_measurable.pi (countable_encodable _) ht
797+
798+
end fintype
734799
end pi
735800

736801
instance {α β} [m₁ : measurable_space α] [m₂ : measurable_space β] : measurable_space (α ⊕ β) :=
@@ -801,6 +866,9 @@ lemma coe_eq (e : α ≃ᵐ β) : (e : α → β) = e.to_equiv := rfl
801866
protected lemma measurable (e : α ≃ᵐ β) : measurable (e : α → β) :=
802867
e.measurable_to_fun
803868

869+
@[simp] lemma coe_mk (e : α ≃ β) (h1 : measurable e) (h2 : measurable e.symm) :
870+
((⟨e, h1, h2⟩ : α ≃ᵐ β) : α → β) = e := rfl
871+
804872
/-- Any measurable space is equivalent to itself. -/
805873
def refl (α : Type*) [measurable_space α] : α ≃ᵐ α :=
806874
{ to_equiv := equiv.refl α,
@@ -821,6 +889,9 @@ instance : inhabited (α ≃ᵐ α) := ⟨refl α⟩
821889
measurable_to_fun := ab.measurable_inv_fun,
822890
measurable_inv_fun := ab.measurable_to_fun }
823891

892+
@[simp] lemma coe_symm_mk (e : α ≃ β) (h1 : measurable e) (h2 : measurable e.symm) :
893+
((⟨e, h1, h2⟩ : α ≃ᵐ β).symm : β → α) = e.symm := rfl
894+
824895
/-- Equal measurable spaces are equivalent. -/
825896
protected def cast {α β} [i₁ : measurable_space α] [i₂ : measurable_space β]
826897
(h : α = β) (hi : i₁ == i₂) : α ≃ᵐ β :=
@@ -838,27 +909,27 @@ iff.intro
838909

839910
/-- Products of equivalent measurable spaces are equivalent. -/
840911
def prod_congr (ab : α ≃ᵐ β) (cd : γ ≃ᵐ δ) : α × γ ≃ᵐ β × δ :=
841-
{ to_equiv := equiv.prod_congr ab.to_equiv cd.to_equiv,
912+
{ to_equiv := prod_congr ab.to_equiv cd.to_equiv,
842913
measurable_to_fun := (ab.measurable_to_fun.comp measurable_id.fst).prod_mk
843914
(cd.measurable_to_fun.comp measurable_id.snd),
844915
measurable_inv_fun := (ab.measurable_inv_fun.comp measurable_id.fst).prod_mk
845916
(cd.measurable_inv_fun.comp measurable_id.snd) }
846917

847918
/-- Products of measurable spaces are symmetric. -/
848919
def prod_comm : α × β ≃ᵐ β × α :=
849-
{ to_equiv := equiv.prod_comm α β,
920+
{ to_equiv := prod_comm α β,
850921
measurable_to_fun := measurable_id.snd.prod_mk measurable_id.fst,
851922
measurable_inv_fun := measurable_id.snd.prod_mk measurable_id.fst }
852923

853924
/-- Products of measurable spaces are associative. -/
854925
def prod_assoc : (α × β) × γ ≃ᵐ α × (β × γ) :=
855-
{ to_equiv := equiv.prod_assoc α β γ,
926+
{ to_equiv := prod_assoc α β γ,
856927
measurable_to_fun := measurable_fst.fst.prod_mk $ measurable_fst.snd.prod_mk measurable_snd,
857928
measurable_inv_fun := (measurable_fst.prod_mk measurable_snd.fst).prod_mk measurable_snd.snd }
858929

859930
/-- Sums of measurable spaces are symmetric. -/
860931
def sum_congr (ab : α ≃ᵐ β) (cd : γ ≃ᵐ δ) : α ⊕ γ ≃ᵐ β ⊕ δ :=
861-
{ to_equiv := equiv.sum_congr ab.to_equiv cd.to_equiv,
932+
{ to_equiv := sum_congr ab.to_equiv cd.to_equiv,
862933
measurable_to_fun :=
863934
begin
864935
cases ab with ab' abm, cases ab', cases cd with cd' cdm, cases cd',
@@ -898,7 +969,7 @@ noncomputable def set.image (f : α → β) (s : set α) (hf : injective f)
898969
measurable_to_fun := (hfm.comp measurable_id.subtype_coe).subtype_mk,
899970
measurable_inv_fun :=
900971
begin
901-
rintro t ⟨u, hu, rfl⟩, simp [preimage_preimage, equiv.set.image_symm_preimage hf],
972+
rintro t ⟨u, hu, rfl⟩, simp [preimage_preimage, set.image_symm_preimage hf],
902973
exact measurable_subtype_coe (hfi u hu)
903974
end }
904975

@@ -948,7 +1019,7 @@ def set.range_inr : (range sum.inr : set (α ⊕ β)) ≃ᵐ β :=
9481019
/-- Products distribute over sums (on the right) as measurable spaces. -/
9491020
def sum_prod_distrib (α β γ) [measurable_space α] [measurable_space β] [measurable_space γ] :
9501021
(α ⊕ β) × γ ≃ᵐ (α × γ) ⊕ (β × γ) :=
951-
{ to_equiv := equiv.sum_prod_distrib α β γ,
1022+
{ to_equiv := sum_prod_distrib α β γ,
9521023
measurable_to_fun :=
9531024
begin
9541025
refine measurable_of_measurable_union_cover
@@ -986,6 +1057,17 @@ def sum_prod_sum (α β γ δ)
9861057
(α ⊕ β) × (γ ⊕ δ) ≃ᵐ ((α × γ) ⊕ (α × δ)) ⊕ ((β × γ) ⊕ (β × δ)) :=
9871058
(sum_prod_distrib _ _ _).trans $ sum_congr (prod_sum_distrib _ _ _) (prod_sum_distrib _ _ _)
9881059

1060+
variables {π π' : δ' → Type*} [∀ x, measurable_space (π x)] [∀ x, measurable_space (π' x)]
1061+
1062+
/-- A family of measurable equivalences `Π a, β₁ a ≃ᵐ β₂ a` generates a measurable equivalence
1063+
between `Π a, β₁ a` and `Π a, β₂ a`. -/
1064+
def Pi_congr_right (e : Π a, π a ≃ᵐ π' a) : (Π a, π a) ≃ᵐ (Π a, π' a) :=
1065+
{ to_equiv := Pi_congr_right (λ a, (e a).to_equiv),
1066+
measurable_to_fun :=
1067+
measurable_pi_lambda _ (λ i, (e i).measurable_to_fun.comp (measurable_pi_apply i)),
1068+
measurable_inv_fun :=
1069+
measurable_pi_lambda _ (λ i, (e i).measurable_inv_fun.comp (measurable_pi_apply i)) }
1070+
9891071
end measurable_equiv
9901072

9911073
/-- A pi-system is a collection of subsets of `α` that is closed under intersections of sets that

0 commit comments

Comments
 (0)