Skip to content

Commit f17e232

Browse files
committed
refactor(MeasureTheory): redefine on measures (#10714)
Redefine `≤` on `MeasureTheory.Measure` so that `μ ≤ ν ↔ ∀ s, μ s ≤ ν s` by definition instead of `∀ s, MeasurableSet s → μ s ≤ ν s`. ### Reasons - this way it is defeq to `≤` on outer measures; - if we decide to introduce an order on all `DFunLike` types **and** migrate measures to `FunLike`, then this is unavoidable; - the reasoning for the old definition was "it's slightly easier to prove `μ ≤ ν` this way"; the counter-argument is "it's slightly harder to apply `μ ≤ ν` this way". ### Other changes - golf some proofs broken by this change; - add `@[gcongr]` tags to some `ENNReal` lemmas; - fix the name `ENNReal.coe_lt_coe_of_le` -> `ENNReal.ENNReal.coe_lt_coe_of_lt`; - drop an unneeded `MeasurableSet` assumption in `set_lintegral_pdf_le_map`
1 parent b06068c commit f17e232

File tree

17 files changed

+86
-100
lines changed

17 files changed

+86
-100
lines changed

Mathlib/Data/ENNReal/Basic.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,8 @@ alias ⟨_, coe_le_coe_of_le⟩ := coe_le_coe
384384
attribute [gcongr] ENNReal.coe_le_coe_of_le
385385

386386
-- Needed until `@[gcongr]` accepts iff statements
387-
alias ⟨_, coe_lt_coe_of_le⟩ := coe_lt_coe
388-
attribute [gcongr] ENNReal.coe_lt_coe_of_le
387+
alias ⟨_, coe_lt_coe_of_lt⟩ := coe_lt_coe
388+
attribute [gcongr] ENNReal.coe_lt_coe_of_lt
389389

390390
theorem coe_mono : Monotone ofNNReal := fun _ _ => coe_le_coe.2
391391
#align ennreal.coe_mono ENNReal.coe_mono

Mathlib/Data/ENNReal/Real.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ theorem toReal_le_toReal (ha : a ≠ ∞) (hb : b ≠ ∞) : a.toReal ≤ b.toRe
7979
norm_cast
8080
#align ennreal.to_real_le_to_real ENNReal.toReal_le_toReal
8181

82+
@[gcongr]
8283
theorem toReal_mono (hb : b ≠ ∞) (h : a ≤ b) : a.toReal ≤ b.toReal :=
8384
(toReal_le_toReal (ne_top_of_le_ne_top hb h) hb).2 h
8485
#align ennreal.to_real_mono ENNReal.toReal_mono
@@ -96,10 +97,12 @@ theorem toReal_lt_toReal (ha : a ≠ ∞) (hb : b ≠ ∞) : a.toReal < b.toReal
9697
norm_cast
9798
#align ennreal.to_real_lt_to_real ENNReal.toReal_lt_toReal
9899

100+
@[gcongr]
99101
theorem toReal_strict_mono (hb : b ≠ ∞) (h : a < b) : a.toReal < b.toReal :=
100102
(toReal_lt_toReal h.ne_top hb).2 h
101103
#align ennreal.to_real_strict_mono ENNReal.toReal_strict_mono
102104

105+
@[gcongr]
103106
theorem toNNReal_mono (hb : b ≠ ∞) (h : a ≤ b) : a.toNNReal ≤ b.toNNReal :=
104107
toReal_mono hb h
105108
#align ennreal.to_nnreal_mono ENNReal.toNNReal_mono
@@ -172,6 +175,7 @@ theorem toReal_pos {a : ℝ≥0∞} (ha₀ : a ≠ 0) (ha_top : a ≠ ∞) : 0 <
172175
toReal_pos_iff.mpr ⟨bot_lt_iff_ne_bot.mpr ha₀, lt_top_iff_ne_top.mpr ha_top⟩
173176
#align ennreal.to_real_pos ENNReal.toReal_pos
174177

178+
@[gcongr]
175179
theorem ofReal_le_ofReal {p q : ℝ} (h : p ≤ q) : ENNReal.ofReal p ≤ ENNReal.ofReal q := by
176180
simp [ENNReal.ofReal, Real.toNNReal_le_toNNReal h]
177181
#align ennreal.of_real_le_of_real ENNReal.ofReal_le_ofReal

Mathlib/MeasureTheory/Decomposition/Lebesgue.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -791,14 +791,14 @@ theorem haveLebesgueDecomposition_of_finiteMeasure [IsFiniteMeasure μ] [IsFinit
791791
-- since we need `μ₁ + ν.withDensity ξ = μ`
792792
set μ₁ := μ - ν.withDensity ξ with hμ₁
793793
have hle : ν.withDensity ξ ≤ μ := by
794-
intro B hB
794+
refine le_iff.2 fun B hB ↦ ?_
795795
rw [hξ, withDensity_apply _ hB]
796796
simp_rw [iSup_apply]
797797
rw [lintegral_iSup (fun i => (iSup_mem_measurableLE _ hf₁ i).1) (iSup_monotone _)]
798798
exact iSup_le fun i => (iSup_mem_measurableLE _ hf₁ i).2 B hB
799799
have : IsFiniteMeasure (ν.withDensity ξ) := by
800800
refine' isFiniteMeasure_withDensity _
801-
have hle' := hle univ MeasurableSet.univ
801+
have hle' := hle univ
802802
rw [withDensity_apply _ MeasurableSet.univ, Measure.restrict_univ] at hle'
803803
exact ne_top_of_le_ne_top (measure_ne_top _ _) hle'
804804
refine' ⟨⟨μ₁, ξ⟩, hξm, _, _⟩
@@ -854,7 +854,7 @@ theorem haveLebesgueDecomposition_of_finiteMeasure [IsFiniteMeasure μ] [IsFinit
854854
-- since `ν.withDensity ξ ≤ μ`, it is clear that `μ = μ₁ + ν.withDensity ξ`
855855
· rw [hμ₁]; ext1 A hA
856856
rw [Measure.coe_add, Pi.add_apply, Measure.sub_apply hA hle, add_comm,
857-
add_tsub_cancel_of_le (hle A hA)]⟩
857+
add_tsub_cancel_of_le (hle A)]⟩
858858
#align measure_theory.measure.have_lebesgue_decomposition_of_finite_measure MeasureTheory.Measure.haveLebesgueDecomposition_of_finiteMeasure
859859

860860
attribute [local instance] haveLebesgueDecomposition_of_finiteMeasure
@@ -913,7 +913,7 @@ instance (priority := 100) haveLebesgueDecomposition_of_sigmaFinite (μ ν : Mea
913913
intro i; rw [sum_apply _ ((S.set_mem i).inter (hA₁ i)), tsum_eq_single i]
914914
· intro j hij
915915
rw [hμn, ← nonpos_iff_eq_zero]
916-
refine' le_trans ((singularPart_le _ _) _ ((S.set_mem i).inter (hA₁ i))) (le_of_eq _)
916+
refine (singularPart_le _ _ _).trans_eq ?_
917917
rw [restrict_apply ((S.set_mem i).inter (hA₁ i)), inter_comm, ← inter_assoc]
918918
have : Disjoint (S.set j) (S.set i) := h₂ hij
919919
rw [disjoint_iff_inter_eq_empty] at this

Mathlib/MeasureTheory/Decomposition/RadonNikodym.lean

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,8 @@ theorem withDensity_rnDeriv_eq (μ ν : Measure α) [HaveLebesgueDecomposition
6262
rw [← measure_add_measure_compl h_sing.measurableSet_nullSet]
6363
simp only [MutuallySingular.measure_nullSet, zero_add]
6464
refine le_antisymm ?_ (zero_le _)
65-
refine (singularPart_le μ ν ?_ ?_).trans_eq ?_
66-
· exact h_sing.measurableSet_nullSet.compl
67-
· exact h h_sing.measure_compl_nullSet
65+
refine (singularPart_le μ ν ?_ ).trans_eq ?_
66+
exact h h_sing.measure_compl_nullSet
6867
#align measure_theory.measure.with_density_rn_deriv_eq MeasureTheory.Measure.withDensity_rnDeriv_eq
6968

7069
variable {μ ν : Measure α}
@@ -367,11 +366,12 @@ lemma set_integral_toReal_rnDeriv_le [SigmaFinite μ] {s : Set α} (hμs : μ s
367366
refine set_integral_mono_set ?_ ?_ (HasSubset.Subset.eventuallyLE (subset_toMeasurable _ _))
368367
· exact integrableOn_toReal_rnDeriv hμt
369368
· exact ae_of_all _ (by simp)
369+
_ = (withDensity ν (rnDeriv μ ν) t).toReal := set_integral_toReal_rnDeriv_eq_withDensity' ht_m
370370
_ ≤ (μ t).toReal := by
371-
rw [set_integral_toReal_rnDeriv_eq_withDensity' ht_m, ENNReal.toReal_le_toReal _ hμt]
372-
· exact withDensity_rnDeriv_le _ _ _ ht_m
373-
· exact ((withDensity_rnDeriv_le _ _ _ ht_m).trans_lt hμt.lt_top).ne
374-
_ = (μ s).toReal := by rw [measure_toMeasurable s]
371+
gcongr
372+
· exact hμt
373+
· apply withDensity_rnDeriv_le
374+
_ = (μ s).toReal := by rw [measure_toMeasurable s]
375375

376376
lemma set_integral_toReal_rnDeriv' [SigmaFinite μ] [HaveLebesgueDecomposition μ ν]
377377
(hμν : μ ≪ ν) {s : Set α} (hs : MeasurableSet s) :

Mathlib/MeasureTheory/Function/SimpleFunc.lean

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,10 +1112,9 @@ theorem lintegral_mono {f g : α →ₛ ℝ≥0∞} (hfg : f ≤ g) (hμν : μ
11121112
f.lintegral μ ≤ g.lintegral ν :=
11131113
calc
11141114
f.lintegral μ ≤ f.lintegral μ ⊔ g.lintegral μ := le_sup_left
1115-
_ ≤ (f ⊔ g).lintegral μ := (le_sup_lintegral _ _)
1115+
_ ≤ (f ⊔ g).lintegral μ := le_sup_lintegral _ _
11161116
_ = g.lintegral μ := by rw [sup_of_le_right hfg]
1117-
_ ≤ g.lintegral ν :=
1118-
Finset.sum_le_sum fun y _ => ENNReal.mul_left_mono <| hμν _ (g.measurableSet_preimage _)
1117+
_ ≤ g.lintegral ν := Finset.sum_le_sum fun y _ => ENNReal.mul_left_mono <| hμν _
11191118
#align measure_theory.simple_func.lintegral_mono MeasureTheory.SimpleFunc.lintegral_mono
11201119

11211120
/-- `SimpleFunc.lintegral` depends only on the measures of `f ⁻¹' {y}`. -/

Mathlib/MeasureTheory/Integral/IntegrableOn.lean

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -482,13 +482,10 @@ theorem IntegrableAtFilter.inf_of_right (hl : IntegrableAtFilter f l μ) :
482482
@[simp]
483483
theorem IntegrableAtFilter.inf_ae_iff {l : Filter α} :
484484
IntegrableAtFilter f (l ⊓ μ.ae) μ ↔ IntegrableAtFilter f l μ := by
485-
refine' ⟨_, fun h => h.filter_mono inf_le_left⟩
485+
refine ⟨?_, fun h h.filter_mono inf_le_left⟩
486486
rintro ⟨s, ⟨t, ht, u, hu, rfl⟩, hf⟩
487-
refine' ⟨t, ht, _⟩
488-
refine' hf.integrable.mono_measure fun v hv => _
489-
simp only [Measure.restrict_apply hv]
490-
refine' measure_mono_ae (mem_of_superset hu fun x hx => _)
491-
exact fun ⟨hv, ht⟩ => ⟨hv, ⟨ht, hx⟩⟩
487+
refine ⟨t, ht, hf.congr_set_ae <| eventuallyEq_set.2 ?_⟩
488+
filter_upwards [hu] with x hx using (and_iff_left hx).symm
492489
#align measure_theory.integrable_at_filter.inf_ae_iff MeasureTheory.IntegrableAtFilter.inf_ae_iff
493490

494491
alias ⟨IntegrableAtFilter.of_inf_ae, _⟩ := IntegrableAtFilter.inf_ae_iff

Mathlib/MeasureTheory/Integral/Layercake.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ theorem lintegral_comp_eq_lintegral_meas_le_mul_of_measurable (μ : Measure α)
331331
refine lt_of_le_of_lt (measure_union_le _ _) ?_
332332
rw [I, zero_add]
333333
apply lt_of_le_of_lt _ J
334-
exact restrict_le_self _ (measurableSet_lt measurable_const f_mble)
334+
exact restrict_le_self _
335335
spanning := by
336336
apply eq_univ_iff_forall.2 (fun a ↦ ?_)
337337
rcases le_or_lt (f a) M with ha|ha

Mathlib/MeasureTheory/Integral/SetToL1.lean

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,12 @@ theorem smul [NormedField 𝕜] [NormedSpace 𝕜 β] (hT : DominatedFinMeasAddi
231231

232232
theorem of_measure_le {μ' : Measure α} (h : μ ≤ μ') (hT : DominatedFinMeasAdditive μ T C)
233233
(hC : 0 ≤ C) : DominatedFinMeasAdditive μ' T C := by
234-
have h' : ∀ s, MeasurableSet s → μ s = ∞ → μ' s = ∞ := by
235-
intro s hs hμs; rw [eq_top_iff, ← hμs]; exact h s hs
236-
refine' ⟨hT.1.of_eq_top_imp_eq_top h', fun s hs hμ's => _⟩
237-
have hμs : μ s < ∞ := (h s hs).trans_lt hμ's
238-
refine' (hT.2 s hs hμs).trans (mul_le_mul le_rfl _ ENNReal.toReal_nonneg hC)
239-
rw [toReal_le_toReal hμs.ne hμ's.ne]
240-
exact h s hs
234+
have h' : ∀ s, μ s = ∞ → μ' s = ∞ := fun s hs ↦ top_unique <| hs.symm.trans_le (h _)
235+
refine ⟨hT.1.of_eq_top_imp_eq_top fun s _ ↦ h' s, fun s hs hμ's ↦ ?_⟩
236+
have hμs : μ s < ∞ := (h s).trans_lt hμ's
237+
calc
238+
‖T s‖ ≤ C * (μ s).toReal := hT.2 s hs hμs
239+
_ ≤ C * (μ' s).toReal := by gcongr; exacts [hμ's.ne, h _]
241240
#align measure_theory.dominated_fin_meas_additive.of_measure_le MeasureTheory.DominatedFinMeasAdditive.of_measure_le
242241

243242
theorem add_measure_right {_ : MeasurableSpace α} (μ ν : Measure α)
@@ -1610,7 +1609,7 @@ theorem setToFun_congr_measure_of_integrable {μ' : Measure α} (c' : ℝ≥0∞
16101609
apply hfμ.induction (P := fun f => setToFun μ T hT f = setToFun μ' T hT' f)
16111610
· intro c s hs hμs
16121611
have hμ's : μ' s ≠ ∞ := by
1613-
refine' ((hμ'_le s hs).trans_lt _).ne
1612+
refine ((hμ'_le s).trans_lt ?_).ne
16141613
rw [Measure.smul_apply, smul_eq_mul]
16151614
exact ENNReal.mul_lt_top hc' hμs.ne
16161615
rw [setToFun_indicator_const hT hs hμs.ne, setToFun_indicator_const hT' hs hμ's]

Mathlib/MeasureTheory/Measure/AEMeasurable.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,8 @@ theorem MeasureTheory.Measure.restrict_map_of_aemeasurable {f : α → δ} (hf :
387387
#align measure_theory.measure.restrict_map_of_ae_measurable MeasureTheory.Measure.restrict_map_of_aemeasurable
388388

389389
theorem MeasureTheory.Measure.map_mono_of_aemeasurable {f : α → δ} (h : μ ≤ ν)
390-
(hf : AEMeasurable f ν) : μ.map f ≤ ν.map f := fun s hs => by
391-
simpa [hf, hs, hf.mono_measure h] using Measure.le_iff'.1 h (f ⁻¹' s)
390+
(hf : AEMeasurable f ν) : μ.map f ≤ ν.map f :=
391+
le_iff.2 fun s hs ↦ by simpa [hf, hs, hf.mono_measure h] using h (f ⁻¹' s)
392392
#align measure_theory.measure.map_mono_of_ae_measurable MeasureTheory.Measure.map_mono_of_aemeasurable
393393

394394
/-- If the `σ`-algebra of the codomain of a null measurable function is countably generated,

Mathlib/MeasureTheory/Measure/Hausdorff.lean

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,8 +478,7 @@ variable [MeasurableSpace X] [BorelSpace X]
478478
/-- If `c ∉ {0, ∞}` and `m₁ d ≤ c * m₂ d` for `d < ε` for some `ε > 0`
479479
(we use `≤ᶠ[𝓝[≥] 0]` to state this), then `mkMetric m₁ hm₁ ≤ c • mkMetric m₂ hm₂`. -/
480480
theorem mkMetric_mono_smul {m₁ m₂ : ℝ≥0∞ → ℝ≥0∞} {c : ℝ≥0∞} (hc : c ≠ ∞) (h0 : c ≠ 0)
481-
(hle : m₁ ≤ᶠ[𝓝[≥] 0] c • m₂) : (mkMetric m₁ : Measure X) ≤ c • mkMetric m₂ := by
482-
intro s _
481+
(hle : m₁ ≤ᶠ[𝓝[≥] 0] c • m₂) : (mkMetric m₁ : Measure X) ≤ c • mkMetric m₂ := fun s ↦ by
483482
rw [← OuterMeasure.coe_mkMetric, coe_smul, ← OuterMeasure.coe_mkMetric]
484483
exact OuterMeasure.mkMetric_mono_smul hc h0 hle s
485484
#align measure_theory.measure.mk_metric_mono_smul MeasureTheory.Measure.mkMetric_mono_smul

0 commit comments

Comments
 (0)