Skip to content

Commit

Permalink
chore(MeasureTheory/Measure): use instead of (#7603)
Browse files Browse the repository at this point in the history
Use `∃ t', t' ⊆ t ∧ _` instead of `∃ t' (_ : t' ⊆ t), _`
and similarly with `⊇`
in `MeasureTheory.toMeasurable` and related lemmas.

Also reflow linebreaks in an unrelated proof.
  • Loading branch information
urkud committed Oct 10, 2023
1 parent c4caeb2 commit 7fb3d8a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 19 deletions.
7 changes: 2 additions & 5 deletions Mathlib/MeasureTheory/Measure/AEMeasurable.lean
Expand Up @@ -91,11 +91,8 @@ theorem sum_measure [Countable ι] {μ : ι → Measure α} (h : ∀ i, AEMeasur
exact measurable_const
· rw [restrict_piecewise_compl, compl_iInter]
intro t ht
refine'
⟨⋃ i, (h i).mk f ⁻¹' t ∩ (s i)ᶜ,
MeasurableSet.iUnion fun i =>
(measurable_mk _ ht).inter (measurableSet_toMeasurable _ _).compl,
_⟩
refine ⟨⋃ i, (h i).mk f ⁻¹' t ∩ (s i)ᶜ, MeasurableSet.iUnion fun i ↦
(measurable_mk _ ht).inter (measurableSet_toMeasurable _ _).compl, ?_⟩
ext ⟨x, hx⟩
simp only [mem_preimage, mem_iUnion, Subtype.coe_mk, Set.restrict, mem_inter_iff,
mem_compl_iff] at hx ⊢
Expand Down
7 changes: 3 additions & 4 deletions Mathlib/MeasureTheory/Measure/MeasureSpace.lean
Expand Up @@ -3514,8 +3514,7 @@ theorem measure_toMeasurable_inter_of_cover {s : Set α} (hs : MeasurableSet s)
-- measurable set `s`. It is built on each member of a spanning family using `toMeasurable`
-- (which is well behaved for finite measure sets thanks to `measure_toMeasurable_inter`), and
-- the desired property passes to the union.
have A :
∃ (t' : _) (_ : t' ⊇ t), MeasurableSet t' ∧ ∀ u, MeasurableSet u → μ (t' ∩ u) = μ (t ∩ u) := by
have A : ∃ t', t' ⊇ t ∧ MeasurableSet t' ∧ ∀ u, MeasurableSet u → μ (t' ∩ u) = μ (t ∩ u) := by
let w n := toMeasurable μ (t ∩ v n)
have hw : ∀ n, μ (w n) < ∞ := by
intro n
Expand Down Expand Up @@ -3568,8 +3567,8 @@ theorem measure_toMeasurable_inter_of_cover {s : Set α} (hs : MeasurableSet s)
rw [toMeasurable]
split_ifs with ht
· apply measure_congr
exact ae_eq_set_inter ht.choose_spec.snd.2 (ae_eq_refl _)
· exact A.choose_spec.snd.2 s hs
exact ae_eq_set_inter ht.choose_spec.2.2 (ae_eq_refl _)
· exact A.choose_spec.2.2 s hs
#align measure_theory.measure.measure_to_measurable_inter_of_cover MeasureTheory.Measure.measure_toMeasurable_inter_of_cover

theorem restrict_toMeasurable_of_cover {s : Set α} {v : ℕ → Set α} (hv : s ⊆ ⋃ n, v n)
Expand Down
14 changes: 7 additions & 7 deletions Mathlib/MeasureTheory/Measure/MeasureSpaceDef.lean
Expand Up @@ -623,15 +623,15 @@ If `s` is a null measurable set, then
we also have `t =ᵐ[μ] s`, see `NullMeasurableSet.toMeasurable_ae_eq`.
This notion is sometimes called a "measurable hull" in the literature. -/
irreducible_def toMeasurable (μ : Measure α) (s : Set α) : Set α :=
if h : ∃ (t : _) (_ : t ⊇ s), MeasurableSet t ∧ t =ᵐ[μ] s then h.choose else
if h' : ∃ (t : _) (_ : t ⊇ s),
MeasurableSet t ∧ ∀ u, MeasurableSet u → μ (t ∩ u) = μ (s ∩ u) then h'.choose
if h : ∃ t, t ⊇ s MeasurableSet t ∧ t =ᵐ[μ] s then h.choose else
if h' : ∃ t, t ⊇ s ∧ MeasurableSet t ∧
∀ u, MeasurableSet u → μ (t ∩ u) = μ (s ∩ u) then h'.choose
else (exists_measurable_superset μ s).choose
#align measure_theory.to_measurable MeasureTheory.toMeasurable

theorem subset_toMeasurable (μ : Measure α) (s : Set α) : s ⊆ toMeasurable μ s := by
rw [toMeasurable_def]; split_ifs with hs h's
exacts [hs.choose_spec.fst, h's.choose_spec.fst, (exists_measurable_superset μ s).choose_spec.1]
exacts [hs.choose_spec.1, h's.choose_spec.1, (exists_measurable_superset μ s).choose_spec.1]
#align measure_theory.subset_to_measurable MeasureTheory.subset_toMeasurable

theorem ae_le_toMeasurable : s ≤ᵐ[μ] toMeasurable μ s :=
Expand All @@ -644,15 +644,15 @@ theorem ae_le_toMeasurable : s ≤ᵐ[μ] toMeasurable μ s :=
theorem measurableSet_toMeasurable (μ : Measure α) (s : Set α) :
MeasurableSet (toMeasurable μ s) := by
rw [toMeasurable_def]; split_ifs with hs h's
exacts [hs.choose_spec.snd.1, h's.choose_spec.snd.1,
exacts [hs.choose_spec.2.1, h's.choose_spec.2.1,
(exists_measurable_superset μ s).choose_spec.2.1]
#align measure_theory.measurable_set_to_measurable MeasureTheory.measurableSet_toMeasurable

@[simp]
theorem measure_toMeasurable (s : Set α) : μ (toMeasurable μ s) = μ s := by
rw [toMeasurable_def]; split_ifs with hs h's
· exact measure_congr hs.choose_spec.snd.2
· simpa only [inter_univ] using h's.choose_spec.snd.2 univ MeasurableSet.univ
· exact measure_congr hs.choose_spec.2.2
· simpa only [inter_univ] using h's.choose_spec.2.2 univ MeasurableSet.univ
· exact (exists_measurable_superset μ s).choose_spec.2.2
#align measure_theory.measure_to_measurable MeasureTheory.measure_toMeasurable

Expand Down
6 changes: 3 additions & 3 deletions Mathlib/MeasureTheory/Measure/NullMeasurable.lean
Expand Up @@ -225,7 +225,7 @@ protected theorem insert [MeasurableSingletonClass (NullMeasurableSpace α μ)]
#align measure_theory.null_measurable_set.insert MeasureTheory.NullMeasurableSet.insert

theorem exists_measurable_superset_ae_eq (h : NullMeasurableSet s μ) :
(t : _) (_ : t ⊇ s), MeasurableSet t ∧ t =ᵐ[μ] s := by
t, t ⊇ s MeasurableSet t ∧ t =ᵐ[μ] s := by
rcases h with ⟨t, htm, hst⟩
refine' ⟨t ∪ toMeasurable μ (s \ t), _, htm.union (measurableSet_toMeasurable _ _), _⟩
· exact diff_subset_iff.1 (subset_toMeasurable _ _)
Expand All @@ -235,15 +235,15 @@ theorem exists_measurable_superset_ae_eq (h : NullMeasurableSet s μ) :

theorem toMeasurable_ae_eq (h : NullMeasurableSet s μ) : toMeasurable μ s =ᵐ[μ] s := by
rw [toMeasurable_def, dif_pos]
exact (exists_measurable_superset_ae_eq h).choose_spec.snd.2
exact (exists_measurable_superset_ae_eq h).choose_spec.2.2
#align measure_theory.null_measurable_set.to_measurable_ae_eq MeasureTheory.NullMeasurableSet.toMeasurable_ae_eq

theorem compl_toMeasurable_compl_ae_eq (h : NullMeasurableSet s μ) : (toMeasurable μ sᶜ)ᶜ =ᵐ[μ] s :=
Iff.mpr ae_eq_set_compl <| toMeasurable_ae_eq h.compl
#align measure_theory.null_measurable_set.compl_to_measurable_compl_ae_eq MeasureTheory.NullMeasurableSet.compl_toMeasurable_compl_ae_eq

theorem exists_measurable_subset_ae_eq (h : NullMeasurableSet s μ) :
(t : _) (_ : t ⊆ s), MeasurableSet t ∧ t =ᵐ[μ] s :=
t, t ⊆ s MeasurableSet t ∧ t =ᵐ[μ] s :=
⟨(toMeasurable μ sᶜ)ᶜ, compl_subset_comm.2 <| subset_toMeasurable _ _,
(measurableSet_toMeasurable _ _).compl, compl_toMeasurable_compl_ae_eq h⟩
#align measure_theory.null_measurable_set.exists_measurable_subset_ae_eq MeasureTheory.NullMeasurableSet.exists_measurable_subset_ae_eq
Expand Down

0 comments on commit 7fb3d8a

Please sign in to comment.