measure_theory.decomposition.lebesgueMathlib.MeasureTheory.Decomposition.Lebesgue

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -7,7 +7,7 @@ import MeasureTheory.Measure.Complex
 import MeasureTheory.Measure.Sub
 import MeasureTheory.Decomposition.Jordan
 import MeasureTheory.Measure.WithDensityVectorMeasure
-import MeasureTheory.Function.AeEqOfIntegral
+import MeasureTheory.Function.AEEqOfIntegral
 
 #align_import measure_theory.decomposition.lebesgue from "leanprover-community/mathlib"@"7e5137f579de09a059a5ce98f364a04e221aabf0"
 
@@ -121,9 +121,9 @@ theorem haveLebesgueDecomposition_add (μ ν : Measure α) [HaveLebesgueDecompos
 #align measure_theory.measure.have_lebesgue_decomposition_add MeasureTheory.Measure.haveLebesgueDecomposition_add
 -/
 
-#print MeasureTheory.Measure.haveLebesgueDecomposition_smul /-
-instance haveLebesgueDecomposition_smul (μ ν : Measure α) [HaveLebesgueDecomposition μ ν]
-    (r : ℝ≥0) : (r • μ).HaveLebesgueDecomposition ν
+#print MeasureTheory.Measure.haveLebesgueDecompositionSmul /-
+instance haveLebesgueDecompositionSmul (μ ν : Measure α) [HaveLebesgueDecomposition μ ν] (r : ℝ≥0) :
+    (r • μ).HaveLebesgueDecomposition ν
     where lebesgue_decomposition :=
     by
     obtain ⟨hmeas, hsing, hadd⟩ := have_lebesgue_decomposition_spec μ ν
@@ -134,7 +134,7 @@ instance haveLebesgueDecomposition_smul (μ ν : Measure α) [HaveLebesgueDecomp
     · change _ = (r : ℝ≥0∞) • _ + ν.with_density ((r : ℝ≥0∞) • _)
       rw [with_density_smul _ hmeas, ← smul_add, ← hadd]
       rfl
-#align measure_theory.measure.have_lebesgue_decomposition_smul MeasureTheory.Measure.haveLebesgueDecomposition_smul
+#align measure_theory.measure.have_lebesgue_decomposition_smul MeasureTheory.Measure.haveLebesgueDecompositionSmul
 -/
 
 #print MeasureTheory.Measure.measurable_rnDeriv /-
@@ -1430,14 +1430,14 @@ theorem singularPart_add_withDensity_rnDeriv_eq [c.HaveLebesgueDecomposition μ]
   ext i hi : 1
   rw [vector_measure.add_apply, signed_measure.to_complex_measure_apply]
   ext
-  · rw [Complex.add_re, with_densityᵥ_apply (c.integrable_rn_deriv μ) hi, ← IsROrC.re_eq_complex_re,
-      ← integral_re (c.integrable_rn_deriv μ).IntegrableOn, IsROrC.re_eq_complex_re, ←
+  · rw [Complex.add_re, with_densityᵥ_apply (c.integrable_rn_deriv μ) hi, ← RCLike.re_eq_complex_re,
+      ← integral_re (c.integrable_rn_deriv μ).IntegrableOn, RCLike.re_eq_complex_re, ←
       with_densityᵥ_apply _ hi]
     · change (c.re.singular_part μ + μ.with_densityᵥ (c.re.rn_deriv μ)) i = _
       rw [c.re.singular_part_add_with_density_rn_deriv_eq μ]
     · exact signed_measure.integrable_rn_deriv _ _
-  · rw [Complex.add_im, with_densityᵥ_apply (c.integrable_rn_deriv μ) hi, ← IsROrC.im_eq_complex_im,
-      ← integral_im (c.integrable_rn_deriv μ).IntegrableOn, IsROrC.im_eq_complex_im, ←
+  · rw [Complex.add_im, with_densityᵥ_apply (c.integrable_rn_deriv μ) hi, ← RCLike.im_eq_complex_im,
+      ← integral_im (c.integrable_rn_deriv μ).IntegrableOn, RCLike.im_eq_complex_im, ←
       with_densityᵥ_apply _ hi]
     · change (c.im.singular_part μ + μ.with_densityᵥ (c.im.rn_deriv μ)) i = _
       rw [c.im.singular_part_add_with_density_rn_deriv_eq μ]
Diff
@@ -262,7 +262,7 @@ theorem eq_singularPart {s : Measure α} {f : α → ℝ≥0∞} (hf : Measurabl
   haveI : have_lebesgue_decomposition μ ν := ⟨⟨⟨s, f⟩, hf, hs, hadd⟩⟩
   obtain ⟨hmeas, hsing, hadd'⟩ := have_lebesgue_decomposition_spec μ ν
   obtain ⟨⟨S, hS₁, hS₂, hS₃⟩, ⟨T, hT₁, hT₂, hT₃⟩⟩ := hs, hsing
-  rw [hadd'] at hadd 
+  rw [hadd'] at hadd
   have hνinter : ν ((S ∩ T)ᶜ) = 0 := by
     rw [compl_inter]
     refine' nonpos_iff_eq_zero.1 (le_trans (measure_union_le _ _) _)
@@ -367,7 +367,7 @@ theorem eq_withDensity_rnDeriv {s : Measure α} {f : α → ℝ≥0∞} (hf : Me
   haveI : have_lebesgue_decomposition μ ν := ⟨⟨⟨s, f⟩, hf, hs, hadd⟩⟩
   obtain ⟨hmeas, hsing, hadd'⟩ := have_lebesgue_decomposition_spec μ ν
   obtain ⟨⟨S, hS₁, hS₂, hS₃⟩, ⟨T, hT₁, hT₂, hT₃⟩⟩ := hs, hsing
-  rw [hadd'] at hadd 
+  rw [hadd'] at hadd
   have hνinter : ν ((S ∩ T)ᶜ) = 0 := by
     rw [compl_inter]
     refine' nonpos_iff_eq_zero.1 (le_trans (measure_union_le _ _) _)
@@ -481,7 +481,7 @@ theorem exists_positive_of_not_mutuallySingular (μ ν : Measure α) [IsFiniteMe
     by
     intro n
     have := nonpos_of_restrict_le_zero _ (hA₂ n)
-    rwa [to_signed_measure_sub_apply hAmeas, sub_nonpos, ENNReal.toReal_le_toReal] at this 
+    rwa [to_signed_measure_sub_apply hAmeas, sub_nonpos, ENNReal.toReal_le_toReal] at this
     exacts [ne_of_lt (measure_lt_top _ _), ne_of_lt (measure_lt_top _ _)]
   have hμ : μ A = 0 :=
     by
@@ -492,7 +492,7 @@ theorem exists_positive_of_not_mutuallySingular (μ ν : Measure α) [IsFiniteMe
     · suffices ∀ b, 0 < b → μA ≤ b by
         by_contra
         have h' := this (μA / 2) (half_pos (zero_lt_iff.2 h))
-        rw [← @Classical.not_not (μA ≤ μA / 2)] at h' 
+        rw [← @Classical.not_not (μA ≤ μA / 2)] at h'
         exact h' (not_le.2 (NNReal.half_lt_self h))
       intro c hc
       have : ∃ n : ℕ, 1 / (n + 1 : ℝ) < c * νA⁻¹; refine' exists_nat_one_div_lt _
@@ -510,15 +510,15 @@ theorem exists_positive_of_not_mutuallySingular (μ ν : Measure α) [IsFiniteMe
       refine' le_trans _ (le_of_lt h')
       rw [← ENNReal.coe_le_coe, ENNReal.coe_mul]
       exact hA₃ n
-    · rw [not_lt, le_zero_iff] at hb 
+    · rw [not_lt, le_zero_iff] at hb
       specialize hA₃ 0
-      simp [hb, le_zero_iff] at hA₃ 
+      simp [hb, le_zero_iff] at hA₃
       assumption
   -- since `μ` and `ν` are not mutually singular, `μ A = 0` implies `ν Aᶜ > 0`
-  rw [mutually_singular] at h ;
-  push_neg at h 
+  rw [mutually_singular] at h;
+  push_neg at h
   have := h _ hAmeas hμ
-  simp_rw [hA₁, compl_Inter, compl_compl] at this 
+  simp_rw [hA₁, compl_Inter, compl_compl] at this
   -- as `Aᶜ = ⋃ n, f n`, `ν Aᶜ > 0` implies there exists some `n` such that `ν (f n) > 0`
   obtain ⟨n, hn⟩ := exists_measure_pos_of_not_measure_Union_null this
   -- thus, choosing `f n` as the set `E` suffices
@@ -699,7 +699,7 @@ theorem haveLebesgueDecomposition_of_finiteMeasure [IsFiniteMeasure μ] [IsFinit
       by
       refine' is_finite_measure_with_density _
       have hle' := hle univ MeasurableSet.univ
-      rw [with_density_apply _ MeasurableSet.univ, measure.restrict_univ] at hle' 
+      rw [with_density_apply _ MeasurableSet.univ, measure.restrict_univ] at hle'
       exact ne_top_of_le_ne_top (measure_ne_top _ _) hle'
     refine' ⟨⟨μ₁, ξ⟩, hξm, _, _⟩
     · by_contra
@@ -707,7 +707,7 @@ theorem haveLebesgueDecomposition_of_finiteMeasure [IsFiniteMeasure μ] [IsFinit
       -- there exists some `ε > 0` and a measurable set `E`, such that `μ(E) > 0` and `E` is
       -- positive with respect to `ν - εμ`
       obtain ⟨ε, hε₁, E, hE₁, hE₂, hE₃⟩ := exists_positive_of_not_mutually_singular μ₁ ν h
-      simp_rw [hμ₁] at hE₃ 
+      simp_rw [hμ₁] at hE₃
       have hξle : ∀ A, MeasurableSet A → ∫⁻ a in A, ξ a ∂ν ≤ μ A :=
         by
         intro A hA; rw [hξ]
@@ -724,7 +724,7 @@ theorem haveLebesgueDecomposition_of_finiteMeasure [IsFiniteMeasure μ] [IsFinit
           ENNReal.toReal_sub_of_le _ (ne_of_lt (measure_lt_top _ _)), sub_nonneg, le_sub_iff_add_le,
           ← ENNReal.toReal_add, ENNReal.toReal_le_toReal, measure.coe_smul, Pi.smul_apply,
           with_density_apply _ (hA.inter hE₁), show ε • ν (A ∩ E) = (ε : ℝ≥0∞) * ν (A ∩ E) by rfl, ←
-          set_lintegral_const, ← lintegral_add_left measurable_const] at this 
+          set_lintegral_const, ← lintegral_add_left measurable_const] at this
         · rw [Ne.def, ENNReal.add_eq_top, not_or]
           exact ⟨ne_of_lt (measure_lt_top _ _), ne_of_lt (measure_lt_top _ _)⟩
         · exact ne_of_lt (measure_lt_top _ _)
@@ -755,7 +755,7 @@ theorem haveLebesgueDecomposition_of_finiteMeasure [IsFiniteMeasure μ] [IsFinit
       rw [hξ₁, lintegral_add_left hξm, lintegral_indicator _ hE₁, set_lintegral_const]
       refine' ENNReal.lt_add_right _ (ENNReal.mul_pos_iff.2 ⟨ENNReal.coe_pos.2 hε₁, hE₂⟩).ne'
       have := measure_ne_top (ν.with_density ξ) univ
-      rwa [with_density_apply _ MeasurableSet.univ, measure.restrict_univ] at this 
+      rwa [with_density_apply _ MeasurableSet.univ, measure.restrict_univ] at this
     -- since `ν.with_density ξ ≤ μ`, it is clear that `μ = μ₁ + ν.with_density ξ`
     · rw [hμ₁]; ext1 A hA
       rw [measure.coe_add, Pi.add_apply, measure.sub_apply hA hle, add_comm,
@@ -824,7 +824,7 @@ instance (priority := 100) haveLebesgueDecomposition_of_sigmaFinite (μ ν : Mea
               refine' le_trans ((singular_part_le _ _) _ ((S.set_mem i).inter (hA₁ i))) (le_of_eq _)
               rw [restrict_apply ((S.set_mem i).inter (hA₁ i)), inter_comm, ← inter_assoc]
               have : Disjoint (S.set j) (S.set i) := h₂ hij
-              rw [disjoint_iff_inter_eq_empty] at this 
+              rw [disjoint_iff_inter_eq_empty] at this
               rw [this, empty_inter, measure_empty]
             · infer_instance
           simp_rw [this, tsum_eq_zero_iff ENNReal.summable]
@@ -837,7 +837,7 @@ instance (priority := 100) haveLebesgueDecomposition_of_sigmaFinite (μ ν : Mea
           by
           constructor
           · rw [disjoint_iff_inf_le]
-            rintro x ⟨hx₁, hx₂⟩; rw [mem_Union] at hx₁ hx₂ 
+            rintro x ⟨hx₁, hx₂⟩; rw [mem_Union] at hx₁ hx₂
             obtain ⟨⟨i, hi₁, hi₂⟩, ⟨j, hj₁, hj₂⟩⟩ := hx₁, hx₂
             have : i = j := by by_contra hij; exact (h₂ hij).le_bot ⟨hi₁, hj₁⟩
             exact hj₂ (this ▸ hi₂)
@@ -845,8 +845,8 @@ instance (priority := 100) haveLebesgueDecomposition_of_sigmaFinite (μ ν : Mea
             intro x hx
             simp only [mem_Union, sup_eq_union, mem_inter_iff, mem_union, mem_compl_iff,
               Classical.or_iff_not_imp_left]
-            intro h; push_neg at h 
-            rw [top_eq_univ, ← S.spanning, mem_Union] at hx 
+            intro h; push_neg at h
+            rw [top_eq_univ, ← S.spanning, mem_Union] at hx
             obtain ⟨i, hi⟩ := hx
             exact ⟨i, hi, h i hi⟩
         rw [hcompl.compl_eq, measure_Union, tsum_eq_zero_iff ENNReal.summable]
@@ -952,7 +952,7 @@ instance haveLebesgueDecomposition_smul_real (s : SignedMeasure α) (μ : Measur
   by_cases hr : 0 ≤ r
   · lift r to ℝ≥0 using hr
     exact s.have_lebesgue_decomposition_smul μ _
-  · rw [not_le] at hr 
+  · rw [not_le] at hr
     refine'
       { posPart :=
           by
@@ -985,11 +985,11 @@ theorem singularPart_mutuallySingular (s : SignedMeasure α) (μ : Measure α) :
   by_cases hl : s.have_lebesgue_decomposition μ
   · haveI := hl
     obtain ⟨i, hi, hpos, hneg⟩ := s.to_jordan_decomposition.mutually_singular
-    rw [s.to_jordan_decomposition.pos_part.have_lebesgue_decomposition_add μ] at hpos 
-    rw [s.to_jordan_decomposition.neg_part.have_lebesgue_decomposition_add μ] at hneg 
-    rw [add_apply, add_eq_zero_iff] at hpos hneg 
+    rw [s.to_jordan_decomposition.pos_part.have_lebesgue_decomposition_add μ] at hpos
+    rw [s.to_jordan_decomposition.neg_part.have_lebesgue_decomposition_add μ] at hneg
+    rw [add_apply, add_eq_zero_iff] at hpos hneg
     exact ⟨i, hi, hpos.1, hneg.1⟩
-  · rw [not_have_lebesgue_decomposition_iff] at hl 
+  · rw [not_have_lebesgue_decomposition_iff] at hl
     cases' hl with hp hn
     · rw [measure.singular_part, dif_neg hp]
       exact mutually_singular.zero_left
@@ -1103,12 +1103,12 @@ theorem jordanDecomposition_add_withDensity_mutuallySingular {f : α → ℝ} (h
     (t.toJordanDecomposition.posPart + μ.withDensity fun x : α => ENNReal.ofReal (f x)) ⟂ₘ
       t.toJordanDecomposition.negPart + μ.withDensity fun x : α => ENNReal.ofReal (-f x) :=
   by
-  rw [mutually_singular_ennreal_iff, total_variation_mutually_singular_iff] at htμ 
+  rw [mutually_singular_ennreal_iff, total_variation_mutually_singular_iff] at htμ
   change
     _ ⟂ₘ vector_measure.equiv_measure.to_fun (vector_measure.equiv_measure.inv_fun μ) ∧
       _ ⟂ₘ vector_measure.equiv_measure.to_fun (vector_measure.equiv_measure.inv_fun μ) at
-    htμ 
-  rw [vector_measure.equiv_measure.right_inv] at htμ 
+    htμ
+  rw [vector_measure.equiv_measure.right_inv] at htμ
   exact
     ((jordan_decomposition.mutually_singular _).add_right
           (htμ.1.mono_ac (refl _) (with_density_absolutely_continuous _ _))).add_left
@@ -1150,9 +1150,9 @@ private theorem have_lebesgue_decomposition_mk' (μ : Measure α) {f : α → 
     (hfi : Integrable f μ) (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
     s.HaveLebesgueDecomposition μ := by
   have htμ' := htμ
-  rw [mutually_singular_ennreal_iff] at htμ 
-  change _ ⟂ₘ vector_measure.equiv_measure.to_fun (vector_measure.equiv_measure.inv_fun μ) at htμ 
-  rw [vector_measure.equiv_measure.right_inv, total_variation_mutually_singular_iff] at htμ 
+  rw [mutually_singular_ennreal_iff] at htμ
+  change _ ⟂ₘ vector_measure.equiv_measure.to_fun (vector_measure.equiv_measure.inv_fun μ) at htμ
+  rw [vector_measure.equiv_measure.right_inv, total_variation_mutually_singular_iff] at htμ
   refine'
     { posPart := by
         use⟨t.to_jordan_decomposition.pos_part, fun x => ENNReal.ofReal (f x)⟩
@@ -1170,7 +1170,7 @@ theorem haveLebesgueDecomposition_mk (μ : Measure α) {f : α → ℝ} (hf : Me
   by
   by_cases hfi : integrable f μ
   · exact have_lebesgue_decomposition_mk' μ hf hfi htμ hadd
-  · rw [with_densityᵥ, dif_neg hfi, add_zero] at hadd 
+  · rw [with_densityᵥ, dif_neg hfi, add_zero] at hadd
     refine' have_lebesgue_decomposition_mk' μ measurable_zero (integrable_zero _ _ μ) htμ _
     rwa [with_densityᵥ_zero, add_zero]
 #align measure_theory.signed_measure.have_lebesgue_decomposition_mk MeasureTheory.SignedMeasure.haveLebesgueDecomposition_mk
@@ -1180,12 +1180,12 @@ private theorem eq_singular_part' (t : SignedMeasure α) {f : α → ℝ} (hf :
     (hfi : Integrable f μ) (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
     t = s.singularPart μ := by
   have htμ' := htμ
-  rw [mutually_singular_ennreal_iff, total_variation_mutually_singular_iff] at htμ 
+  rw [mutually_singular_ennreal_iff, total_variation_mutually_singular_iff] at htμ
   change
     _ ⟂ₘ vector_measure.equiv_measure.to_fun (vector_measure.equiv_measure.inv_fun μ) ∧
       _ ⟂ₘ vector_measure.equiv_measure.to_fun (vector_measure.equiv_measure.inv_fun μ) at
-    htμ 
-  rw [vector_measure.equiv_measure.right_inv] at htμ 
+    htμ
+  rw [vector_measure.equiv_measure.right_inv] at htμ
   · rw [singular_part, ← t.to_signed_measure_to_jordan_decomposition,
       jordan_decomposition.to_signed_measure]
     congr
@@ -1208,7 +1208,7 @@ theorem eq_singularPart (t : SignedMeasure α) (f : α → ℝ) (htμ : t ⟂ᵥ
   · refine' eq_singular_part' t hfi.1.measurable_mk (hfi.congr hfi.1.ae_eq_mk) htμ _
     convert hadd using 2
     exact with_densityᵥ_eq.congr_ae hfi.1.ae_eq_mk.symm
-  · rw [with_densityᵥ, dif_neg hfi, add_zero] at hadd 
+  · rw [with_densityᵥ, dif_neg hfi, add_zero] at hadd
     refine' eq_singular_part' t measurable_zero (integrable_zero _ _ μ) htμ _
     rwa [with_densityᵥ_zero, add_zero]
 #align measure_theory.signed_measure.eq_singular_part MeasureTheory.SignedMeasure.eq_singularPart
@@ -1371,7 +1371,7 @@ theorem rnDeriv_sub (s t : SignedMeasure α) (μ : Measure α) [s.HaveLebesgueDe
     [t.HaveLebesgueDecomposition μ] [hst : (s - t).HaveLebesgueDecomposition μ] :
     (s - t).rnDeriv μ =ᵐ[μ] s.rnDeriv μ - t.rnDeriv μ :=
   by
-  rw [sub_eq_add_neg] at hst 
+  rw [sub_eq_add_neg] at hst
   rw [sub_eq_add_neg, sub_eq_add_neg]
   exact ae_eq_trans (rn_deriv_add _ _ _) (Filter.EventuallyEq.add (ae_eq_refl _) (rn_deriv_neg _ _))
 #align measure_theory.signed_measure.rn_deriv_sub MeasureTheory.SignedMeasure.rnDeriv_sub
Diff
@@ -437,15 +437,15 @@ theorem rnDeriv_withDensity (ν : Measure α) [SigmaFinite ν] {f : α → ℝ
 #align measure_theory.measure.rn_deriv_with_density MeasureTheory.Measure.rnDeriv_withDensity
 -/
 
-#print MeasureTheory.Measure.rnDeriv_restrict /-
+#print MeasureTheory.Measure.rnDeriv_restrict_self /-
 /-- The Radon-Nikodym derivative of the restriction of a measure to a measurable set is the
 indicator function of this set. -/
-theorem rnDeriv_restrict (ν : Measure α) [SigmaFinite ν] {s : Set α} (hs : MeasurableSet s) :
+theorem rnDeriv_restrict_self (ν : Measure α) [SigmaFinite ν] {s : Set α} (hs : MeasurableSet s) :
     (ν.restrict s).rnDeriv ν =ᵐ[ν] s.indicator 1 :=
   by
   rw [← with_density_indicator_one hs]
   exact rn_deriv_with_density _ (measurable_one.indicator hs)
-#align measure_theory.measure.rn_deriv_restrict MeasureTheory.Measure.rnDeriv_restrict
+#align measure_theory.measure.rn_deriv_restrict MeasureTheory.Measure.rnDeriv_restrict_self
 -/
 
 open VectorMeasure SignedMeasure
Diff
@@ -844,7 +844,7 @@ instance (priority := 100) haveLebesgueDecomposition_of_sigmaFinite (μ ν : Mea
           · rw [codisjoint_iff_le_sup]
             intro x hx
             simp only [mem_Union, sup_eq_union, mem_inter_iff, mem_union, mem_compl_iff,
-              or_iff_not_imp_left]
+              Classical.or_iff_not_imp_left]
             intro h; push_neg at h 
             rw [top_eq_univ, ← S.spanning, mem_Union] at hx 
             obtain ⟨i, hi⟩ := hx
Diff
@@ -3,11 +3,11 @@ Copyright (c) 2021 Kexing Ying. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Kexing Ying
 -/
-import Mathbin.MeasureTheory.Measure.Complex
-import Mathbin.MeasureTheory.Measure.Sub
-import Mathbin.MeasureTheory.Decomposition.Jordan
-import Mathbin.MeasureTheory.Measure.WithDensityVectorMeasure
-import Mathbin.MeasureTheory.Function.AeEqOfIntegral
+import MeasureTheory.Measure.Complex
+import MeasureTheory.Measure.Sub
+import MeasureTheory.Decomposition.Jordan
+import MeasureTheory.Measure.WithDensityVectorMeasure
+import MeasureTheory.Function.AeEqOfIntegral
 
 #align_import measure_theory.decomposition.lebesgue from "leanprover-community/mathlib"@"7e5137f579de09a059a5ce98f364a04e221aabf0"
 
Diff
@@ -1155,12 +1155,11 @@ private theorem have_lebesgue_decomposition_mk' (μ : Measure α) {f : α → 
   rw [vector_measure.equiv_measure.right_inv, total_variation_mutually_singular_iff] at htμ 
   refine'
     { posPart := by
-        use ⟨t.to_jordan_decomposition.pos_part, fun x => ENNReal.ofReal (f x)⟩
+        use⟨t.to_jordan_decomposition.pos_part, fun x => ENNReal.ofReal (f x)⟩
         refine' ⟨hf.ennreal_of_real, htμ.1, _⟩
         rw [to_jordan_decomposition_eq_of_eq_add_with_density hf hfi htμ' hadd]
-      negPart :=
-        by
-        use ⟨t.to_jordan_decomposition.neg_part, fun x => ENNReal.ofReal (-f x)⟩
+      negPart := by
+        use⟨t.to_jordan_decomposition.neg_part, fun x => ENNReal.ofReal (-f x)⟩
         refine' ⟨hf.neg.ennreal_of_real, htμ.2, _⟩
         rw [to_jordan_decomposition_eq_of_eq_add_with_density hf hfi htμ' hadd] }
 
Diff
@@ -2,11 +2,6 @@
 Copyright (c) 2021 Kexing Ying. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Kexing Ying
-
-! This file was ported from Lean 3 source module measure_theory.decomposition.lebesgue
-! leanprover-community/mathlib commit 7e5137f579de09a059a5ce98f364a04e221aabf0
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.MeasureTheory.Measure.Complex
 import Mathbin.MeasureTheory.Measure.Sub
@@ -14,6 +9,8 @@ import Mathbin.MeasureTheory.Decomposition.Jordan
 import Mathbin.MeasureTheory.Measure.WithDensityVectorMeasure
 import Mathbin.MeasureTheory.Function.AeEqOfIntegral
 
+#align_import measure_theory.decomposition.lebesgue from "leanprover-community/mathlib"@"7e5137f579de09a059a5ce98f364a04e221aabf0"
+
 /-!
 # Lebesgue decomposition
 
Diff
@@ -1135,7 +1135,7 @@ theorem toJordanDecomposition_eq_of_eq_add_withDensity {f : α → ℝ} (hf : Me
   haveI := is_finite_measure_with_density_of_real hfi.neg.2
   refine' to_jordan_decomposition_eq _
   simp_rw [jordan_decomposition.to_signed_measure, hadd]
-  ext (i hi)
+  ext i hi
   rw [vector_measure.sub_apply, to_signed_measure_apply_measurable hi,
       to_signed_measure_apply_measurable hi, add_apply, add_apply, ENNReal.toReal_add,
       ENNReal.toReal_add, add_sub_add_comm, ← to_signed_measure_apply_measurable hi, ←
@@ -1431,7 +1431,7 @@ theorem singularPart_add_withDensity_rnDeriv_eq [c.HaveLebesgueDecomposition μ]
     c.singularPart μ + μ.withDensityᵥ (c.rnDeriv μ) = c :=
   by
   conv_rhs => rw [← c.to_complex_measure_to_signed_measure]
-  ext (i hi) : 1
+  ext i hi : 1
   rw [vector_measure.add_apply, signed_measure.to_complex_measure_apply]
   ext
   · rw [Complex.add_re, with_densityᵥ_apply (c.integrable_rn_deriv μ) hi, ← IsROrC.re_eq_complex_re,
Diff
@@ -75,8 +75,6 @@ open Set
 
 variable {α β : Type _} {m : MeasurableSpace α} {μ ν : MeasureTheory.Measure α}
 
-include m
-
 namespace MeasureTheory
 
 namespace Measure
@@ -126,6 +124,7 @@ theorem haveLebesgueDecomposition_add (μ ν : Measure α) [HaveLebesgueDecompos
 #align measure_theory.measure.have_lebesgue_decomposition_add MeasureTheory.Measure.haveLebesgueDecomposition_add
 -/
 
+#print MeasureTheory.Measure.haveLebesgueDecomposition_smul /-
 instance haveLebesgueDecomposition_smul (μ ν : Measure α) [HaveLebesgueDecomposition μ ν]
     (r : ℝ≥0) : (r • μ).HaveLebesgueDecomposition ν
     where lebesgue_decomposition :=
@@ -139,6 +138,7 @@ instance haveLebesgueDecomposition_smul (μ ν : Measure α) [HaveLebesgueDecomp
       rw [with_density_smul _ hmeas, ← smul_add, ← hadd]
       rfl
 #align measure_theory.measure.have_lebesgue_decomposition_smul MeasureTheory.Measure.haveLebesgueDecomposition_smul
+-/
 
 #print MeasureTheory.Measure.measurable_rnDeriv /-
 @[measurability]
@@ -205,6 +205,7 @@ instance [TopologicalSpace α] [IsLocallyFiniteMeasure μ] :
     IsLocallyFiniteMeasure (ν.withDensity <| μ.rnDeriv ν) :=
   isLocallyFiniteMeasure_of_le <| withDensity_rnDeriv_le μ ν
 
+#print MeasureTheory.Measure.lintegral_rnDeriv_lt_top_of_measure_ne_top /-
 theorem lintegral_rnDeriv_lt_top_of_measure_ne_top {μ : Measure α} (ν : Measure α) {s : Set α}
     (hs : μ s ≠ ∞) : ∫⁻ x in s, μ.rnDeriv ν x ∂ν < ∞ :=
   by
@@ -226,13 +227,17 @@ theorem lintegral_rnDeriv_lt_top_of_measure_ne_top {μ : Measure α} (ν : Measu
   · erw [measure.rn_deriv, dif_neg hl, lintegral_zero]
     exact WithTop.zero_lt_top
 #align measure_theory.measure.lintegral_rn_deriv_lt_top_of_measure_ne_top MeasureTheory.Measure.lintegral_rnDeriv_lt_top_of_measure_ne_top
+-/
 
+#print MeasureTheory.Measure.lintegral_rnDeriv_lt_top /-
 theorem lintegral_rnDeriv_lt_top (μ ν : Measure α) [IsFiniteMeasure μ] :
     ∫⁻ x, μ.rnDeriv ν x ∂ν < ∞ := by
   rw [← set_lintegral_univ]
   exact lintegral_rn_deriv_lt_top_of_measure_ne_top _ (measure_lt_top _ _).Ne
 #align measure_theory.measure.lintegral_rn_deriv_lt_top MeasureTheory.Measure.lintegral_rnDeriv_lt_top
+-/
 
+#print MeasureTheory.Measure.rnDeriv_lt_top /-
 /-- The Radon-Nikodym derivative of a sigma-finite measure `μ` with respect to another
 measure `ν` is `ν`-almost everywhere finite. -/
 theorem rnDeriv_lt_top (μ ν : Measure α) [SigmaFinite μ] : ∀ᵐ x ∂ν, μ.rnDeriv ν x < ∞ :=
@@ -245,6 +250,7 @@ theorem rnDeriv_lt_top (μ ν : Measure α) [SigmaFinite μ] : ∀ᵐ x ∂ν, 
   refine' (lintegral_rn_deriv_lt_top_of_measure_ne_top _ _).Ne
   exact (measure_spanning_sets_lt_top _ _).Ne
 #align measure_theory.measure.rn_deriv_lt_top MeasureTheory.Measure.rnDeriv_lt_top
+-/
 
 #print MeasureTheory.Measure.eq_singularPart /-
 /-- Given measures `μ` and `ν`, if `s` is a measure mutually singular to `ν` and `f` is a
@@ -305,6 +311,7 @@ theorem singularPart_zero (ν : Measure α) : (0 : Measure α).singularPart ν =
 #align measure_theory.measure.singular_part_zero MeasureTheory.Measure.singularPart_zero
 -/
 
+#print MeasureTheory.Measure.singularPart_smul /-
 theorem singularPart_smul (μ ν : Measure α) (r : ℝ≥0) :
     (r • μ).singularPart ν = r • μ.singularPart ν :=
   by
@@ -322,6 +329,7 @@ theorem singularPart_smul (μ ν : Measure α) (r : ℝ≥0) :
     rw [← inv_smul_smul₀ hr μ]
     exact @measure.have_lebesgue_decomposition_smul _ _ _ _ hl' _
 #align measure_theory.measure.singular_part_smul MeasureTheory.Measure.singularPart_smul
+-/
 
 #print MeasureTheory.Measure.singularPart_add /-
 theorem singularPart_add (μ₁ μ₂ ν : Measure α) [HaveLebesgueDecomposition μ₁ ν]
@@ -432,6 +440,7 @@ theorem rnDeriv_withDensity (ν : Measure α) [SigmaFinite ν] {f : α → ℝ
 #align measure_theory.measure.rn_deriv_with_density MeasureTheory.Measure.rnDeriv_withDensity
 -/
 
+#print MeasureTheory.Measure.rnDeriv_restrict /-
 /-- The Radon-Nikodym derivative of the restriction of a measure to a measurable set is the
 indicator function of this set. -/
 theorem rnDeriv_restrict (ν : Measure α) [SigmaFinite ν] {s : Set α} (hs : MeasurableSet s) :
@@ -440,9 +449,11 @@ theorem rnDeriv_restrict (ν : Measure α) [SigmaFinite ν] {s : Set α} (hs : M
   rw [← with_density_indicator_one hs]
   exact rn_deriv_with_density _ (measurable_one.indicator hs)
 #align measure_theory.measure.rn_deriv_restrict MeasureTheory.Measure.rnDeriv_restrict
+-/
 
 open VectorMeasure SignedMeasure
 
+#print MeasureTheory.Measure.exists_positive_of_not_mutuallySingular /-
 /-- If two finite measures `μ` and `ν` are not mutually singular, there exists some `ε > 0` and
 a measurable set `E`, such that `ν(E) > 0` and `E` is positive with respect to `μ - εν`.
 
@@ -516,6 +527,7 @@ theorem exists_positive_of_not_mutuallySingular (μ ν : Measure α) [IsFiniteMe
   -- thus, choosing `f n` as the set `E` suffices
   exact ⟨1 / (n + 1), by simp, f n, hf₁ n, hn, hf₂ n⟩
 #align measure_theory.measure.exists_positive_of_not_mutually_singular MeasureTheory.Measure.exists_positive_of_not_mutuallySingular
+-/
 
 namespace LebesgueDecomposition
 
@@ -529,10 +541,13 @@ def measurableLE (μ ν : Measure α) : Set (α → ℝ≥0∞) :=
 #align measure_theory.measure.lebesgue_decomposition.measurable_le MeasureTheory.Measure.LebesgueDecomposition.measurableLE
 -/
 
+#print MeasureTheory.Measure.LebesgueDecomposition.zero_mem_measurableLE /-
 theorem zero_mem_measurableLE : (0 : α → ℝ≥0∞) ∈ measurableLE μ ν :=
   ⟨measurable_zero, fun A hA => by simp⟩
 #align measure_theory.measure.lebesgue_decomposition.zero_mem_measurable_le MeasureTheory.Measure.LebesgueDecomposition.zero_mem_measurableLE
+-/
 
+#print MeasureTheory.Measure.LebesgueDecomposition.sup_mem_measurableLE /-
 theorem sup_mem_measurableLE {f g : α → ℝ≥0∞} (hf : f ∈ measurableLE μ ν)
     (hg : g ∈ measurableLE μ ν) : (fun a => f a ⊔ g a) ∈ measurableLE μ ν :=
   by
@@ -545,7 +560,9 @@ theorem sup_mem_measurableLE {f g : α → ℝ≥0∞} (hf : f ∈ measurableLE
   · simp only [← not_le, ← compl_set_of, ← diff_eq]
     exact measure_inter_add_diff _ (measurableSet_le hf.1 hg.1)
 #align measure_theory.measure.lebesgue_decomposition.sup_mem_measurable_le MeasureTheory.Measure.LebesgueDecomposition.sup_mem_measurableLE
+-/
 
+#print MeasureTheory.Measure.LebesgueDecomposition.iSup_succ_eq_sup /-
 theorem iSup_succ_eq_sup {α} (f : ℕ → α → ℝ≥0∞) (m : ℕ) (a : α) :
     (⨆ (k : ℕ) (hk : k ≤ m + 1), f k a) = f m.succ a ⊔ ⨆ (k : ℕ) (hk : k ≤ m), f k a :=
   by
@@ -566,7 +583,9 @@ theorem iSup_succ_eq_sup {α} (f : ℕ → α → ℝ≥0∞) (m : ℕ) (a : α)
       convert @le_iSup₂ _ _ (fun i => i ≤ m + 1) _ _ m.succ le_rfl
       rfl
 #align measure_theory.measure.lebesgue_decomposition.supr_succ_eq_sup MeasureTheory.Measure.LebesgueDecomposition.iSup_succ_eq_sup
+-/
 
+#print MeasureTheory.Measure.LebesgueDecomposition.iSup_mem_measurableLE /-
 theorem iSup_mem_measurableLE (f : ℕ → α → ℝ≥0∞) (hf : ∀ n, f n ∈ measurableLE μ ν) (n : ℕ) :
     (fun x => ⨆ (k) (hk : k ≤ n), f k x) ∈ measurableLE μ ν :=
   by
@@ -581,31 +600,38 @@ theorem iSup_mem_measurableLE (f : ℕ → α → ℝ≥0∞) (hf : ∀ n, f n 
     refine' ⟨measurable_iSup fun n => Measurable.iSup_Prop _ (hf n).1, fun A hA => _⟩
     rw [this]; exact (sup_mem_measurable_le (hf m.succ) hm).2 A hA
 #align measure_theory.measure.lebesgue_decomposition.supr_mem_measurable_le MeasureTheory.Measure.LebesgueDecomposition.iSup_mem_measurableLE
+-/
 
+#print MeasureTheory.Measure.LebesgueDecomposition.iSup_mem_measurableLE' /-
 theorem iSup_mem_measurableLE' (f : ℕ → α → ℝ≥0∞) (hf : ∀ n, f n ∈ measurableLE μ ν) (n : ℕ) :
     (⨆ (k) (hk : k ≤ n), f k) ∈ measurableLE μ ν :=
   by
   convert supr_mem_measurable_le f hf n
   ext; simp
 #align measure_theory.measure.lebesgue_decomposition.supr_mem_measurable_le' MeasureTheory.Measure.LebesgueDecomposition.iSup_mem_measurableLE'
+-/
 
 section SuprLemmas
 
+#print MeasureTheory.Measure.LebesgueDecomposition.iSup_monotone /-
 --TODO: these statements should be moved elsewhere
-omit m
-
 theorem iSup_monotone {α : Type _} (f : ℕ → α → ℝ≥0∞) :
     Monotone fun n x => ⨆ (k) (hk : k ≤ n), f k x := fun n m hnm x =>
   biSup_mono fun i => ge_trans hnm
 #align measure_theory.measure.lebesgue_decomposition.supr_monotone MeasureTheory.Measure.LebesgueDecomposition.iSup_monotone
+-/
 
+#print MeasureTheory.Measure.LebesgueDecomposition.iSup_monotone' /-
 theorem iSup_monotone' {α : Type _} (f : ℕ → α → ℝ≥0∞) (x : α) :
     Monotone fun n => ⨆ (k) (hk : k ≤ n), f k x := fun n m hnm => iSup_monotone f hnm x
 #align measure_theory.measure.lebesgue_decomposition.supr_monotone' MeasureTheory.Measure.LebesgueDecomposition.iSup_monotone'
+-/
 
+#print MeasureTheory.Measure.LebesgueDecomposition.iSup_le_le /-
 theorem iSup_le_le {α : Type _} (f : ℕ → α → ℝ≥0∞) (n k : ℕ) (hk : k ≤ n) :
     f k ≤ fun x => ⨆ (k) (hk : k ≤ n), f k x := fun x => le_iSup₂ k hk
 #align measure_theory.measure.lebesgue_decomposition.supr_le_le MeasureTheory.Measure.LebesgueDecomposition.iSup_le_le
+-/
 
 end SuprLemmas
 
@@ -909,6 +935,7 @@ instance haveLebesgueDecomposition_neg (s : SignedMeasure α) (μ : Measure α)
 #align measure_theory.signed_measure.have_lebesgue_decomposition_neg MeasureTheory.SignedMeasure.haveLebesgueDecomposition_neg
 -/
 
+#print MeasureTheory.SignedMeasure.haveLebesgueDecomposition_smul /-
 instance haveLebesgueDecomposition_smul (s : SignedMeasure α) (μ : Measure α)
     [s.HaveLebesgueDecomposition μ] (r : ℝ≥0) : (r • s).HaveLebesgueDecomposition μ
     where
@@ -919,6 +946,7 @@ instance haveLebesgueDecomposition_smul (s : SignedMeasure α) (μ : Measure α)
     rw [to_jordan_decomposition_smul, jordan_decomposition.smul_neg_part]
     infer_instance
 #align measure_theory.signed_measure.have_lebesgue_decomposition_smul MeasureTheory.SignedMeasure.haveLebesgueDecomposition_smul
+-/
 
 #print MeasureTheory.SignedMeasure.haveLebesgueDecomposition_smul_real /-
 instance haveLebesgueDecomposition_smul_real (s : SignedMeasure α) (μ : Measure α)
@@ -991,6 +1019,7 @@ theorem singularPart_totalVariation (s : SignedMeasure α) (μ : Measure α) :
 #align measure_theory.signed_measure.singular_part_total_variation MeasureTheory.SignedMeasure.singularPart_totalVariation
 -/
 
+#print MeasureTheory.SignedMeasure.mutuallySingular_singularPart /-
 theorem mutuallySingular_singularPart (s : SignedMeasure α) (μ : Measure α) :
     singularPart s μ ⟂ᵥ μ.toENNRealVectorMeasure :=
   by
@@ -999,6 +1028,7 @@ theorem mutuallySingular_singularPart (s : SignedMeasure α) (μ : Measure α) :
   rw [vector_measure.equiv_measure.right_inv μ]
   exact (mutually_singular_singular_part _ _).add_left (mutually_singular_singular_part _ _)
 #align measure_theory.signed_measure.mutually_singular_singular_part MeasureTheory.SignedMeasure.mutuallySingular_singularPart
+-/
 
 end
 
@@ -1070,6 +1100,7 @@ theorem singularPart_add_withDensity_rnDeriv_eq [s.HaveLebesgueDecomposition μ]
 
 variable {s μ}
 
+#print MeasureTheory.SignedMeasure.jordanDecomposition_add_withDensity_mutuallySingular /-
 theorem jordanDecomposition_add_withDensity_mutuallySingular {f : α → ℝ} (hf : Measurable f)
     (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) :
     (t.toJordanDecomposition.posPart + μ.withDensity fun x : α => ENNReal.ofReal (f x)) ⟂ₘ
@@ -1087,7 +1118,9 @@ theorem jordanDecomposition_add_withDensity_mutuallySingular {f : α → ℝ} (h
       ((htμ.2.symm.mono_ac (with_density_absolutely_continuous _ _) (refl _)).add_right
         (with_density_of_real_mutually_singular hf))
 #align measure_theory.signed_measure.jordan_decomposition_add_with_density_mutually_singular MeasureTheory.SignedMeasure.jordanDecomposition_add_withDensity_mutuallySingular
+-/
 
+#print MeasureTheory.SignedMeasure.toJordanDecomposition_eq_of_eq_add_withDensity /-
 theorem toJordanDecomposition_eq_of_eq_add_withDensity {f : α → ℝ} (hf : Measurable f)
     (hfi : Integrable f μ) (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
     s.toJordanDecomposition =
@@ -1114,6 +1147,7 @@ theorem toJordanDecomposition_eq_of_eq_add_withDensity {f : α → ℝ} (hf : Me
       vector_measure.sub_apply] <;>
     exact (measure_lt_top _ _).Ne
 #align measure_theory.signed_measure.to_jordan_decomposition_eq_of_eq_add_with_density MeasureTheory.SignedMeasure.toJordanDecomposition_eq_of_eq_add_withDensity
+-/
 
 private theorem have_lebesgue_decomposition_mk' (μ : Measure α) {f : α → ℝ} (hf : Measurable f)
     (hfi : Integrable f μ) (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
@@ -1133,6 +1167,7 @@ private theorem have_lebesgue_decomposition_mk' (μ : Measure α) {f : α → 
         refine' ⟨hf.neg.ennreal_of_real, htμ.2, _⟩
         rw [to_jordan_decomposition_eq_of_eq_add_with_density hf hfi htμ' hadd] }
 
+#print MeasureTheory.SignedMeasure.haveLebesgueDecomposition_mk /-
 theorem haveLebesgueDecomposition_mk (μ : Measure α) {f : α → ℝ} (hf : Measurable f)
     (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
     s.HaveLebesgueDecomposition μ :=
@@ -1143,6 +1178,7 @@ theorem haveLebesgueDecomposition_mk (μ : Measure α) {f : α → ℝ} (hf : Me
     refine' have_lebesgue_decomposition_mk' μ measurable_zero (integrable_zero _ _ μ) htμ _
     rwa [with_densityᵥ_zero, add_zero]
 #align measure_theory.signed_measure.have_lebesgue_decomposition_mk MeasureTheory.SignedMeasure.haveLebesgueDecomposition_mk
+-/
 
 private theorem eq_singular_part' (t : SignedMeasure α) {f : α → ℝ} (hf : Measurable f)
     (hfi : Integrable f μ) (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
@@ -1164,6 +1200,7 @@ private theorem eq_singular_part' (t : SignedMeasure α) {f : α → ℝ} (hf :
       refine' eq_singular_part hfneg htμ.2 _
       rw [to_jordan_decomposition_eq_of_eq_add_with_density hf hfi htμ' hadd]
 
+#print MeasureTheory.SignedMeasure.eq_singularPart /-
 /-- Given a measure `μ`, signed measures `s` and `t`, and a function `f` such that `t` is
 mutually singular with respect to `μ` and `s = t + μ.with_densityᵥ f`, we have
 `t = singular_part s μ`, i.e. `t` is the singular part of the Lebesgue decomposition between
@@ -1179,6 +1216,7 @@ theorem eq_singularPart (t : SignedMeasure α) (f : α → ℝ) (htμ : t ⟂ᵥ
     refine' eq_singular_part' t measurable_zero (integrable_zero _ _ μ) htμ _
     rwa [with_densityᵥ_zero, add_zero]
 #align measure_theory.signed_measure.eq_singular_part MeasureTheory.SignedMeasure.eq_singularPart
+-/
 
 #print MeasureTheory.SignedMeasure.singularPart_zero /-
 theorem singularPart_zero (μ : Measure α) : (0 : SignedMeasure α).singularPart μ = 0 :=
@@ -1270,6 +1308,7 @@ theorem singularPart_sub (s t : SignedMeasure α) (μ : Measure α) [s.HaveLebes
 #align measure_theory.signed_measure.singular_part_sub MeasureTheory.SignedMeasure.singularPart_sub
 -/
 
+#print MeasureTheory.SignedMeasure.eq_rnDeriv /-
 /-- Given a measure `μ`, signed measures `s` and `t`, and a function `f` such that `t` is
 mutually singular with respect to `μ` and `s = t + μ.with_densityᵥ f`, we have
 `f = rn_deriv s μ`, i.e. `f` is the Radon-Nikodym derivative of `s` and `μ`. -/
@@ -1286,7 +1325,9 @@ theorem eq_rnDeriv (t : SignedMeasure α) (f : α → ℝ) (hfi : Integrable f 
   rw [← add_right_inj t, ← hadd, eq_singular_part _ f htμ hadd,
     singular_part_add_with_density_rn_deriv_eq]
 #align measure_theory.signed_measure.eq_rn_deriv MeasureTheory.SignedMeasure.eq_rnDeriv
+-/
 
+#print MeasureTheory.SignedMeasure.rnDeriv_neg /-
 theorem rnDeriv_neg (s : SignedMeasure α) (μ : Measure α) [s.HaveLebesgueDecomposition μ] :
     (-s).rnDeriv μ =ᵐ[μ] -s.rnDeriv μ :=
   by
@@ -1296,7 +1337,9 @@ theorem rnDeriv_neg (s : SignedMeasure α) (μ : Measure α) [s.HaveLebesgueDeco
     singular_part_add_with_density_rn_deriv_eq, singular_part_neg, ← neg_add,
     singular_part_add_with_density_rn_deriv_eq]
 #align measure_theory.signed_measure.rn_deriv_neg MeasureTheory.SignedMeasure.rnDeriv_neg
+-/
 
+#print MeasureTheory.SignedMeasure.rnDeriv_smul /-
 theorem rnDeriv_smul (s : SignedMeasure α) (μ : Measure α) [s.HaveLebesgueDecomposition μ] (r : ℝ) :
     (r • s).rnDeriv μ =ᵐ[μ] r • s.rnDeriv μ :=
   by
@@ -1309,7 +1352,9 @@ theorem rnDeriv_smul (s : SignedMeasure α) (μ : Measure α) [s.HaveLebesgueDec
   change _ = _ + r • _
   rw [← smul_add, singular_part_add_with_density_rn_deriv_eq]
 #align measure_theory.signed_measure.rn_deriv_smul MeasureTheory.SignedMeasure.rnDeriv_smul
+-/
 
+#print MeasureTheory.SignedMeasure.rnDeriv_add /-
 theorem rnDeriv_add (s t : SignedMeasure α) (μ : Measure α) [s.HaveLebesgueDecomposition μ]
     [t.HaveLebesgueDecomposition μ] [(s + t).HaveLebesgueDecomposition μ] :
     (s + t).rnDeriv μ =ᵐ[μ] s.rnDeriv μ + t.rnDeriv μ :=
@@ -1323,7 +1368,9 @@ theorem rnDeriv_add (s t : SignedMeasure α) (μ : Measure α) [s.HaveLebesgueDe
     singular_part_add_with_density_rn_deriv_eq, ← add_assoc,
     singular_part_add_with_density_rn_deriv_eq]
 #align measure_theory.signed_measure.rn_deriv_add MeasureTheory.SignedMeasure.rnDeriv_add
+-/
 
+#print MeasureTheory.SignedMeasure.rnDeriv_sub /-
 theorem rnDeriv_sub (s t : SignedMeasure α) (μ : Measure α) [s.HaveLebesgueDecomposition μ]
     [t.HaveLebesgueDecomposition μ] [hst : (s - t).HaveLebesgueDecomposition μ] :
     (s - t).rnDeriv μ =ᵐ[μ] s.rnDeriv μ - t.rnDeriv μ :=
@@ -1332,6 +1379,7 @@ theorem rnDeriv_sub (s t : SignedMeasure α) (μ : Measure α) [s.HaveLebesgueDe
   rw [sub_eq_add_neg, sub_eq_add_neg]
   exact ae_eq_trans (rn_deriv_add _ _ _) (Filter.EventuallyEq.add (ae_eq_refl _) (rn_deriv_neg _ _))
 #align measure_theory.signed_measure.rn_deriv_sub MeasureTheory.SignedMeasure.rnDeriv_sub
+-/
 
 end SignedMeasure
 
@@ -1368,6 +1416,7 @@ def rnDeriv (c : ComplexMeasure α) (μ : Measure α) : α → ℂ := fun x =>
 
 variable {c : ComplexMeasure α}
 
+#print MeasureTheory.ComplexMeasure.integrable_rnDeriv /-
 theorem integrable_rnDeriv (c : ComplexMeasure α) (μ : Measure α) : Integrable (c.rnDeriv μ) μ :=
   by
   rw [← mem_ℒp_one_iff_integrable, ← mem_ℒp_re_im_iff]
@@ -1375,7 +1424,9 @@ theorem integrable_rnDeriv (c : ComplexMeasure α) (μ : Measure α) : Integrabl
     ⟨mem_ℒp_one_iff_integrable.2 (signed_measure.integrable_rn_deriv _ _),
       mem_ℒp_one_iff_integrable.2 (signed_measure.integrable_rn_deriv _ _)⟩
 #align measure_theory.complex_measure.integrable_rn_deriv MeasureTheory.ComplexMeasure.integrable_rnDeriv
+-/
 
+#print MeasureTheory.ComplexMeasure.singularPart_add_withDensity_rnDeriv_eq /-
 theorem singularPart_add_withDensity_rnDeriv_eq [c.HaveLebesgueDecomposition μ] :
     c.singularPart μ + μ.withDensityᵥ (c.rnDeriv μ) = c :=
   by
@@ -1396,6 +1447,7 @@ theorem singularPart_add_withDensity_rnDeriv_eq [c.HaveLebesgueDecomposition μ]
       rw [c.im.singular_part_add_with_density_rn_deriv_eq μ]
     · exact signed_measure.integrable_rn_deriv _ _
 #align measure_theory.complex_measure.singular_part_add_with_density_rn_deriv_eq MeasureTheory.ComplexMeasure.singularPart_add_withDensity_rnDeriv_eq
+-/
 
 end ComplexMeasure
 
Diff
@@ -206,12 +206,12 @@ instance [TopologicalSpace α] [IsLocallyFiniteMeasure μ] :
   isLocallyFiniteMeasure_of_le <| withDensity_rnDeriv_le μ ν
 
 theorem lintegral_rnDeriv_lt_top_of_measure_ne_top {μ : Measure α} (ν : Measure α) {s : Set α}
-    (hs : μ s ≠ ∞) : (∫⁻ x in s, μ.rnDeriv ν x ∂ν) < ∞ :=
+    (hs : μ s ≠ ∞) : ∫⁻ x in s, μ.rnDeriv ν x ∂ν < ∞ :=
   by
   by_cases hl : have_lebesgue_decomposition μ ν
   · haveI := hl
     obtain ⟨-, -, hadd⟩ := have_lebesgue_decomposition_spec μ ν
-    suffices : (∫⁻ x in to_measurable μ s, μ.rn_deriv ν x ∂ν) < ∞
+    suffices : ∫⁻ x in to_measurable μ s, μ.rn_deriv ν x ∂ν < ∞
     exact lt_of_le_of_lt (lintegral_mono_set (subset_to_measurable _ _)) this
     rw [← with_density_apply _ (measurable_set_to_measurable _ _)]
     refine'
@@ -228,7 +228,7 @@ theorem lintegral_rnDeriv_lt_top_of_measure_ne_top {μ : Measure α} (ν : Measu
 #align measure_theory.measure.lintegral_rn_deriv_lt_top_of_measure_ne_top MeasureTheory.Measure.lintegral_rnDeriv_lt_top_of_measure_ne_top
 
 theorem lintegral_rnDeriv_lt_top (μ ν : Measure α) [IsFiniteMeasure μ] :
-    (∫⁻ x, μ.rnDeriv ν x ∂ν) < ∞ := by
+    ∫⁻ x, μ.rnDeriv ν x ∂ν < ∞ := by
   rw [← set_lintegral_univ]
   exact lintegral_rn_deriv_lt_top_of_measure_ne_top _ (measure_lt_top _ _).Ne
 #align measure_theory.measure.lintegral_rn_deriv_lt_top MeasureTheory.Measure.lintegral_rnDeriv_lt_top
@@ -417,7 +417,7 @@ theorem eq_rnDeriv [SigmaFinite ν] {s : Measure α} {f : α → ℝ≥0∞} (hf
   refine' ae_eq_of_forall_set_lintegral_eq_of_sigma_finite hf (measurable_rn_deriv μ ν) _
   intro a ha h'a
   calc
-    (∫⁻ x : α in a, f x ∂ν) = ν.with_density f a := (with_density_apply f ha).symm
+    ∫⁻ x : α in a, f x ∂ν = ν.with_density f a := (with_density_apply f ha).symm
     _ = ν.with_density (μ.rn_deriv ν) a := by rw [eq_with_density_rn_deriv hf hs hadd]
     _ = ∫⁻ x : α in a, μ.rn_deriv ν x ∂ν := with_density_apply _ ha
 #align measure_theory.measure.eq_rn_deriv MeasureTheory.Measure.eq_rnDeriv
@@ -525,7 +525,7 @@ functions `f`, such that, for all measurable sets `A`, `∫⁻ x in A, f x ∂μ
 
 This is useful for the Lebesgue decomposition theorem. -/
 def measurableLE (μ ν : Measure α) : Set (α → ℝ≥0∞) :=
-  {f | Measurable f ∧ ∀ (A : Set α) (hA : MeasurableSet A), (∫⁻ x in A, f x ∂μ) ≤ ν A}
+  {f | Measurable f ∧ ∀ (A : Set α) (hA : MeasurableSet A), ∫⁻ x in A, f x ∂μ ≤ ν A}
 #align measure_theory.measure.lebesgue_decomposition.measurable_le MeasureTheory.Measure.LebesgueDecomposition.measurableLE
 -/
 
@@ -685,14 +685,14 @@ theorem haveLebesgueDecomposition_of_finiteMeasure [IsFiniteMeasure μ] [IsFinit
       -- positive with respect to `ν - εμ`
       obtain ⟨ε, hε₁, E, hE₁, hE₂, hE₃⟩ := exists_positive_of_not_mutually_singular μ₁ ν h
       simp_rw [hμ₁] at hE₃ 
-      have hξle : ∀ A, MeasurableSet A → (∫⁻ a in A, ξ a ∂ν) ≤ μ A :=
+      have hξle : ∀ A, MeasurableSet A → ∫⁻ a in A, ξ a ∂ν ≤ μ A :=
         by
         intro A hA; rw [hξ]
         simp_rw [iSup_apply]
         rw [lintegral_supr (fun n => (supr_mem_measurable_le _ hf₁ n).1) (supr_monotone _)]
         exact iSup_le fun n => (supr_mem_measurable_le _ hf₁ n).2 A hA
       -- since `E` is positive, we have `∫⁻ a in A ∩ E, ε + ξ a ∂ν ≤ μ (A ∩ E)` for all `A`
-      have hε₂ : ∀ A : Set α, MeasurableSet A → (∫⁻ a in A ∩ E, ε + ξ a ∂ν) ≤ μ (A ∩ E) :=
+      have hε₂ : ∀ A : Set α, MeasurableSet A → ∫⁻ a in A ∩ E, ε + ξ a ∂ν ≤ μ (A ∩ E) :=
         by
         intro A hA
         have := subset_le_of_restrict_le_restrict _ _ hE₁ hE₃ (inter_subset_right A E)
@@ -716,8 +716,8 @@ theorem haveLebesgueDecomposition_of_finiteMeasure [IsFiniteMeasure μ] [IsFinit
         by
         refine' ⟨Measurable.add hξm (Measurable.indicator measurable_const hE₁), fun A hA => _⟩
         have :
-          (∫⁻ a in A, (ξ + E.indicator fun _ => ε) a ∂ν) =
-            (∫⁻ a in A ∩ E, ε + ξ a ∂ν) + ∫⁻ a in A \ E, ξ a ∂ν :=
+          ∫⁻ a in A, (ξ + E.indicator fun _ => ε) a ∂ν =
+            ∫⁻ a in A ∩ E, ε + ξ a ∂ν + ∫⁻ a in A \ E, ξ a ∂ν :=
           by
           simp only [lintegral_add_left measurable_const, lintegral_add_left hξm,
             set_lintegral_const, add_assoc, lintegral_inter_add_diff _ _ hE₁, Pi.add_apply,
@@ -725,7 +725,7 @@ theorem haveLebesgueDecomposition_of_finiteMeasure [IsFiniteMeasure μ] [IsFinit
           rw [inter_comm, add_comm]
         rw [this, ← measure_inter_add_diff A hE₁]
         exact add_le_add (hε₂ A hA) (hξle (A \ E) (hA.diff hE₁))
-      have : (∫⁻ a, ξ a + E.indicator (fun _ => ε) a ∂ν) ≤ Sup (measurable_le_eval ν μ) :=
+      have : ∫⁻ a, ξ a + E.indicator (fun _ => ε) a ∂ν ≤ Sup (measurable_le_eval ν μ) :=
         le_sSup ⟨ξ + E.indicator fun _ => ε, hξε, rfl⟩
       -- but this contradicts the maximality of `∫⁻ x, ξ x ∂ν`
       refine' not_lt.2 this _
Diff
@@ -420,7 +420,6 @@ theorem eq_rnDeriv [SigmaFinite ν] {s : Measure α} {f : α → ℝ≥0∞} (hf
     (∫⁻ x : α in a, f x ∂ν) = ν.with_density f a := (with_density_apply f ha).symm
     _ = ν.with_density (μ.rn_deriv ν) a := by rw [eq_with_density_rn_deriv hf hs hadd]
     _ = ∫⁻ x : α in a, μ.rn_deriv ν x ∂ν := with_density_apply _ ha
-    
 #align measure_theory.measure.eq_rn_deriv MeasureTheory.Measure.eq_rnDeriv
 -/
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Kexing Ying
 
 ! This file was ported from Lean 3 source module measure_theory.decomposition.lebesgue
-! leanprover-community/mathlib commit b2ff9a3d7a15fd5b0f060b135421d6a89a999c2f
+! leanprover-community/mathlib commit 7e5137f579de09a059a5ce98f364a04e221aabf0
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -17,6 +17,9 @@ import Mathbin.MeasureTheory.Function.AeEqOfIntegral
 /-!
 # Lebesgue decomposition
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 This file proves the Lebesgue decomposition theorem. The Lebesgue decomposition theorem states that,
 given two σ-finite measures `μ` and `ν`, there exists a σ-finite measure `ξ` and a measurable
 function `f` such that `μ = ξ + fν` and `ξ` is mutually singular with respect to `ν`.
Diff
@@ -78,6 +78,7 @@ namespace MeasureTheory
 
 namespace Measure
 
+#print MeasureTheory.Measure.HaveLebesgueDecomposition /-
 /-- A pair of measures `μ` and `ν` is said to `have_lebesgue_decomposition` if there exists a
 measure `ξ` and a measurable function `f`, such that `ξ` is mutually singular with respect to
 `ν` and `μ = ξ + ν.with_density f`. -/
@@ -85,21 +86,27 @@ class HaveLebesgueDecomposition (μ ν : Measure α) : Prop where
   lebesgue_decomposition :
     ∃ p : Measure α × (α → ℝ≥0∞), Measurable p.2 ∧ p.1 ⟂ₘ ν ∧ μ = p.1 + ν.withDensity p.2
 #align measure_theory.measure.have_lebesgue_decomposition MeasureTheory.Measure.HaveLebesgueDecomposition
+-/
 
+#print MeasureTheory.Measure.singularPart /-
 /-- If a pair of measures `have_lebesgue_decomposition`, then `singular_part` chooses the
 measure from `have_lebesgue_decomposition`, otherwise it returns the zero measure. For sigma-finite
 measures, `μ = μ.singular_part ν + ν.with_density (μ.rn_deriv ν)`. -/
 irreducible_def singularPart (μ ν : Measure α) : Measure α :=
   if h : HaveLebesgueDecomposition μ ν then (Classical.choose h.lebesgue_decomposition).1 else 0
 #align measure_theory.measure.singular_part MeasureTheory.Measure.singularPart
+-/
 
+#print MeasureTheory.Measure.rnDeriv /-
 /-- If a pair of measures `have_lebesgue_decomposition`, then `rn_deriv` chooses the
 measurable function from `have_lebesgue_decomposition`, otherwise it returns the zero function.
 For sigma-finite measures, `μ = μ.singular_part ν + ν.with_density (μ.rn_deriv ν)`.-/
 irreducible_def rnDeriv (μ ν : Measure α) : α → ℝ≥0∞ :=
   if h : HaveLebesgueDecomposition μ ν then (Classical.choose h.lebesgue_decomposition).2 else 0
 #align measure_theory.measure.rn_deriv MeasureTheory.Measure.rnDeriv
+-/
 
+#print MeasureTheory.Measure.haveLebesgueDecomposition_spec /-
 theorem haveLebesgueDecomposition_spec (μ ν : Measure α) [h : HaveLebesgueDecomposition μ ν] :
     Measurable (μ.rnDeriv ν) ∧
       μ.singularPart ν ⟂ₘ ν ∧ μ = μ.singularPart ν + ν.withDensity (μ.rnDeriv ν) :=
@@ -107,11 +114,14 @@ theorem haveLebesgueDecomposition_spec (μ ν : Measure α) [h : HaveLebesgueDec
   rw [singular_part, rn_deriv, dif_pos h, dif_pos h]
   exact Classical.choose_spec h.lebesgue_decomposition
 #align measure_theory.measure.have_lebesgue_decomposition_spec MeasureTheory.Measure.haveLebesgueDecomposition_spec
+-/
 
+#print MeasureTheory.Measure.haveLebesgueDecomposition_add /-
 theorem haveLebesgueDecomposition_add (μ ν : Measure α) [HaveLebesgueDecomposition μ ν] :
     μ = μ.singularPart ν + ν.withDensity (μ.rnDeriv ν) :=
   (haveLebesgueDecomposition_spec μ ν).2.2
 #align measure_theory.measure.have_lebesgue_decomposition_add MeasureTheory.Measure.haveLebesgueDecomposition_add
+-/
 
 instance haveLebesgueDecomposition_smul (μ ν : Measure α) [HaveLebesgueDecomposition μ ν]
     (r : ℝ≥0) : (r • μ).HaveLebesgueDecomposition ν
@@ -127,6 +137,7 @@ instance haveLebesgueDecomposition_smul (μ ν : Measure α) [HaveLebesgueDecomp
       rfl
 #align measure_theory.measure.have_lebesgue_decomposition_smul MeasureTheory.Measure.haveLebesgueDecomposition_smul
 
+#print MeasureTheory.Measure.measurable_rnDeriv /-
 @[measurability]
 theorem measurable_rnDeriv (μ ν : Measure α) : Measurable <| μ.rnDeriv ν :=
   by
@@ -135,7 +146,9 @@ theorem measurable_rnDeriv (μ ν : Measure α) : Measurable <| μ.rnDeriv ν :=
   · rw [rn_deriv, dif_neg h]
     exact measurable_zero
 #align measure_theory.measure.measurable_rn_deriv MeasureTheory.Measure.measurable_rnDeriv
+-/
 
+#print MeasureTheory.Measure.mutuallySingular_singularPart /-
 theorem mutuallySingular_singularPart (μ ν : Measure α) : μ.singularPart ν ⟂ₘ ν :=
   by
   by_cases h : have_lebesgue_decomposition μ ν
@@ -143,7 +156,9 @@ theorem mutuallySingular_singularPart (μ ν : Measure α) : μ.singularPart ν
   · rw [singular_part, dif_neg h]
     exact mutually_singular.zero_left
 #align measure_theory.measure.mutually_singular_singular_part MeasureTheory.Measure.mutuallySingular_singularPart
+-/
 
+#print MeasureTheory.Measure.singularPart_le /-
 theorem singularPart_le (μ ν : Measure α) : μ.singularPart ν ≤ μ :=
   by
   by_cases hl : have_lebesgue_decomposition μ ν
@@ -153,7 +168,9 @@ theorem singularPart_le (μ ν : Measure α) : μ.singularPart ν ≤ μ :=
   · rw [singular_part, dif_neg hl]
     exact measure.zero_le μ
 #align measure_theory.measure.singular_part_le MeasureTheory.Measure.singularPart_le
+-/
 
+#print MeasureTheory.Measure.withDensity_rnDeriv_le /-
 theorem withDensity_rnDeriv_le (μ ν : Measure α) : ν.withDensity (μ.rnDeriv ν) ≤ μ :=
   by
   by_cases hl : have_lebesgue_decomposition μ ν
@@ -163,6 +180,7 @@ theorem withDensity_rnDeriv_le (μ ν : Measure α) : ν.withDensity (μ.rnDeriv
   · rw [rn_deriv, dif_neg hl, with_density_zero]
     exact measure.zero_le μ
 #align measure_theory.measure.with_density_rn_deriv_le MeasureTheory.Measure.withDensity_rnDeriv_le
+-/
 
 instance [IsFiniteMeasure μ] : IsFiniteMeasure (μ.singularPart ν) :=
   isFiniteMeasure_of_le μ <| singularPart_le μ ν
@@ -225,6 +243,7 @@ theorem rnDeriv_lt_top (μ ν : Measure α) [SigmaFinite μ] : ∀ᵐ x ∂ν, 
   exact (measure_spanning_sets_lt_top _ _).Ne
 #align measure_theory.measure.rn_deriv_lt_top MeasureTheory.Measure.rnDeriv_lt_top
 
+#print MeasureTheory.Measure.eq_singularPart /-
 /-- Given measures `μ` and `ν`, if `s` is a measure mutually singular to `ν` and `f` is a
 measurable function such that `μ = s + fν`, then `s = μ.singular_part μ`.
 
@@ -273,12 +292,15 @@ theorem eq_singularPart {s : Measure α} {f : α → ℝ≥0∞} (hf : Measurabl
     exact hT₂ ▸ measure_mono ((inter_subset_right _ _).trans (inter_subset_right _ _))
   rw [heq' A hA, HEq, restrict_apply hA, ← diff_eq, ae_disjoint.measure_diff_left hμinter]
 #align measure_theory.measure.eq_singular_part MeasureTheory.Measure.eq_singularPart
+-/
 
+#print MeasureTheory.Measure.singularPart_zero /-
 theorem singularPart_zero (ν : Measure α) : (0 : Measure α).singularPart ν = 0 :=
   by
   refine' (eq_singular_part measurable_zero mutually_singular.zero_left _).symm
   rw [zero_add, with_density_zero]
 #align measure_theory.measure.singular_part_zero MeasureTheory.Measure.singularPart_zero
+-/
 
 theorem singularPart_smul (μ ν : Measure α) (r : ℝ≥0) :
     (r • μ).singularPart ν = r • μ.singularPart ν :=
@@ -298,6 +320,7 @@ theorem singularPart_smul (μ ν : Measure α) (r : ℝ≥0) :
     exact @measure.have_lebesgue_decomposition_smul _ _ _ _ hl' _
 #align measure_theory.measure.singular_part_smul MeasureTheory.Measure.singularPart_smul
 
+#print MeasureTheory.Measure.singularPart_add /-
 theorem singularPart_add (μ₁ μ₂ ν : Measure α) [HaveLebesgueDecomposition μ₁ ν]
     [HaveLebesgueDecomposition μ₂ ν] :
     (μ₁ + μ₂).singularPart ν = μ₁.singularPart ν + μ₂.singularPart ν :=
@@ -312,13 +335,17 @@ theorem singularPart_add (μ₁ μ₂ ν : Measure α) [HaveLebesgueDecompositio
   rw [← have_lebesgue_decomposition_add μ₁ ν, add_assoc, add_comm (ν.with_density (μ₂.rn_deriv ν)),
     ← have_lebesgue_decomposition_add μ₂ ν]
 #align measure_theory.measure.singular_part_add MeasureTheory.Measure.singularPart_add
+-/
 
+#print MeasureTheory.Measure.singularPart_withDensity /-
 theorem singularPart_withDensity (ν : Measure α) {f : α → ℝ≥0∞} (hf : Measurable f) :
     (ν.withDensity f).singularPart ν = 0 :=
   haveI : ν.with_density f = 0 + ν.with_density f := by rw [zero_add]
   (eq_singular_part hf mutually_singular.zero_left this).symm
 #align measure_theory.measure.singular_part_with_density MeasureTheory.Measure.singularPart_withDensity
+-/
 
+#print MeasureTheory.Measure.eq_withDensity_rnDeriv /-
 /-- Given measures `μ` and `ν`, if `s` is a measure mutually singular to `ν` and `f` is a
 measurable function such that `μ = s + fν`, then `f = μ.rn_deriv ν`.
 
@@ -371,7 +398,9 @@ theorem eq_withDensity_rnDeriv {s : Measure α} {f : α → ℝ≥0∞} (hf : Me
   rw [heq' A hA, HEq, ← add_zero ((ν.with_density (μ.rn_deriv ν)).restrict (S ∩ T) A), ← hνrn,
     restrict_apply hA, ← diff_eq, measure_inter_add_diff _ (hS₁.inter hT₁)]
 #align measure_theory.measure.eq_with_density_rn_deriv MeasureTheory.Measure.eq_withDensity_rnDeriv
+-/
 
+#print MeasureTheory.Measure.eq_rnDeriv /-
 /-- Given measures `μ` and `ν`, if `s` is a measure mutually singular to `ν` and `f` is a
 measurable function such that `μ = s + fν`, then `f = μ.rn_deriv ν`.
 
@@ -390,13 +419,16 @@ theorem eq_rnDeriv [SigmaFinite ν] {s : Measure α} {f : α → ℝ≥0∞} (hf
     _ = ∫⁻ x : α in a, μ.rn_deriv ν x ∂ν := with_density_apply _ ha
     
 #align measure_theory.measure.eq_rn_deriv MeasureTheory.Measure.eq_rnDeriv
+-/
 
+#print MeasureTheory.Measure.rnDeriv_withDensity /-
 /-- The Radon-Nikodym derivative of `f ν` with respect to `ν` is `f`. -/
 theorem rnDeriv_withDensity (ν : Measure α) [SigmaFinite ν] {f : α → ℝ≥0∞} (hf : Measurable f) :
     (ν.withDensity f).rnDeriv ν =ᵐ[ν] f :=
   haveI : ν.with_density f = 0 + ν.with_density f := by rw [zero_add]
   (eq_rn_deriv hf mutually_singular.zero_left this).symm
 #align measure_theory.measure.rn_deriv_with_density MeasureTheory.Measure.rnDeriv_withDensity
+-/
 
 /-- The Radon-Nikodym derivative of the restriction of a measure to a measurable set is the
 indicator function of this set. -/
@@ -485,20 +517,22 @@ theorem exists_positive_of_not_mutuallySingular (μ ν : Measure α) [IsFiniteMe
 
 namespace LebesgueDecomposition
 
+#print MeasureTheory.Measure.LebesgueDecomposition.measurableLE /-
 /-- Given two measures `μ` and `ν`, `measurable_le μ ν` is the set of measurable
 functions `f`, such that, for all measurable sets `A`, `∫⁻ x in A, f x ∂μ ≤ ν A`.
 
 This is useful for the Lebesgue decomposition theorem. -/
-def measurableLe (μ ν : Measure α) : Set (α → ℝ≥0∞) :=
+def measurableLE (μ ν : Measure α) : Set (α → ℝ≥0∞) :=
   {f | Measurable f ∧ ∀ (A : Set α) (hA : MeasurableSet A), (∫⁻ x in A, f x ∂μ) ≤ ν A}
-#align measure_theory.measure.lebesgue_decomposition.measurable_le MeasureTheory.Measure.LebesgueDecomposition.measurableLe
+#align measure_theory.measure.lebesgue_decomposition.measurable_le MeasureTheory.Measure.LebesgueDecomposition.measurableLE
+-/
 
-theorem zero_mem_measurableLe : (0 : α → ℝ≥0∞) ∈ measurableLe μ ν :=
+theorem zero_mem_measurableLE : (0 : α → ℝ≥0∞) ∈ measurableLE μ ν :=
   ⟨measurable_zero, fun A hA => by simp⟩
-#align measure_theory.measure.lebesgue_decomposition.zero_mem_measurable_le MeasureTheory.Measure.LebesgueDecomposition.zero_mem_measurableLe
+#align measure_theory.measure.lebesgue_decomposition.zero_mem_measurable_le MeasureTheory.Measure.LebesgueDecomposition.zero_mem_measurableLE
 
-theorem sup_mem_measurableLe {f g : α → ℝ≥0∞} (hf : f ∈ measurableLe μ ν)
-    (hg : g ∈ measurableLe μ ν) : (fun a => f a ⊔ g a) ∈ measurableLe μ ν :=
+theorem sup_mem_measurableLE {f g : α → ℝ≥0∞} (hf : f ∈ measurableLE μ ν)
+    (hg : g ∈ measurableLE μ ν) : (fun a => f a ⊔ g a) ∈ measurableLE μ ν :=
   by
   simp_rw [ENNReal.sup_eq_max]
   refine' ⟨Measurable.max hf.1 hg.1, fun A hA => _⟩
@@ -508,7 +542,7 @@ theorem sup_mem_measurableLe {f g : α → ℝ≥0∞} (hf : f ∈ measurableLe
   refine' (add_le_add (hg.2 _ h₁) (hf.2 _ h₂)).trans_eq _
   · simp only [← not_le, ← compl_set_of, ← diff_eq]
     exact measure_inter_add_diff _ (measurableSet_le hf.1 hg.1)
-#align measure_theory.measure.lebesgue_decomposition.sup_mem_measurable_le MeasureTheory.Measure.LebesgueDecomposition.sup_mem_measurableLe
+#align measure_theory.measure.lebesgue_decomposition.sup_mem_measurable_le MeasureTheory.Measure.LebesgueDecomposition.sup_mem_measurableLE
 
 theorem iSup_succ_eq_sup {α} (f : ℕ → α → ℝ≥0∞) (m : ℕ) (a : α) :
     (⨆ (k : ℕ) (hk : k ≤ m + 1), f k a) = f m.succ a ⊔ ⨆ (k : ℕ) (hk : k ≤ m), f k a :=
@@ -531,8 +565,8 @@ theorem iSup_succ_eq_sup {α} (f : ℕ → α → ℝ≥0∞) (m : ℕ) (a : α)
       rfl
 #align measure_theory.measure.lebesgue_decomposition.supr_succ_eq_sup MeasureTheory.Measure.LebesgueDecomposition.iSup_succ_eq_sup
 
-theorem iSup_mem_measurableLe (f : ℕ → α → ℝ≥0∞) (hf : ∀ n, f n ∈ measurableLe μ ν) (n : ℕ) :
-    (fun x => ⨆ (k) (hk : k ≤ n), f k x) ∈ measurableLe μ ν :=
+theorem iSup_mem_measurableLE (f : ℕ → α → ℝ≥0∞) (hf : ∀ n, f n ∈ measurableLE μ ν) (n : ℕ) :
+    (fun x => ⨆ (k) (hk : k ≤ n), f k x) ∈ measurableLE μ ν :=
   by
   induction' n with m hm
   · refine' ⟨_, _⟩
@@ -544,14 +578,14 @@ theorem iSup_mem_measurableLe (f : ℕ → α → ℝ≥0∞) (hf : ∀ n, f n 
       funext fun _ => supr_succ_eq_sup _ _ _
     refine' ⟨measurable_iSup fun n => Measurable.iSup_Prop _ (hf n).1, fun A hA => _⟩
     rw [this]; exact (sup_mem_measurable_le (hf m.succ) hm).2 A hA
-#align measure_theory.measure.lebesgue_decomposition.supr_mem_measurable_le MeasureTheory.Measure.LebesgueDecomposition.iSup_mem_measurableLe
+#align measure_theory.measure.lebesgue_decomposition.supr_mem_measurable_le MeasureTheory.Measure.LebesgueDecomposition.iSup_mem_measurableLE
 
-theorem iSup_mem_measurable_le' (f : ℕ → α → ℝ≥0∞) (hf : ∀ n, f n ∈ measurableLe μ ν) (n : ℕ) :
-    (⨆ (k) (hk : k ≤ n), f k) ∈ measurableLe μ ν :=
+theorem iSup_mem_measurableLE' (f : ℕ → α → ℝ≥0∞) (hf : ∀ n, f n ∈ measurableLE μ ν) (n : ℕ) :
+    (⨆ (k) (hk : k ≤ n), f k) ∈ measurableLE μ ν :=
   by
   convert supr_mem_measurable_le f hf n
   ext; simp
-#align measure_theory.measure.lebesgue_decomposition.supr_mem_measurable_le' MeasureTheory.Measure.LebesgueDecomposition.iSup_mem_measurable_le'
+#align measure_theory.measure.lebesgue_decomposition.supr_mem_measurable_le' MeasureTheory.Measure.LebesgueDecomposition.iSup_mem_measurableLE'
 
 section SuprLemmas
 
@@ -573,10 +607,12 @@ theorem iSup_le_le {α : Type _} (f : ℕ → α → ℝ≥0∞) (n k : ℕ) (hk
 
 end SuprLemmas
 
+#print MeasureTheory.Measure.LebesgueDecomposition.measurableLEEval /-
 /-- `measurable_le_eval μ ν` is the set of `∫⁻ x, f x ∂μ` for all `f ∈ measurable_le μ ν`. -/
-def measurableLeEval (μ ν : Measure α) : Set ℝ≥0∞ :=
-  (fun f : α → ℝ≥0∞ => ∫⁻ x, f x ∂μ) '' measurableLe μ ν
-#align measure_theory.measure.lebesgue_decomposition.measurable_le_eval MeasureTheory.Measure.LebesgueDecomposition.measurableLeEval
+def measurableLEEval (μ ν : Measure α) : Set ℝ≥0∞ :=
+  (fun f : α → ℝ≥0∞ => ∫⁻ x, f x ∂μ) '' measurableLE μ ν
+#align measure_theory.measure.lebesgue_decomposition.measurable_le_eval MeasureTheory.Measure.LebesgueDecomposition.measurableLEEval
+-/
 
 end LebesgueDecomposition
 
@@ -584,13 +620,14 @@ open LebesgueDecomposition
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:107:6: warning: expanding binder group (n k) -/
 /- ./././Mathport/Syntax/Translate/Expr.lean:107:6: warning: expanding binder group (n k) -/
+#print MeasureTheory.Measure.haveLebesgueDecomposition_of_finiteMeasure /-
 /-- Any pair of finite measures `μ` and `ν`, `have_lebesgue_decomposition`. That is to say,
 there exist a measure `ξ` and a measurable function `f`, such that `ξ` is mutually singular
 with respect to `ν` and `μ = ξ + ν.with_density f`.
 
 This is not an instance since this is also shown for the more general σ-finite measures with
 `measure_theory.measure.have_lebesgue_decomposition_of_sigma_finite`. -/
-theorem haveLebesgueDecomposition_of_finite_measure [IsFiniteMeasure μ] [IsFiniteMeasure ν] :
+theorem haveLebesgueDecomposition_of_finiteMeasure [IsFiniteMeasure μ] [IsFiniteMeasure ν] :
     HaveLebesgueDecomposition μ ν :=
   ⟨by
     have h :=
@@ -698,7 +735,8 @@ theorem haveLebesgueDecomposition_of_finite_measure [IsFiniteMeasure μ] [IsFini
     · rw [hμ₁]; ext1 A hA
       rw [measure.coe_add, Pi.add_apply, measure.sub_apply hA hle, add_comm,
         add_tsub_cancel_of_le (hle A hA)]⟩
-#align measure_theory.measure.have_lebesgue_decomposition_of_finite_measure MeasureTheory.Measure.haveLebesgueDecomposition_of_finite_measure
+#align measure_theory.measure.have_lebesgue_decomposition_of_finite_measure MeasureTheory.Measure.haveLebesgueDecomposition_of_finiteMeasure
+-/
 
 attribute [local instance] have_lebesgue_decomposition_of_finite_measure
 
@@ -706,6 +744,7 @@ instance {S : μ.FiniteSpanningSetsIn {s : Set α | MeasurableSet s}} (n : ℕ)
     IsFiniteMeasure (μ.restrict <| S.Set n) :=
   ⟨by rw [restrict_apply MeasurableSet.univ, univ_inter]; exact S.finite _⟩
 
+#print MeasureTheory.Measure.haveLebesgueDecomposition_of_sigmaFinite /-
 -- see Note [lower instance priority]
 /-- **The Lebesgue decomposition theorem**: Any pair of σ-finite measures `μ` and `ν`
 `have_lebesgue_decomposition`. That is to say, there exist a measure `ξ` and a measurable function
@@ -813,6 +852,7 @@ instance (priority := 100) haveLebesgueDecomposition_of_sigmaFinite (μ ν : Mea
         · infer_instance
       · exact fun n => Measurable.indicator (measurable_rn_deriv _ _) (S.set_mem n)⟩
 #align measure_theory.measure.have_lebesgue_decomposition_of_sigma_finite MeasureTheory.Measure.haveLebesgueDecomposition_of_sigmaFinite
+-/
 
 end Measure
 
@@ -820,6 +860,7 @@ namespace SignedMeasure
 
 open Measure
 
+#print MeasureTheory.SignedMeasure.HaveLebesgueDecomposition /-
 /-- A signed measure `s` is said to `have_lebesgue_decomposition` with respect to a measure `μ`
 if the positive part and the negative part of `s` both `have_lebesgue_decomposition` with
 respect to `μ`. -/
@@ -827,18 +868,22 @@ class HaveLebesgueDecomposition (s : SignedMeasure α) (μ : Measure α) : Prop
   posPart : s.toJordanDecomposition.posPart.HaveLebesgueDecomposition μ
   negPart : s.toJordanDecomposition.negPart.HaveLebesgueDecomposition μ
 #align measure_theory.signed_measure.have_lebesgue_decomposition MeasureTheory.SignedMeasure.HaveLebesgueDecomposition
+-/
 
 attribute [instance] have_lebesgue_decomposition.pos_part
 
 attribute [instance] have_lebesgue_decomposition.neg_part
 
+#print MeasureTheory.SignedMeasure.not_haveLebesgueDecomposition_iff /-
 theorem not_haveLebesgueDecomposition_iff (s : SignedMeasure α) (μ : Measure α) :
     ¬s.HaveLebesgueDecomposition μ ↔
       ¬s.toJordanDecomposition.posPart.HaveLebesgueDecomposition μ ∨
         ¬s.toJordanDecomposition.negPart.HaveLebesgueDecomposition μ :=
   ⟨fun h => not_or_of_imp fun hp hn => h ⟨hp, hn⟩, fun h hl => (not_and_or.2 h) ⟨hl.1, hl.2⟩⟩
 #align measure_theory.signed_measure.not_have_lebesgue_decomposition_iff MeasureTheory.SignedMeasure.not_haveLebesgueDecomposition_iff
+-/
 
+#print MeasureTheory.SignedMeasure.haveLebesgueDecomposition_of_sigmaFinite /-
 -- `infer_instance` directly does not work
 -- see Note [lower instance priority]
 instance (priority := 100) haveLebesgueDecomposition_of_sigmaFinite (s : SignedMeasure α)
@@ -847,7 +892,9 @@ instance (priority := 100) haveLebesgueDecomposition_of_sigmaFinite (s : SignedM
   posPart := inferInstance
   negPart := inferInstance
 #align measure_theory.signed_measure.have_lebesgue_decomposition_of_sigma_finite MeasureTheory.SignedMeasure.haveLebesgueDecomposition_of_sigmaFinite
+-/
 
+#print MeasureTheory.SignedMeasure.haveLebesgueDecomposition_neg /-
 instance haveLebesgueDecomposition_neg (s : SignedMeasure α) (μ : Measure α)
     [s.HaveLebesgueDecomposition μ] : (-s).HaveLebesgueDecomposition μ
     where
@@ -858,6 +905,7 @@ instance haveLebesgueDecomposition_neg (s : SignedMeasure α) (μ : Measure α)
     rw [to_jordan_decomposition_neg, jordan_decomposition.neg_neg_part]
     infer_instance
 #align measure_theory.signed_measure.have_lebesgue_decomposition_neg MeasureTheory.SignedMeasure.haveLebesgueDecomposition_neg
+-/
 
 instance haveLebesgueDecomposition_smul (s : SignedMeasure α) (μ : Measure α)
     [s.HaveLebesgueDecomposition μ] (r : ℝ≥0) : (r • s).HaveLebesgueDecomposition μ
@@ -870,6 +918,7 @@ instance haveLebesgueDecomposition_smul (s : SignedMeasure α) (μ : Measure α)
     infer_instance
 #align measure_theory.signed_measure.have_lebesgue_decomposition_smul MeasureTheory.SignedMeasure.haveLebesgueDecomposition_smul
 
+#print MeasureTheory.SignedMeasure.haveLebesgueDecomposition_smul_real /-
 instance haveLebesgueDecomposition_smul_real (s : SignedMeasure α) (μ : Measure α)
     [s.HaveLebesgueDecomposition μ] (r : ℝ) : (r • s).HaveLebesgueDecomposition μ :=
   by
@@ -887,7 +936,9 @@ instance haveLebesgueDecomposition_smul_real (s : SignedMeasure α) (μ : Measur
           rw [to_jordan_decomposition_smul_real, jordan_decomposition.real_smul_neg_part_neg _ _ hr]
           infer_instance }
 #align measure_theory.signed_measure.have_lebesgue_decomposition_smul_real MeasureTheory.SignedMeasure.haveLebesgueDecomposition_smul_real
+-/
 
+#print MeasureTheory.SignedMeasure.singularPart /-
 /-- Given a signed measure `s` and a measure `μ`, `s.singular_part μ` is the signed measure
 such that `s.singular_part μ + μ.with_densityᵥ (s.rn_deriv μ) = s` and
 `s.singular_part μ` is mutually singular with respect to `μ`. -/
@@ -895,9 +946,11 @@ def singularPart (s : SignedMeasure α) (μ : Measure α) : SignedMeasure α :=
   (s.toJordanDecomposition.posPart.singularPart μ).toSignedMeasure -
     (s.toJordanDecomposition.negPart.singularPart μ).toSignedMeasure
 #align measure_theory.signed_measure.singular_part MeasureTheory.SignedMeasure.singularPart
+-/
 
 section
 
+#print MeasureTheory.SignedMeasure.singularPart_mutuallySingular /-
 theorem singularPart_mutuallySingular (s : SignedMeasure α) (μ : Measure α) :
     s.toJordanDecomposition.posPart.singularPart μ ⟂ₘ
       s.toJordanDecomposition.negPart.singularPart μ :=
@@ -916,7 +969,9 @@ theorem singularPart_mutuallySingular (s : SignedMeasure α) (μ : Measure α) :
     · rw [measure.singular_part, measure.singular_part, dif_neg hn]
       exact mutually_singular.zero_right
 #align measure_theory.signed_measure.singular_part_mutually_singular MeasureTheory.SignedMeasure.singularPart_mutuallySingular
+-/
 
+#print MeasureTheory.SignedMeasure.singularPart_totalVariation /-
 theorem singularPart_totalVariation (s : SignedMeasure α) (μ : Measure α) :
     (s.singularPart μ).totalVariation =
       s.toJordanDecomposition.posPart.singularPart μ +
@@ -932,6 +987,7 @@ theorem singularPart_totalVariation (s : SignedMeasure α) (μ : Measure α) :
     rfl
   · rw [total_variation, this]
 #align measure_theory.signed_measure.singular_part_total_variation MeasureTheory.SignedMeasure.singularPart_totalVariation
+-/
 
 theorem mutuallySingular_singularPart (s : SignedMeasure α) (μ : Measure α) :
     singularPart s μ ⟂ᵥ μ.toENNRealVectorMeasure :=
@@ -944,6 +1000,7 @@ theorem mutuallySingular_singularPart (s : SignedMeasure α) (μ : Measure α) :
 
 end
 
+#print MeasureTheory.SignedMeasure.rnDeriv /-
 /-- The Radon-Nikodym derivative between a signed measure and a positive measure.
 
 `rn_deriv s μ` satisfies `μ.with_densityᵥ (s.rn_deriv μ) = s`
@@ -954,31 +1011,37 @@ def rnDeriv (s : SignedMeasure α) (μ : Measure α) : α → ℝ := fun x =>
   (s.toJordanDecomposition.posPart.rnDeriv μ x).toReal -
     (s.toJordanDecomposition.negPart.rnDeriv μ x).toReal
 #align measure_theory.signed_measure.rn_deriv MeasureTheory.SignedMeasure.rnDeriv
+-/
 
 variable {s t : SignedMeasure α}
 
+#print MeasureTheory.SignedMeasure.measurable_rnDeriv /-
 @[measurability]
 theorem measurable_rnDeriv (s : SignedMeasure α) (μ : Measure α) : Measurable (rnDeriv s μ) :=
   by
   rw [rn_deriv]
   measurability
 #align measure_theory.signed_measure.measurable_rn_deriv MeasureTheory.SignedMeasure.measurable_rnDeriv
+-/
 
+#print MeasureTheory.SignedMeasure.integrable_rnDeriv /-
 theorem integrable_rnDeriv (s : SignedMeasure α) (μ : Measure α) : Integrable (rnDeriv s μ) μ := by
   refine' integrable.sub _ _ <;>
     · constructor
       · apply Measurable.aestronglyMeasurable; measurability
       exact has_finite_integral_to_real_of_lintegral_ne_top (lintegral_rn_deriv_lt_top _ μ).Ne
 #align measure_theory.signed_measure.integrable_rn_deriv MeasureTheory.SignedMeasure.integrable_rnDeriv
+-/
 
 variable (s μ)
 
+#print MeasureTheory.SignedMeasure.singularPart_add_withDensity_rnDeriv_eq /-
 /-- **The Lebesgue Decomposition theorem between a signed measure and a measure**:
 Given a signed measure `s` and a σ-finite measure `μ`, there exist a signed measure `t` and a
 measurable and integrable function `f`, such that `t` is mutually singular with respect to `μ`
 and `s = t + μ.with_densityᵥ f`. In this case `t = s.singular_part μ` and
 `f = s.rn_deriv μ`. -/
-theorem singularPart_add_with_density_rnDeriv_eq [s.HaveLebesgueDecomposition μ] :
+theorem singularPart_add_withDensity_rnDeriv_eq [s.HaveLebesgueDecomposition μ] :
     s.singularPart μ + μ.withDensityᵥ (s.rnDeriv μ) = s :=
   by
   conv_rhs =>
@@ -1000,11 +1063,12 @@ theorem singularPart_add_with_density_rnDeriv_eq [s.HaveLebesgueDecomposition μ
     first
     | exact (lintegral_rn_deriv_lt_top _ _).Ne
     | measurability
-#align measure_theory.signed_measure.singular_part_add_with_density_rn_deriv_eq MeasureTheory.SignedMeasure.singularPart_add_with_density_rnDeriv_eq
+#align measure_theory.signed_measure.singular_part_add_with_density_rn_deriv_eq MeasureTheory.SignedMeasure.singularPart_add_withDensity_rnDeriv_eq
+-/
 
 variable {s μ}
 
-theorem jordan_decomposition_add_withDensity_mutuallySingular {f : α → ℝ} (hf : Measurable f)
+theorem jordanDecomposition_add_withDensity_mutuallySingular {f : α → ℝ} (hf : Measurable f)
     (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) :
     (t.toJordanDecomposition.posPart + μ.withDensity fun x : α => ENNReal.ofReal (f x)) ⟂ₘ
       t.toJordanDecomposition.negPart + μ.withDensity fun x : α => ENNReal.ofReal (-f x) :=
@@ -1020,7 +1084,7 @@ theorem jordan_decomposition_add_withDensity_mutuallySingular {f : α → ℝ} (
           (htμ.1.mono_ac (refl _) (with_density_absolutely_continuous _ _))).add_left
       ((htμ.2.symm.mono_ac (with_density_absolutely_continuous _ _) (refl _)).add_right
         (with_density_of_real_mutually_singular hf))
-#align measure_theory.signed_measure.jordan_decomposition_add_with_density_mutually_singular MeasureTheory.SignedMeasure.jordan_decomposition_add_withDensity_mutuallySingular
+#align measure_theory.signed_measure.jordan_decomposition_add_with_density_mutually_singular MeasureTheory.SignedMeasure.jordanDecomposition_add_withDensity_mutuallySingular
 
 theorem toJordanDecomposition_eq_of_eq_add_withDensity {f : α → ℝ} (hf : Measurable f)
     (hfi : Integrable f μ) (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
@@ -1030,7 +1094,7 @@ theorem toJordanDecomposition_eq_of_eq_add_withDensity {f : α → ℝ} (hf : Me
         (t.toJordanDecomposition.negPart + μ.withDensity fun x => ENNReal.ofReal (-f x))
         (by haveI := is_finite_measure_with_density_of_real hfi.2; infer_instance)
         (by haveI := is_finite_measure_with_density_of_real hfi.neg.2; infer_instance)
-        (jordan_decomposition_add_withDensity_mutuallySingular hf htμ) :=
+        (jordanDecomposition_add_withDensity_mutuallySingular hf htμ) :=
   by
   haveI := is_finite_measure_with_density_of_real hfi.2
   haveI := is_finite_measure_with_density_of_real hfi.neg.2
@@ -1114,12 +1178,15 @@ theorem eq_singularPart (t : SignedMeasure α) (f : α → ℝ) (htμ : t ⟂ᵥ
     rwa [with_densityᵥ_zero, add_zero]
 #align measure_theory.signed_measure.eq_singular_part MeasureTheory.SignedMeasure.eq_singularPart
 
+#print MeasureTheory.SignedMeasure.singularPart_zero /-
 theorem singularPart_zero (μ : Measure α) : (0 : SignedMeasure α).singularPart μ = 0 :=
   by
   refine' (eq_singular_part 0 0 vector_measure.mutually_singular.zero_left _).symm
   rw [zero_add, with_densityᵥ_zero]
 #align measure_theory.signed_measure.singular_part_zero MeasureTheory.SignedMeasure.singularPart_zero
+-/
 
+#print MeasureTheory.SignedMeasure.singularPart_neg /-
 theorem singularPart_neg (s : SignedMeasure α) (μ : Measure α) :
     (-s).singularPart μ = -s.singularPart μ :=
   by
@@ -1137,8 +1204,10 @@ theorem singularPart_neg (s : SignedMeasure α) (μ : Measure α) :
     rw [to_jordan_decomposition_neg, jordan_decomposition.neg_neg_part]
   rw [singular_part, singular_part, neg_sub, h₁, h₂]
 #align measure_theory.signed_measure.singular_part_neg MeasureTheory.SignedMeasure.singularPart_neg
+-/
 
-theorem singularPart_smul_nNReal (s : SignedMeasure α) (μ : Measure α) (r : ℝ≥0) :
+#print MeasureTheory.SignedMeasure.singularPart_smul_nnreal /-
+theorem singularPart_smul_nnreal (s : SignedMeasure α) (μ : Measure α) (r : ℝ≥0) :
     (r • s).singularPart μ = r • s.singularPart μ :=
   by
   rw [singular_part, singular_part, smul_sub, ← to_signed_measure_smul, ← to_signed_measure_smul]
@@ -1149,8 +1218,10 @@ theorem singularPart_smul_nNReal (s : SignedMeasure α) (μ : Measure α) (r : 
     skip
     congr
     rw [to_jordan_decomposition_smul, jordan_decomposition.smul_neg_part, singular_part_smul]
-#align measure_theory.signed_measure.singular_part_smul_nnreal MeasureTheory.SignedMeasure.singularPart_smul_nNReal
+#align measure_theory.signed_measure.singular_part_smul_nnreal MeasureTheory.SignedMeasure.singularPart_smul_nnreal
+-/
 
+#print MeasureTheory.SignedMeasure.singularPart_smul /-
 theorem singularPart_smul (s : SignedMeasure α) (μ : Measure α) (r : ℝ) :
     (r • s).singularPart μ = r • s.singularPart μ :=
   by
@@ -1171,7 +1242,9 @@ theorem singularPart_smul (s : SignedMeasure α) (μ : Measure α) (r : ℝ) :
     change -(((-r).toNNReal : ℝ) • _) = _
     rw [← neg_smul, Real.coe_toNNReal _ (le_of_lt (neg_pos.mpr (not_le.1 hr))), neg_neg]
 #align measure_theory.signed_measure.singular_part_smul MeasureTheory.SignedMeasure.singularPart_smul
+-/
 
+#print MeasureTheory.SignedMeasure.singularPart_add /-
 theorem singularPart_add (s t : SignedMeasure α) (μ : Measure α) [s.HaveLebesgueDecomposition μ]
     [t.HaveLebesgueDecomposition μ] :
     (s + t).singularPart μ = s.singularPart μ + t.singularPart μ :=
@@ -1185,12 +1258,15 @@ theorem singularPart_add (s t : SignedMeasure α) (μ : Measure α) [s.HaveLebes
     singular_part_add_with_density_rn_deriv_eq, ← add_assoc,
     singular_part_add_with_density_rn_deriv_eq]
 #align measure_theory.signed_measure.singular_part_add MeasureTheory.SignedMeasure.singularPart_add
+-/
 
+#print MeasureTheory.SignedMeasure.singularPart_sub /-
 theorem singularPart_sub (s t : SignedMeasure α) (μ : Measure α) [s.HaveLebesgueDecomposition μ]
     [t.HaveLebesgueDecomposition μ] :
     (s - t).singularPart μ = s.singularPart μ - t.singularPart μ := by
   rw [sub_eq_add_neg, sub_eq_add_neg, singular_part_add, singular_part_neg]
 #align measure_theory.signed_measure.singular_part_sub MeasureTheory.SignedMeasure.singularPart_sub
+-/
 
 /-- Given a measure `μ`, signed measures `s` and `t`, and a function `f` such that `t` is
 mutually singular with respect to `μ` and `s = t + μ.with_densityᵥ f`, we have
@@ -1259,28 +1335,34 @@ end SignedMeasure
 
 namespace ComplexMeasure
 
+#print MeasureTheory.ComplexMeasure.HaveLebesgueDecomposition /-
 /-- A complex measure is said to `have_lebesgue_decomposition` with respect to a positive measure
 if both its real and imaginary part `have_lebesgue_decomposition` with respect to that measure. -/
 class HaveLebesgueDecomposition (c : ComplexMeasure α) (μ : Measure α) : Prop where
-  re_part : c.re.HaveLebesgueDecomposition μ
-  im_part : c.im.HaveLebesgueDecomposition μ
+  rePart : c.re.HaveLebesgueDecomposition μ
+  imPart : c.im.HaveLebesgueDecomposition μ
 #align measure_theory.complex_measure.have_lebesgue_decomposition MeasureTheory.ComplexMeasure.HaveLebesgueDecomposition
+-/
 
 attribute [instance] have_lebesgue_decomposition.re_part
 
 attribute [instance] have_lebesgue_decomposition.im_part
 
+#print MeasureTheory.ComplexMeasure.singularPart /-
 /-- The singular part between a complex measure `c` and a positive measure `μ` is the complex
 measure satisfying `c.singular_part μ + μ.with_densityᵥ (c.rn_deriv μ) = c`. This property is given
 by `measure_theory.complex_measure.singular_part_add_with_density_rn_deriv_eq`. -/
 def singularPart (c : ComplexMeasure α) (μ : Measure α) : ComplexMeasure α :=
   (c.re.singularPart μ).toComplexMeasure (c.im.singularPart μ)
 #align measure_theory.complex_measure.singular_part MeasureTheory.ComplexMeasure.singularPart
+-/
 
+#print MeasureTheory.ComplexMeasure.rnDeriv /-
 /-- The Radon-Nikodym derivative between a complex measure and a positive measure. -/
 def rnDeriv (c : ComplexMeasure α) (μ : Measure α) : α → ℂ := fun x =>
   ⟨c.re.rnDeriv μ x, c.im.rnDeriv μ x⟩
 #align measure_theory.complex_measure.rn_deriv MeasureTheory.ComplexMeasure.rnDeriv
+-/
 
 variable {c : ComplexMeasure α}
 
@@ -1292,7 +1374,7 @@ theorem integrable_rnDeriv (c : ComplexMeasure α) (μ : Measure α) : Integrabl
       mem_ℒp_one_iff_integrable.2 (signed_measure.integrable_rn_deriv _ _)⟩
 #align measure_theory.complex_measure.integrable_rn_deriv MeasureTheory.ComplexMeasure.integrable_rnDeriv
 
-theorem singularPart_add_with_density_rnDeriv_eq [c.HaveLebesgueDecomposition μ] :
+theorem singularPart_add_withDensity_rnDeriv_eq [c.HaveLebesgueDecomposition μ] :
     c.singularPart μ + μ.withDensityᵥ (c.rnDeriv μ) = c :=
   by
   conv_rhs => rw [← c.to_complex_measure_to_signed_measure]
@@ -1311,7 +1393,7 @@ theorem singularPart_add_with_density_rnDeriv_eq [c.HaveLebesgueDecomposition μ
     · change (c.im.singular_part μ + μ.with_densityᵥ (c.im.rn_deriv μ)) i = _
       rw [c.im.singular_part_add_with_density_rn_deriv_eq μ]
     · exact signed_measure.integrable_rn_deriv _ _
-#align measure_theory.complex_measure.singular_part_add_with_density_rn_deriv_eq MeasureTheory.ComplexMeasure.singularPart_add_with_density_rnDeriv_eq
+#align measure_theory.complex_measure.singular_part_add_with_density_rn_deriv_eq MeasureTheory.ComplexMeasure.singularPart_add_withDensity_rnDeriv_eq
 
 end ComplexMeasure
 
Diff
@@ -934,7 +934,7 @@ theorem singularPart_totalVariation (s : SignedMeasure α) (μ : Measure α) :
 #align measure_theory.signed_measure.singular_part_total_variation MeasureTheory.SignedMeasure.singularPart_totalVariation
 
 theorem mutuallySingular_singularPart (s : SignedMeasure α) (μ : Measure α) :
-    singularPart s μ ⟂ᵥ μ.toEnnrealVectorMeasure :=
+    singularPart s μ ⟂ᵥ μ.toENNRealVectorMeasure :=
   by
   rw [mutually_singular_ennreal_iff, singular_part_total_variation]
   change _ ⟂ₘ vector_measure.equiv_measure.to_fun (vector_measure.equiv_measure.inv_fun μ)
@@ -1005,7 +1005,7 @@ theorem singularPart_add_with_density_rnDeriv_eq [s.HaveLebesgueDecomposition μ
 variable {s μ}
 
 theorem jordan_decomposition_add_withDensity_mutuallySingular {f : α → ℝ} (hf : Measurable f)
-    (htμ : t ⟂ᵥ μ.toEnnrealVectorMeasure) :
+    (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) :
     (t.toJordanDecomposition.posPart + μ.withDensity fun x : α => ENNReal.ofReal (f x)) ⟂ₘ
       t.toJordanDecomposition.negPart + μ.withDensity fun x : α => ENNReal.ofReal (-f x) :=
   by
@@ -1023,7 +1023,7 @@ theorem jordan_decomposition_add_withDensity_mutuallySingular {f : α → ℝ} (
 #align measure_theory.signed_measure.jordan_decomposition_add_with_density_mutually_singular MeasureTheory.SignedMeasure.jordan_decomposition_add_withDensity_mutuallySingular
 
 theorem toJordanDecomposition_eq_of_eq_add_withDensity {f : α → ℝ} (hf : Measurable f)
-    (hfi : Integrable f μ) (htμ : t ⟂ᵥ μ.toEnnrealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
+    (hfi : Integrable f μ) (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
     s.toJordanDecomposition =
       @JordanDecomposition.mk α _
         (t.toJordanDecomposition.posPart + μ.withDensity fun x => ENNReal.ofReal (f x))
@@ -1050,7 +1050,7 @@ theorem toJordanDecomposition_eq_of_eq_add_withDensity {f : α → ℝ} (hf : Me
 #align measure_theory.signed_measure.to_jordan_decomposition_eq_of_eq_add_with_density MeasureTheory.SignedMeasure.toJordanDecomposition_eq_of_eq_add_withDensity
 
 private theorem have_lebesgue_decomposition_mk' (μ : Measure α) {f : α → ℝ} (hf : Measurable f)
-    (hfi : Integrable f μ) (htμ : t ⟂ᵥ μ.toEnnrealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
+    (hfi : Integrable f μ) (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
     s.HaveLebesgueDecomposition μ := by
   have htμ' := htμ
   rw [mutually_singular_ennreal_iff] at htμ 
@@ -1068,7 +1068,7 @@ private theorem have_lebesgue_decomposition_mk' (μ : Measure α) {f : α → 
         rw [to_jordan_decomposition_eq_of_eq_add_with_density hf hfi htμ' hadd] }
 
 theorem haveLebesgueDecomposition_mk (μ : Measure α) {f : α → ℝ} (hf : Measurable f)
-    (htμ : t ⟂ᵥ μ.toEnnrealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
+    (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
     s.HaveLebesgueDecomposition μ :=
   by
   by_cases hfi : integrable f μ
@@ -1079,7 +1079,7 @@ theorem haveLebesgueDecomposition_mk (μ : Measure α) {f : α → ℝ} (hf : Me
 #align measure_theory.signed_measure.have_lebesgue_decomposition_mk MeasureTheory.SignedMeasure.haveLebesgueDecomposition_mk
 
 private theorem eq_singular_part' (t : SignedMeasure α) {f : α → ℝ} (hf : Measurable f)
-    (hfi : Integrable f μ) (htμ : t ⟂ᵥ μ.toEnnrealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
+    (hfi : Integrable f μ) (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
     t = s.singularPart μ := by
   have htμ' := htμ
   rw [mutually_singular_ennreal_iff, total_variation_mutually_singular_iff] at htμ 
@@ -1102,7 +1102,7 @@ private theorem eq_singular_part' (t : SignedMeasure α) {f : α → ℝ} (hf :
 mutually singular with respect to `μ` and `s = t + μ.with_densityᵥ f`, we have
 `t = singular_part s μ`, i.e. `t` is the singular part of the Lebesgue decomposition between
 `s` and `μ`. -/
-theorem eq_singularPart (t : SignedMeasure α) (f : α → ℝ) (htμ : t ⟂ᵥ μ.toEnnrealVectorMeasure)
+theorem eq_singularPart (t : SignedMeasure α) (f : α → ℝ) (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure)
     (hadd : s = t + μ.withDensityᵥ f) : t = s.singularPart μ :=
   by
   by_cases hfi : integrable f μ
@@ -1196,7 +1196,7 @@ theorem singularPart_sub (s t : SignedMeasure α) (μ : Measure α) [s.HaveLebes
 mutually singular with respect to `μ` and `s = t + μ.with_densityᵥ f`, we have
 `f = rn_deriv s μ`, i.e. `f` is the Radon-Nikodym derivative of `s` and `μ`. -/
 theorem eq_rnDeriv (t : SignedMeasure α) (f : α → ℝ) (hfi : Integrable f μ)
-    (htμ : t ⟂ᵥ μ.toEnnrealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) : f =ᵐ[μ] s.rnDeriv μ :=
+    (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) : f =ᵐ[μ] s.rnDeriv μ :=
   by
   set f' := hfi.1.mk f
   have hadd' : s = t + μ.with_densityᵥ f' :=
Diff
@@ -164,24 +164,25 @@ theorem withDensity_rnDeriv_le (μ ν : Measure α) : ν.withDensity (μ.rnDeriv
     exact measure.zero_le μ
 #align measure_theory.measure.with_density_rn_deriv_le MeasureTheory.Measure.withDensity_rnDeriv_le
 
-instance [FiniteMeasure μ] : FiniteMeasure (μ.singularPart ν) :=
-  finiteMeasureOfLe μ <| singularPart_le μ ν
+instance [IsFiniteMeasure μ] : IsFiniteMeasure (μ.singularPart ν) :=
+  isFiniteMeasure_of_le μ <| singularPart_le μ ν
 
 instance [SigmaFinite μ] : SigmaFinite (μ.singularPart ν) :=
   sigmaFinite_of_le μ <| singularPart_le μ ν
 
-instance [TopologicalSpace α] [LocallyFiniteMeasure μ] : LocallyFiniteMeasure (μ.singularPart ν) :=
-  locallyFiniteMeasure_of_le <| singularPart_le μ ν
+instance [TopologicalSpace α] [IsLocallyFiniteMeasure μ] :
+    IsLocallyFiniteMeasure (μ.singularPart ν) :=
+  isLocallyFiniteMeasure_of_le <| singularPart_le μ ν
 
-instance [FiniteMeasure μ] : FiniteMeasure (ν.withDensity <| μ.rnDeriv ν) :=
-  finiteMeasureOfLe μ <| withDensity_rnDeriv_le μ ν
+instance [IsFiniteMeasure μ] : IsFiniteMeasure (ν.withDensity <| μ.rnDeriv ν) :=
+  isFiniteMeasure_of_le μ <| withDensity_rnDeriv_le μ ν
 
 instance [SigmaFinite μ] : SigmaFinite (ν.withDensity <| μ.rnDeriv ν) :=
   sigmaFinite_of_le μ <| withDensity_rnDeriv_le μ ν
 
-instance [TopologicalSpace α] [LocallyFiniteMeasure μ] :
-    LocallyFiniteMeasure (ν.withDensity <| μ.rnDeriv ν) :=
-  locallyFiniteMeasure_of_le <| withDensity_rnDeriv_le μ ν
+instance [TopologicalSpace α] [IsLocallyFiniteMeasure μ] :
+    IsLocallyFiniteMeasure (ν.withDensity <| μ.rnDeriv ν) :=
+  isLocallyFiniteMeasure_of_le <| withDensity_rnDeriv_le μ ν
 
 theorem lintegral_rnDeriv_lt_top_of_measure_ne_top {μ : Measure α} (ν : Measure α) {s : Set α}
     (hs : μ s ≠ ∞) : (∫⁻ x in s, μ.rnDeriv ν x ∂ν) < ∞ :=
@@ -205,7 +206,7 @@ theorem lintegral_rnDeriv_lt_top_of_measure_ne_top {μ : Measure α} (ν : Measu
     exact WithTop.zero_lt_top
 #align measure_theory.measure.lintegral_rn_deriv_lt_top_of_measure_ne_top MeasureTheory.Measure.lintegral_rnDeriv_lt_top_of_measure_ne_top
 
-theorem lintegral_rnDeriv_lt_top (μ ν : Measure α) [FiniteMeasure μ] :
+theorem lintegral_rnDeriv_lt_top (μ ν : Measure α) [IsFiniteMeasure μ] :
     (∫⁻ x, μ.rnDeriv ν x ∂ν) < ∞ := by
   rw [← set_lintegral_univ]
   exact lintegral_rn_deriv_lt_top_of_measure_ne_top _ (measure_lt_top _ _).Ne
@@ -216,7 +217,7 @@ measure `ν` is `ν`-almost everywhere finite. -/
 theorem rnDeriv_lt_top (μ ν : Measure α) [SigmaFinite μ] : ∀ᵐ x ∂ν, μ.rnDeriv ν x < ∞ :=
   by
   suffices ∀ n, ∀ᵐ x ∂ν, x ∈ spanning_sets μ n → μ.rn_deriv ν x < ∞ by
-    filter_upwards [ae_all_iff.2 this]with _ hx using hx _ (mem_spanning_sets_index _ _)
+    filter_upwards [ae_all_iff.2 this] with _ hx using hx _ (mem_spanning_sets_index _ _)
   intro n
   rw [← ae_restrict_iff' (measurable_spanning_sets _ _)]
   apply ae_lt_top (measurable_rn_deriv _ _)
@@ -412,8 +413,8 @@ open VectorMeasure SignedMeasure
 a measurable set `E`, such that `ν(E) > 0` and `E` is positive with respect to `μ - εν`.
 
 This lemma is useful for the Lebesgue decomposition theorem. -/
-theorem exists_positive_of_not_mutuallySingular (μ ν : Measure α) [FiniteMeasure μ]
-    [FiniteMeasure ν] (h : ¬μ ⟂ₘ ν) :
+theorem exists_positive_of_not_mutuallySingular (μ ν : Measure α) [IsFiniteMeasure μ]
+    [IsFiniteMeasure ν] (h : ¬μ ⟂ₘ ν) :
     ∃ ε : ℝ≥0,
       0 < ε ∧
         ∃ E : Set α,
@@ -473,7 +474,7 @@ theorem exists_positive_of_not_mutuallySingular (μ ν : Measure α) [FiniteMeas
       assumption
   -- since `μ` and `ν` are not mutually singular, `μ A = 0` implies `ν Aᶜ > 0`
   rw [mutually_singular] at h ;
-  push_neg  at h 
+  push_neg at h 
   have := h _ hAmeas hμ
   simp_rw [hA₁, compl_Inter, compl_compl] at this 
   -- as `Aᶜ = ⋃ n, f n`, `ν Aᶜ > 0` implies there exists some `n` such that `ν (f n) > 0`
@@ -489,7 +490,7 @@ functions `f`, such that, for all measurable sets `A`, `∫⁻ x in A, f x ∂μ
 
 This is useful for the Lebesgue decomposition theorem. -/
 def measurableLe (μ ν : Measure α) : Set (α → ℝ≥0∞) :=
-  { f | Measurable f ∧ ∀ (A : Set α) (hA : MeasurableSet A), (∫⁻ x in A, f x ∂μ) ≤ ν A }
+  {f | Measurable f ∧ ∀ (A : Set α) (hA : MeasurableSet A), (∫⁻ x in A, f x ∂μ) ≤ ν A}
 #align measure_theory.measure.lebesgue_decomposition.measurable_le MeasureTheory.Measure.LebesgueDecomposition.measurableLe
 
 theorem zero_mem_measurableLe : (0 : α → ℝ≥0∞) ∈ measurableLe μ ν :=
@@ -526,7 +527,7 @@ theorem iSup_succ_eq_sup {α} (f : ℕ → α → ℝ≥0∞) (m : ℕ) (a : α)
       · exact le_sup_of_le_right (le_iSup₂ n h)
       · exact h ▸ le_sup_left
     · refine' sup_le _ (biSup_mono fun n hn => hn.trans m.le_succ)
-      convert@le_iSup₂ _ _ (fun i => i ≤ m + 1) _ _ m.succ le_rfl
+      convert @le_iSup₂ _ _ (fun i => i ≤ m + 1) _ _ m.succ le_rfl
       rfl
 #align measure_theory.measure.lebesgue_decomposition.supr_succ_eq_sup MeasureTheory.Measure.LebesgueDecomposition.iSup_succ_eq_sup
 
@@ -589,7 +590,7 @@ with respect to `ν` and `μ = ξ + ν.with_density f`.
 
 This is not an instance since this is also shown for the more general σ-finite measures with
 `measure_theory.measure.have_lebesgue_decomposition_of_sigma_finite`. -/
-theorem haveLebesgueDecomposition_of_finite_measure [FiniteMeasure μ] [FiniteMeasure ν] :
+theorem haveLebesgueDecomposition_of_finite_measure [IsFiniteMeasure μ] [IsFiniteMeasure ν] :
     HaveLebesgueDecomposition μ ν :=
   ⟨by
     have h :=
@@ -613,7 +614,7 @@ theorem haveLebesgueDecomposition_of_finite_measure [FiniteMeasure μ] [FiniteMe
           exact le_sSup ⟨⨆ (k : ℕ) (hk : k ≤ n), f k, supr_mem_measurable_le' _ hf₁ _, rfl⟩
       · intro n
         refine' Measurable.aemeasurable _
-        convert(supr_mem_measurable_le _ hf₁ n).1
+        convert (supr_mem_measurable_le _ hf₁ n).1
         ext; simp
       · refine' Filter.eventually_of_forall fun a => _
         simp [supr_monotone' f _]
@@ -701,8 +702,8 @@ theorem haveLebesgueDecomposition_of_finite_measure [FiniteMeasure μ] [FiniteMe
 
 attribute [local instance] have_lebesgue_decomposition_of_finite_measure
 
-instance {S : μ.FiniteSpanningSetsIn { s : Set α | MeasurableSet s }} (n : ℕ) :
-    FiniteMeasure (μ.restrict <| S.Set n) :=
+instance {S : μ.FiniteSpanningSetsIn {s : Set α | MeasurableSet s}} (n : ℕ) :
+    IsFiniteMeasure (μ.restrict <| S.Set n) :=
   ⟨by rw [restrict_apply MeasurableSet.univ, univ_inter]; exact S.finite _⟩
 
 -- see Note [lower instance priority]
@@ -780,7 +781,7 @@ instance (priority := 100) haveLebesgueDecomposition_of_sigmaFinite (μ ν : Mea
             intro x hx
             simp only [mem_Union, sup_eq_union, mem_inter_iff, mem_union, mem_compl_iff,
               or_iff_not_imp_left]
-            intro h; push_neg  at h 
+            intro h; push_neg at h 
             rw [top_eq_univ, ← S.spanning, mem_Union] at hx 
             obtain ⟨i, hi⟩ := hx
             exact ⟨i, hi, h i hi⟩
Diff
@@ -236,7 +236,7 @@ theorem eq_singularPart {s : Measure α} {f : α → ℝ≥0∞} (hf : Measurabl
   haveI : have_lebesgue_decomposition μ ν := ⟨⟨⟨s, f⟩, hf, hs, hadd⟩⟩
   obtain ⟨hmeas, hsing, hadd'⟩ := have_lebesgue_decomposition_spec μ ν
   obtain ⟨⟨S, hS₁, hS₂, hS₃⟩, ⟨T, hT₁, hT₂, hT₃⟩⟩ := hs, hsing
-  rw [hadd'] at hadd
+  rw [hadd'] at hadd 
   have hνinter : ν ((S ∩ T)ᶜ) = 0 := by
     rw [compl_inter]
     refine' nonpos_iff_eq_zero.1 (le_trans (measure_union_le _ _) _)
@@ -331,7 +331,7 @@ theorem eq_withDensity_rnDeriv {s : Measure α} {f : α → ℝ≥0∞} (hf : Me
   haveI : have_lebesgue_decomposition μ ν := ⟨⟨⟨s, f⟩, hf, hs, hadd⟩⟩
   obtain ⟨hmeas, hsing, hadd'⟩ := have_lebesgue_decomposition_spec μ ν
   obtain ⟨⟨S, hS₁, hS₂, hS₃⟩, ⟨T, hT₁, hT₂, hT₃⟩⟩ := hs, hsing
-  rw [hadd'] at hadd
+  rw [hadd'] at hadd 
   have hνinter : ν ((S ∩ T)ᶜ) = 0 := by
     rw [compl_inter]
     refine' nonpos_iff_eq_zero.1 (le_trans (measure_union_le _ _) _)
@@ -426,7 +426,7 @@ theorem exists_positive_of_not_mutuallySingular (μ ν : Measure α) [FiniteMeas
         MeasurableSet i ∧
           0 ≤[i] μ.to_signed_measure - ((1 / (n + 1) : ℝ≥0) • ν).toSignedMeasure ∧
             μ.to_signed_measure - ((1 / (n + 1) : ℝ≥0) • ν).toSignedMeasure ≤[iᶜ] 0 :=
-    by intro ; exact exists_compl_positive_negative _
+    by intro; exact exists_compl_positive_negative _
   choose f hf₁ hf₂ hf₃ using this
   -- set `A` to be the intersection of all the negative parts of obtained Hahn decompositions
   -- and we show that `μ A = 0`
@@ -438,8 +438,8 @@ theorem exists_positive_of_not_mutuallySingular (μ ν : Measure α) [FiniteMeas
     by
     intro n
     have := nonpos_of_restrict_le_zero _ (hA₂ n)
-    rwa [to_signed_measure_sub_apply hAmeas, sub_nonpos, ENNReal.toReal_le_toReal] at this
-    exacts[ne_of_lt (measure_lt_top _ _), ne_of_lt (measure_lt_top _ _)]
+    rwa [to_signed_measure_sub_apply hAmeas, sub_nonpos, ENNReal.toReal_le_toReal] at this 
+    exacts [ne_of_lt (measure_lt_top _ _), ne_of_lt (measure_lt_top _ _)]
   have hμ : μ A = 0 :=
     by
     lift μ A to ℝ≥0 using ne_of_lt (measure_lt_top _ _) with μA
@@ -449,7 +449,7 @@ theorem exists_positive_of_not_mutuallySingular (μ ν : Measure α) [FiniteMeas
     · suffices ∀ b, 0 < b → μA ≤ b by
         by_contra
         have h' := this (μA / 2) (half_pos (zero_lt_iff.2 h))
-        rw [← @Classical.not_not (μA ≤ μA / 2)] at h'
+        rw [← @Classical.not_not (μA ≤ μA / 2)] at h' 
         exact h' (not_le.2 (NNReal.half_lt_self h))
       intro c hc
       have : ∃ n : ℕ, 1 / (n + 1 : ℝ) < c * νA⁻¹; refine' exists_nat_one_div_lt _
@@ -467,15 +467,15 @@ theorem exists_positive_of_not_mutuallySingular (μ ν : Measure α) [FiniteMeas
       refine' le_trans _ (le_of_lt h')
       rw [← ENNReal.coe_le_coe, ENNReal.coe_mul]
       exact hA₃ n
-    · rw [not_lt, le_zero_iff] at hb
+    · rw [not_lt, le_zero_iff] at hb 
       specialize hA₃ 0
-      simp [hb, le_zero_iff] at hA₃
+      simp [hb, le_zero_iff] at hA₃ 
       assumption
   -- since `μ` and `ν` are not mutually singular, `μ A = 0` implies `ν Aᶜ > 0`
-  rw [mutually_singular] at h;
-  push_neg  at h
+  rw [mutually_singular] at h ;
+  push_neg  at h 
   have := h _ hAmeas hμ
-  simp_rw [hA₁, compl_Inter, compl_compl] at this
+  simp_rw [hA₁, compl_Inter, compl_compl] at this 
   -- as `Aᶜ = ⋃ n, f n`, `ν Aᶜ > 0` implies there exists some `n` such that `ν (f n) > 0`
   obtain ⟨n, hn⟩ := exists_measure_pos_of_not_measure_Union_null this
   -- thus, choosing `f n` as the set `E` suffices
@@ -636,7 +636,7 @@ theorem haveLebesgueDecomposition_of_finite_measure [FiniteMeasure μ] [FiniteMe
       by
       refine' is_finite_measure_with_density _
       have hle' := hle univ MeasurableSet.univ
-      rw [with_density_apply _ MeasurableSet.univ, measure.restrict_univ] at hle'
+      rw [with_density_apply _ MeasurableSet.univ, measure.restrict_univ] at hle' 
       exact ne_top_of_le_ne_top (measure_ne_top _ _) hle'
     refine' ⟨⟨μ₁, ξ⟩, hξm, _, _⟩
     · by_contra
@@ -644,7 +644,7 @@ theorem haveLebesgueDecomposition_of_finite_measure [FiniteMeasure μ] [FiniteMe
       -- there exists some `ε > 0` and a measurable set `E`, such that `μ(E) > 0` and `E` is
       -- positive with respect to `ν - εμ`
       obtain ⟨ε, hε₁, E, hE₁, hE₂, hE₃⟩ := exists_positive_of_not_mutually_singular μ₁ ν h
-      simp_rw [hμ₁] at hE₃
+      simp_rw [hμ₁] at hE₃ 
       have hξle : ∀ A, MeasurableSet A → (∫⁻ a in A, ξ a ∂ν) ≤ μ A :=
         by
         intro A hA; rw [hξ]
@@ -661,7 +661,7 @@ theorem haveLebesgueDecomposition_of_finite_measure [FiniteMeasure μ] [FiniteMe
           ENNReal.toReal_sub_of_le _ (ne_of_lt (measure_lt_top _ _)), sub_nonneg, le_sub_iff_add_le,
           ← ENNReal.toReal_add, ENNReal.toReal_le_toReal, measure.coe_smul, Pi.smul_apply,
           with_density_apply _ (hA.inter hE₁), show ε • ν (A ∩ E) = (ε : ℝ≥0∞) * ν (A ∩ E) by rfl, ←
-          set_lintegral_const, ← lintegral_add_left measurable_const] at this
+          set_lintegral_const, ← lintegral_add_left measurable_const] at this 
         · rw [Ne.def, ENNReal.add_eq_top, not_or]
           exact ⟨ne_of_lt (measure_lt_top _ _), ne_of_lt (measure_lt_top _ _)⟩
         · exact ne_of_lt (measure_lt_top _ _)
@@ -692,7 +692,7 @@ theorem haveLebesgueDecomposition_of_finite_measure [FiniteMeasure μ] [FiniteMe
       rw [hξ₁, lintegral_add_left hξm, lintegral_indicator _ hE₁, set_lintegral_const]
       refine' ENNReal.lt_add_right _ (ENNReal.mul_pos_iff.2 ⟨ENNReal.coe_pos.2 hε₁, hE₂⟩).ne'
       have := measure_ne_top (ν.with_density ξ) univ
-      rwa [with_density_apply _ MeasurableSet.univ, measure.restrict_univ] at this
+      rwa [with_density_apply _ MeasurableSet.univ, measure.restrict_univ] at this 
     -- since `ν.with_density ξ ≤ μ`, it is clear that `μ = μ₁ + ν.with_density ξ`
     · rw [hμ₁]; ext1 A hA
       rw [measure.coe_add, Pi.add_apply, measure.sub_apply hA hle, add_comm,
@@ -759,7 +759,7 @@ instance (priority := 100) haveLebesgueDecomposition_of_sigmaFinite (μ ν : Mea
               refine' le_trans ((singular_part_le _ _) _ ((S.set_mem i).inter (hA₁ i))) (le_of_eq _)
               rw [restrict_apply ((S.set_mem i).inter (hA₁ i)), inter_comm, ← inter_assoc]
               have : Disjoint (S.set j) (S.set i) := h₂ hij
-              rw [disjoint_iff_inter_eq_empty] at this
+              rw [disjoint_iff_inter_eq_empty] at this 
               rw [this, empty_inter, measure_empty]
             · infer_instance
           simp_rw [this, tsum_eq_zero_iff ENNReal.summable]
@@ -772,7 +772,7 @@ instance (priority := 100) haveLebesgueDecomposition_of_sigmaFinite (μ ν : Mea
           by
           constructor
           · rw [disjoint_iff_inf_le]
-            rintro x ⟨hx₁, hx₂⟩; rw [mem_Union] at hx₁ hx₂
+            rintro x ⟨hx₁, hx₂⟩; rw [mem_Union] at hx₁ hx₂ 
             obtain ⟨⟨i, hi₁, hi₂⟩, ⟨j, hj₁, hj₂⟩⟩ := hx₁, hx₂
             have : i = j := by by_contra hij; exact (h₂ hij).le_bot ⟨hi₁, hj₁⟩
             exact hj₂ (this ▸ hi₂)
@@ -780,8 +780,8 @@ instance (priority := 100) haveLebesgueDecomposition_of_sigmaFinite (μ ν : Mea
             intro x hx
             simp only [mem_Union, sup_eq_union, mem_inter_iff, mem_union, mem_compl_iff,
               or_iff_not_imp_left]
-            intro h; push_neg  at h
-            rw [top_eq_univ, ← S.spanning, mem_Union] at hx
+            intro h; push_neg  at h 
+            rw [top_eq_univ, ← S.spanning, mem_Union] at hx 
             obtain ⟨i, hi⟩ := hx
             exact ⟨i, hi, h i hi⟩
         rw [hcompl.compl_eq, measure_Union, tsum_eq_zero_iff ENNReal.summable]
@@ -875,7 +875,7 @@ instance haveLebesgueDecomposition_smul_real (s : SignedMeasure α) (μ : Measur
   by_cases hr : 0 ≤ r
   · lift r to ℝ≥0 using hr
     exact s.have_lebesgue_decomposition_smul μ _
-  · rw [not_le] at hr
+  · rw [not_le] at hr 
     refine'
       { posPart :=
           by
@@ -904,11 +904,11 @@ theorem singularPart_mutuallySingular (s : SignedMeasure α) (μ : Measure α) :
   by_cases hl : s.have_lebesgue_decomposition μ
   · haveI := hl
     obtain ⟨i, hi, hpos, hneg⟩ := s.to_jordan_decomposition.mutually_singular
-    rw [s.to_jordan_decomposition.pos_part.have_lebesgue_decomposition_add μ] at hpos
-    rw [s.to_jordan_decomposition.neg_part.have_lebesgue_decomposition_add μ] at hneg
-    rw [add_apply, add_eq_zero_iff] at hpos hneg
+    rw [s.to_jordan_decomposition.pos_part.have_lebesgue_decomposition_add μ] at hpos 
+    rw [s.to_jordan_decomposition.neg_part.have_lebesgue_decomposition_add μ] at hneg 
+    rw [add_apply, add_eq_zero_iff] at hpos hneg 
     exact ⟨i, hi, hpos.1, hneg.1⟩
-  · rw [not_have_lebesgue_decomposition_iff] at hl
+  · rw [not_have_lebesgue_decomposition_iff] at hl 
     cases' hl with hp hn
     · rw [measure.singular_part, dif_neg hp]
       exact mutually_singular.zero_left
@@ -995,7 +995,10 @@ theorem singularPart_add_with_density_rnDeriv_eq [s.HaveLebesgueDecomposition μ
   · exact s.to_jordan_decomposition.pos_part.have_lebesgue_decomposition_add μ
   · rw [add_comm]
     exact s.to_jordan_decomposition.neg_part.have_lebesgue_decomposition_add μ
-  all_goals first |exact (lintegral_rn_deriv_lt_top _ _).Ne|measurability
+  all_goals
+    first
+    | exact (lintegral_rn_deriv_lt_top _ _).Ne
+    | measurability
 #align measure_theory.signed_measure.singular_part_add_with_density_rn_deriv_eq MeasureTheory.SignedMeasure.singularPart_add_with_density_rnDeriv_eq
 
 variable {s μ}
@@ -1005,12 +1008,12 @@ theorem jordan_decomposition_add_withDensity_mutuallySingular {f : α → ℝ} (
     (t.toJordanDecomposition.posPart + μ.withDensity fun x : α => ENNReal.ofReal (f x)) ⟂ₘ
       t.toJordanDecomposition.negPart + μ.withDensity fun x : α => ENNReal.ofReal (-f x) :=
   by
-  rw [mutually_singular_ennreal_iff, total_variation_mutually_singular_iff] at htμ
+  rw [mutually_singular_ennreal_iff, total_variation_mutually_singular_iff] at htμ 
   change
     _ ⟂ₘ vector_measure.equiv_measure.to_fun (vector_measure.equiv_measure.inv_fun μ) ∧
       _ ⟂ₘ vector_measure.equiv_measure.to_fun (vector_measure.equiv_measure.inv_fun μ) at
-    htμ
-  rw [vector_measure.equiv_measure.right_inv] at htμ
+    htμ 
+  rw [vector_measure.equiv_measure.right_inv] at htμ 
   exact
     ((jordan_decomposition.mutually_singular _).add_right
           (htμ.1.mono_ac (refl _) (with_density_absolutely_continuous _ _))).add_left
@@ -1049,9 +1052,9 @@ private theorem have_lebesgue_decomposition_mk' (μ : Measure α) {f : α → 
     (hfi : Integrable f μ) (htμ : t ⟂ᵥ μ.toEnnrealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
     s.HaveLebesgueDecomposition μ := by
   have htμ' := htμ
-  rw [mutually_singular_ennreal_iff] at htμ
-  change _ ⟂ₘ vector_measure.equiv_measure.to_fun (vector_measure.equiv_measure.inv_fun μ) at htμ
-  rw [vector_measure.equiv_measure.right_inv, total_variation_mutually_singular_iff] at htμ
+  rw [mutually_singular_ennreal_iff] at htμ 
+  change _ ⟂ₘ vector_measure.equiv_measure.to_fun (vector_measure.equiv_measure.inv_fun μ) at htμ 
+  rw [vector_measure.equiv_measure.right_inv, total_variation_mutually_singular_iff] at htμ 
   refine'
     { posPart := by
         use ⟨t.to_jordan_decomposition.pos_part, fun x => ENNReal.ofReal (f x)⟩
@@ -1069,7 +1072,7 @@ theorem haveLebesgueDecomposition_mk (μ : Measure α) {f : α → ℝ} (hf : Me
   by
   by_cases hfi : integrable f μ
   · exact have_lebesgue_decomposition_mk' μ hf hfi htμ hadd
-  · rw [with_densityᵥ, dif_neg hfi, add_zero] at hadd
+  · rw [with_densityᵥ, dif_neg hfi, add_zero] at hadd 
     refine' have_lebesgue_decomposition_mk' μ measurable_zero (integrable_zero _ _ μ) htμ _
     rwa [with_densityᵥ_zero, add_zero]
 #align measure_theory.signed_measure.have_lebesgue_decomposition_mk MeasureTheory.SignedMeasure.haveLebesgueDecomposition_mk
@@ -1078,12 +1081,12 @@ private theorem eq_singular_part' (t : SignedMeasure α) {f : α → ℝ} (hf :
     (hfi : Integrable f μ) (htμ : t ⟂ᵥ μ.toEnnrealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
     t = s.singularPart μ := by
   have htμ' := htμ
-  rw [mutually_singular_ennreal_iff, total_variation_mutually_singular_iff] at htμ
+  rw [mutually_singular_ennreal_iff, total_variation_mutually_singular_iff] at htμ 
   change
     _ ⟂ₘ vector_measure.equiv_measure.to_fun (vector_measure.equiv_measure.inv_fun μ) ∧
       _ ⟂ₘ vector_measure.equiv_measure.to_fun (vector_measure.equiv_measure.inv_fun μ) at
-    htμ
-  rw [vector_measure.equiv_measure.right_inv] at htμ
+    htμ 
+  rw [vector_measure.equiv_measure.right_inv] at htμ 
   · rw [singular_part, ← t.to_signed_measure_to_jordan_decomposition,
       jordan_decomposition.to_signed_measure]
     congr
@@ -1105,7 +1108,7 @@ theorem eq_singularPart (t : SignedMeasure α) (f : α → ℝ) (htμ : t ⟂ᵥ
   · refine' eq_singular_part' t hfi.1.measurable_mk (hfi.congr hfi.1.ae_eq_mk) htμ _
     convert hadd using 2
     exact with_densityᵥ_eq.congr_ae hfi.1.ae_eq_mk.symm
-  · rw [with_densityᵥ, dif_neg hfi, add_zero] at hadd
+  · rw [with_densityᵥ, dif_neg hfi, add_zero] at hadd 
     refine' eq_singular_part' t measurable_zero (integrable_zero _ _ μ) htμ _
     rwa [with_densityᵥ_zero, add_zero]
 #align measure_theory.signed_measure.eq_singular_part MeasureTheory.SignedMeasure.eq_singularPart
@@ -1246,7 +1249,7 @@ theorem rnDeriv_sub (s t : SignedMeasure α) (μ : Measure α) [s.HaveLebesgueDe
     [t.HaveLebesgueDecomposition μ] [hst : (s - t).HaveLebesgueDecomposition μ] :
     (s - t).rnDeriv μ =ᵐ[μ] s.rnDeriv μ - t.rnDeriv μ :=
   by
-  rw [sub_eq_add_neg] at hst
+  rw [sub_eq_add_neg] at hst 
   rw [sub_eq_add_neg, sub_eq_add_neg]
   exact ae_eq_trans (rn_deriv_add _ _ _) (Filter.EventuallyEq.add (ae_eq_refl _) (rn_deriv_neg _ _))
 #align measure_theory.signed_measure.rn_deriv_sub MeasureTheory.SignedMeasure.rnDeriv_sub
Diff
@@ -932,14 +932,14 @@ theorem singularPart_totalVariation (s : SignedMeasure α) (μ : Measure α) :
   · rw [total_variation, this]
 #align measure_theory.signed_measure.singular_part_total_variation MeasureTheory.SignedMeasure.singularPart_totalVariation
 
-theorem mutuallySingularSingularPart (s : SignedMeasure α) (μ : Measure α) :
+theorem mutuallySingular_singularPart (s : SignedMeasure α) (μ : Measure α) :
     singularPart s μ ⟂ᵥ μ.toEnnrealVectorMeasure :=
   by
   rw [mutually_singular_ennreal_iff, singular_part_total_variation]
   change _ ⟂ₘ vector_measure.equiv_measure.to_fun (vector_measure.equiv_measure.inv_fun μ)
   rw [vector_measure.equiv_measure.right_inv μ]
   exact (mutually_singular_singular_part _ _).add_left (mutually_singular_singular_part _ _)
-#align measure_theory.signed_measure.mutually_singular_singular_part MeasureTheory.SignedMeasure.mutuallySingularSingularPart
+#align measure_theory.signed_measure.mutually_singular_singular_part MeasureTheory.SignedMeasure.mutuallySingular_singularPart
 
 end
 
Diff
@@ -66,7 +66,7 @@ Lebesgue decomposition theorem
 
 noncomputable section
 
-open Classical MeasureTheory NNReal ENNReal
+open scoped Classical MeasureTheory NNReal ENNReal
 
 open Set
 
Diff
@@ -426,18 +426,14 @@ theorem exists_positive_of_not_mutuallySingular (μ ν : Measure α) [FiniteMeas
         MeasurableSet i ∧
           0 ≤[i] μ.to_signed_measure - ((1 / (n + 1) : ℝ≥0) • ν).toSignedMeasure ∧
             μ.to_signed_measure - ((1 / (n + 1) : ℝ≥0) • ν).toSignedMeasure ≤[iᶜ] 0 :=
-    by
-    intro
-    exact exists_compl_positive_negative _
+    by intro ; exact exists_compl_positive_negative _
   choose f hf₁ hf₂ hf₃ using this
   -- set `A` to be the intersection of all the negative parts of obtained Hahn decompositions
   -- and we show that `μ A = 0`
   set A := ⋂ n, f nᶜ with hA₁
   have hAmeas : MeasurableSet A := MeasurableSet.iInter fun n => (hf₁ n).compl
-  have hA₂ : ∀ n : ℕ, μ.to_signed_measure - ((1 / (n + 1) : ℝ≥0) • ν).toSignedMeasure ≤[A] 0 :=
-    by
-    intro n
-    exact restrict_le_restrict_subset _ _ (hf₁ n).compl (hf₃ n) (Inter_subset _ _)
+  have hA₂ : ∀ n : ℕ, μ.to_signed_measure - ((1 / (n + 1) : ℝ≥0) • ν).toSignedMeasure ≤[A] 0 := by
+    intro n; exact restrict_le_restrict_subset _ _ (hf₁ n).compl (hf₃ n) (Inter_subset _ _)
   have hA₃ : ∀ n : ℕ, μ A ≤ (1 / (n + 1) : ℝ≥0) * ν A :=
     by
     intro n
@@ -456,15 +452,11 @@ theorem exists_positive_of_not_mutuallySingular (μ ν : Measure α) [FiniteMeas
         rw [← @Classical.not_not (μA ≤ μA / 2)] at h'
         exact h' (not_le.2 (NNReal.half_lt_self h))
       intro c hc
-      have : ∃ n : ℕ, 1 / (n + 1 : ℝ) < c * νA⁻¹
-      refine' exists_nat_one_div_lt _
+      have : ∃ n : ℕ, 1 / (n + 1 : ℝ) < c * νA⁻¹; refine' exists_nat_one_div_lt _
       · refine' mul_pos hc _
-        rw [_root_.inv_pos]
-        exact hb
+        rw [_root_.inv_pos]; exact hb
       rcases this with ⟨n, hn⟩
-      have hb₁ : (0 : ℝ) < νA⁻¹ := by
-        rw [_root_.inv_pos]
-        exact hb
+      have hb₁ : (0 : ℝ) < νA⁻¹ := by rw [_root_.inv_pos]; exact hb
       have h' : 1 / (↑n + 1) * νA < c :=
         by
         rw [← NNReal.coe_lt_coe, ← mul_lt_mul_right hb₁, NNReal.coe_mul, mul_assoc, ←
@@ -480,7 +472,7 @@ theorem exists_positive_of_not_mutuallySingular (μ ν : Measure α) [FiniteMeas
       simp [hb, le_zero_iff] at hA₃
       assumption
   -- since `μ` and `ν` are not mutually singular, `μ A = 0` implies `ν Aᶜ > 0`
-  rw [mutually_singular] at h
+  rw [mutually_singular] at h;
   push_neg  at h
   have := h _ hAmeas hμ
   simp_rw [hA₁, compl_Inter, compl_compl] at this
@@ -544,15 +536,13 @@ theorem iSup_mem_measurableLe (f : ℕ → α → ℝ≥0∞) (hf : ∀ n, f n 
   induction' n with m hm
   · refine' ⟨_, _⟩
     · simp [(hf 0).1]
-    · intro A hA
-      simp [(hf 0).2 A hA]
+    · intro A hA; simp [(hf 0).2 A hA]
   · have :
       (fun a : α => ⨆ (k : ℕ) (hk : k ≤ m + 1), f k a) = fun a =>
         f m.succ a ⊔ ⨆ (k : ℕ) (hk : k ≤ m), f k a :=
       funext fun _ => supr_succ_eq_sup _ _ _
     refine' ⟨measurable_iSup fun n => Measurable.iSup_Prop _ (hf n).1, fun A hA => _⟩
-    rw [this]
-    exact (sup_mem_measurable_le (hf m.succ) hm).2 A hA
+    rw [this]; exact (sup_mem_measurable_le (hf m.succ) hm).2 A hA
 #align measure_theory.measure.lebesgue_decomposition.supr_mem_measurable_le MeasureTheory.Measure.LebesgueDecomposition.iSup_mem_measurableLe
 
 theorem iSup_mem_measurable_le' (f : ℕ → α → ℝ≥0∞) (hf : ∀ n, f n ∈ measurableLe μ ν) (n : ℕ) :
@@ -616,8 +606,7 @@ theorem haveLebesgueDecomposition_of_finite_measure [FiniteMeasure μ] [FiniteMe
           (⨆ (n) (k) (hk : k ≤ n), f k) _ _ _
       · refine' tendsto_nhds_unique _ this
         refine' tendsto_of_tendsto_of_tendsto_of_le_of_le hg₂ tendsto_const_nhds _ _
-        · intro n
-          rw [← hf₂ n]
+        · intro n; rw [← hf₂ n]
           apply lintegral_mono
           simp only [iSup_apply, supr_le_le f n n le_rfl]
         · intro n
@@ -625,8 +614,7 @@ theorem haveLebesgueDecomposition_of_finite_measure [FiniteMeasure μ] [FiniteMe
       · intro n
         refine' Measurable.aemeasurable _
         convert(supr_mem_measurable_le _ hf₁ n).1
-        ext
-        simp
+        ext; simp
       · refine' Filter.eventually_of_forall fun a => _
         simp [supr_monotone' f _]
       · refine' Filter.eventually_of_forall fun a => _
@@ -634,8 +622,7 @@ theorem haveLebesgueDecomposition_of_finite_measure [FiniteMeasure μ] [FiniteMe
     have hξm : Measurable ξ :=
       by
       convert measurable_iSup fun n => (supr_mem_measurable_le _ hf₁ n).1
-      ext
-      simp [hξ]
+      ext; simp [hξ]
     -- `ξ` is the `f` in the theorem statement and we set `μ₁` to be `μ - ν.with_density ξ`
     -- since we need `μ₁ + ν.with_density ξ = μ`
     set μ₁ := μ - ν.with_density ξ with hμ₁
@@ -660,8 +647,7 @@ theorem haveLebesgueDecomposition_of_finite_measure [FiniteMeasure μ] [FiniteMe
       simp_rw [hμ₁] at hE₃
       have hξle : ∀ A, MeasurableSet A → (∫⁻ a in A, ξ a ∂ν) ≤ μ A :=
         by
-        intro A hA
-        rw [hξ]
+        intro A hA; rw [hξ]
         simp_rw [iSup_apply]
         rw [lintegral_supr (fun n => (supr_mem_measurable_le _ hf₁ n).1) (supr_monotone _)]
         exact iSup_le fun n => (supr_mem_measurable_le _ hf₁ n).2 A hA
@@ -708,8 +694,7 @@ theorem haveLebesgueDecomposition_of_finite_measure [FiniteMeasure μ] [FiniteMe
       have := measure_ne_top (ν.with_density ξ) univ
       rwa [with_density_apply _ MeasurableSet.univ, measure.restrict_univ] at this
     -- since `ν.with_density ξ ≤ μ`, it is clear that `μ = μ₁ + ν.with_density ξ`
-    · rw [hμ₁]
-      ext1 A hA
+    · rw [hμ₁]; ext1 A hA
       rw [measure.coe_add, Pi.add_apply, measure.sub_apply hA hle, add_comm,
         add_tsub_cancel_of_le (hle A hA)]⟩
 #align measure_theory.measure.have_lebesgue_decomposition_of_finite_measure MeasureTheory.Measure.haveLebesgueDecomposition_of_finite_measure
@@ -718,9 +703,7 @@ attribute [local instance] have_lebesgue_decomposition_of_finite_measure
 
 instance {S : μ.FiniteSpanningSetsIn { s : Set α | MeasurableSet s }} (n : ℕ) :
     FiniteMeasure (μ.restrict <| S.Set n) :=
-  ⟨by
-    rw [restrict_apply MeasurableSet.univ, univ_inter]
-    exact S.finite _⟩
+  ⟨by rw [restrict_apply MeasurableSet.univ, univ_inter]; exact S.finite _⟩
 
 -- see Note [lower instance priority]
 /-- **The Lebesgue decomposition theorem**: Any pair of σ-finite measures `μ` and `ν`
@@ -770,8 +753,7 @@ instance (priority := 100) haveLebesgueDecomposition_of_sigmaFinite (μ ν : Mea
               (Sum fun n => (μn n).singularPart (νn n)) (S.set i ∩ A i) =
                 (μn i).singularPart (νn i) (S.set i ∩ A i) :=
             by
-            intro i
-            rw [sum_apply _ ((S.set_mem i).inter (hA₁ i)), tsum_eq_single i]
+            intro i; rw [sum_apply _ ((S.set_mem i).inter (hA₁ i)), tsum_eq_single i]
             · intro j hij
               rw [hμn, ← nonpos_iff_eq_zero]
               refine' le_trans ((singular_part_le _ _) _ ((S.set_mem i).inter (hA₁ i))) (le_of_eq _)
@@ -781,8 +763,7 @@ instance (priority := 100) haveLebesgueDecomposition_of_sigmaFinite (μ ν : Mea
               rw [this, empty_inter, measure_empty]
             · infer_instance
           simp_rw [this, tsum_eq_zero_iff ENNReal.summable]
-          intro n
-          exact measure_mono_null (inter_subset_right _ _) (hA₂ n)
+          intro n; exact measure_mono_null (inter_subset_right _ _) (hA₂ n)
         · exact h₂.mono fun i j => Disjoint.mono inf_le_left inf_le_left
         · exact fun n => (S.set_mem n).inter (hA₁ n)
       -- We will now show `ν Bᶜ = 0`. This follows since `Bᶜ = ⋃ n, S.set n ∩ (A n)ᶜ` and thus,
@@ -791,25 +772,20 @@ instance (priority := 100) haveLebesgueDecomposition_of_sigmaFinite (μ ν : Mea
           by
           constructor
           · rw [disjoint_iff_inf_le]
-            rintro x ⟨hx₁, hx₂⟩
-            rw [mem_Union] at hx₁ hx₂
+            rintro x ⟨hx₁, hx₂⟩; rw [mem_Union] at hx₁ hx₂
             obtain ⟨⟨i, hi₁, hi₂⟩, ⟨j, hj₁, hj₂⟩⟩ := hx₁, hx₂
-            have : i = j := by
-              by_contra hij
-              exact (h₂ hij).le_bot ⟨hi₁, hj₁⟩
+            have : i = j := by by_contra hij; exact (h₂ hij).le_bot ⟨hi₁, hj₁⟩
             exact hj₂ (this ▸ hi₂)
           · rw [codisjoint_iff_le_sup]
             intro x hx
             simp only [mem_Union, sup_eq_union, mem_inter_iff, mem_union, mem_compl_iff,
               or_iff_not_imp_left]
-            intro h
-            push_neg  at h
+            intro h; push_neg  at h
             rw [top_eq_univ, ← S.spanning, mem_Union] at hx
             obtain ⟨i, hi⟩ := hx
             exact ⟨i, hi, h i hi⟩
         rw [hcompl.compl_eq, measure_Union, tsum_eq_zero_iff ENNReal.summable]
-        · intro n
-          rw [inter_comm, ← restrict_apply (hA₁ n).compl, ← hA₃ n, hνn, h₁]
+        · intro n; rw [inter_comm, ← restrict_apply (hA₁ n).compl, ← hA₃ n, hνn, h₁]
         · exact h₂.mono fun i j => Disjoint.mono inf_le_left inf_le_left
         · exact fun n => (S.set_mem n).inter (hA₁ n).compl
     -- Finally, it remains to show `μ = ξ + ν.with_density f`. Since `μ = sum μn`, and
@@ -990,8 +966,7 @@ theorem measurable_rnDeriv (s : SignedMeasure α) (μ : Measure α) : Measurable
 theorem integrable_rnDeriv (s : SignedMeasure α) (μ : Measure α) : Integrable (rnDeriv s μ) μ := by
   refine' integrable.sub _ _ <;>
     · constructor
-      · apply Measurable.aestronglyMeasurable
-        measurability
+      · apply Measurable.aestronglyMeasurable; measurability
       exact has_finite_integral_to_real_of_lintegral_ne_top (lintegral_rn_deriv_lt_top _ μ).Ne
 #align measure_theory.signed_measure.integrable_rn_deriv MeasureTheory.SignedMeasure.integrable_rnDeriv
 
@@ -1049,12 +1024,8 @@ theorem toJordanDecomposition_eq_of_eq_add_withDensity {f : α → ℝ} (hf : Me
       @JordanDecomposition.mk α _
         (t.toJordanDecomposition.posPart + μ.withDensity fun x => ENNReal.ofReal (f x))
         (t.toJordanDecomposition.negPart + μ.withDensity fun x => ENNReal.ofReal (-f x))
-        (by
-          haveI := is_finite_measure_with_density_of_real hfi.2
-          infer_instance)
-        (by
-          haveI := is_finite_measure_with_density_of_real hfi.neg.2
-          infer_instance)
+        (by haveI := is_finite_measure_with_density_of_real hfi.2; infer_instance)
+        (by haveI := is_finite_measure_with_density_of_real hfi.neg.2; infer_instance)
         (jordan_decomposition_add_withDensity_mutuallySingular hf htμ) :=
   by
   haveI := is_finite_measure_with_density_of_real hfi.2
Diff
@@ -1091,7 +1091,6 @@ private theorem have_lebesgue_decomposition_mk' (μ : Measure α) {f : α → 
         use ⟨t.to_jordan_decomposition.neg_part, fun x => ENNReal.ofReal (-f x)⟩
         refine' ⟨hf.neg.ennreal_of_real, htμ.2, _⟩
         rw [to_jordan_decomposition_eq_of_eq_add_with_density hf hfi htμ' hadd] }
-#align measure_theory.signed_measure.have_lebesgue_decomposition_mk' measure_theory.signed_measure.have_lebesgue_decomposition_mk'
 
 theorem haveLebesgueDecomposition_mk (μ : Measure α) {f : α → ℝ} (hf : Measurable f)
     (htμ : t ⟂ᵥ μ.toEnnrealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
@@ -1123,7 +1122,6 @@ private theorem eq_singular_part' (t : SignedMeasure α) {f : α → ℝ} (hf :
     · have hfneg : Measurable fun x => ENNReal.ofReal (-f x) := by measurability
       refine' eq_singular_part hfneg htμ.2 _
       rw [to_jordan_decomposition_eq_of_eq_add_with_density hf hfi htμ' hadd]
-#align measure_theory.signed_measure.eq_singular_part' measure_theory.signed_measure.eq_singular_part'
 
 /-- Given a measure `μ`, signed measures `s` and `t`, and a function `f` such that `t` is
 mutually singular with respect to `μ` and `s = t + μ.with_densityᵥ f`, we have
Diff
@@ -444,9 +444,10 @@ theorem exists_positive_of_not_mutuallySingular (μ ν : Measure α) [FiniteMeas
     have := nonpos_of_restrict_le_zero _ (hA₂ n)
     rwa [to_signed_measure_sub_apply hAmeas, sub_nonpos, ENNReal.toReal_le_toReal] at this
     exacts[ne_of_lt (measure_lt_top _ _), ne_of_lt (measure_lt_top _ _)]
-  have hμ : μ A = 0 := by
-    lift μ A to ℝ≥0 using ne_of_lt (measure_lt_top _ _)
-    lift ν A to ℝ≥0 using ne_of_lt (measure_lt_top _ _)
+  have hμ : μ A = 0 :=
+    by
+    lift μ A to ℝ≥0 using ne_of_lt (measure_lt_top _ _) with μA
+    lift ν A to ℝ≥0 using ne_of_lt (measure_lt_top _ _) with νA
     rw [ENNReal.coe_eq_zero]
     by_cases hb : 0 < νA
     · suffices ∀ b, 0 < b → μA ≤ b by
Diff
@@ -989,7 +989,7 @@ theorem measurable_rnDeriv (s : SignedMeasure α) (μ : Measure α) : Measurable
 theorem integrable_rnDeriv (s : SignedMeasure α) (μ : Measure α) : Integrable (rnDeriv s μ) μ := by
   refine' integrable.sub _ _ <;>
     · constructor
-      · apply Measurable.aeStronglyMeasurable
+      · apply Measurable.aestronglyMeasurable
         measurability
       exact has_finite_integral_to_real_of_lintegral_ne_top (lintegral_rn_deriv_lt_top _ μ).Ne
 #align measure_theory.signed_measure.integrable_rn_deriv MeasureTheory.SignedMeasure.integrable_rnDeriv
Diff
@@ -444,10 +444,9 @@ theorem exists_positive_of_not_mutuallySingular (μ ν : Measure α) [FiniteMeas
     have := nonpos_of_restrict_le_zero _ (hA₂ n)
     rwa [to_signed_measure_sub_apply hAmeas, sub_nonpos, ENNReal.toReal_le_toReal] at this
     exacts[ne_of_lt (measure_lt_top _ _), ne_of_lt (measure_lt_top _ _)]
-  have hμ : μ A = 0 :=
-    by
-    lift μ A to ℝ≥0 using ne_of_lt (measure_lt_top _ _) with μA
-    lift ν A to ℝ≥0 using ne_of_lt (measure_lt_top _ _) with νA
+  have hμ : μ A = 0 := by
+    lift μ A to ℝ≥0 using ne_of_lt (measure_lt_top _ _)
+    lift ν A to ℝ≥0 using ne_of_lt (measure_lt_top _ _)
     rw [ENNReal.coe_eq_zero]
     by_cases hb : 0 < νA
     · suffices ∀ b, 0 < b → μA ≤ b by
Diff
@@ -751,7 +751,7 @@ instance (priority := 100) haveLebesgueDecomposition_of_sigmaFinite (μ ν : Mea
     refine' ⟨⟨ξ, f⟩, _, _, _⟩
     ·
       exact
-        Measurable.eNNReal_tsum' fun n =>
+        Measurable.ennreal_tsum' fun n =>
           Measurable.indicator (measurable_rn_deriv (μn n) (νn n)) (S.set_mem n)
     -- We show that `ξ` is mutually singular with respect to `ν`
     · choose A hA₁ hA₂ hA₃ using fun n => mutually_singular_singular_part (μn n) (νn n)
Diff
@@ -433,7 +433,7 @@ theorem exists_positive_of_not_mutuallySingular (μ ν : Measure α) [FiniteMeas
   -- set `A` to be the intersection of all the negative parts of obtained Hahn decompositions
   -- and we show that `μ A = 0`
   set A := ⋂ n, f nᶜ with hA₁
-  have hAmeas : MeasurableSet A := MeasurableSet.interᵢ fun n => (hf₁ n).compl
+  have hAmeas : MeasurableSet A := MeasurableSet.iInter fun n => (hf₁ n).compl
   have hA₂ : ∀ n : ℕ, μ.to_signed_measure - ((1 / (n + 1) : ℝ≥0) • ν).toSignedMeasure ≤[A] 0 :=
     by
     intro n
@@ -517,7 +517,7 @@ theorem sup_mem_measurableLe {f g : α → ℝ≥0∞} (hf : f ∈ measurableLe
     exact measure_inter_add_diff _ (measurableSet_le hf.1 hg.1)
 #align measure_theory.measure.lebesgue_decomposition.sup_mem_measurable_le MeasureTheory.Measure.LebesgueDecomposition.sup_mem_measurableLe
 
-theorem supᵢ_succ_eq_sup {α} (f : ℕ → α → ℝ≥0∞) (m : ℕ) (a : α) :
+theorem iSup_succ_eq_sup {α} (f : ℕ → α → ℝ≥0∞) (m : ℕ) (a : α) :
     (⨆ (k : ℕ) (hk : k ≤ m + 1), f k a) = f m.succ a ⊔ ⨆ (k : ℕ) (hk : k ≤ m), f k a :=
   by
   ext x
@@ -529,16 +529,16 @@ theorem supᵢ_succ_eq_sup {α} (f : ℕ → α → ℝ≥0∞) (m : ℕ) (a : 
     rw [@le_antisymm_iff ℝ≥0∞, hc, hd]
     -- Specifying the type is weirdly necessary
     refine' ⟨_, _⟩
-    · refine' supᵢ₂_le fun n hn => _
+    · refine' iSup₂_le fun n hn => _
       rcases Nat.of_le_succ hn with (h | h)
-      · exact le_sup_of_le_right (le_supᵢ₂ n h)
+      · exact le_sup_of_le_right (le_iSup₂ n h)
       · exact h ▸ le_sup_left
-    · refine' sup_le _ (bsupᵢ_mono fun n hn => hn.trans m.le_succ)
-      convert@le_supᵢ₂ _ _ (fun i => i ≤ m + 1) _ _ m.succ le_rfl
+    · refine' sup_le _ (biSup_mono fun n hn => hn.trans m.le_succ)
+      convert@le_iSup₂ _ _ (fun i => i ≤ m + 1) _ _ m.succ le_rfl
       rfl
-#align measure_theory.measure.lebesgue_decomposition.supr_succ_eq_sup MeasureTheory.Measure.LebesgueDecomposition.supᵢ_succ_eq_sup
+#align measure_theory.measure.lebesgue_decomposition.supr_succ_eq_sup MeasureTheory.Measure.LebesgueDecomposition.iSup_succ_eq_sup
 
-theorem supᵢ_mem_measurableLe (f : ℕ → α → ℝ≥0∞) (hf : ∀ n, f n ∈ measurableLe μ ν) (n : ℕ) :
+theorem iSup_mem_measurableLe (f : ℕ → α → ℝ≥0∞) (hf : ∀ n, f n ∈ measurableLe μ ν) (n : ℕ) :
     (fun x => ⨆ (k) (hk : k ≤ n), f k x) ∈ measurableLe μ ν :=
   by
   induction' n with m hm
@@ -550,35 +550,35 @@ theorem supᵢ_mem_measurableLe (f : ℕ → α → ℝ≥0∞) (hf : ∀ n, f n
       (fun a : α => ⨆ (k : ℕ) (hk : k ≤ m + 1), f k a) = fun a =>
         f m.succ a ⊔ ⨆ (k : ℕ) (hk : k ≤ m), f k a :=
       funext fun _ => supr_succ_eq_sup _ _ _
-    refine' ⟨measurable_supᵢ fun n => Measurable.supᵢ_Prop _ (hf n).1, fun A hA => _⟩
+    refine' ⟨measurable_iSup fun n => Measurable.iSup_Prop _ (hf n).1, fun A hA => _⟩
     rw [this]
     exact (sup_mem_measurable_le (hf m.succ) hm).2 A hA
-#align measure_theory.measure.lebesgue_decomposition.supr_mem_measurable_le MeasureTheory.Measure.LebesgueDecomposition.supᵢ_mem_measurableLe
+#align measure_theory.measure.lebesgue_decomposition.supr_mem_measurable_le MeasureTheory.Measure.LebesgueDecomposition.iSup_mem_measurableLe
 
-theorem supᵢ_mem_measurable_le' (f : ℕ → α → ℝ≥0∞) (hf : ∀ n, f n ∈ measurableLe μ ν) (n : ℕ) :
+theorem iSup_mem_measurable_le' (f : ℕ → α → ℝ≥0∞) (hf : ∀ n, f n ∈ measurableLe μ ν) (n : ℕ) :
     (⨆ (k) (hk : k ≤ n), f k) ∈ measurableLe μ ν :=
   by
   convert supr_mem_measurable_le f hf n
   ext; simp
-#align measure_theory.measure.lebesgue_decomposition.supr_mem_measurable_le' MeasureTheory.Measure.LebesgueDecomposition.supᵢ_mem_measurable_le'
+#align measure_theory.measure.lebesgue_decomposition.supr_mem_measurable_le' MeasureTheory.Measure.LebesgueDecomposition.iSup_mem_measurable_le'
 
 section SuprLemmas
 
 --TODO: these statements should be moved elsewhere
 omit m
 
-theorem supᵢ_monotone {α : Type _} (f : ℕ → α → ℝ≥0∞) :
+theorem iSup_monotone {α : Type _} (f : ℕ → α → ℝ≥0∞) :
     Monotone fun n x => ⨆ (k) (hk : k ≤ n), f k x := fun n m hnm x =>
-  bsupᵢ_mono fun i => ge_trans hnm
-#align measure_theory.measure.lebesgue_decomposition.supr_monotone MeasureTheory.Measure.LebesgueDecomposition.supᵢ_monotone
+  biSup_mono fun i => ge_trans hnm
+#align measure_theory.measure.lebesgue_decomposition.supr_monotone MeasureTheory.Measure.LebesgueDecomposition.iSup_monotone
 
-theorem supᵢ_monotone' {α : Type _} (f : ℕ → α → ℝ≥0∞) (x : α) :
-    Monotone fun n => ⨆ (k) (hk : k ≤ n), f k x := fun n m hnm => supᵢ_monotone f hnm x
-#align measure_theory.measure.lebesgue_decomposition.supr_monotone' MeasureTheory.Measure.LebesgueDecomposition.supᵢ_monotone'
+theorem iSup_monotone' {α : Type _} (f : ℕ → α → ℝ≥0∞) (x : α) :
+    Monotone fun n => ⨆ (k) (hk : k ≤ n), f k x := fun n m hnm => iSup_monotone f hnm x
+#align measure_theory.measure.lebesgue_decomposition.supr_monotone' MeasureTheory.Measure.LebesgueDecomposition.iSup_monotone'
 
-theorem supᵢ_le_le {α : Type _} (f : ℕ → α → ℝ≥0∞) (n k : ℕ) (hk : k ≤ n) :
-    f k ≤ fun x => ⨆ (k) (hk : k ≤ n), f k x := fun x => le_supᵢ₂ k hk
-#align measure_theory.measure.lebesgue_decomposition.supr_le_le MeasureTheory.Measure.LebesgueDecomposition.supᵢ_le_le
+theorem iSup_le_le {α : Type _} (f : ℕ → α → ℝ≥0∞) (n k : ℕ) (hk : k ≤ n) :
+    f k ≤ fun x => ⨆ (k) (hk : k ≤ n), f k x := fun x => le_iSup₂ k hk
+#align measure_theory.measure.lebesgue_decomposition.supr_le_le MeasureTheory.Measure.LebesgueDecomposition.iSup_le_le
 
 end SuprLemmas
 
@@ -603,7 +603,7 @@ theorem haveLebesgueDecomposition_of_finite_measure [FiniteMeasure μ] [FiniteMe
     HaveLebesgueDecomposition μ ν :=
   ⟨by
     have h :=
-      @exists_seq_tendsto_supₛ _ _ _ _ _ (measurable_le_eval ν μ)
+      @exists_seq_tendsto_sSup _ _ _ _ _ (measurable_le_eval ν μ)
         ⟨0, 0, zero_mem_measurable_le, by simp⟩ (OrderTop.bddAbove _)
     choose g hmono hg₂ f hf₁ hf₂ using h
     -- we set `ξ` to be the supremum of an increasing sequence of functions obtained from above
@@ -619,9 +619,9 @@ theorem haveLebesgueDecomposition_of_finite_measure [FiniteMeasure μ] [FiniteMe
         · intro n
           rw [← hf₂ n]
           apply lintegral_mono
-          simp only [supᵢ_apply, supr_le_le f n n le_rfl]
+          simp only [iSup_apply, supr_le_le f n n le_rfl]
         · intro n
-          exact le_supₛ ⟨⨆ (k : ℕ) (hk : k ≤ n), f k, supr_mem_measurable_le' _ hf₁ _, rfl⟩
+          exact le_sSup ⟨⨆ (k : ℕ) (hk : k ≤ n), f k, supr_mem_measurable_le' _ hf₁ _, rfl⟩
       · intro n
         refine' Measurable.aemeasurable _
         convert(supr_mem_measurable_le _ hf₁ n).1
@@ -630,10 +630,10 @@ theorem haveLebesgueDecomposition_of_finite_measure [FiniteMeasure μ] [FiniteMe
       · refine' Filter.eventually_of_forall fun a => _
         simp [supr_monotone' f _]
       · refine' Filter.eventually_of_forall fun a => _
-        simp [tendsto_atTop_supᵢ (supr_monotone' f a)]
+        simp [tendsto_atTop_iSup (supr_monotone' f a)]
     have hξm : Measurable ξ :=
       by
-      convert measurable_supᵢ fun n => (supr_mem_measurable_le _ hf₁ n).1
+      convert measurable_iSup fun n => (supr_mem_measurable_le _ hf₁ n).1
       ext
       simp [hξ]
     -- `ξ` is the `f` in the theorem statement and we set `μ₁` to be `μ - ν.with_density ξ`
@@ -642,9 +642,9 @@ theorem haveLebesgueDecomposition_of_finite_measure [FiniteMeasure μ] [FiniteMe
     have hle : ν.with_density ξ ≤ μ := by
       intro B hB
       rw [hξ, with_density_apply _ hB]
-      simp_rw [supᵢ_apply]
+      simp_rw [iSup_apply]
       rw [lintegral_supr (fun i => (supr_mem_measurable_le _ hf₁ i).1) (supr_monotone _)]
-      exact supᵢ_le fun i => (supr_mem_measurable_le _ hf₁ i).2 B hB
+      exact iSup_le fun i => (supr_mem_measurable_le _ hf₁ i).2 B hB
     have : is_finite_measure (ν.with_density ξ) :=
       by
       refine' is_finite_measure_with_density _
@@ -662,9 +662,9 @@ theorem haveLebesgueDecomposition_of_finite_measure [FiniteMeasure μ] [FiniteMe
         by
         intro A hA
         rw [hξ]
-        simp_rw [supᵢ_apply]
+        simp_rw [iSup_apply]
         rw [lintegral_supr (fun n => (supr_mem_measurable_le _ hf₁ n).1) (supr_monotone _)]
-        exact supᵢ_le fun n => (supr_mem_measurable_le _ hf₁ n).2 A hA
+        exact iSup_le fun n => (supr_mem_measurable_le _ hf₁ n).2 A hA
       -- since `E` is positive, we have `∫⁻ a in A ∩ E, ε + ξ a ∂ν ≤ μ (A ∩ E)` for all `A`
       have hε₂ : ∀ A : Set α, MeasurableSet A → (∫⁻ a in A ∩ E, ε + ξ a ∂ν) ≤ μ (A ∩ E) :=
         by
@@ -700,7 +700,7 @@ theorem haveLebesgueDecomposition_of_finite_measure [FiniteMeasure μ] [FiniteMe
         rw [this, ← measure_inter_add_diff A hE₁]
         exact add_le_add (hε₂ A hA) (hξle (A \ E) (hA.diff hE₁))
       have : (∫⁻ a, ξ a + E.indicator (fun _ => ε) a ∂ν) ≤ Sup (measurable_le_eval ν μ) :=
-        le_supₛ ⟨ξ + E.indicator fun _ => ε, hξε, rfl⟩
+        le_sSup ⟨ξ + E.indicator fun _ => ε, hξε, rfl⟩
       -- but this contradicts the maximality of `∫⁻ x, ξ x ∂ν`
       refine' not_lt.2 this _
       rw [hξ₁, lintegral_add_left hξm, lintegral_indicator _ hE₁, set_lintegral_const]
@@ -758,7 +758,7 @@ instance (priority := 100) haveLebesgueDecomposition_of_sigmaFinite (μ ν : Mea
       simp only [hξ]
       -- We use the set `B := ⋃ j, (S.set j) ∩ A j` where `A n` is the set provided as
       -- `singular_part (μn n) (νn n) ⟂ₘ νn n`
-      refine' ⟨⋃ j, S.set j ∩ A j, MeasurableSet.unionᵢ fun n => (S.set_mem n).inter (hA₁ n), _, _⟩
+      refine' ⟨⋃ j, S.set j ∩ A j, MeasurableSet.iUnion fun n => (S.set_mem n).inter (hA₁ n), _, _⟩
       -- `ξ B = 0` since `ξ B = ∑ i j, singular_part (μn j) (νn j) (S.set i ∩ A i)`
       --                     `= ∑ i, singular_part (μn i) (νn i) (S.set i ∩ A i)`
       --                     `≤ ∑ i, singular_part (μn i) (νn i) (A i) = 0`
Diff
@@ -164,25 +164,24 @@ theorem withDensity_rnDeriv_le (μ ν : Measure α) : ν.withDensity (μ.rnDeriv
     exact measure.zero_le μ
 #align measure_theory.measure.with_density_rn_deriv_le MeasureTheory.Measure.withDensity_rnDeriv_le
 
-instance [IsFiniteMeasure μ] : IsFiniteMeasure (μ.singularPart ν) :=
-  isFiniteMeasure_of_le μ <| singularPart_le μ ν
+instance [FiniteMeasure μ] : FiniteMeasure (μ.singularPart ν) :=
+  finiteMeasureOfLe μ <| singularPart_le μ ν
 
 instance [SigmaFinite μ] : SigmaFinite (μ.singularPart ν) :=
   sigmaFinite_of_le μ <| singularPart_le μ ν
 
-instance [TopologicalSpace α] [IsLocallyFiniteMeasure μ] :
-    IsLocallyFiniteMeasure (μ.singularPart ν) :=
-  isLocallyFiniteMeasure_of_le <| singularPart_le μ ν
+instance [TopologicalSpace α] [LocallyFiniteMeasure μ] : LocallyFiniteMeasure (μ.singularPart ν) :=
+  locallyFiniteMeasure_of_le <| singularPart_le μ ν
 
-instance [IsFiniteMeasure μ] : IsFiniteMeasure (ν.withDensity <| μ.rnDeriv ν) :=
-  isFiniteMeasure_of_le μ <| withDensity_rnDeriv_le μ ν
+instance [FiniteMeasure μ] : FiniteMeasure (ν.withDensity <| μ.rnDeriv ν) :=
+  finiteMeasureOfLe μ <| withDensity_rnDeriv_le μ ν
 
 instance [SigmaFinite μ] : SigmaFinite (ν.withDensity <| μ.rnDeriv ν) :=
   sigmaFinite_of_le μ <| withDensity_rnDeriv_le μ ν
 
-instance [TopologicalSpace α] [IsLocallyFiniteMeasure μ] :
-    IsLocallyFiniteMeasure (ν.withDensity <| μ.rnDeriv ν) :=
-  isLocallyFiniteMeasure_of_le <| withDensity_rnDeriv_le μ ν
+instance [TopologicalSpace α] [LocallyFiniteMeasure μ] :
+    LocallyFiniteMeasure (ν.withDensity <| μ.rnDeriv ν) :=
+  locallyFiniteMeasure_of_le <| withDensity_rnDeriv_le μ ν
 
 theorem lintegral_rnDeriv_lt_top_of_measure_ne_top {μ : Measure α} (ν : Measure α) {s : Set α}
     (hs : μ s ≠ ∞) : (∫⁻ x in s, μ.rnDeriv ν x ∂ν) < ∞ :=
@@ -206,7 +205,7 @@ theorem lintegral_rnDeriv_lt_top_of_measure_ne_top {μ : Measure α} (ν : Measu
     exact WithTop.zero_lt_top
 #align measure_theory.measure.lintegral_rn_deriv_lt_top_of_measure_ne_top MeasureTheory.Measure.lintegral_rnDeriv_lt_top_of_measure_ne_top
 
-theorem lintegral_rnDeriv_lt_top (μ ν : Measure α) [IsFiniteMeasure μ] :
+theorem lintegral_rnDeriv_lt_top (μ ν : Measure α) [FiniteMeasure μ] :
     (∫⁻ x, μ.rnDeriv ν x ∂ν) < ∞ := by
   rw [← set_lintegral_univ]
   exact lintegral_rn_deriv_lt_top_of_measure_ne_top _ (measure_lt_top _ _).Ne
@@ -413,8 +412,8 @@ open VectorMeasure SignedMeasure
 a measurable set `E`, such that `ν(E) > 0` and `E` is positive with respect to `μ - εν`.
 
 This lemma is useful for the Lebesgue decomposition theorem. -/
-theorem exists_positive_of_not_mutuallySingular (μ ν : Measure α) [IsFiniteMeasure μ]
-    [IsFiniteMeasure ν] (h : ¬μ ⟂ₘ ν) :
+theorem exists_positive_of_not_mutuallySingular (μ ν : Measure α) [FiniteMeasure μ]
+    [FiniteMeasure ν] (h : ¬μ ⟂ₘ ν) :
     ∃ ε : ℝ≥0,
       0 < ε ∧
         ∃ E : Set α,
@@ -600,7 +599,7 @@ with respect to `ν` and `μ = ξ + ν.with_density f`.
 
 This is not an instance since this is also shown for the more general σ-finite measures with
 `measure_theory.measure.have_lebesgue_decomposition_of_sigma_finite`. -/
-theorem haveLebesgueDecomposition_of_finite_measure [IsFiniteMeasure μ] [IsFiniteMeasure ν] :
+theorem haveLebesgueDecomposition_of_finite_measure [FiniteMeasure μ] [FiniteMeasure ν] :
     HaveLebesgueDecomposition μ ν :=
   ⟨by
     have h :=
@@ -718,7 +717,7 @@ theorem haveLebesgueDecomposition_of_finite_measure [IsFiniteMeasure μ] [IsFini
 attribute [local instance] have_lebesgue_decomposition_of_finite_measure
 
 instance {S : μ.FiniteSpanningSetsIn { s : Set α | MeasurableSet s }} (n : ℕ) :
-    IsFiniteMeasure (μ.restrict <| S.Set n) :=
+    FiniteMeasure (μ.restrict <| S.Set n) :=
   ⟨by
     rw [restrict_apply MeasurableSet.univ, univ_inter]
     exact S.finite _⟩
Diff
@@ -113,8 +113,8 @@ theorem haveLebesgueDecomposition_add (μ ν : Measure α) [HaveLebesgueDecompos
   (haveLebesgueDecomposition_spec μ ν).2.2
 #align measure_theory.measure.have_lebesgue_decomposition_add MeasureTheory.Measure.haveLebesgueDecomposition_add
 
-instance haveLebesgueDecompositionSmul (μ ν : Measure α) [HaveLebesgueDecomposition μ ν] (r : ℝ≥0) :
-    (r • μ).HaveLebesgueDecomposition ν
+instance haveLebesgueDecomposition_smul (μ ν : Measure α) [HaveLebesgueDecomposition μ ν]
+    (r : ℝ≥0) : (r • μ).HaveLebesgueDecomposition ν
     where lebesgue_decomposition :=
     by
     obtain ⟨hmeas, hsing, hadd⟩ := have_lebesgue_decomposition_spec μ ν
@@ -125,7 +125,7 @@ instance haveLebesgueDecompositionSmul (μ ν : Measure α) [HaveLebesgueDecompo
     · change _ = (r : ℝ≥0∞) • _ + ν.with_density ((r : ℝ≥0∞) • _)
       rw [with_density_smul _ hmeas, ← smul_add, ← hadd]
       rfl
-#align measure_theory.measure.have_lebesgue_decomposition_smul MeasureTheory.Measure.haveLebesgueDecompositionSmul
+#align measure_theory.measure.have_lebesgue_decomposition_smul MeasureTheory.Measure.haveLebesgueDecomposition_smul
 
 @[measurability]
 theorem measurable_rnDeriv (μ ν : Measure α) : Measurable <| μ.rnDeriv ν :=
@@ -136,13 +136,13 @@ theorem measurable_rnDeriv (μ ν : Measure α) : Measurable <| μ.rnDeriv ν :=
     exact measurable_zero
 #align measure_theory.measure.measurable_rn_deriv MeasureTheory.Measure.measurable_rnDeriv
 
-theorem mutuallySingularSingularPart (μ ν : Measure α) : μ.singularPart ν ⟂ₘ ν :=
+theorem mutuallySingular_singularPart (μ ν : Measure α) : μ.singularPart ν ⟂ₘ ν :=
   by
   by_cases h : have_lebesgue_decomposition μ ν
   · exact (have_lebesgue_decomposition_spec μ ν).2.1
   · rw [singular_part, dif_neg h]
     exact mutually_singular.zero_left
-#align measure_theory.measure.mutually_singular_singular_part MeasureTheory.Measure.mutuallySingularSingularPart
+#align measure_theory.measure.mutually_singular_singular_part MeasureTheory.Measure.mutuallySingular_singularPart
 
 theorem singularPart_le (μ ν : Measure α) : μ.singularPart ν ≤ μ :=
   by
@@ -165,24 +165,24 @@ theorem withDensity_rnDeriv_le (μ ν : Measure α) : ν.withDensity (μ.rnDeriv
 #align measure_theory.measure.with_density_rn_deriv_le MeasureTheory.Measure.withDensity_rnDeriv_le
 
 instance [IsFiniteMeasure μ] : IsFiniteMeasure (μ.singularPart ν) :=
-  isFiniteMeasureOfLe μ <| singularPart_le μ ν
+  isFiniteMeasure_of_le μ <| singularPart_le μ ν
 
 instance [SigmaFinite μ] : SigmaFinite (μ.singularPart ν) :=
-  sigmaFiniteOfLe μ <| singularPart_le μ ν
+  sigmaFinite_of_le μ <| singularPart_le μ ν
 
 instance [TopologicalSpace α] [IsLocallyFiniteMeasure μ] :
     IsLocallyFiniteMeasure (μ.singularPart ν) :=
-  isLocallyFiniteMeasureOfLe <| singularPart_le μ ν
+  isLocallyFiniteMeasure_of_le <| singularPart_le μ ν
 
 instance [IsFiniteMeasure μ] : IsFiniteMeasure (ν.withDensity <| μ.rnDeriv ν) :=
-  isFiniteMeasureOfLe μ <| withDensity_rnDeriv_le μ ν
+  isFiniteMeasure_of_le μ <| withDensity_rnDeriv_le μ ν
 
 instance [SigmaFinite μ] : SigmaFinite (ν.withDensity <| μ.rnDeriv ν) :=
-  sigmaFiniteOfLe μ <| withDensity_rnDeriv_le μ ν
+  sigmaFinite_of_le μ <| withDensity_rnDeriv_le μ ν
 
 instance [TopologicalSpace α] [IsLocallyFiniteMeasure μ] :
     IsLocallyFiniteMeasure (ν.withDensity <| μ.rnDeriv ν) :=
-  isLocallyFiniteMeasureOfLe <| withDensity_rnDeriv_le μ ν
+  isLocallyFiniteMeasure_of_le <| withDensity_rnDeriv_le μ ν
 
 theorem lintegral_rnDeriv_lt_top_of_measure_ne_top {μ : Measure α} (ν : Measure α) {s : Set α}
     (hs : μ s ≠ ∞) : (∫⁻ x in s, μ.rnDeriv ν x ∂ν) < ∞ :=
@@ -600,7 +600,7 @@ with respect to `ν` and `μ = ξ + ν.with_density f`.
 
 This is not an instance since this is also shown for the more general σ-finite measures with
 `measure_theory.measure.have_lebesgue_decomposition_of_sigma_finite`. -/
-theorem haveLebesgueDecompositionOfFiniteMeasure [IsFiniteMeasure μ] [IsFiniteMeasure ν] :
+theorem haveLebesgueDecomposition_of_finite_measure [IsFiniteMeasure μ] [IsFiniteMeasure ν] :
     HaveLebesgueDecomposition μ ν :=
   ⟨by
     have h :=
@@ -624,7 +624,7 @@ theorem haveLebesgueDecompositionOfFiniteMeasure [IsFiniteMeasure μ] [IsFiniteM
         · intro n
           exact le_supₛ ⟨⨆ (k : ℕ) (hk : k ≤ n), f k, supr_mem_measurable_le' _ hf₁ _, rfl⟩
       · intro n
-        refine' Measurable.aeMeasurable _
+        refine' Measurable.aemeasurable _
         convert(supr_mem_measurable_le _ hf₁ n).1
         ext
         simp
@@ -713,7 +713,7 @@ theorem haveLebesgueDecompositionOfFiniteMeasure [IsFiniteMeasure μ] [IsFiniteM
       ext1 A hA
       rw [measure.coe_add, Pi.add_apply, measure.sub_apply hA hle, add_comm,
         add_tsub_cancel_of_le (hle A hA)]⟩
-#align measure_theory.measure.have_lebesgue_decomposition_of_finite_measure MeasureTheory.Measure.haveLebesgueDecompositionOfFiniteMeasure
+#align measure_theory.measure.have_lebesgue_decomposition_of_finite_measure MeasureTheory.Measure.haveLebesgueDecomposition_of_finite_measure
 
 attribute [local instance] have_lebesgue_decomposition_of_finite_measure
 
@@ -727,8 +727,8 @@ instance {S : μ.FiniteSpanningSetsIn { s : Set α | MeasurableSet s }} (n : ℕ
 /-- **The Lebesgue decomposition theorem**: Any pair of σ-finite measures `μ` and `ν`
 `have_lebesgue_decomposition`. That is to say, there exist a measure `ξ` and a measurable function
 `f`, such that `ξ` is mutually singular with respect to `ν` and `μ = ξ + ν.with_density f` -/
-instance (priority := 100) haveLebesgueDecompositionOfSigmaFinite (μ ν : Measure α) [SigmaFinite μ]
-    [SigmaFinite ν] : HaveLebesgueDecomposition μ ν :=
+instance (priority := 100) haveLebesgueDecomposition_of_sigmaFinite (μ ν : Measure α)
+    [SigmaFinite μ] [SigmaFinite ν] : HaveLebesgueDecomposition μ ν :=
   ⟨by
     -- Since `μ` and `ν` are both σ-finite, there exists a sequence of pairwise disjoint spanning
     -- sets which are finite with respect to both `μ` and `ν`
@@ -836,7 +836,7 @@ instance (priority := 100) haveLebesgueDecompositionOfSigmaFinite (μ ν : Measu
             coe_zero, Pi.zero_apply]
         · infer_instance
       · exact fun n => Measurable.indicator (measurable_rn_deriv _ _) (S.set_mem n)⟩
-#align measure_theory.measure.have_lebesgue_decomposition_of_sigma_finite MeasureTheory.Measure.haveLebesgueDecompositionOfSigmaFinite
+#align measure_theory.measure.have_lebesgue_decomposition_of_sigma_finite MeasureTheory.Measure.haveLebesgueDecomposition_of_sigmaFinite
 
 end Measure
 
@@ -865,14 +865,14 @@ theorem not_haveLebesgueDecomposition_iff (s : SignedMeasure α) (μ : Measure 
 
 -- `infer_instance` directly does not work
 -- see Note [lower instance priority]
-instance (priority := 100) haveLebesgueDecompositionOfSigmaFinite (s : SignedMeasure α)
+instance (priority := 100) haveLebesgueDecomposition_of_sigmaFinite (s : SignedMeasure α)
     (μ : Measure α) [SigmaFinite μ] : s.HaveLebesgueDecomposition μ
     where
   posPart := inferInstance
   negPart := inferInstance
-#align measure_theory.signed_measure.have_lebesgue_decomposition_of_sigma_finite MeasureTheory.SignedMeasure.haveLebesgueDecompositionOfSigmaFinite
+#align measure_theory.signed_measure.have_lebesgue_decomposition_of_sigma_finite MeasureTheory.SignedMeasure.haveLebesgueDecomposition_of_sigmaFinite
 
-instance haveLebesgueDecompositionNeg (s : SignedMeasure α) (μ : Measure α)
+instance haveLebesgueDecomposition_neg (s : SignedMeasure α) (μ : Measure α)
     [s.HaveLebesgueDecomposition μ] : (-s).HaveLebesgueDecomposition μ
     where
   posPart := by
@@ -881,9 +881,9 @@ instance haveLebesgueDecompositionNeg (s : SignedMeasure α) (μ : Measure α)
   negPart := by
     rw [to_jordan_decomposition_neg, jordan_decomposition.neg_neg_part]
     infer_instance
-#align measure_theory.signed_measure.have_lebesgue_decomposition_neg MeasureTheory.SignedMeasure.haveLebesgueDecompositionNeg
+#align measure_theory.signed_measure.have_lebesgue_decomposition_neg MeasureTheory.SignedMeasure.haveLebesgueDecomposition_neg
 
-instance haveLebesgueDecompositionSmul (s : SignedMeasure α) (μ : Measure α)
+instance haveLebesgueDecomposition_smul (s : SignedMeasure α) (μ : Measure α)
     [s.HaveLebesgueDecomposition μ] (r : ℝ≥0) : (r • s).HaveLebesgueDecomposition μ
     where
   posPart := by
@@ -892,9 +892,9 @@ instance haveLebesgueDecompositionSmul (s : SignedMeasure α) (μ : Measure α)
   negPart := by
     rw [to_jordan_decomposition_smul, jordan_decomposition.smul_neg_part]
     infer_instance
-#align measure_theory.signed_measure.have_lebesgue_decomposition_smul MeasureTheory.SignedMeasure.haveLebesgueDecompositionSmul
+#align measure_theory.signed_measure.have_lebesgue_decomposition_smul MeasureTheory.SignedMeasure.haveLebesgueDecomposition_smul
 
-instance haveLebesgueDecompositionSmulReal (s : SignedMeasure α) (μ : Measure α)
+instance haveLebesgueDecomposition_smul_real (s : SignedMeasure α) (μ : Measure α)
     [s.HaveLebesgueDecomposition μ] (r : ℝ) : (r • s).HaveLebesgueDecomposition μ :=
   by
   by_cases hr : 0 ≤ r
@@ -910,7 +910,7 @@ instance haveLebesgueDecompositionSmulReal (s : SignedMeasure α) (μ : Measure
           by
           rw [to_jordan_decomposition_smul_real, jordan_decomposition.real_smul_neg_part_neg _ _ hr]
           infer_instance }
-#align measure_theory.signed_measure.have_lebesgue_decomposition_smul_real MeasureTheory.SignedMeasure.haveLebesgueDecompositionSmulReal
+#align measure_theory.signed_measure.have_lebesgue_decomposition_smul_real MeasureTheory.SignedMeasure.haveLebesgueDecomposition_smul_real
 
 /-- Given a signed measure `s` and a measure `μ`, `s.singular_part μ` is the signed measure
 such that `s.singular_part μ + μ.with_densityᵥ (s.rn_deriv μ) = s` and
@@ -922,7 +922,7 @@ def singularPart (s : SignedMeasure α) (μ : Measure α) : SignedMeasure α :=
 
 section
 
-theorem singularPartMutuallySingular (s : SignedMeasure α) (μ : Measure α) :
+theorem singularPart_mutuallySingular (s : SignedMeasure α) (μ : Measure α) :
     s.toJordanDecomposition.posPart.singularPart μ ⟂ₘ
       s.toJordanDecomposition.negPart.singularPart μ :=
   by
@@ -939,7 +939,7 @@ theorem singularPartMutuallySingular (s : SignedMeasure α) (μ : Measure α) :
       exact mutually_singular.zero_left
     · rw [measure.singular_part, measure.singular_part, dif_neg hn]
       exact mutually_singular.zero_right
-#align measure_theory.signed_measure.singular_part_mutually_singular MeasureTheory.SignedMeasure.singularPartMutuallySingular
+#align measure_theory.signed_measure.singular_part_mutually_singular MeasureTheory.SignedMeasure.singularPart_mutuallySingular
 
 theorem singularPart_totalVariation (s : SignedMeasure α) (μ : Measure α) :
     (s.singularPart μ).totalVariation =
@@ -988,13 +988,13 @@ theorem measurable_rnDeriv (s : SignedMeasure α) (μ : Measure α) : Measurable
   measurability
 #align measure_theory.signed_measure.measurable_rn_deriv MeasureTheory.SignedMeasure.measurable_rnDeriv
 
-theorem integrableRnDeriv (s : SignedMeasure α) (μ : Measure α) : Integrable (rnDeriv s μ) μ := by
+theorem integrable_rnDeriv (s : SignedMeasure α) (μ : Measure α) : Integrable (rnDeriv s μ) μ := by
   refine' integrable.sub _ _ <;>
     · constructor
       · apply Measurable.aeStronglyMeasurable
         measurability
       exact has_finite_integral_to_real_of_lintegral_ne_top (lintegral_rn_deriv_lt_top _ μ).Ne
-#align measure_theory.signed_measure.integrable_rn_deriv MeasureTheory.SignedMeasure.integrableRnDeriv
+#align measure_theory.signed_measure.integrable_rn_deriv MeasureTheory.SignedMeasure.integrable_rnDeriv
 
 variable (s μ)
 
@@ -1026,7 +1026,7 @@ theorem singularPart_add_with_density_rnDeriv_eq [s.HaveLebesgueDecomposition μ
 
 variable {s μ}
 
-theorem jordanDecompositionAddWithDensityMutuallySingular {f : α → ℝ} (hf : Measurable f)
+theorem jordan_decomposition_add_withDensity_mutuallySingular {f : α → ℝ} (hf : Measurable f)
     (htμ : t ⟂ᵥ μ.toEnnrealVectorMeasure) :
     (t.toJordanDecomposition.posPart + μ.withDensity fun x : α => ENNReal.ofReal (f x)) ⟂ₘ
       t.toJordanDecomposition.negPart + μ.withDensity fun x : α => ENNReal.ofReal (-f x) :=
@@ -1039,10 +1039,10 @@ theorem jordanDecompositionAddWithDensityMutuallySingular {f : α → ℝ} (hf :
   rw [vector_measure.equiv_measure.right_inv] at htμ
   exact
     ((jordan_decomposition.mutually_singular _).add_right
-          (htμ.1.monoAc (refl _) (with_density_absolutely_continuous _ _))).add_left
-      ((htμ.2.symm.monoAc (with_density_absolutely_continuous _ _) (refl _)).add_right
+          (htμ.1.mono_ac (refl _) (with_density_absolutely_continuous _ _))).add_left
+      ((htμ.2.symm.mono_ac (with_density_absolutely_continuous _ _) (refl _)).add_right
         (with_density_of_real_mutually_singular hf))
-#align measure_theory.signed_measure.jordan_decomposition_add_with_density_mutually_singular MeasureTheory.SignedMeasure.jordanDecompositionAddWithDensityMutuallySingular
+#align measure_theory.signed_measure.jordan_decomposition_add_with_density_mutually_singular MeasureTheory.SignedMeasure.jordan_decomposition_add_withDensity_mutuallySingular
 
 theorem toJordanDecomposition_eq_of_eq_add_withDensity {f : α → ℝ} (hf : Measurable f)
     (hfi : Integrable f μ) (htμ : t ⟂ᵥ μ.toEnnrealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
@@ -1056,7 +1056,7 @@ theorem toJordanDecomposition_eq_of_eq_add_withDensity {f : α → ℝ} (hf : Me
         (by
           haveI := is_finite_measure_with_density_of_real hfi.neg.2
           infer_instance)
-        (jordanDecompositionAddWithDensityMutuallySingular hf htμ) :=
+        (jordan_decomposition_add_withDensity_mutuallySingular hf htμ) :=
   by
   haveI := is_finite_measure_with_density_of_real hfi.2
   haveI := is_finite_measure_with_density_of_real hfi.neg.2
@@ -1094,7 +1094,7 @@ private theorem have_lebesgue_decomposition_mk' (μ : Measure α) {f : α → 
         rw [to_jordan_decomposition_eq_of_eq_add_with_density hf hfi htμ' hadd] }
 #align measure_theory.signed_measure.have_lebesgue_decomposition_mk' measure_theory.signed_measure.have_lebesgue_decomposition_mk'
 
-theorem haveLebesgueDecompositionMk (μ : Measure α) {f : α → ℝ} (hf : Measurable f)
+theorem haveLebesgueDecomposition_mk (μ : Measure α) {f : α → ℝ} (hf : Measurable f)
     (htμ : t ⟂ᵥ μ.toEnnrealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
     s.HaveLebesgueDecomposition μ :=
   by
@@ -1103,7 +1103,7 @@ theorem haveLebesgueDecompositionMk (μ : Measure α) {f : α → ℝ} (hf : Mea
   · rw [with_densityᵥ, dif_neg hfi, add_zero] at hadd
     refine' have_lebesgue_decomposition_mk' μ measurable_zero (integrable_zero _ _ μ) htμ _
     rwa [with_densityᵥ_zero, add_zero]
-#align measure_theory.signed_measure.have_lebesgue_decomposition_mk MeasureTheory.SignedMeasure.haveLebesgueDecompositionMk
+#align measure_theory.signed_measure.have_lebesgue_decomposition_mk MeasureTheory.SignedMeasure.haveLebesgueDecomposition_mk
 
 private theorem eq_singular_part' (t : SignedMeasure α) {f : α → ℝ} (hf : Measurable f)
     (hfi : Integrable f μ) (htμ : t ⟂ᵥ μ.toEnnrealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
@@ -1290,8 +1290,8 @@ namespace ComplexMeasure
 /-- A complex measure is said to `have_lebesgue_decomposition` with respect to a positive measure
 if both its real and imaginary part `have_lebesgue_decomposition` with respect to that measure. -/
 class HaveLebesgueDecomposition (c : ComplexMeasure α) (μ : Measure α) : Prop where
-  rePart : c.re.HaveLebesgueDecomposition μ
-  imPart : c.im.HaveLebesgueDecomposition μ
+  re_part : c.re.HaveLebesgueDecomposition μ
+  im_part : c.im.HaveLebesgueDecomposition μ
 #align measure_theory.complex_measure.have_lebesgue_decomposition MeasureTheory.ComplexMeasure.HaveLebesgueDecomposition
 
 attribute [instance] have_lebesgue_decomposition.re_part
@@ -1312,13 +1312,13 @@ def rnDeriv (c : ComplexMeasure α) (μ : Measure α) : α → ℂ := fun x =>
 
 variable {c : ComplexMeasure α}
 
-theorem integrableRnDeriv (c : ComplexMeasure α) (μ : Measure α) : Integrable (c.rnDeriv μ) μ :=
+theorem integrable_rnDeriv (c : ComplexMeasure α) (μ : Measure α) : Integrable (c.rnDeriv μ) μ :=
   by
   rw [← mem_ℒp_one_iff_integrable, ← mem_ℒp_re_im_iff]
   exact
     ⟨mem_ℒp_one_iff_integrable.2 (signed_measure.integrable_rn_deriv _ _),
       mem_ℒp_one_iff_integrable.2 (signed_measure.integrable_rn_deriv _ _)⟩
-#align measure_theory.complex_measure.integrable_rn_deriv MeasureTheory.ComplexMeasure.integrableRnDeriv
+#align measure_theory.complex_measure.integrable_rn_deriv MeasureTheory.ComplexMeasure.integrable_rnDeriv
 
 theorem singularPart_add_with_density_rnDeriv_eq [c.HaveLebesgueDecomposition μ] :
     c.singularPart μ + μ.withDensityᵥ (c.rnDeriv μ) = c :=
Diff
@@ -535,7 +535,7 @@ theorem supᵢ_succ_eq_sup {α} (f : ℕ → α → ℝ≥0∞) (m : ℕ) (a : 
       · exact le_sup_of_le_right (le_supᵢ₂ n h)
       · exact h ▸ le_sup_left
     · refine' sup_le _ (bsupᵢ_mono fun n hn => hn.trans m.le_succ)
-      convert @le_supᵢ₂ _ _ (fun i => i ≤ m + 1) _ _ m.succ le_rfl
+      convert@le_supᵢ₂ _ _ (fun i => i ≤ m + 1) _ _ m.succ le_rfl
       rfl
 #align measure_theory.measure.lebesgue_decomposition.supr_succ_eq_sup MeasureTheory.Measure.LebesgueDecomposition.supᵢ_succ_eq_sup
 
@@ -625,7 +625,7 @@ theorem haveLebesgueDecompositionOfFiniteMeasure [IsFiniteMeasure μ] [IsFiniteM
           exact le_supₛ ⟨⨆ (k : ℕ) (hk : k ≤ n), f k, supr_mem_measurable_le' _ hf₁ _, rfl⟩
       · intro n
         refine' Measurable.aeMeasurable _
-        convert (supr_mem_measurable_le _ hf₁ n).1
+        convert(supr_mem_measurable_le _ hf₁ n).1
         ext
         simp
       · refine' Filter.eventually_of_forall fun a => _
Diff
@@ -66,7 +66,7 @@ Lebesgue decomposition theorem
 
 noncomputable section
 
-open Classical MeasureTheory NNReal Ennreal
+open Classical MeasureTheory NNReal ENNReal
 
 open Set
 
@@ -291,7 +291,7 @@ theorem singularPart_smul (μ ν : Measure α) (r : ℝ≥0) :
       (eq_singular_part ((measurable_rn_deriv μ ν).const_smul (r : ℝ≥0∞))
           (mutually_singular.smul r (have_lebesgue_decomposition_spec _ _).2.1) _).symm
     rw [with_density_smul _ (measurable_rn_deriv _ _), ← smul_add, ←
-      have_lebesgue_decomposition_add μ ν, Ennreal.smul_def]
+      have_lebesgue_decomposition_add μ ν, ENNReal.smul_def]
   · rw [singular_part, singular_part, dif_neg hl, dif_neg, smul_zero]
     refine' fun hl' => hl _
     rw [← inv_smul_smul₀ hr μ]
@@ -443,13 +443,13 @@ theorem exists_positive_of_not_mutuallySingular (μ ν : Measure α) [IsFiniteMe
     by
     intro n
     have := nonpos_of_restrict_le_zero _ (hA₂ n)
-    rwa [to_signed_measure_sub_apply hAmeas, sub_nonpos, Ennreal.toReal_le_toReal] at this
+    rwa [to_signed_measure_sub_apply hAmeas, sub_nonpos, ENNReal.toReal_le_toReal] at this
     exacts[ne_of_lt (measure_lt_top _ _), ne_of_lt (measure_lt_top _ _)]
   have hμ : μ A = 0 :=
     by
     lift μ A to ℝ≥0 using ne_of_lt (measure_lt_top _ _) with μA
     lift ν A to ℝ≥0 using ne_of_lt (measure_lt_top _ _) with νA
-    rw [Ennreal.coe_eq_zero]
+    rw [ENNReal.coe_eq_zero]
     by_cases hb : 0 < νA
     · suffices ∀ b, 0 < b → μA ≤ b by
         by_contra
@@ -474,7 +474,7 @@ theorem exists_positive_of_not_mutuallySingular (μ ν : Measure α) [IsFiniteMe
         · exact hn
         · exact Ne.symm (ne_of_lt hb)
       refine' le_trans _ (le_of_lt h')
-      rw [← Ennreal.coe_le_coe, Ennreal.coe_mul]
+      rw [← ENNReal.coe_le_coe, ENNReal.coe_mul]
       exact hA₃ n
     · rw [not_lt, le_zero_iff] at hb
       specialize hA₃ 0
@@ -508,7 +508,7 @@ theorem zero_mem_measurableLe : (0 : α → ℝ≥0∞) ∈ measurableLe μ ν :
 theorem sup_mem_measurableLe {f g : α → ℝ≥0∞} (hf : f ∈ measurableLe μ ν)
     (hg : g ∈ measurableLe μ ν) : (fun a => f a ⊔ g a) ∈ measurableLe μ ν :=
   by
-  simp_rw [Ennreal.sup_eq_max]
+  simp_rw [ENNReal.sup_eq_max]
   refine' ⟨Measurable.max hf.1 hg.1, fun A hA => _⟩
   have h₁ := hA.inter (measurableSet_le hf.1 hg.1)
   have h₂ := hA.inter (measurableSet_lt hg.1 hf.1)
@@ -522,7 +522,7 @@ theorem supᵢ_succ_eq_sup {α} (f : ℕ → α → ℝ≥0∞) (m : ℕ) (a : 
     (⨆ (k : ℕ) (hk : k ≤ m + 1), f k a) = f m.succ a ⊔ ⨆ (k : ℕ) (hk : k ≤ m), f k a :=
   by
   ext x
-  simp only [Option.mem_def, Ennreal.some_eq_coe]
+  simp only [Option.mem_def, ENNReal.some_eq_coe]
   constructor <;> intro h <;> rw [← h]; symm
   all_goals
     set c := ⨆ (k : ℕ) (hk : k ≤ m + 1), f k a with hc
@@ -673,11 +673,11 @@ theorem haveLebesgueDecompositionOfFiniteMeasure [IsFiniteMeasure μ] [IsFiniteM
         have := subset_le_of_restrict_le_restrict _ _ hE₁ hE₃ (inter_subset_right A E)
         rwa [zero_apply, to_signed_measure_sub_apply (hA.inter hE₁),
           measure.sub_apply (hA.inter hE₁) hle,
-          Ennreal.toReal_sub_of_le _ (ne_of_lt (measure_lt_top _ _)), sub_nonneg, le_sub_iff_add_le,
-          ← Ennreal.toReal_add, Ennreal.toReal_le_toReal, measure.coe_smul, Pi.smul_apply,
+          ENNReal.toReal_sub_of_le _ (ne_of_lt (measure_lt_top _ _)), sub_nonneg, le_sub_iff_add_le,
+          ← ENNReal.toReal_add, ENNReal.toReal_le_toReal, measure.coe_smul, Pi.smul_apply,
           with_density_apply _ (hA.inter hE₁), show ε • ν (A ∩ E) = (ε : ℝ≥0∞) * ν (A ∩ E) by rfl, ←
           set_lintegral_const, ← lintegral_add_left measurable_const] at this
-        · rw [Ne.def, Ennreal.add_eq_top, not_or]
+        · rw [Ne.def, ENNReal.add_eq_top, not_or]
           exact ⟨ne_of_lt (measure_lt_top _ _), ne_of_lt (measure_lt_top _ _)⟩
         · exact ne_of_lt (measure_lt_top _ _)
         · exact ne_of_lt (measure_lt_top _ _)
@@ -705,7 +705,7 @@ theorem haveLebesgueDecompositionOfFiniteMeasure [IsFiniteMeasure μ] [IsFiniteM
       -- but this contradicts the maximality of `∫⁻ x, ξ x ∂ν`
       refine' not_lt.2 this _
       rw [hξ₁, lintegral_add_left hξm, lintegral_indicator _ hE₁, set_lintegral_const]
-      refine' Ennreal.lt_add_right _ (Ennreal.mul_pos_iff.2 ⟨Ennreal.coe_pos.2 hε₁, hE₂⟩).ne'
+      refine' ENNReal.lt_add_right _ (ENNReal.mul_pos_iff.2 ⟨ENNReal.coe_pos.2 hε₁, hE₂⟩).ne'
       have := measure_ne_top (ν.with_density ξ) univ
       rwa [with_density_apply _ MeasurableSet.univ, measure.restrict_univ] at this
     -- since `ν.with_density ξ ≤ μ`, it is clear that `μ = μ₁ + ν.with_density ξ`
@@ -752,7 +752,7 @@ instance (priority := 100) haveLebesgueDecompositionOfSigmaFinite (μ ν : Measu
     refine' ⟨⟨ξ, f⟩, _, _, _⟩
     ·
       exact
-        Measurable.ennreal_tsum' fun n =>
+        Measurable.eNNReal_tsum' fun n =>
           Measurable.indicator (measurable_rn_deriv (μn n) (νn n)) (S.set_mem n)
     -- We show that `ξ` is mutually singular with respect to `ν`
     · choose A hA₁ hA₂ hA₃ using fun n => mutually_singular_singular_part (μn n) (νn n)
@@ -781,7 +781,7 @@ instance (priority := 100) haveLebesgueDecompositionOfSigmaFinite (μ ν : Measu
               rw [disjoint_iff_inter_eq_empty] at this
               rw [this, empty_inter, measure_empty]
             · infer_instance
-          simp_rw [this, tsum_eq_zero_iff Ennreal.summable]
+          simp_rw [this, tsum_eq_zero_iff ENNReal.summable]
           intro n
           exact measure_mono_null (inter_subset_right _ _) (hA₂ n)
         · exact h₂.mono fun i j => Disjoint.mono inf_le_left inf_le_left
@@ -808,7 +808,7 @@ instance (priority := 100) haveLebesgueDecompositionOfSigmaFinite (μ ν : Measu
             rw [top_eq_univ, ← S.spanning, mem_Union] at hx
             obtain ⟨i, hi⟩ := hx
             exact ⟨i, hi, h i hi⟩
-        rw [hcompl.compl_eq, measure_Union, tsum_eq_zero_iff Ennreal.summable]
+        rw [hcompl.compl_eq, measure_Union, tsum_eq_zero_iff ENNReal.summable]
         · intro n
           rw [inter_comm, ← restrict_apply (hA₁ n).compl, ← hA₃ n, hνn, h₁]
         · exact h₂.mono fun i j => Disjoint.mono inf_le_left inf_le_left
@@ -1028,8 +1028,8 @@ variable {s μ}
 
 theorem jordanDecompositionAddWithDensityMutuallySingular {f : α → ℝ} (hf : Measurable f)
     (htμ : t ⟂ᵥ μ.toEnnrealVectorMeasure) :
-    (t.toJordanDecomposition.posPart + μ.withDensity fun x : α => Ennreal.ofReal (f x)) ⟂ₘ
-      t.toJordanDecomposition.negPart + μ.withDensity fun x : α => Ennreal.ofReal (-f x) :=
+    (t.toJordanDecomposition.posPart + μ.withDensity fun x : α => ENNReal.ofReal (f x)) ⟂ₘ
+      t.toJordanDecomposition.negPart + μ.withDensity fun x : α => ENNReal.ofReal (-f x) :=
   by
   rw [mutually_singular_ennreal_iff, total_variation_mutually_singular_iff] at htμ
   change
@@ -1048,8 +1048,8 @@ theorem toJordanDecomposition_eq_of_eq_add_withDensity {f : α → ℝ} (hf : Me
     (hfi : Integrable f μ) (htμ : t ⟂ᵥ μ.toEnnrealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
     s.toJordanDecomposition =
       @JordanDecomposition.mk α _
-        (t.toJordanDecomposition.posPart + μ.withDensity fun x => Ennreal.ofReal (f x))
-        (t.toJordanDecomposition.negPart + μ.withDensity fun x => Ennreal.ofReal (-f x))
+        (t.toJordanDecomposition.posPart + μ.withDensity fun x => ENNReal.ofReal (f x))
+        (t.toJordanDecomposition.negPart + μ.withDensity fun x => ENNReal.ofReal (-f x))
         (by
           haveI := is_finite_measure_with_density_of_real hfi.2
           infer_instance)
@@ -1064,8 +1064,8 @@ theorem toJordanDecomposition_eq_of_eq_add_withDensity {f : α → ℝ} (hf : Me
   simp_rw [jordan_decomposition.to_signed_measure, hadd]
   ext (i hi)
   rw [vector_measure.sub_apply, to_signed_measure_apply_measurable hi,
-      to_signed_measure_apply_measurable hi, add_apply, add_apply, Ennreal.toReal_add,
-      Ennreal.toReal_add, add_sub_add_comm, ← to_signed_measure_apply_measurable hi, ←
+      to_signed_measure_apply_measurable hi, add_apply, add_apply, ENNReal.toReal_add,
+      ENNReal.toReal_add, add_sub_add_comm, ← to_signed_measure_apply_measurable hi, ←
       to_signed_measure_apply_measurable hi, ← vector_measure.sub_apply, ←
       jordan_decomposition.to_signed_measure, to_signed_measure_to_jordan_decomposition,
       vector_measure.add_apply, ← to_signed_measure_apply_measurable hi, ←
@@ -1084,12 +1084,12 @@ private theorem have_lebesgue_decomposition_mk' (μ : Measure α) {f : α → 
   rw [vector_measure.equiv_measure.right_inv, total_variation_mutually_singular_iff] at htμ
   refine'
     { posPart := by
-        use ⟨t.to_jordan_decomposition.pos_part, fun x => Ennreal.ofReal (f x)⟩
+        use ⟨t.to_jordan_decomposition.pos_part, fun x => ENNReal.ofReal (f x)⟩
         refine' ⟨hf.ennreal_of_real, htμ.1, _⟩
         rw [to_jordan_decomposition_eq_of_eq_add_with_density hf hfi htμ' hadd]
       negPart :=
         by
-        use ⟨t.to_jordan_decomposition.neg_part, fun x => Ennreal.ofReal (-f x)⟩
+        use ⟨t.to_jordan_decomposition.neg_part, fun x => ENNReal.ofReal (-f x)⟩
         refine' ⟨hf.neg.ennreal_of_real, htμ.2, _⟩
         rw [to_jordan_decomposition_eq_of_eq_add_with_density hf hfi htμ' hadd] }
 #align measure_theory.signed_measure.have_lebesgue_decomposition_mk' measure_theory.signed_measure.have_lebesgue_decomposition_mk'
@@ -1118,10 +1118,10 @@ private theorem eq_singular_part' (t : SignedMeasure α) {f : α → ℝ} (hf :
   · rw [singular_part, ← t.to_signed_measure_to_jordan_decomposition,
       jordan_decomposition.to_signed_measure]
     congr
-    · have hfpos : Measurable fun x => Ennreal.ofReal (f x) := by measurability
+    · have hfpos : Measurable fun x => ENNReal.ofReal (f x) := by measurability
       refine' eq_singular_part hfpos htμ.1 _
       rw [to_jordan_decomposition_eq_of_eq_add_with_density hf hfi htμ' hadd]
-    · have hfneg : Measurable fun x => Ennreal.ofReal (-f x) := by measurability
+    · have hfneg : Measurable fun x => ENNReal.ofReal (-f x) := by measurability
       refine' eq_singular_part hfneg htμ.2 _
       rw [to_jordan_decomposition_eq_of_eq_add_with_density hf hfi htμ' hadd]
 #align measure_theory.signed_measure.eq_singular_part' measure_theory.signed_measure.eq_singular_part'
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Kexing Ying
 
 ! This file was ported from Lean 3 source module measure_theory.decomposition.lebesgue
-! leanprover-community/mathlib commit 70a4f2197832bceab57d7f41379b2592d1110570
+! leanprover-community/mathlib commit b2ff9a3d7a15fd5b0f060b135421d6a89a999c2f
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -453,7 +453,7 @@ theorem exists_positive_of_not_mutuallySingular (μ ν : Measure α) [IsFiniteMe
     by_cases hb : 0 < νA
     · suffices ∀ b, 0 < b → μA ≤ b by
         by_contra
-        have h' := this (μA / 2) (NNReal.half_pos (zero_lt_iff.2 h))
+        have h' := this (μA / 2) (half_pos (zero_lt_iff.2 h))
         rw [← @Classical.not_not (μA ≤ μA / 2)] at h'
         exact h' (not_le.2 (NNReal.half_lt_self h))
       intro c hc

Changes in mathlib4

mathlib3
mathlib4
chore(MeasureTheory/Decomposition/Lebesgue): use Classical and noncomputable only where needed (#12442)
Diff
@@ -46,19 +46,16 @@ The Lebesgue decomposition provides the Radon-Nikodym theorem readily.
 Lebesgue decomposition theorem
 -/
 
-
-noncomputable section
-
-open scoped Classical MeasureTheory NNReal ENNReal
+open scoped MeasureTheory NNReal ENNReal
 
 open Set
 
-variable {α β : Type*} {m : MeasurableSpace α} {μ ν : MeasureTheory.Measure α}
-
 namespace MeasureTheory
 
 namespace Measure
 
+variable {α β : Type*} {m : MeasurableSpace α} {μ ν : Measure α}
+
 /-- A pair of measures `μ` and `ν` is said to `HaveLebesgueDecomposition` if there exists a
 measure `ξ` and a measurable function `f`, such that `ξ` is mutually singular with respect to
 `ν` and `μ = ξ + ν.withDensity f`. -/
@@ -68,19 +65,21 @@ class HaveLebesgueDecomposition (μ ν : Measure α) : Prop where
 #align measure_theory.measure.have_lebesgue_decomposition MeasureTheory.Measure.HaveLebesgueDecomposition
 #align measure_theory.measure.have_lebesgue_decomposition.lebesgue_decomposition MeasureTheory.Measure.HaveLebesgueDecomposition.lebesgue_decomposition
 
+open Classical in
 /-- If a pair of measures `HaveLebesgueDecomposition`, then `singularPart` chooses the
 measure from `HaveLebesgueDecomposition`, otherwise it returns the zero measure. For sigma-finite
 measures, `μ = μ.singularPart ν + ν.withDensity (μ.rnDeriv ν)`. -/
 @[pp_dot]
-irreducible_def singularPart (μ ν : Measure α) : Measure α :=
+noncomputable irreducible_def singularPart (μ ν : Measure α) : Measure α :=
   if h : HaveLebesgueDecomposition μ ν then (Classical.choose h.lebesgue_decomposition).1 else 0
 #align measure_theory.measure.singular_part MeasureTheory.Measure.singularPart
 
+open Classical in
 /-- If a pair of measures `HaveLebesgueDecomposition`, then `rnDeriv` chooses the
 measurable function from `HaveLebesgueDecomposition`, otherwise it returns the zero function.
 For sigma-finite measures, `μ = μ.singularPart ν + ν.withDensity (μ.rnDeriv ν)`. -/
 @[pp_dot]
-irreducible_def rnDeriv (μ ν : Measure α) : α → ℝ≥0∞ :=
+noncomputable irreducible_def rnDeriv (μ ν : Measure α) : α → ℝ≥0∞ :=
   if h : HaveLebesgueDecomposition μ ν then (Classical.choose h.lebesgue_decomposition).2 else 0
 #align measure_theory.measure.rn_deriv MeasureTheory.Measure.rnDeriv
 
feat(MeasureTheory): add singularPart and rnDeriv lemmas (#11883)

Also golf and move rnDeriv_restrict.

Diff
@@ -238,6 +238,11 @@ theorem singularPart_zero (ν : Measure α) : (0 : Measure α).singularPart ν =
   singularPart_eq_zero_of_ac (AbsolutelyContinuous.zero _)
 #align measure_theory.measure.singular_part_zero MeasureTheory.Measure.singularPart_zero
 
+@[simp]
+lemma singularPart_zero_right (μ : Measure α) : μ.singularPart 0 = μ := by
+  conv_rhs => rw [haveLebesgueDecomposition_add μ 0]
+  simp
+
 lemma singularPart_eq_zero (μ ν : Measure α) [μ.HaveLebesgueDecomposition ν] :
     μ.singularPart ν = 0 ↔ μ ≪ ν := by
   have h_dec := haveLebesgueDecomposition_add μ ν
@@ -306,6 +311,12 @@ lemma singularPart_eq_self [μ.HaveLebesgueDecomposition ν] : μ.singularPart 
   · conv_rhs => rw [h_dec]
     rw [(withDensity_rnDeriv_eq_zero _ _).mpr h, add_zero]
 
+@[simp]
+lemma singularPart_singularPart (μ ν : Measure α) :
+    (μ.singularPart ν).singularPart ν = μ.singularPart ν := by
+  rw [Measure.singularPart_eq_self]
+  exact Measure.mutuallySingular_singularPart _ _
+
 instance singularPart.instIsFiniteMeasure [IsFiniteMeasure μ] :
     IsFiniteMeasure (μ.singularPart ν) :=
   isFiniteMeasure_of_le μ <| singularPart_le μ ν
@@ -462,6 +473,16 @@ theorem singularPart_add (μ₁ μ₂ ν : Measure α) [HaveLebesgueDecompositio
     ← haveLebesgueDecomposition_add μ₂ ν]
 #align measure_theory.measure.singular_part_add MeasureTheory.Measure.singularPart_add
 
+lemma singularPart_restrict (μ ν : Measure α) [HaveLebesgueDecomposition μ ν]
+    {s : Set α} (hs : MeasurableSet s) :
+    (μ.restrict s).singularPart ν = (μ.singularPart ν).restrict s := by
+  refine (Measure.eq_singularPart (f := s.indicator (μ.rnDeriv ν)) ?_ ?_ ?_).symm
+  · exact (μ.measurable_rnDeriv ν).indicator hs
+  · exact (Measure.mutuallySingular_singularPart μ ν).restrict s
+  · ext t
+    rw [withDensity_indicator hs, ← restrict_withDensity hs, ← Measure.restrict_add,
+      ← μ.haveLebesgueDecomposition_add ν]
+
 /-- Given measures `μ` and `ν`, if `s` is a measure mutually singular to `ν` and `f` is a
 measurable function such that `μ = s + fν`, then `f = μ.rnDeriv ν`.
 
@@ -545,6 +566,14 @@ theorem rnDeriv_withDensity (ν : Measure α) [SigmaFinite ν] {f : α → ℝ
   rnDeriv_withDensity₀ ν hf.aemeasurable
 #align measure_theory.measure.rn_deriv_with_density MeasureTheory.Measure.rnDeriv_withDensity
 
+lemma rnDeriv_restrict (μ ν : Measure α) [HaveLebesgueDecomposition μ ν] [SigmaFinite ν]
+    {s : Set α} (hs : MeasurableSet s) :
+    (μ.restrict s).rnDeriv ν =ᵐ[ν] s.indicator (μ.rnDeriv ν) := by
+  refine (eq_rnDeriv (s := (μ.restrict s).singularPart ν)
+    ((measurable_rnDeriv _ _).indicator hs) (mutuallySingular_singularPart _ _) ?_).symm
+  rw [singularPart_restrict _ _ hs, withDensity_indicator hs, ← restrict_withDensity hs,
+    ← Measure.restrict_add, ← μ.haveLebesgueDecomposition_add ν]
+
 /-- The Radon-Nikodym derivative of the restriction of a measure to a measurable set is the
 indicator function of this set. -/
 theorem rnDeriv_restrict_self (ν : Measure α) [SigmaFinite ν] {s : Set α} (hs : MeasurableSet s) :
style: replace '.-/' by '. -/' (#11938)

Purely automatic replacement. If this is in any way controversial; I'm happy to just close this PR.

Diff
@@ -78,7 +78,7 @@ irreducible_def singularPart (μ ν : Measure α) : Measure α :=
 
 /-- If a pair of measures `HaveLebesgueDecomposition`, then `rnDeriv` chooses the
 measurable function from `HaveLebesgueDecomposition`, otherwise it returns the zero function.
-For sigma-finite measures, `μ = μ.singularPart ν + ν.withDensity (μ.rnDeriv ν)`.-/
+For sigma-finite measures, `μ = μ.singularPart ν + ν.withDensity (μ.rnDeriv ν)`. -/
 @[pp_dot]
 irreducible_def rnDeriv (μ ν : Measure α) : α → ℝ≥0∞ :=
   if h : HaveLebesgueDecomposition μ ν then (Classical.choose h.lebesgue_decomposition).2 else 0
chore: Add pp_dot to measure definitions trim, withDensity, restrict, rnDeriv and singularPart (#11871)

We use dot notation for them everywhere in the code. Let's use it in the infoview as well.

Diff
@@ -71,6 +71,7 @@ class HaveLebesgueDecomposition (μ ν : Measure α) : Prop where
 /-- If a pair of measures `HaveLebesgueDecomposition`, then `singularPart` chooses the
 measure from `HaveLebesgueDecomposition`, otherwise it returns the zero measure. For sigma-finite
 measures, `μ = μ.singularPart ν + ν.withDensity (μ.rnDeriv ν)`. -/
+@[pp_dot]
 irreducible_def singularPart (μ ν : Measure α) : Measure α :=
   if h : HaveLebesgueDecomposition μ ν then (Classical.choose h.lebesgue_decomposition).1 else 0
 #align measure_theory.measure.singular_part MeasureTheory.Measure.singularPart
@@ -78,6 +79,7 @@ irreducible_def singularPart (μ ν : Measure α) : Measure α :=
 /-- If a pair of measures `HaveLebesgueDecomposition`, then `rnDeriv` chooses the
 measurable function from `HaveLebesgueDecomposition`, otherwise it returns the zero function.
 For sigma-finite measures, `μ = μ.singularPart ν + ν.withDensity (μ.rnDeriv ν)`.-/
+@[pp_dot]
 irreducible_def rnDeriv (μ ν : Measure α) : α → ℝ≥0∞ :=
   if h : HaveLebesgueDecomposition μ ν then (Classical.choose h.lebesgue_decomposition).2 else 0
 #align measure_theory.measure.rn_deriv MeasureTheory.Measure.rnDeriv
chore: avoid Ne.def (adaptation for nightly-2024-03-27) (#11813)
Diff
@@ -869,7 +869,7 @@ theorem haveLebesgueDecomposition_of_finiteMeasure [IsFiniteMeasure μ] [IsFinit
           ← ENNReal.toReal_add, ENNReal.toReal_le_toReal, Measure.coe_smul, Pi.smul_apply,
           withDensity_apply _ (hA.inter hE₁), show ε • ν (A ∩ E) = (ε : ℝ≥0∞) * ν (A ∩ E) by rfl,
           ← set_lintegral_const, ← lintegral_add_left measurable_const] at this
-        · rw [Ne.def, ENNReal.add_eq_top, not_or]
+        · rw [Ne, ENNReal.add_eq_top, not_or]
           exact ⟨measure_ne_top _ _, measure_ne_top _ _⟩
         · exact measure_ne_top _ _
         · exact measure_ne_top _ _
chore: Reduce scope of LinearOrderedCommGroupWithZero (#11716)

Reconstitute the file Algebra.Order.Monoid.WithZero from three files:

  • Algebra.Order.Monoid.WithZero.Defs
  • Algebra.Order.Monoid.WithZero.Basic
  • Algebra.Order.WithZero

Avoid importing it in many files. Most uses were just to get le_zero_iff to work on Nat.

Before pre_11716

After post_11716

Diff
@@ -692,7 +692,7 @@ theorem exists_positive_of_not_mutuallySingular (μ ν : Measure α) [IsFiniteMe
       exact hA₃ n
     · rw [not_lt, le_zero_iff] at hb
       specialize hA₃ 0
-      simp? [hb, le_zero_iff] at hA₃ says
+      simp? [hb] at hA₃ says
         simp only [CharP.cast_eq_zero, zero_add, ne_eq, one_ne_zero, not_false_eq_true, div_self,
           ENNReal.coe_one, hb, ENNReal.coe_zero, mul_zero, nonpos_iff_eq_zero,
           ENNReal.coe_eq_zero] at hA₃
chore(MeasureTheory.Decomposition.Lebesgue): cleaning and a few new basic lemmas (#11561)

Move lemmas to put similar ones together, replace refine' by refine and => by . Lemmas added:

  • singularPart_add_rnDeriv and rnDeriv_add_singularPart: almost aliases of haveLebesgueDecomposition_add
  • haveLebesgueDecomposition_smul', haveLebesgueDecomposition_rnDeriv
  • singularPart_eq_zero_of_ac, singularPart_eq_zero, singularPart_self, singularPart_eq_self

Co-authored-by: Rémy Degenne <remydegenne@gmail.com>

Diff
@@ -82,15 +82,7 @@ irreducible_def rnDeriv (μ ν : Measure α) : α → ℝ≥0∞ :=
   if h : HaveLebesgueDecomposition μ ν then (Classical.choose h.lebesgue_decomposition).2 else 0
 #align measure_theory.measure.rn_deriv MeasureTheory.Measure.rnDeriv
 
-lemma singularPart_of_not_haveLebesgueDecomposition {μ ν : Measure α}
-    (h : ¬ HaveLebesgueDecomposition μ ν) :
-    μ.singularPart ν = 0 := by
-  rw [singularPart]; exact dif_neg h
-
-lemma rnDeriv_of_not_haveLebesgueDecomposition {μ ν : Measure α}
-    (h : ¬ HaveLebesgueDecomposition μ ν) :
-    μ.rnDeriv ν = 0 := by
-  rw [rnDeriv]; exact dif_neg h
+section ByDefinition
 
 theorem haveLebesgueDecomposition_spec (μ ν : Measure α) [h : HaveLebesgueDecomposition μ ν] :
     Measurable (μ.rnDeriv ν) ∧
@@ -99,27 +91,67 @@ theorem haveLebesgueDecomposition_spec (μ ν : Measure α) [h : HaveLebesgueDec
   exact Classical.choose_spec h.lebesgue_decomposition
 #align measure_theory.measure.have_lebesgue_decomposition_spec MeasureTheory.Measure.haveLebesgueDecomposition_spec
 
-instance instHaveLebesgueDecomposition_zero_left : HaveLebesgueDecomposition 0 ν where
-  lebesgue_decomposition := ⟨⟨0, 0⟩, measurable_zero, MutuallySingular.zero_left, by simp⟩
+lemma rnDeriv_of_not_haveLebesgueDecomposition (h : ¬ HaveLebesgueDecomposition μ ν) :
+    μ.rnDeriv ν = 0 := by
+  rw [rnDeriv, dif_neg h]
 
-instance instHaveLebesgueDecomposition_zero_right : HaveLebesgueDecomposition μ 0 where
-  lebesgue_decomposition := ⟨⟨μ, 0⟩, measurable_zero, MutuallySingular.zero_right, by simp⟩
+lemma singularPart_of_not_haveLebesgueDecomposition (h : ¬ HaveLebesgueDecomposition μ ν) :
+    μ.singularPart ν = 0 := by
+  rw [singularPart, dif_neg h]
+
+@[measurability]
+theorem measurable_rnDeriv (μ ν : Measure α) : Measurable <| μ.rnDeriv ν := by
+  by_cases h : HaveLebesgueDecomposition μ ν
+  · exact (haveLebesgueDecomposition_spec μ ν).1
+  · rw [rnDeriv_of_not_haveLebesgueDecomposition h]
+    exact measurable_zero
+#align measure_theory.measure.measurable_rn_deriv MeasureTheory.Measure.measurable_rnDeriv
+
+theorem mutuallySingular_singularPart (μ ν : Measure α) : μ.singularPart ν ⟂ₘ ν := by
+  by_cases h : HaveLebesgueDecomposition μ ν
+  · exact (haveLebesgueDecomposition_spec μ ν).2.1
+  · rw [singularPart_of_not_haveLebesgueDecomposition h]
+    exact MutuallySingular.zero_left
+#align measure_theory.measure.mutually_singular_singular_part MeasureTheory.Measure.mutuallySingular_singularPart
 
 theorem haveLebesgueDecomposition_add (μ ν : Measure α) [HaveLebesgueDecomposition μ ν] :
     μ = μ.singularPart ν + ν.withDensity (μ.rnDeriv ν) :=
   (haveLebesgueDecomposition_spec μ ν).2.2
 #align measure_theory.measure.have_lebesgue_decomposition_add MeasureTheory.Measure.haveLebesgueDecomposition_add
 
-instance haveLebesgueDecomposition_smul (μ ν : Measure α) [HaveLebesgueDecomposition μ ν]
-    (r : ℝ≥0) : (r • μ).HaveLebesgueDecomposition ν where
+lemma singularPart_add_rnDeriv (μ ν : Measure α) [HaveLebesgueDecomposition μ ν] :
+    μ.singularPart ν + ν.withDensity (μ.rnDeriv ν) = μ := (haveLebesgueDecomposition_add μ ν).symm
+
+lemma rnDeriv_add_singularPart (μ ν : Measure α) [HaveLebesgueDecomposition μ ν] :
+    ν.withDensity (μ.rnDeriv ν) + μ.singularPart ν = μ := by rw [add_comm, singularPart_add_rnDeriv]
+
+end ByDefinition
+
+section HaveLebesgueDecomposition
+
+instance instHaveLebesgueDecompositionZeroLeft : HaveLebesgueDecomposition 0 ν where
+  lebesgue_decomposition := ⟨⟨0, 0⟩, measurable_zero, MutuallySingular.zero_left, by simp⟩
+
+instance instHaveLebesgueDecompositionZeroRight : HaveLebesgueDecomposition μ 0 where
+  lebesgue_decomposition := ⟨⟨μ, 0⟩, measurable_zero, MutuallySingular.zero_right, by simp⟩
+
+instance instHaveLebesgueDecompositionSelf : HaveLebesgueDecomposition μ μ where
+  lebesgue_decomposition := ⟨⟨0, 1⟩, measurable_const, MutuallySingular.zero_left, by simp⟩
+
+instance haveLebesgueDecompositionSmul' (μ ν : Measure α) [HaveLebesgueDecomposition μ ν]
+    (r : ℝ≥0∞) : (r • μ).HaveLebesgueDecomposition ν where
   lebesgue_decomposition := by
     obtain ⟨hmeas, hsing, hadd⟩ := haveLebesgueDecomposition_spec μ ν
-    refine' ⟨⟨r • μ.singularPart ν, r • μ.rnDeriv ν⟩, hmeas.const_smul _, hsing.smul _, _⟩
+    refine ⟨⟨r • μ.singularPart ν, r • μ.rnDeriv ν⟩, hmeas.const_smul _, hsing.smul _, ?_⟩
     simp only [ENNReal.smul_def]
     rw [withDensity_smul _ hmeas, ← smul_add, ← hadd]
-#align measure_theory.measure.have_lebesgue_decomposition_smul MeasureTheory.Measure.haveLebesgueDecomposition_smul
 
-instance haveLebesgueDecomposition_smul_right (μ ν : Measure α) [HaveLebesgueDecomposition μ ν]
+instance haveLebesgueDecompositionSmul (μ ν : Measure α) [HaveLebesgueDecomposition μ ν]
+    (r : ℝ≥0) : (r • μ).HaveLebesgueDecomposition ν := by
+  rw [ENNReal.smul_def]; infer_instance
+#align measure_theory.measure.have_lebesgue_decomposition_smul MeasureTheory.Measure.haveLebesgueDecompositionSmul
+
+instance haveLebesgueDecompositionSmulRight (μ ν : Measure α) [HaveLebesgueDecomposition μ ν]
     (r : ℝ≥0) :
     μ.HaveLebesgueDecomposition (r • ν) where
   lebesgue_decomposition := by
@@ -138,29 +170,19 @@ instance haveLebesgueDecomposition_smul_right (μ ν : Measure α) [HaveLebesgue
 theorem haveLebesgueDecomposition_withDensity (μ : Measure α) {f : α → ℝ≥0∞} (hf : Measurable f) :
     (μ.withDensity f).HaveLebesgueDecomposition μ := ⟨⟨⟨0, f⟩, hf, .zero_left, (zero_add _).symm⟩⟩
 
-@[measurability]
-theorem measurable_rnDeriv (μ ν : Measure α) : Measurable <| μ.rnDeriv ν := by
-  by_cases h : HaveLebesgueDecomposition μ ν
-  · exact (haveLebesgueDecomposition_spec μ ν).1
-  · rw [rnDeriv, dif_neg h]
-    exact measurable_zero
-#align measure_theory.measure.measurable_rn_deriv MeasureTheory.Measure.measurable_rnDeriv
-
-theorem mutuallySingular_singularPart (μ ν : Measure α) : μ.singularPart ν ⟂ₘ ν := by
-  by_cases h : HaveLebesgueDecomposition μ ν
-  · exact (haveLebesgueDecomposition_spec μ ν).2.1
-  · rw [singularPart, dif_neg h]
-    exact MutuallySingular.zero_left
-#align measure_theory.measure.mutually_singular_singular_part MeasureTheory.Measure.mutuallySingular_singularPart
+instance haveLebesgueDecompositionRnDeriv (μ ν : Measure α) :
+    HaveLebesgueDecomposition (ν.withDensity (μ.rnDeriv ν)) ν :=
+  haveLebesgueDecomposition_withDensity ν (measurable_rnDeriv _ _)
 
-instance instHaveLebesgueDecomposition_singularPart :
+instance instHaveLebesgueDecompositionSingularPart :
     HaveLebesgueDecomposition (μ.singularPart ν) ν :=
   ⟨⟨μ.singularPart ν, 0⟩, measurable_zero, mutuallySingular_singularPart μ ν, by simp⟩
 
+end HaveLebesgueDecomposition
+
 theorem singularPart_le (μ ν : Measure α) : μ.singularPart ν ≤ μ := by
   by_cases hl : HaveLebesgueDecomposition μ ν
-  · cases' (haveLebesgueDecomposition_spec μ ν).2 with _ h
-    conv_rhs => rw [h]
+  · conv_rhs => rw [haveLebesgueDecomposition_add μ ν]
     exact Measure.le_add_right le_rfl
   · rw [singularPart, dif_neg hl]
     exact Measure.zero_le μ
@@ -168,8 +190,7 @@ theorem singularPart_le (μ ν : Measure α) : μ.singularPart ν ≤ μ := by
 
 theorem withDensity_rnDeriv_le (μ ν : Measure α) : ν.withDensity (μ.rnDeriv ν) ≤ μ := by
   by_cases hl : HaveLebesgueDecomposition μ ν
-  · cases' (haveLebesgueDecomposition_spec μ ν).2 with _ h
-    conv_rhs => rw [h]
+  · conv_rhs => rw [haveLebesgueDecomposition_add μ ν]
     exact Measure.le_add_left le_rfl
   · rw [rnDeriv, dif_neg hl, withDensity_zero]
     exact Measure.zero_le μ
@@ -189,8 +210,7 @@ lemma MutuallySingular.singularPart (h : μ ⟂ₘ ν) (ν' : Measure α) :
     μ.singularPart ν' ⟂ₘ ν :=
   h.mono (singularPart_le μ ν') le_rfl
 
-lemma absolutelyContinuous_withDensity_rnDeriv {μ ν : Measure α} [HaveLebesgueDecomposition ν μ]
-    (hμν : μ ≪ ν) :
+lemma absolutelyContinuous_withDensity_rnDeriv [HaveLebesgueDecomposition ν μ] (hμν : μ ≪ ν) :
     μ ≪ μ.withDensity (ν.rnDeriv μ) := by
   rw [haveLebesgueDecomposition_add ν μ] at hμν
   refine AbsolutelyContinuous.mk (fun s _ hνs ↦ ?_)
@@ -206,6 +226,24 @@ lemma absolutelyContinuous_withDensity_rnDeriv {μ ν : Measure α} [HaveLebesgu
     · exact measure_mono_null (Set.inter_subset_left _ _) hνs
   · exact measure_mono_null (Set.inter_subset_right _ _) ht2
 
+lemma singularPart_eq_zero_of_ac (h : μ ≪ ν) : μ.singularPart ν = 0 := by
+  rw [← MutuallySingular.self_iff]
+  exact MutuallySingular.mono_ac (mutuallySingular_singularPart _ _)
+    AbsolutelyContinuous.rfl ((absolutelyContinuous_of_le (singularPart_le _ _)).trans h)
+
+@[simp]
+theorem singularPart_zero (ν : Measure α) : (0 : Measure α).singularPart ν = 0 :=
+  singularPart_eq_zero_of_ac (AbsolutelyContinuous.zero _)
+#align measure_theory.measure.singular_part_zero MeasureTheory.Measure.singularPart_zero
+
+lemma singularPart_eq_zero (μ ν : Measure α) [μ.HaveLebesgueDecomposition ν] :
+    μ.singularPart ν = 0 ↔ μ ≪ ν := by
+  have h_dec := haveLebesgueDecomposition_add μ ν
+  refine ⟨fun h ↦ ?_, singularPart_eq_zero_of_ac⟩
+  rw [h, zero_add] at h_dec
+  rw [h_dec]
+  exact withDensity_absolutelyContinuous ν _
+
 @[simp]
 lemma withDensity_rnDeriv_eq_zero (μ ν : Measure α) [μ.HaveLebesgueDecomposition ν] :
     ν.withDensity (μ.rnDeriv ν) = 0 ↔ μ ⟂ₘ ν := by
@@ -228,18 +266,44 @@ lemma rnDeriv_zero (ν : Measure α) : (0 : Measure α).rnDeriv ν =ᵐ[ν] 0 :=
   rw [rnDeriv_eq_zero]
   exact MutuallySingular.zero_left
 
-lemma MutuallySingular.rnDeriv_ae_eq_zero {μ ν : Measure α} (hμν : μ ⟂ₘ ν) :
+lemma MutuallySingular.rnDeriv_ae_eq_zero (hμν : μ ⟂ₘ ν) :
     μ.rnDeriv ν =ᵐ[ν] 0 := by
   by_cases h : μ.HaveLebesgueDecomposition ν
   · rw [rnDeriv_eq_zero]
     exact hμν
   · rw [rnDeriv_of_not_haveLebesgueDecomposition h]
 
+@[simp]
+theorem singularPart_withDensity (ν : Measure α) (f : α → ℝ≥0∞) :
+    (ν.withDensity f).singularPart ν = 0 :=
+  singularPart_eq_zero_of_ac (withDensity_absolutelyContinuous _ _)
+#align measure_theory.measure.singular_part_with_density MeasureTheory.Measure.singularPart_withDensity
+
 lemma rnDeriv_singularPart (μ ν : Measure α) :
     (μ.singularPart ν).rnDeriv ν =ᵐ[ν] 0 := by
   rw [rnDeriv_eq_zero]
   exact mutuallySingular_singularPart μ ν
 
+@[simp]
+lemma singularPart_self (μ : Measure α) : μ.singularPart μ = 0 :=
+  singularPart_eq_zero_of_ac Measure.AbsolutelyContinuous.rfl
+
+lemma rnDeriv_self (μ : Measure α) [SigmaFinite μ] : μ.rnDeriv μ =ᵐ[μ] fun _ ↦ 1 := by
+  have h := rnDeriv_add_singularPart μ μ
+  rw [singularPart_self, add_zero] at h
+  have h_one : μ = μ.withDensity 1 := by simp
+  conv_rhs at h => rw [h_one]
+  rwa [withDensity_eq_iff_of_sigmaFinite (measurable_rnDeriv _ _).aemeasurable] at h
+  exact aemeasurable_const
+
+lemma singularPart_eq_self [μ.HaveLebesgueDecomposition ν] : μ.singularPart ν = μ ↔ μ ⟂ₘ ν := by
+  have h_dec := haveLebesgueDecomposition_add μ ν
+  refine ⟨fun h ↦ ?_, fun  h ↦ ?_⟩
+  · rw [← h]
+    exact mutuallySingular_singularPart _ _
+  · conv_rhs => rw [h_dec]
+    rw [(withDensity_rnDeriv_eq_zero _ _).mpr h, add_zero]
+
 instance singularPart.instIsFiniteMeasure [IsFiniteMeasure μ] :
     IsFiniteMeasure (μ.singularPart ν) :=
   isFiniteMeasure_of_le μ <| singularPart_le μ ν
@@ -269,16 +333,17 @@ instance withDensity.instIsLocallyFiniteMeasure [TopologicalSpace α] [IsLocally
   isLocallyFiniteMeasure_of_le <| withDensity_rnDeriv_le μ ν
 #align measure_theory.measure.with_density.measure_theory.is_locally_finite_measure MeasureTheory.Measure.withDensity.instIsLocallyFiniteMeasure
 
-theorem lintegral_rnDeriv_lt_top_of_measure_ne_top {μ : Measure α} (ν : Measure α) {s : Set α}
-    (hs : μ s ≠ ∞) : ∫⁻ x in s, μ.rnDeriv ν x ∂ν < ∞ := by
+section RNDerivFinite
+
+theorem lintegral_rnDeriv_lt_top_of_measure_ne_top (ν : Measure α) {s : Set α} (hs : μ s ≠ ∞) :
+    ∫⁻ x in s, μ.rnDeriv ν x ∂ν < ∞ := by
   by_cases hl : HaveLebesgueDecomposition μ ν
-  · obtain ⟨-, -, hadd⟩ := haveLebesgueDecomposition_spec μ ν
-    suffices (∫⁻ x in toMeasurable μ s, μ.rnDeriv ν x ∂ν) < ∞ from
+  · suffices (∫⁻ x in toMeasurable μ s, μ.rnDeriv ν x ∂ν) < ∞ from
       lt_of_le_of_lt (lintegral_mono_set (subset_toMeasurable _ _)) this
     rw [← withDensity_apply _ (measurableSet_toMeasurable _ _)]
     calc
       _ ≤ (singularPart μ ν) (toMeasurable μ s) + _ := le_add_self
-      _ = μ s := by rw [← Measure.add_apply, ← hadd, measure_toMeasurable]
+      _ = μ s := by rw [← Measure.add_apply, ← haveLebesgueDecomposition_add, measure_toMeasurable]
       _ < ⊤ := hs.lt_top
   · simp only [Measure.rnDeriv, dif_neg hl, Pi.zero_apply, lintegral_zero, ENNReal.zero_lt_top]
 #align measure_theory.measure.lintegral_rn_deriv_lt_top_of_measure_ne_top MeasureTheory.Measure.lintegral_rnDeriv_lt_top_of_measure_ne_top
@@ -289,7 +354,7 @@ theorem lintegral_rnDeriv_lt_top (μ ν : Measure α) [IsFiniteMeasure μ] :
   exact lintegral_rnDeriv_lt_top_of_measure_ne_top _ (measure_lt_top _ _).ne
 #align measure_theory.measure.lintegral_rn_deriv_lt_top MeasureTheory.Measure.lintegral_rnDeriv_lt_top
 
-lemma integrable_toReal_rnDeriv {μ ν : Measure α} [IsFiniteMeasure μ] :
+lemma integrable_toReal_rnDeriv [IsFiniteMeasure μ] :
     Integrable (fun x ↦ (μ.rnDeriv ν x).toReal) ν :=
   integrable_toReal_of_lintegral_ne_top (Measure.measurable_rnDeriv _ _).aemeasurable
     (Measure.lintegral_rnDeriv_lt_top _ _).ne
@@ -302,13 +367,15 @@ theorem rnDeriv_lt_top (μ ν : Measure α) [SigmaFinite μ] : ∀ᵐ x ∂ν, 
   intro n
   rw [← ae_restrict_iff' (measurable_spanningSets _ _)]
   apply ae_lt_top (measurable_rnDeriv _ _)
-  refine' (lintegral_rnDeriv_lt_top_of_measure_ne_top _ _).ne
+  refine (lintegral_rnDeriv_lt_top_of_measure_ne_top _ ?_).ne
   exact (measure_spanningSets_lt_top _ _).ne
 #align measure_theory.measure.rn_deriv_lt_top MeasureTheory.Measure.rnDeriv_lt_top
 
 lemma rnDeriv_ne_top (μ ν : Measure α) [SigmaFinite μ] : ∀ᵐ x ∂ν, μ.rnDeriv ν x ≠ ∞ := by
   filter_upwards [Measure.rnDeriv_lt_top μ ν] with x hx using hx.ne
 
+end RNDerivFinite
+
 /-- Given measures `μ` and `ν`, if `s` is a measure mutually singular to `ν` and `f` is a
 measurable function such that `μ = s + fν`, then `s = μ.singularPart μ`.
 
@@ -323,16 +390,16 @@ theorem eq_singularPart {s : Measure α} {f : α → ℝ≥0∞} (hf : Measurabl
   rw [hadd'] at hadd
   have hνinter : ν (S ∩ T)ᶜ = 0 := by
     rw [compl_inter]
-    refine' nonpos_iff_eq_zero.1 (le_trans (measure_union_le _ _) _)
+    refine nonpos_iff_eq_zero.1 (le_trans (measure_union_le _ _) ?_)
     rw [hT₃, hS₃, add_zero]
   have heq : s.restrict (S ∩ T)ᶜ = (μ.singularPart ν).restrict (S ∩ T)ᶜ := by
     ext1 A hA
     have hf : ν.withDensity f (A ∩ (S ∩ T)ᶜ) = 0 := by
-      refine' withDensity_absolutelyContinuous ν _ _
+      refine withDensity_absolutelyContinuous ν _ ?_
       rw [← nonpos_iff_eq_zero]
       exact hνinter ▸ measure_mono (inter_subset_right _ _)
     have hrn : ν.withDensity (μ.rnDeriv ν) (A ∩ (S ∩ T)ᶜ) = 0 := by
-      refine' withDensity_absolutelyContinuous ν _ _
+      refine withDensity_absolutelyContinuous ν _ ?_
       rw [← nonpos_iff_eq_zero]
       exact hνinter ▸ measure_mono (inter_subset_right _ _)
     rw [restrict_apply hA, restrict_apply hA, ← add_zero (s (A ∩ (S ∩ T)ᶜ)), ← hf, ← add_apply, ←
@@ -350,25 +417,19 @@ theorem eq_singularPart {s : Measure α} {f : α → ℝ≥0∞} (hf : Measurabl
   rw [heq' A hA, heq, restrict_apply hA, ← diff_eq, AEDisjoint.measure_diff_left hμinter]
 #align measure_theory.measure.eq_singular_part MeasureTheory.Measure.eq_singularPart
 
-theorem singularPart_zero (ν : Measure α) : (0 : Measure α).singularPart ν = 0 := by
-  refine' (eq_singularPart measurable_zero MutuallySingular.zero_left _).symm
-  rw [zero_add, withDensity_zero]
-#align measure_theory.measure.singular_part_zero MeasureTheory.Measure.singularPart_zero
-
 theorem singularPart_smul (μ ν : Measure α) (r : ℝ≥0) :
     (r • μ).singularPart ν = r • μ.singularPart ν := by
   by_cases hr : r = 0
   · rw [hr, zero_smul, zero_smul, singularPart_zero]
   by_cases hl : HaveLebesgueDecomposition μ ν
-  · refine'
-      (eq_singularPart ((measurable_rnDeriv μ ν).const_smul (r : ℝ≥0∞))
-          (MutuallySingular.smul r (haveLebesgueDecomposition_spec _ _).2.1) _).symm
+  · refine (eq_singularPart ((measurable_rnDeriv μ ν).const_smul (r : ℝ≥0∞))
+          (MutuallySingular.smul r (mutuallySingular_singularPart _ _)) ?_).symm
     rw [withDensity_smul _ (measurable_rnDeriv _ _), ← smul_add,
       ← haveLebesgueDecomposition_add μ ν, ENNReal.smul_def]
   · rw [singularPart, singularPart, dif_neg hl, dif_neg, smul_zero]
-    refine' fun hl' => hl _
+    refine fun hl' ↦ hl ?_
     rw [← inv_smul_smul₀ hr μ]
-    exact Measure.haveLebesgueDecomposition_smul _ _ _
+    infer_instance
 #align measure_theory.measure.singular_part_smul MeasureTheory.Measure.singularPart_smul
 
 theorem singularPart_smul_right (μ ν : Measure α) (r : ℝ≥0) (hr : r ≠ 0) :
@@ -384,30 +445,21 @@ theorem singularPart_smul_right (μ ν : Measure α) (r : ℝ≥0) (hr : r ≠ 0
       simp only [Pi.smul_apply]
       rw [← ENNReal.smul_def, smul_inv_smul₀ hr]
   · rw [singularPart, singularPart, dif_neg hl, dif_neg]
-    refine fun hl' => hl ?_
+    refine fun hl' ↦ hl ?_
     rw [← inv_smul_smul₀ hr ν]
     infer_instance
 
 theorem singularPart_add (μ₁ μ₂ ν : Measure α) [HaveLebesgueDecomposition μ₁ ν]
     [HaveLebesgueDecomposition μ₂ ν] :
     (μ₁ + μ₂).singularPart ν = μ₁.singularPart ν + μ₂.singularPart ν := by
-  refine'
-    (eq_singularPart ((measurable_rnDeriv μ₁ ν).add (measurable_rnDeriv μ₂ ν))
-        ((haveLebesgueDecomposition_spec _ _).2.1.add_left
-          (haveLebesgueDecomposition_spec _ _).2.1)
-        _).symm
+  refine (eq_singularPart ((measurable_rnDeriv μ₁ ν).add (measurable_rnDeriv μ₂ ν))
+    ((mutuallySingular_singularPart _ _).add_left (mutuallySingular_singularPart _ _)) ?_).symm
   erw [withDensity_add_left (measurable_rnDeriv μ₁ ν)]
   conv_rhs => rw [add_assoc, add_comm (μ₂.singularPart ν), ← add_assoc, ← add_assoc]
   rw [← haveLebesgueDecomposition_add μ₁ ν, add_assoc, add_comm (ν.withDensity (μ₂.rnDeriv ν)),
     ← haveLebesgueDecomposition_add μ₂ ν]
 #align measure_theory.measure.singular_part_add MeasureTheory.Measure.singularPart_add
 
-theorem singularPart_withDensity (ν : Measure α) {f : α → ℝ≥0∞} (hf : Measurable f) :
-    (ν.withDensity f).singularPart ν = 0 :=
-  have : ν.withDensity f = 0 + ν.withDensity f := by rw [zero_add]
-  (eq_singularPart hf MutuallySingular.zero_left this).symm
-#align measure_theory.measure.singular_part_with_density MeasureTheory.Measure.singularPart_withDensity
-
 /-- Given measures `μ` and `ν`, if `s` is a measure mutually singular to `ν` and `f` is a
 measurable function such that `μ = s + fν`, then `f = μ.rnDeriv ν`.
 
@@ -423,7 +475,7 @@ theorem eq_withDensity_rnDeriv {s : Measure α} {f : α → ℝ≥0∞} (hf : Me
   rw [hadd'] at hadd
   have hνinter : ν (S ∩ T)ᶜ = 0 := by
     rw [compl_inter]
-    refine' nonpos_iff_eq_zero.1 (le_trans (measure_union_le _ _) _)
+    refine nonpos_iff_eq_zero.1 (le_trans (measure_union_le _ _) ?_)
     rw [hT₃, hS₃, add_zero]
   have heq :
     (ν.withDensity f).restrict (S ∩ T) = (ν.withDensity (μ.rnDeriv ν)).restrict (S ∩ T) := by
@@ -454,13 +506,13 @@ theorem eq_withDensity_rnDeriv {s : Measure α} {f : α → ℝ≥0∞} (hf : Me
     restrict_apply hA, ← diff_eq, measure_inter_add_diff _ (hS₁.inter hT₁)]
 #align measure_theory.measure.eq_with_density_rn_deriv MeasureTheory.Measure.eq_withDensity_rnDeriv
 
-theorem eq_withDensity_rnDeriv₀ {μ ν : Measure α} {s : Measure α} {f : α → ℝ≥0∞}
+theorem eq_withDensity_rnDeriv₀ {s : Measure α} {f : α → ℝ≥0∞}
     (hf : AEMeasurable f ν) (hs : s ⟂ₘ ν) (hadd : μ = s + ν.withDensity f) :
     ν.withDensity f = ν.withDensity (μ.rnDeriv ν) := by
   rw [withDensity_congr_ae hf.ae_eq_mk] at hadd ⊢
   exact eq_withDensity_rnDeriv hf.measurable_mk hs hadd
 
-theorem eq_rnDeriv₀ {μ ν : Measure α} [SigmaFinite ν] {s : Measure α} {f : α → ℝ≥0∞}
+theorem eq_rnDeriv₀ [SigmaFinite ν] {s : Measure α} {f : α → ℝ≥0∞}
     (hf : AEMeasurable f ν) (hs : s ⟂ₘ ν) (hadd : μ = s + ν.withDensity f) :
     f =ᵐ[ν] μ.rnDeriv ν :=
   (withDensity_eq_iff_of_sigmaFinite hf (measurable_rnDeriv _ _).aemeasurable).mp
@@ -478,9 +530,6 @@ theorem eq_rnDeriv [SigmaFinite ν] {s : Measure α} {f : α → ℝ≥0∞} (hf
   eq_rnDeriv₀ hf.aemeasurable hs hadd
 #align measure_theory.measure.eq_rn_deriv MeasureTheory.Measure.eq_rnDeriv
 
-lemma rnDeriv_self (μ : Measure α) [SigmaFinite μ] : μ.rnDeriv μ =ᵐ[μ] fun _ ↦ 1 :=
-  (eq_rnDeriv (measurable_const) MutuallySingular.zero_left (by simp)).symm
-
 /-- The Radon-Nikodym derivative of `f ν` with respect to `ν` is `f`. -/
 theorem rnDeriv_withDensity₀ (ν : Measure α) [SigmaFinite ν] {f : α → ℝ≥0∞}
     (hf : AEMeasurable f ν) :
@@ -608,7 +657,7 @@ theorem exists_positive_of_not_mutuallySingular (μ ν : Measure α) [IsFiniteMe
   -- set `A` to be the intersection of all the negative parts of obtained Hahn decompositions
   -- and we show that `μ A = 0`
   set A := ⋂ n, (f n)ᶜ with hA₁
-  have hAmeas : MeasurableSet A := MeasurableSet.iInter fun n => (hf₁ n).compl
+  have hAmeas : MeasurableSet A := MeasurableSet.iInter fun n ↦ (hf₁ n).compl
   have hA₂ : ∀ n : ℕ, μ.toSignedMeasure - ((1 / (n + 1) : ℝ≥0) • ν).toSignedMeasure ≤[A] 0 := by
     intro n; exact restrict_le_restrict_subset _ _ (hf₁ n).compl (hf₃ n) (iInter_subset _ _)
   have hA₃ : ∀ n : ℕ, μ A ≤ (1 / (n + 1) : ℝ≥0) * ν A := by
@@ -628,10 +677,8 @@ theorem exists_positive_of_not_mutuallySingular (μ ν : Measure α) [IsFiniteMe
         exact h' (not_le.2 (NNReal.half_lt_self h))
       intro c hc
       have : ∃ n : ℕ, 1 / (n + 1 : ℝ) < c * (νA : ℝ)⁻¹ := by
-        refine' exists_nat_one_div_lt _
-        refine' mul_pos hc _
-        rw [_root_.inv_pos]
-        exact hb
+        refine exists_nat_one_div_lt ?_
+        positivity
       rcases this with ⟨n, hn⟩
       have hb₁ : (0 : ℝ) < (νA : ℝ)⁻¹ := by rw [_root_.inv_pos]; exact hb
       have h' : 1 / (↑n + 1) * νA < c := by
@@ -640,7 +687,7 @@ theorem exists_positive_of_not_mutuallySingular (μ ν : Measure α) [IsFiniteMe
           NNReal.coe_inv]
         · exact hn
         · exact hb.ne'
-      refine' le_trans _ (le_of_lt h')
+      refine le_trans ?_ h'.le
       rw [← ENNReal.coe_le_coe, ENNReal.coe_mul]
       exact hA₃ n
     · rw [not_lt, le_zero_iff] at hb
@@ -671,17 +718,17 @@ def measurableLE (μ ν : Measure α) : Set (α → ℝ≥0∞) :=
 #align measure_theory.measure.lebesgue_decomposition.measurable_le MeasureTheory.Measure.LebesgueDecomposition.measurableLE
 
 theorem zero_mem_measurableLE : (0 : α → ℝ≥0∞) ∈ measurableLE μ ν :=
-  ⟨measurable_zero, fun A _ => by simp⟩
+  ⟨measurable_zero, fun A _ ↦ by simp⟩
 #align measure_theory.measure.lebesgue_decomposition.zero_mem_measurable_le MeasureTheory.Measure.LebesgueDecomposition.zero_mem_measurableLE
 
 theorem sup_mem_measurableLE {f g : α → ℝ≥0∞} (hf : f ∈ measurableLE μ ν)
-    (hg : g ∈ measurableLE μ ν) : (fun a => f a ⊔ g a) ∈ measurableLE μ ν := by
+    (hg : g ∈ measurableLE μ ν) : (fun a ↦ f a ⊔ g a) ∈ measurableLE μ ν := by
   simp_rw [ENNReal.sup_eq_max]
-  refine' ⟨Measurable.max hf.1 hg.1, fun A hA => _⟩
+  refine ⟨Measurable.max hf.1 hg.1, fun A hA ↦ ?_⟩
   have h₁ := hA.inter (measurableSet_le hf.1 hg.1)
   have h₂ := hA.inter (measurableSet_lt hg.1 hf.1)
   rw [set_lintegral_max hf.1 hg.1]
-  refine' (add_le_add (hg.2 _ h₁) (hf.2 _ h₂)).trans_eq _
+  refine (add_le_add (hg.2 _ h₁) (hf.2 _ h₂)).trans_eq ?_
   · simp only [← not_le, ← compl_setOf, ← diff_eq]
     exact measure_inter_add_diff _ (measurableSet_le hf.1 hg.1)
 #align measure_theory.measure.lebesgue_decomposition.sup_mem_measurable_le MeasureTheory.Measure.LebesgueDecomposition.sup_mem_measurableLE
@@ -691,26 +738,26 @@ theorem iSup_succ_eq_sup {α} (f : ℕ → α → ℝ≥0∞) (m : ℕ) (a : α)
   set c := ⨆ (k : ℕ) (_ : k ≤ m + 1), f k a with hc
   set d := f m.succ a ⊔ ⨆ (k : ℕ) (_ : k ≤ m), f k a with hd
   rw [le_antisymm_iff, hc, hd]
-  refine' ⟨_, _⟩
-  · refine' iSup₂_le fun n hn => _
+  constructor
+  · refine iSup₂_le fun n hn ↦ ?_
     rcases Nat.of_le_succ hn with (h | h)
-    · exact le_sup_of_le_right (le_iSup₂ (f := fun k (_ : k ≤ m) => f k a) n h)
+    · exact le_sup_of_le_right (le_iSup₂ (f := fun k (_ : k ≤ m) ↦ f k a) n h)
     · exact h ▸ le_sup_left
-  · refine' sup_le _ (biSup_mono fun n hn => hn.trans m.le_succ)
-    exact @le_iSup₂ ℝ≥0∞ ℕ (fun i => i ≤ m + 1) _ _ (m + 1) le_rfl
+  · refine sup_le ?_ (biSup_mono fun n hn ↦ hn.trans m.le_succ)
+    exact @le_iSup₂ ℝ≥0∞ ℕ (fun i ↦ i ≤ m + 1) _ _ (m + 1) le_rfl
 #align measure_theory.measure.lebesgue_decomposition.supr_succ_eq_sup MeasureTheory.Measure.LebesgueDecomposition.iSup_succ_eq_sup
 
 theorem iSup_mem_measurableLE (f : ℕ → α → ℝ≥0∞) (hf : ∀ n, f n ∈ measurableLE μ ν) (n : ℕ) :
-    (fun x => ⨆ (k) (_ : k ≤ n), f k x) ∈ measurableLE μ ν := by
+    (fun x ↦ ⨆ (k) (_ : k ≤ n), f k x) ∈ measurableLE μ ν := by
   induction' n with m hm
-  · refine' ⟨_, _⟩
+  · constructor
     · simp [(hf 0).1]
     · intro A hA; simp [(hf 0).2 A hA]
   · have :
-      (fun a : α => ⨆ (k : ℕ) (_ : k ≤ m + 1), f k a) = fun a =>
+      (fun a : α ↦ ⨆ (k : ℕ) (_ : k ≤ m + 1), f k a) = fun a ↦
         f m.succ a ⊔ ⨆ (k : ℕ) (_ : k ≤ m), f k a :=
-      funext fun _ => iSup_succ_eq_sup _ _ _
-    refine' ⟨measurable_iSup fun n => Measurable.iSup_Prop _ (hf n).1, fun A hA => _⟩
+      funext fun _ ↦ iSup_succ_eq_sup _ _ _
+    refine ⟨measurable_iSup fun n ↦ Measurable.iSup_Prop _ (hf n).1, fun A hA ↦ ?_⟩
     rw [this]; exact (sup_mem_measurableLE (hf m.succ) hm).2 A hA
 #align measure_theory.measure.lebesgue_decomposition.supr_mem_measurable_le MeasureTheory.Measure.LebesgueDecomposition.iSup_mem_measurableLE
 
@@ -725,24 +772,24 @@ section SuprLemmas
 --TODO: these statements should be moved elsewhere
 
 theorem iSup_monotone {α : Type*} (f : ℕ → α → ℝ≥0∞) :
-    Monotone fun n x => ⨆ (k) (_ : k ≤ n), f k x := fun _ _ hnm _ =>
-  biSup_mono fun _ => ge_trans hnm
+    Monotone fun n x ↦ ⨆ (k) (_ : k ≤ n), f k x :=
+  fun _ _ hnm _ ↦ biSup_mono fun _ ↦ ge_trans hnm
 #align measure_theory.measure.lebesgue_decomposition.supr_monotone MeasureTheory.Measure.LebesgueDecomposition.iSup_monotone
 
 theorem iSup_monotone' {α : Type*} (f : ℕ → α → ℝ≥0∞) (x : α) :
-    Monotone fun n => ⨆ (k) (_ : k ≤ n), f k x := fun _ _ hnm => iSup_monotone f hnm x
+    Monotone fun n ↦ ⨆ (k) (_ : k ≤ n), f k x := fun _ _ hnm ↦ iSup_monotone f hnm x
 #align measure_theory.measure.lebesgue_decomposition.supr_monotone' MeasureTheory.Measure.LebesgueDecomposition.iSup_monotone'
 
 theorem iSup_le_le {α : Type*} (f : ℕ → α → ℝ≥0∞) (n k : ℕ) (hk : k ≤ n) :
-    f k ≤ fun x => ⨆ (k) (_ : k ≤ n), f k x :=
-  fun x => le_iSup₂ (f := fun k (_ : k ≤ n) => f k x) k hk
+    f k ≤ fun x ↦ ⨆ (k) (_ : k ≤ n), f k x :=
+  fun x ↦ le_iSup₂ (f := fun k (_ : k ≤ n) ↦ f k x) k hk
 #align measure_theory.measure.lebesgue_decomposition.supr_le_le MeasureTheory.Measure.LebesgueDecomposition.iSup_le_le
 
 end SuprLemmas
 
 /-- `measurableLEEval μ ν` is the set of `∫⁻ x, f x ∂μ` for all `f ∈ measurableLE μ ν`. -/
 def measurableLEEval (μ ν : Measure α) : Set ℝ≥0∞ :=
-  (fun f : α → ℝ≥0∞ => ∫⁻ x, f x ∂μ) '' measurableLE μ ν
+  (fun f : α → ℝ≥0∞ ↦ ∫⁻ x, f x ∂μ) '' measurableLE μ ν
 #align measure_theory.measure.lebesgue_decomposition.measurable_le_eval MeasureTheory.Measure.LebesgueDecomposition.measurableLEEval
 
 end LebesgueDecomposition
@@ -758,34 +805,33 @@ This is not an instance since this is also shown for the more general σ-finite
 theorem haveLebesgueDecomposition_of_finiteMeasure [IsFiniteMeasure μ] [IsFiniteMeasure ν] :
     HaveLebesgueDecomposition μ ν :=
   ⟨by
-    have h :=
-      @exists_seq_tendsto_sSup _ _ _ _ _ (measurableLEEval ν μ)
-        ⟨0, 0, zero_mem_measurableLE, by simp⟩ (OrderTop.bddAbove _)
+    have h := @exists_seq_tendsto_sSup _ _ _ _ _ (measurableLEEval ν μ)
+      ⟨0, 0, zero_mem_measurableLE, by simp⟩ (OrderTop.bddAbove _)
     choose g _ hg₂ f hf₁ hf₂ using h
     -- we set `ξ` to be the supremum of an increasing sequence of functions obtained from above
     set ξ := ⨆ (n) (k) (_ : k ≤ n), f k with hξ
     -- we see that `ξ` has the largest integral among all functions in `measurableLE`
     have hξ₁ : sSup (measurableLEEval ν μ) = ∫⁻ a, ξ a ∂ν := by
       have :=
-        @lintegral_tendsto_of_tendsto_of_monotone _ _ ν (fun n => ⨆ (k) (_ : k ≤ n), f k)
+        @lintegral_tendsto_of_tendsto_of_monotone _ _ ν (fun n ↦ ⨆ (k) (_ : k ≤ n), f k)
           (⨆ (n) (k) (_ : k ≤ n), f k) ?_ ?_ ?_
-      · refine' tendsto_nhds_unique _ this
-        refine' tendsto_of_tendsto_of_tendsto_of_le_of_le hg₂ tendsto_const_nhds _ _
+      · refine tendsto_nhds_unique ?_ this
+        refine tendsto_of_tendsto_of_tendsto_of_le_of_le hg₂ tendsto_const_nhds ?_ ?_
         · intro n; rw [← hf₂ n]
           apply lintegral_mono
           simp only [iSup_apply, iSup_le_le f n n le_rfl]
         · intro n
           exact le_sSup ⟨⨆ (k : ℕ) (_ : k ≤ n), f k, iSup_mem_measurableLE' _ hf₁ _, rfl⟩
       · intro n
-        refine' Measurable.aemeasurable _
+        refine Measurable.aemeasurable ?_
         convert (iSup_mem_measurableLE _ hf₁ n).1
         simp
-      · refine' Filter.eventually_of_forall fun a => _
+      · refine Filter.eventually_of_forall fun a ↦ ?_
         simp [iSup_monotone' f _]
-      · refine' Filter.eventually_of_forall fun a => _
+      · refine Filter.eventually_of_forall fun a ↦ ?_
         simp [tendsto_atTop_iSup (iSup_monotone' f a)]
     have hξm : Measurable ξ := by
-      convert measurable_iSup fun n => (iSup_mem_measurableLE _ hf₁ n).1
+      convert measurable_iSup fun n ↦ (iSup_mem_measurableLE _ hf₁ n).1
       simp [hξ]
     -- `ξ` is the `f` in the theorem statement and we set `μ₁` to be `μ - ν.withDensity ξ`
     -- since we need `μ₁ + ν.withDensity ξ = μ`
@@ -794,14 +840,14 @@ theorem haveLebesgueDecomposition_of_finiteMeasure [IsFiniteMeasure μ] [IsFinit
       refine le_iff.2 fun B hB ↦ ?_
       rw [hξ, withDensity_apply _ hB]
       simp_rw [iSup_apply]
-      rw [lintegral_iSup (fun i => (iSup_mem_measurableLE _ hf₁ i).1) (iSup_monotone _)]
-      exact iSup_le fun i => (iSup_mem_measurableLE _ hf₁ i).2 B hB
+      rw [lintegral_iSup (fun i ↦ (iSup_mem_measurableLE _ hf₁ i).1) (iSup_monotone _)]
+      exact iSup_le fun i ↦ (iSup_mem_measurableLE _ hf₁ i).2 B hB
     have : IsFiniteMeasure (ν.withDensity ξ) := by
-      refine' isFiniteMeasure_withDensity _
+      refine isFiniteMeasure_withDensity ?_
       have hle' := hle univ
       rw [withDensity_apply _ MeasurableSet.univ, Measure.restrict_univ] at hle'
       exact ne_top_of_le_ne_top (measure_ne_top _ _) hle'
-    refine' ⟨⟨μ₁, ξ⟩, hξm, _, _⟩
+    refine ⟨⟨μ₁, ξ⟩, hξm, ?_, ?_⟩
     · by_contra h
       -- if they are not mutually singular, then from `exists_positive_of_not_mutuallySingular`,
       -- there exists some `ε > 0` and a measurable set `E`, such that `μ(E) > 0` and `E` is
@@ -811,8 +857,8 @@ theorem haveLebesgueDecomposition_of_finiteMeasure [IsFiniteMeasure μ] [IsFinit
       have hξle : ∀ A, MeasurableSet A → (∫⁻ a in A, ξ a ∂ν) ≤ μ A := by
         intro A hA; rw [hξ]
         simp_rw [iSup_apply]
-        rw [lintegral_iSup (fun n => (iSup_mem_measurableLE _ hf₁ n).1) (iSup_monotone _)]
-        exact iSup_le fun n => (iSup_mem_measurableLE _ hf₁ n).2 A hA
+        rw [lintegral_iSup (fun n ↦ (iSup_mem_measurableLE _ hf₁ n).1) (iSup_monotone _)]
+        exact iSup_le fun n ↦ (iSup_mem_measurableLE _ hf₁ n).2 A hA
       -- since `E` is positive, we have `∫⁻ a in A ∩ E, ε + ξ a ∂ν ≤ μ (A ∩ E)` for all `A`
       have hε₂ : ∀ A : Set α, MeasurableSet A → (∫⁻ a in A ∩ E, ε + ξ a ∂ν) ≤ μ (A ∩ E) := by
         intro A hA
@@ -832,10 +878,10 @@ theorem haveLebesgueDecomposition_of_finiteMeasure [IsFiniteMeasure μ] [IsFinit
           exact hξle (A ∩ E) (hA.inter hE₁)
       -- from this, we can show `ξ + ε * E.indicator` is a function in `measurableLE` with
       -- integral greater than `ξ`
-      have hξε : (ξ + E.indicator fun _ => (ε : ℝ≥0∞)) ∈ measurableLE ν μ := by
-        refine' ⟨Measurable.add hξm (Measurable.indicator measurable_const hE₁), fun A hA => _⟩
+      have hξε : (ξ + E.indicator fun _ ↦ (ε : ℝ≥0∞)) ∈ measurableLE ν μ := by
+        refine ⟨Measurable.add hξm (Measurable.indicator measurable_const hE₁), fun A hA ↦ ?_⟩
         have :
-          (∫⁻ a in A, (ξ + E.indicator fun _ => (ε : ℝ≥0∞)) a ∂ν) =
+          (∫⁻ a in A, (ξ + E.indicator fun _ ↦ (ε : ℝ≥0∞)) a ∂ν) =
             (∫⁻ a in A ∩ E, ε + ξ a ∂ν) + ∫⁻ a in A \ E, ξ a ∂ν := by
           simp only [lintegral_add_left measurable_const, lintegral_add_left hξm,
             set_lintegral_const, add_assoc, lintegral_inter_add_diff _ _ hE₁, Pi.add_apply,
@@ -843,12 +889,12 @@ theorem haveLebesgueDecomposition_of_finiteMeasure [IsFiniteMeasure μ] [IsFinit
           rw [inter_comm, add_comm]
         rw [this, ← measure_inter_add_diff A hE₁]
         exact add_le_add (hε₂ A hA) (hξle (A \ E) (hA.diff hE₁))
-      have : (∫⁻ a, ξ a + E.indicator (fun _ => (ε : ℝ≥0∞)) a ∂ν) ≤ sSup (measurableLEEval ν μ) :=
-        le_sSup ⟨ξ + E.indicator fun _ => (ε : ℝ≥0∞), hξε, rfl⟩
+      have : (∫⁻ a, ξ a + E.indicator (fun _ ↦ (ε : ℝ≥0∞)) a ∂ν) ≤ sSup (measurableLEEval ν μ) :=
+        le_sSup ⟨ξ + E.indicator fun _ ↦ (ε : ℝ≥0∞), hξε, rfl⟩
       -- but this contradicts the maximality of `∫⁻ x, ξ x ∂ν`
-      refine' not_lt.2 this _
+      refine not_lt.2 this ?_
       rw [hξ₁, lintegral_add_left hξm, lintegral_indicator _ hE₁, set_lintegral_const]
-      refine' ENNReal.lt_add_right _ (ENNReal.mul_pos_iff.2 ⟨ENNReal.coe_pos.2 hε₁, hE₂⟩).ne'
+      refine ENNReal.lt_add_right ?_ (ENNReal.mul_pos_iff.2 ⟨ENNReal.coe_pos.2 hε₁, hE₂⟩).ne'
       have := measure_ne_top (ν.withDensity ξ) univ
       rwa [withDensity_apply _ MeasurableSet.univ, Measure.restrict_univ] at this
     -- since `ν.withDensity ξ ≤ μ`, it is clear that `μ = μ₁ + ν.withDensity ξ`
@@ -878,38 +924,35 @@ instance (priority := 100) haveLebesgueDecomposition_of_sigmaFinite (μ ν : Mea
     -- We define `μn` and `νn` as sequences of measures such that `μn n = μ ∩ S n` and
     -- `νn n = ν ∩ S n` where `S` is the aforementioned finite spanning set sequence.
     -- Since `S` is spanning, it is clear that `sum μn = μ` and `sum νn = ν`
-    set μn : ℕ → Measure α := fun n => μ.restrict (S.set n) with hμn
+    set μn : ℕ → Measure α := fun n ↦ μ.restrict (S.set n) with hμn
     have hμ : μ = sum μn := by rw [hμn, ← restrict_iUnion h₂ S.set_mem, S.spanning, restrict_univ]
-    set νn : ℕ → Measure α := fun n => ν.restrict (T.set n) with hνn
+    set νn : ℕ → Measure α := fun n ↦ ν.restrict (T.set n) with hνn
     have hν : ν = sum νn := by rw [hνn, ← restrict_iUnion h₃ T.set_mem, T.spanning, restrict_univ]
     -- As `S` is finite with respect to both `μ` and `ν`, it is clear that `μn n` and `νn n` are
     -- finite measures for all `n : ℕ`. Thus, we may apply the finite Lebesgue decomposition theorem
     -- to `μn n` and `νn n`. We define `ξ` as the sum of the singular part of the Lebesgue
     -- decompositions of `μn n` and `νn n`, and `f` as the sum of the Radon-Nikodym derivatives of
     -- `μn n` and `νn n` restricted on `S n`
-    set ξ := sum fun n => singularPart (μn n) (νn n) with hξ
+    set ξ := sum fun n ↦ singularPart (μn n) (νn n) with hξ
     set f := ∑' n, (S.set n).indicator (rnDeriv (μn n) (νn n))
     -- I claim `ξ` and `f` form a Lebesgue decomposition of `μ` and `ν`
-    refine' ⟨⟨ξ, f⟩, _, _, _⟩
-    · exact
-        Measurable.ennreal_tsum' fun n =>
-          Measurable.indicator (measurable_rnDeriv (μn n) (νn n)) (S.set_mem n)
+    refine ⟨⟨ξ, f⟩, ?_, ?_, ?_⟩
+    · exact Measurable.ennreal_tsum'
+        fun n ↦ Measurable.indicator (measurable_rnDeriv (μn n) (νn n)) (S.set_mem n)
     -- We show that `ξ` is mutually singular with respect to `ν`
-    · choose A hA₁ hA₂ hA₃ using fun n => mutuallySingular_singularPart (μn n) (νn n)
+    · choose A hA₁ hA₂ hA₃ using fun n ↦ mutuallySingular_singularPart (μn n) (νn n)
       simp only [hξ]
       -- We use the set `B := ⋃ j, (S.set j) ∩ A j` where `A n` is the set provided as
       -- `singularPart (μn n) (νn n) ⟂ₘ νn n`
-      refine' ⟨⋃ j, S.set j ∩ A j, MeasurableSet.iUnion fun n => (S.set_mem n).inter (hA₁ n), _, _⟩
+      refine ⟨⋃ j, S.set j ∩ A j, MeasurableSet.iUnion fun n ↦ (S.set_mem n).inter (hA₁ n), ?_, ?_⟩
       -- `ξ B = 0` since `ξ B = ∑ i j, singularPart (μn j) (νn j) (S.set i ∩ A i)`
       --                     `= ∑ i, singularPart (μn i) (νn i) (S.set i ∩ A i)`
       --                     `≤ ∑ i, singularPart (μn i) (νn i) (A i) = 0`
       -- where the second equality follows as `singularPart (μn j) (νn j) (S.set i ∩ A i)` vanishes
       -- for all `i ≠ j`
       · rw [measure_iUnion]
-        · have :
-            ∀ i,
-              (sum fun n => (μn n).singularPart (νn n)) (S.set i ∩ A i) =
-                (μn i).singularPart (νn i) (S.set i ∩ A i) := by
+        · have : ∀ i, (sum fun n ↦ (μn n).singularPart (νn n)) (S.set i ∩ A i)
+              = (μn i).singularPart (νn i) (S.set i ∩ A i) := by
             intro i; rw [sum_apply _ ((S.set_mem i).inter (hA₁ i)), tsum_eq_single i]
             · intro j hij
               rw [hμn, ← nonpos_iff_eq_zero]
@@ -920,8 +963,8 @@ instance (priority := 100) haveLebesgueDecomposition_of_sigmaFinite (μ ν : Mea
               rw [this, empty_inter, measure_empty]
           simp_rw [this, tsum_eq_zero_iff ENNReal.summable]
           intro n; exact measure_mono_null (inter_subset_right _ _) (hA₂ n)
-        · exact h₂.mono fun i j => Disjoint.mono inf_le_left inf_le_left
-        · exact fun n => (S.set_mem n).inter (hA₁ n)
+        · exact h₂.mono fun i j ↦ Disjoint.mono inf_le_left inf_le_left
+        · exact fun n ↦ (S.set_mem n).inter (hA₁ n)
       -- We will now show `ν Bᶜ = 0`. This follows since `Bᶜ = ⋃ n, S.set n ∩ (A n)ᶜ` and thus,
       -- `ν Bᶜ = ∑ i, ν (S.set i ∩ (A i)ᶜ) = ∑ i, (νn i) (A i)ᶜ = 0`
       · have hcompl : IsCompl (⋃ n, S.set n ∩ A n) (⋃ n, S.set n ∩ (A n)ᶜ) := by
@@ -941,8 +984,8 @@ instance (priority := 100) haveLebesgueDecomposition_of_sigmaFinite (μ ν : Mea
             exact ⟨i, hi, h i hi⟩
         rw [hcompl.compl_eq, measure_iUnion, tsum_eq_zero_iff ENNReal.summable]
         · intro n; rw [inter_comm, ← restrict_apply (hA₁ n).compl, ← hA₃ n, hνn, h₁]
-        · exact h₂.mono fun i j => Disjoint.mono inf_le_left inf_le_left
-        · exact fun n => (S.set_mem n).inter (hA₁ n).compl
+        · exact h₂.mono fun i j ↦ Disjoint.mono inf_le_left inf_le_left
+        · exact fun n ↦ (S.set_mem n).inter (hA₁ n).compl
     -- Finally, it remains to show `μ = ξ + ν.withDensity f`. Since `μ = sum μn`, and
     -- `ξ + ν.withDensity f = ∑ n, singularPart (μn n) (νn n)`
     --                        `+ ν.withDensity (rnDeriv (μn n) (νn n)) ∩ (S.set n)`,
@@ -951,19 +994,19 @@ instance (priority := 100) haveLebesgueDecomposition_of_sigmaFinite (μ ν : Mea
     · simp only
       nth_rw 1 [hμ]
       rw [withDensity_tsum _, sum_add_sum]
-      · refine' sum_congr fun n => _
+      · refine sum_congr fun n ↦ ?_
         nth_rw 1 [haveLebesgueDecomposition_add (μn n) (νn n)]
         suffices heq :
           (νn n).withDensity ((μn n).rnDeriv (νn n)) =
             ν.withDensity ((S.set n).indicator ((μn n).rnDeriv (νn n))) by rw [heq]
         rw [hν, withDensity_indicator (S.set_mem n), restrict_sum _ (S.set_mem n)]
-        suffices hsumeq : (sum fun i : ℕ => (νn i).restrict (S.set n)) = νn n by rw [hsumeq]
+        suffices hsumeq : (sum fun i : ℕ ↦ (νn i).restrict (S.set n)) = νn n by rw [hsumeq]
         ext1 s hs
         rw [sum_apply _ hs, tsum_eq_single n, hνn, h₁, restrict_restrict (T.set_mem n), inter_self]
         · intro m hm
           rw [hνn, h₁, restrict_restrict (T.set_mem n), (h₃ hm.symm).inter_eq, restrict_empty,
             coe_zero, Pi.zero_apply]
-      · exact fun n => Measurable.indicator (measurable_rnDeriv _ _) (S.set_mem n)⟩
+      · exact fun n ↦ Measurable.indicator (measurable_rnDeriv _ _) (S.set_mem n)⟩
 #align measure_theory.measure.have_lebesgue_decomposition_of_sigma_finite MeasureTheory.Measure.haveLebesgueDecomposition_of_sigmaFinite
 
 section rnDeriv
chore: move Mathlib to v4.7.0-rc1 (#11162)

This is a very large PR, but it has been reviewed piecemeal already in PRs to the bump/v4.7.0 branch as we update to intermediate nightlies.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Kyle Miller <kmill31415@gmail.com> Co-authored-by: damiano <adomani@gmail.com>

Diff
@@ -653,7 +653,7 @@ theorem exists_positive_of_not_mutuallySingular (μ ν : Measure α) [IsFiniteMe
   -- since `μ` and `ν` are not mutually singular, `μ A = 0` implies `ν Aᶜ > 0`
   rw [MutuallySingular] at h; push_neg at h
   have := h _ hAmeas hμ
-  simp_rw [compl_iInter, compl_compl] at this
+  simp_rw [A, compl_iInter, compl_compl] at this
   -- as `Aᶜ = ⋃ n, f n`, `ν Aᶜ > 0` implies there exists some `n` such that `ν (f n) > 0`
   obtain ⟨n, hn⟩ := exists_measure_pos_of_not_measure_iUnion_null this
   -- thus, choosing `f n` as the set `E` suffices
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
Diff
@@ -791,14 +791,14 @@ theorem haveLebesgueDecomposition_of_finiteMeasure [IsFiniteMeasure μ] [IsFinit
     -- since we need `μ₁ + ν.withDensity ξ = μ`
     set μ₁ := μ - ν.withDensity ξ with hμ₁
     have hle : ν.withDensity ξ ≤ μ := by
-      intro B hB
+      refine le_iff.2 fun B hB ↦ ?_
       rw [hξ, withDensity_apply _ hB]
       simp_rw [iSup_apply]
       rw [lintegral_iSup (fun i => (iSup_mem_measurableLE _ hf₁ i).1) (iSup_monotone _)]
       exact iSup_le fun i => (iSup_mem_measurableLE _ hf₁ i).2 B hB
     have : IsFiniteMeasure (ν.withDensity ξ) := by
       refine' isFiniteMeasure_withDensity _
-      have hle' := hle univ MeasurableSet.univ
+      have hle' := hle univ
       rw [withDensity_apply _ MeasurableSet.univ, Measure.restrict_univ] at hle'
       exact ne_top_of_le_ne_top (measure_ne_top _ _) hle'
     refine' ⟨⟨μ₁, ξ⟩, hξm, _, _⟩
@@ -854,7 +854,7 @@ theorem haveLebesgueDecomposition_of_finiteMeasure [IsFiniteMeasure μ] [IsFinit
     -- since `ν.withDensity ξ ≤ μ`, it is clear that `μ = μ₁ + ν.withDensity ξ`
     · rw [hμ₁]; ext1 A hA
       rw [Measure.coe_add, Pi.add_apply, Measure.sub_apply hA hle, add_comm,
-        add_tsub_cancel_of_le (hle A hA)]⟩
+        add_tsub_cancel_of_le (hle A)]⟩
 #align measure_theory.measure.have_lebesgue_decomposition_of_finite_measure MeasureTheory.Measure.haveLebesgueDecomposition_of_finiteMeasure
 
 attribute [local instance] haveLebesgueDecomposition_of_finiteMeasure
@@ -913,7 +913,7 @@ instance (priority := 100) haveLebesgueDecomposition_of_sigmaFinite (μ ν : Mea
             intro i; rw [sum_apply _ ((S.set_mem i).inter (hA₁ i)), tsum_eq_single i]
             · intro j hij
               rw [hμn, ← nonpos_iff_eq_zero]
-              refine' le_trans ((singularPart_le _ _) _ ((S.set_mem i).inter (hA₁ i))) (le_of_eq _)
+              refine (singularPart_le _ _ _).trans_eq ?_
               rw [restrict_apply ((S.set_mem i).inter (hA₁ i)), inter_comm, ← inter_assoc]
               have : Disjoint (S.set j) (S.set i) := h₂ hij
               rw [disjoint_iff_inter_eq_empty] at this
chore: remove stream-of-consciousness uses of have, replace and suffices (#10640)

No changes to tactic file, it's just boring fixes throughout the library.

This follows on from #6964.

Co-authored-by: sgouezel <sebastien.gouezel@univ-rennes1.fr> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -627,9 +627,11 @@ theorem exists_positive_of_not_mutuallySingular (μ ν : Measure α) [IsFiniteMe
         rw [← @Classical.not_not (μA ≤ μA / 2)] at h'
         exact h' (not_le.2 (NNReal.half_lt_self h))
       intro c hc
-      have : ∃ n : ℕ, 1 / (n + 1 : ℝ) < c * (νA : ℝ)⁻¹; refine' exists_nat_one_div_lt _
-      · refine' mul_pos hc _
-        rw [_root_.inv_pos]; exact hb
+      have : ∃ n : ℕ, 1 / (n + 1 : ℝ) < c * (νA : ℝ)⁻¹ := by
+        refine' exists_nat_one_div_lt _
+        refine' mul_pos hc _
+        rw [_root_.inv_pos]
+        exact hb
       rcases this with ⟨n, hn⟩
       have hb₁ : (0 : ℝ) < (νA : ℝ)⁻¹ := by rw [_root_.inv_pos]; exact hb
       have h' : 1 / (↑n + 1) * νA < c := by
@@ -953,11 +955,9 @@ instance (priority := 100) haveLebesgueDecomposition_of_sigmaFinite (μ ν : Mea
         nth_rw 1 [haveLebesgueDecomposition_add (μn n) (νn n)]
         suffices heq :
           (νn n).withDensity ((μn n).rnDeriv (νn n)) =
-            ν.withDensity ((S.set n).indicator ((μn n).rnDeriv (νn n)))
-        · rw [heq]
+            ν.withDensity ((S.set n).indicator ((μn n).rnDeriv (νn n))) by rw [heq]
         rw [hν, withDensity_indicator (S.set_mem n), restrict_sum _ (S.set_mem n)]
-        suffices hsumeq : (sum fun i : ℕ => (νn i).restrict (S.set n)) = νn n
-        · rw [hsumeq]
+        suffices hsumeq : (sum fun i : ℕ => (νn i).restrict (S.set n)) = νn n by rw [hsumeq]
         ext1 s hs
         rw [sum_apply _ hs, tsum_eq_single n, hνn, h₁, restrict_restrict (T.set_mem n), inter_self]
         · intro m hm
chore: tidy various files (#10453)
Diff
@@ -114,12 +114,9 @@ instance haveLebesgueDecomposition_smul (μ ν : Measure α) [HaveLebesgueDecomp
     (r : ℝ≥0) : (r • μ).HaveLebesgueDecomposition ν where
   lebesgue_decomposition := by
     obtain ⟨hmeas, hsing, hadd⟩ := haveLebesgueDecomposition_spec μ ν
-    refine' ⟨⟨r • μ.singularPart ν, r • μ.rnDeriv ν⟩, _, hsing.smul _, _⟩
-    · change Measurable ((r : ℝ≥0∞) • μ.rnDeriv ν) -- cannot remove this line
-      exact hmeas.const_smul _
-    · change _ = (r : ℝ≥0∞) • _ + ν.withDensity ((r : ℝ≥0∞) • _)
-      rw [withDensity_smul _ hmeas, ← smul_add, ← hadd]
-      rfl
+    refine' ⟨⟨r • μ.singularPart ν, r • μ.rnDeriv ν⟩, hmeas.const_smul _, hsing.smul _, _⟩
+    simp only [ENNReal.smul_def]
+    rw [withDensity_smul _ hmeas, ← smul_add, ← hadd]
 #align measure_theory.measure.have_lebesgue_decomposition_smul MeasureTheory.Measure.haveLebesgueDecomposition_smul
 
 instance haveLebesgueDecomposition_smul_right (μ ν : Measure α) [HaveLebesgueDecomposition μ ν]
@@ -129,16 +126,14 @@ instance haveLebesgueDecomposition_smul_right (μ ν : Measure α) [HaveLebesgue
     obtain ⟨hmeas, hsing, hadd⟩ := haveLebesgueDecomposition_spec μ ν
     by_cases hr : r = 0
     · exact ⟨⟨μ, 0⟩, measurable_const, by simp [hr], by simp⟩
-    refine ⟨⟨μ.singularPart ν, r⁻¹ • μ.rnDeriv ν⟩, ?_, ?_, ?_⟩
-    · change Measurable (r⁻¹ • μ.rnDeriv ν)
-      exact hmeas.const_smul _
-    · exact hsing.mono_ac AbsolutelyContinuous.rfl smul_absolutelyContinuous
-    · have : r⁻¹ • rnDeriv μ ν = ((r⁻¹ : ℝ≥0) : ℝ≥0∞) • rnDeriv μ ν := by simp [ENNReal.smul_def]
-      rw [this, withDensity_smul _ hmeas, ENNReal.smul_def r, withDensity_smul_measure,
-        ← smul_assoc, smul_eq_mul, ENNReal.coe_inv hr, ENNReal.inv_mul_cancel, one_smul]
-      · exact hadd
-      · simp [hr]
-      · exact ENNReal.coe_ne_top
+    refine ⟨⟨μ.singularPart ν, r⁻¹ • μ.rnDeriv ν⟩, hmeas.const_smul _,
+      hsing.mono_ac AbsolutelyContinuous.rfl smul_absolutelyContinuous, ?_⟩
+    have : r⁻¹ • rnDeriv μ ν = ((r⁻¹ : ℝ≥0) : ℝ≥0∞) • rnDeriv μ ν := by simp [ENNReal.smul_def]
+    rw [this, withDensity_smul _ hmeas, ENNReal.smul_def r, withDensity_smul_measure,
+      ← smul_assoc, smul_eq_mul, ENNReal.coe_inv hr, ENNReal.inv_mul_cancel, one_smul]
+    · exact hadd
+    · simp [hr]
+    · exact ENNReal.coe_ne_top
 
 theorem haveLebesgueDecomposition_withDensity (μ : Measure α) {f : α → ℝ≥0∞} (hf : Measurable f) :
     (μ.withDensity f).HaveLebesgueDecomposition μ := ⟨⟨⟨0, f⟩, hf, .zero_left, (zero_add _).symm⟩⟩
@@ -200,8 +195,7 @@ lemma absolutelyContinuous_withDensity_rnDeriv {μ ν : Measure α} [HaveLebesgu
   rw [haveLebesgueDecomposition_add ν μ] at hμν
   refine AbsolutelyContinuous.mk (fun s _ hνs ↦ ?_)
   obtain ⟨t, _, ht1, ht2⟩ := mutuallySingular_singularPart ν μ
-  have hs_eq_union : s = s ∩ t ∪ s ∩ tᶜ := by ext x; simp
-  rw [hs_eq_union]
+  rw [← inter_union_compl s]
   refine le_antisymm ((measure_union_le (s ∩ t) (s ∩ tᶜ)).trans ?_) (zero_le _)
   simp only [nonpos_iff_eq_zero, add_eq_zero]
   constructor
@@ -228,8 +222,7 @@ lemma withDensity_rnDeriv_eq_zero (μ ν : Measure α) [μ.HaveLebesgueDecomposi
 @[simp]
 lemma rnDeriv_eq_zero (μ ν : Measure α) [μ.HaveLebesgueDecomposition ν] :
     μ.rnDeriv ν =ᵐ[ν] 0 ↔ μ ⟂ₘ ν := by
-  rw [← withDensity_rnDeriv_eq_zero,
-    withDensity_eq_zero_iff (measurable_rnDeriv _ _).aemeasurable]
+  rw [← withDensity_rnDeriv_eq_zero, withDensity_eq_zero_iff (measurable_rnDeriv _ _).aemeasurable]
 
 lemma rnDeriv_zero (ν : Measure α) : (0 : Measure α).rnDeriv ν =ᵐ[ν] 0 := by
   rw [rnDeriv_eq_zero]
@@ -279,24 +272,19 @@ instance withDensity.instIsLocallyFiniteMeasure [TopologicalSpace α] [IsLocally
 theorem lintegral_rnDeriv_lt_top_of_measure_ne_top {μ : Measure α} (ν : Measure α) {s : Set α}
     (hs : μ s ≠ ∞) : ∫⁻ x in s, μ.rnDeriv ν x ∂ν < ∞ := by
   by_cases hl : HaveLebesgueDecomposition μ ν
-  · haveI := hl
-    obtain ⟨-, -, hadd⟩ := haveLebesgueDecomposition_spec μ ν
-    suffices : (∫⁻ x in toMeasurable μ s, μ.rnDeriv ν x ∂ν) < ∞
-    exact lt_of_le_of_lt (lintegral_mono_set (subset_toMeasurable _ _)) this
+  · obtain ⟨-, -, hadd⟩ := haveLebesgueDecomposition_spec μ ν
+    suffices (∫⁻ x in toMeasurable μ s, μ.rnDeriv ν x ∂ν) < ∞ from
+      lt_of_le_of_lt (lintegral_mono_set (subset_toMeasurable _ _)) this
     rw [← withDensity_apply _ (measurableSet_toMeasurable _ _)]
-    refine'
-      lt_of_le_of_lt
-        (le_add_left le_rfl :
-          _ ≤ μ.singularPart ν (toMeasurable μ s) + ν.withDensity (μ.rnDeriv ν) (toMeasurable μ s))
-        _
-    rw [← Measure.add_apply, ← hadd, measure_toMeasurable]
-    exact hs.lt_top
-  · erw [Measure.rnDeriv, dif_neg hl, lintegral_zero]
-    exact WithTop.zero_lt_top
+    calc
+      _ ≤ (singularPart μ ν) (toMeasurable μ s) + _ := le_add_self
+      _ = μ s := by rw [← Measure.add_apply, ← hadd, measure_toMeasurable]
+      _ < ⊤ := hs.lt_top
+  · simp only [Measure.rnDeriv, dif_neg hl, Pi.zero_apply, lintegral_zero, ENNReal.zero_lt_top]
 #align measure_theory.measure.lintegral_rn_deriv_lt_top_of_measure_ne_top MeasureTheory.Measure.lintegral_rnDeriv_lt_top_of_measure_ne_top
 
 theorem lintegral_rnDeriv_lt_top (μ ν : Measure α) [IsFiniteMeasure μ] :
-    (∫⁻ x, μ.rnDeriv ν x ∂ν) < ∞ := by
+    ∫⁻ x, μ.rnDeriv ν x ∂ν < ∞ := by
   rw [← set_lintegral_univ]
   exact lintegral_rnDeriv_lt_top_of_measure_ne_top _ (measure_lt_top _ _).ne
 #align measure_theory.measure.lintegral_rn_deriv_lt_top MeasureTheory.Measure.lintegral_rnDeriv_lt_top
@@ -329,7 +317,7 @@ while `MeasureTheory.Measure.eq_rnDeriv` provides the uniqueness of the
 `rnDeriv`. -/
 theorem eq_singularPart {s : Measure α} {f : α → ℝ≥0∞} (hf : Measurable f) (hs : s ⟂ₘ ν)
     (hadd : μ = s + ν.withDensity f) : s = μ.singularPart ν := by
-  haveI : HaveLebesgueDecomposition μ ν := ⟨⟨⟨s, f⟩, hf, hs, hadd⟩⟩
+  have : HaveLebesgueDecomposition μ ν := ⟨⟨⟨s, f⟩, hf, hs, hadd⟩⟩
   obtain ⟨hmeas, hsing, hadd'⟩ := haveLebesgueDecomposition_spec μ ν
   obtain ⟨⟨S, hS₁, hS₂, hS₃⟩, ⟨T, hT₁, hT₂, hT₃⟩⟩ := hs, hsing
   rw [hadd'] at hadd
@@ -380,7 +368,7 @@ theorem singularPart_smul (μ ν : Measure α) (r : ℝ≥0) :
   · rw [singularPart, singularPart, dif_neg hl, dif_neg, smul_zero]
     refine' fun hl' => hl _
     rw [← inv_smul_smul₀ hr μ]
-    exact @Measure.haveLebesgueDecomposition_smul _ _ _ _ hl' _
+    exact Measure.haveLebesgueDecomposition_smul _ _ _
 #align measure_theory.measure.singular_part_smul MeasureTheory.Measure.singularPart_smul
 
 theorem singularPart_smul_right (μ ν : Measure α) (r : ℝ≥0) (hr : r ≠ 0) :
@@ -393,8 +381,8 @@ theorem singularPart_smul_right (μ ν : Measure α) (r : ℝ≥0) (hr : r ≠ 0
       swap; · exact (measurable_rnDeriv _ _).const_smul _
       convert haveLebesgueDecomposition_add μ ν
       ext x
-      simp only [Pi.smul_apply, ne_eq]
-      rw [← ENNReal.smul_def, ← smul_assoc, smul_eq_mul, mul_inv_cancel hr, one_smul]
+      simp only [Pi.smul_apply]
+      rw [← ENNReal.smul_def, smul_inv_smul₀ hr]
   · rw [singularPart, singularPart, dif_neg hl, dif_neg]
     refine fun hl' => hl ?_
     rw [← inv_smul_smul₀ hr ν]
@@ -416,7 +404,7 @@ theorem singularPart_add (μ₁ μ₂ ν : Measure α) [HaveLebesgueDecompositio
 
 theorem singularPart_withDensity (ν : Measure α) {f : α → ℝ≥0∞} (hf : Measurable f) :
     (ν.withDensity f).singularPart ν = 0 :=
-  haveI : ν.withDensity f = 0 + ν.withDensity f := by rw [zero_add]
+  have : ν.withDensity f = 0 + ν.withDensity f := by rw [zero_add]
   (eq_singularPart hf MutuallySingular.zero_left this).symm
 #align measure_theory.measure.singular_part_with_density MeasureTheory.Measure.singularPart_withDensity
 
@@ -429,7 +417,7 @@ theorem, while `MeasureTheory.Measure.eq_singularPart` provides the uniqueness o
 terms of the functions is given in `eq_rnDeriv`. -/
 theorem eq_withDensity_rnDeriv {s : Measure α} {f : α → ℝ≥0∞} (hf : Measurable f) (hs : s ⟂ₘ ν)
     (hadd : μ = s + ν.withDensity f) : ν.withDensity f = ν.withDensity (μ.rnDeriv ν) := by
-  haveI : HaveLebesgueDecomposition μ ν := ⟨⟨⟨s, f⟩, hf, hs, hadd⟩⟩
+  have : HaveLebesgueDecomposition μ ν := ⟨⟨⟨s, f⟩, hf, hs, hadd⟩⟩
   obtain ⟨hmeas, hsing, hadd'⟩ := haveLebesgueDecomposition_spec μ ν
   obtain ⟨⟨S, hS₁, hS₂, hS₃⟩, ⟨T, hT₁, hT₂, hT₃⟩⟩ := hs, hsing
   rw [hadd'] at hadd
@@ -497,7 +485,7 @@ lemma rnDeriv_self (μ : Measure α) [SigmaFinite μ] : μ.rnDeriv μ =ᵐ[μ] f
 theorem rnDeriv_withDensity₀ (ν : Measure α) [SigmaFinite ν] {f : α → ℝ≥0∞}
     (hf : AEMeasurable f ν) :
     (ν.withDensity f).rnDeriv ν =ᵐ[ν] f :=
-  haveI : ν.withDensity f = 0 + ν.withDensity f := by rw [zero_add]
+  have : ν.withDensity f = 0 + ν.withDensity f := by rw [zero_add]
   (eq_rnDeriv₀ hf MutuallySingular.zero_left this).symm
 
 /-- The Radon-Nikodym derivative of `f ν` with respect to `ν` is `f`. -/
@@ -627,10 +615,10 @@ theorem exists_positive_of_not_mutuallySingular (μ ν : Measure α) [IsFiniteMe
     intro n
     have := nonpos_of_restrict_le_zero _ (hA₂ n)
     rwa [toSignedMeasure_sub_apply hAmeas, sub_nonpos, ENNReal.toReal_le_toReal] at this
-    exacts [ne_of_lt (measure_lt_top _ _), ne_of_lt (measure_lt_top _ _)]
+    exacts [measure_ne_top _ _, measure_ne_top _ _]
   have hμ : μ A = 0 := by
-    lift μ A to ℝ≥0 using ne_of_lt (measure_lt_top _ _) with μA
-    lift ν A to ℝ≥0 using ne_of_lt (measure_lt_top _ _) with νA
+    lift μ A to ℝ≥0 using measure_ne_top _ _ with μA
+    lift ν A to ℝ≥0 using measure_ne_top _ _ with νA
     rw [ENNReal.coe_eq_zero]
     by_cases hb : 0 < νA
     · suffices ∀ b, 0 < b → μA ≤ b by
@@ -649,7 +637,7 @@ theorem exists_positive_of_not_mutuallySingular (μ ν : Measure α) [IsFiniteMe
           NNReal.coe_inv, ← NNReal.coe_mul, _root_.mul_inv_cancel, ← NNReal.coe_mul, mul_one,
           NNReal.coe_inv]
         · exact hn
-        · exact Ne.symm (ne_of_lt hb)
+        · exact hb.ne'
       refine' le_trans _ (le_of_lt h')
       rw [← ENNReal.coe_le_coe, ENNReal.coe_mul]
       exact hA₃ n
@@ -698,22 +686,16 @@ theorem sup_mem_measurableLE {f g : α → ℝ≥0∞} (hf : f ∈ measurableLE
 
 theorem iSup_succ_eq_sup {α} (f : ℕ → α → ℝ≥0∞) (m : ℕ) (a : α) :
     ⨆ (k : ℕ) (_ : k ≤ m + 1), f k a = f m.succ a ⊔ ⨆ (k : ℕ) (_ : k ≤ m), f k a := by
-  refine Option.ext fun x => ?_
-  simp only [Option.mem_def, ENNReal.some_eq_coe]
-  constructor <;> intro h <;> rw [← h]; symm
-  all_goals
-    set c := ⨆ (k : ℕ) (_ : k ≤ m + 1), f k a with hc
-    set d := f m.succ a ⊔ ⨆ (k : ℕ) (_ : k ≤ m), f k a with hd
-    rw [@le_antisymm_iff ℝ≥0∞, hc, hd]
-    -- Specifying the type is weirdly necessary
-    refine' ⟨_, _⟩
-    · refine' iSup₂_le fun n hn => _
-      rcases Nat.of_le_succ hn with (h | h)
-      · exact le_sup_of_le_right (le_iSup₂ (f := fun k (_ : k ≤ m) => f k a) n h)
-      · exact h ▸ le_sup_left
-    · refine' sup_le _ (biSup_mono fun n hn => hn.trans m.le_succ)
-      convert @le_iSup₂ ℝ≥0∞ ℕ (fun i => i ≤ m + 1) _ _ m.succ le_rfl
-      rfl
+  set c := ⨆ (k : ℕ) (_ : k ≤ m + 1), f k a with hc
+  set d := f m.succ a ⊔ ⨆ (k : ℕ) (_ : k ≤ m), f k a with hd
+  rw [le_antisymm_iff, hc, hd]
+  refine' ⟨_, _⟩
+  · refine' iSup₂_le fun n hn => _
+    rcases Nat.of_le_succ hn with (h | h)
+    · exact le_sup_of_le_right (le_iSup₂ (f := fun k (_ : k ≤ m) => f k a) n h)
+    · exact h ▸ le_sup_left
+  · refine' sup_le _ (biSup_mono fun n hn => hn.trans m.le_succ)
+    exact @le_iSup₂ ℝ≥0∞ ℕ (fun i => i ≤ m + 1) _ _ (m + 1) le_rfl
 #align measure_theory.measure.lebesgue_decomposition.supr_succ_eq_sup MeasureTheory.Measure.LebesgueDecomposition.iSup_succ_eq_sup
 
 theorem iSup_mem_measurableLE (f : ℕ → α → ℝ≥0∞) (hf : ∀ n, f n ∈ measurableLE μ ν) (n : ℕ) :
@@ -733,7 +715,7 @@ theorem iSup_mem_measurableLE (f : ℕ → α → ℝ≥0∞) (hf : ∀ n, f n 
 theorem iSup_mem_measurableLE' (f : ℕ → α → ℝ≥0∞) (hf : ∀ n, f n ∈ measurableLE μ ν) (n : ℕ) :
     (⨆ (k) (_ : k ≤ n), f k) ∈ measurableLE μ ν := by
   convert iSup_mem_measurableLE f hf n
-  refine Option.ext fun x => ?_; simp
+  simp
 #align measure_theory.measure.lebesgue_decomposition.supr_mem_measurable_le' MeasureTheory.Measure.LebesgueDecomposition.iSup_mem_measurableLE'
 
 section SuprLemmas
@@ -795,14 +777,14 @@ theorem haveLebesgueDecomposition_of_finiteMeasure [IsFiniteMeasure μ] [IsFinit
       · intro n
         refine' Measurable.aemeasurable _
         convert (iSup_mem_measurableLE _ hf₁ n).1
-        refine Option.ext fun x => ?_; simp
+        simp
       · refine' Filter.eventually_of_forall fun a => _
         simp [iSup_monotone' f _]
       · refine' Filter.eventually_of_forall fun a => _
         simp [tendsto_atTop_iSup (iSup_monotone' f a)]
     have hξm : Measurable ξ := by
       convert measurable_iSup fun n => (iSup_mem_measurableLE _ hf₁ n).1
-      refine Option.ext fun x => ?_; simp [hξ]
+      simp [hξ]
     -- `ξ` is the `f` in the theorem statement and we set `μ₁` to be `μ - ν.withDensity ξ`
     -- since we need `μ₁ + ν.withDensity ξ = μ`
     set μ₁ := μ - ν.withDensity ξ with hμ₁
@@ -835,15 +817,15 @@ theorem haveLebesgueDecomposition_of_finiteMeasure [IsFiniteMeasure μ] [IsFinit
         have := subset_le_of_restrict_le_restrict _ _ hE₁ hE₃ (inter_subset_right A E)
         rwa [zero_apply, toSignedMeasure_sub_apply (hA.inter hE₁),
           Measure.sub_apply (hA.inter hE₁) hle,
-          ENNReal.toReal_sub_of_le _ (ne_of_lt (measure_lt_top _ _)), sub_nonneg, le_sub_iff_add_le,
+          ENNReal.toReal_sub_of_le _ (measure_ne_top _ _), sub_nonneg, le_sub_iff_add_le,
           ← ENNReal.toReal_add, ENNReal.toReal_le_toReal, Measure.coe_smul, Pi.smul_apply,
           withDensity_apply _ (hA.inter hE₁), show ε • ν (A ∩ E) = (ε : ℝ≥0∞) * ν (A ∩ E) by rfl,
           ← set_lintegral_const, ← lintegral_add_left measurable_const] at this
         · rw [Ne.def, ENNReal.add_eq_top, not_or]
-          exact ⟨ne_of_lt (measure_lt_top _ _), ne_of_lt (measure_lt_top _ _)⟩
-        · exact ne_of_lt (measure_lt_top _ _)
-        · exact ne_of_lt (measure_lt_top _ _)
-        · exact ne_of_lt (measure_lt_top _ _)
+          exact ⟨measure_ne_top _ _, measure_ne_top _ _⟩
+        · exact measure_ne_top _ _
+        · exact measure_ne_top _ _
+        · exact measure_ne_top _ _
         · rw [withDensity_apply _ (hA.inter hE₁)]
           exact hξle (A ∩ E) (hA.inter hE₁)
       -- from this, we can show `ξ + ε * E.indicator` is a function in `measurableLE` with
@@ -1039,14 +1021,8 @@ theorem rnDeriv_smul_right_of_ne_top' (ν μ : Measure α) [SigmaFinite ν] [Sig
     refine rnDeriv_smul_right' ν μ ?_
     rw [ne_eq, ENNReal.toNNReal_eq_zero_iff]
     simp [hr, hr_ne_top]
-  have : (r.toNNReal)⁻¹ • rnDeriv ν μ = r⁻¹ • rnDeriv ν μ := by
-    ext x
-    simp only [Pi.smul_apply, ENNReal.smul_def, ne_eq, smul_eq_mul]
-    rw [ENNReal.coe_inv, ENNReal.coe_toNNReal hr_ne_top]
-    rw [ne_eq, ENNReal.toNNReal_eq_zero_iff]
-    simp [hr, hr_ne_top]
-  simp_rw [this, ENNReal.smul_def, ENNReal.coe_toNNReal hr_ne_top] at h
-  exact h
+  rwa [ENNReal.smul_def, ENNReal.coe_toNNReal hr_ne_top,
+    ← ENNReal.toNNReal_inv, ENNReal.smul_def, ENNReal.coe_toNNReal (ENNReal.inv_ne_top.mpr hr)] at h
 
 /-- Radon-Nikodym derivative of a sum of two measures.
 See also `rnDeriv_add`, which has no hypothesis on `μ` but requires finite `ν₁` and `ν₂`. -/
chore: reduce imports (#9830)

This uses the improved shake script from #9772 to reduce imports across mathlib. The corresponding noshake.json file has been added to #9772.

Co-authored-by: Mario Carneiro <di.gama@gmail.com>

Diff
@@ -4,8 +4,8 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Kexing Ying
 -/
 import Mathlib.MeasureTheory.Measure.Sub
-import Mathlib.MeasureTheory.Decomposition.Jordan
-import Mathlib.MeasureTheory.Measure.WithDensityVectorMeasure
+import Mathlib.MeasureTheory.Decomposition.SignedHahn
+import Mathlib.MeasureTheory.Function.AEEqOfIntegral
 
 #align_import measure_theory.decomposition.lebesgue from "leanprover-community/mathlib"@"b2ff9a3d7a15fd5b0f060b135421d6a89a999c2f"
 
chore(*): replace $ with <| (#9319)

See Zulip thread for the discussion.

Diff
@@ -545,7 +545,7 @@ See also `rnDeriv_smul_right'`, which requires sigma-finite `ν` and `μ`. -/
 theorem rnDeriv_smul_right (ν μ : Measure α) [IsFiniteMeasure ν]
     [ν.HaveLebesgueDecomposition μ] {r : ℝ≥0} (hr : r ≠ 0) :
     ν.rnDeriv (r • μ) =ᵐ[μ] r⁻¹ • ν.rnDeriv μ := by
-  refine (absolutelyContinuous_smul $ ENNReal.coe_ne_zero.2 hr).ae_le
+  refine (absolutelyContinuous_smul <| ENNReal.coe_ne_zero.2 hr).ae_le
     (?_ : ν.rnDeriv (r • μ) =ᵐ[r • μ] r⁻¹ • ν.rnDeriv μ)
   rw [← withDensity_eq_iff]
   rotate_left
@@ -1015,7 +1015,7 @@ See also `rnDeriv_smul_right`, which has no hypothesis on `μ` but requires fini
 theorem rnDeriv_smul_right' (ν μ : Measure α) [SigmaFinite ν] [SigmaFinite μ]
     {r : ℝ≥0} (hr : r ≠ 0) :
     ν.rnDeriv (r • μ) =ᵐ[μ] r⁻¹ • ν.rnDeriv μ := by
-  refine (absolutelyContinuous_smul $ ENNReal.coe_ne_zero.2 hr).ae_le
+  refine (absolutelyContinuous_smul <| ENNReal.coe_ne_zero.2 hr).ae_le
     (?_ : ν.rnDeriv (r • μ) =ᵐ[r • μ] r⁻¹ • ν.rnDeriv μ)
   rw [← withDensity_eq_iff_of_sigmaFinite]
   · simp_rw [ENNReal.smul_def]
feat: Checking ae on a countable type (#8945)

and other simple measure lemmas

From PFR and LeanCamCombi

Co-authored-by: Yury G. Kudryashov <urkud@urkud.name>

Diff
@@ -132,8 +132,7 @@ instance haveLebesgueDecomposition_smul_right (μ ν : Measure α) [HaveLebesgue
     refine ⟨⟨μ.singularPart ν, r⁻¹ • μ.rnDeriv ν⟩, ?_, ?_, ?_⟩
     · change Measurable (r⁻¹ • μ.rnDeriv ν)
       exact hmeas.const_smul _
-    · refine MutuallySingular.mono_ac hsing AbsolutelyContinuous.rfl ?_
-      exact absolutelyContinuous_of_le_smul le_rfl
+    · exact hsing.mono_ac AbsolutelyContinuous.rfl smul_absolutelyContinuous
     · have : r⁻¹ • rnDeriv μ ν = ((r⁻¹ : ℝ≥0) : ℝ≥0∞) • rnDeriv μ ν := by simp [ENNReal.smul_def]
       rw [this, withDensity_smul _ hmeas, ENNReal.smul_def r, withDensity_smul_measure,
         ← smul_assoc, smul_eq_mul, ENNReal.coe_inv hr, ENNReal.inv_mul_cancel, one_smul]
@@ -388,8 +387,8 @@ theorem singularPart_smul_right (μ ν : Measure α) (r : ℝ≥0) (hr : r ≠ 0
     μ.singularPart (r • ν) = μ.singularPart ν := by
   by_cases hl : HaveLebesgueDecomposition μ ν
   · refine (eq_singularPart ((measurable_rnDeriv μ ν).const_smul r⁻¹) ?_ ?_).symm
-    · refine (mutuallySingular_singularPart μ ν).mono_ac AbsolutelyContinuous.rfl ?_
-      exact absolutelyContinuous_of_le_smul le_rfl
+    · exact (mutuallySingular_singularPart μ ν).mono_ac AbsolutelyContinuous.rfl
+        smul_absolutelyContinuous
     · rw [ENNReal.smul_def r, withDensity_smul_measure, ← withDensity_smul]
       swap; · exact (measurable_rnDeriv _ _).const_smul _
       convert haveLebesgueDecomposition_add μ ν
@@ -546,11 +545,8 @@ See also `rnDeriv_smul_right'`, which requires sigma-finite `ν` and `μ`. -/
 theorem rnDeriv_smul_right (ν μ : Measure α) [IsFiniteMeasure ν]
     [ν.HaveLebesgueDecomposition μ] {r : ℝ≥0} (hr : r ≠ 0) :
     ν.rnDeriv (r • μ) =ᵐ[μ] r⁻¹ • ν.rnDeriv μ := by
-  suffices ν.rnDeriv (r • μ) =ᵐ[r • μ] r⁻¹ • ν.rnDeriv μ by
-    suffices hμ : μ ≪ r • μ by exact hμ.ae_le this
-    refine absolutelyContinuous_of_le_smul (c := r⁻¹) ?_
-    rw [← ENNReal.coe_inv hr, ← ENNReal.smul_def, ← smul_assoc, smul_eq_mul,
-      inv_mul_cancel hr, one_smul]
+  refine (absolutelyContinuous_smul $ ENNReal.coe_ne_zero.2 hr).ae_le
+    (?_ : ν.rnDeriv (r • μ) =ᵐ[r • μ] r⁻¹ • ν.rnDeriv μ)
   rw [← withDensity_eq_iff]
   rotate_left
   · exact (measurable_rnDeriv _ _).aemeasurable
@@ -1019,11 +1015,8 @@ See also `rnDeriv_smul_right`, which has no hypothesis on `μ` but requires fini
 theorem rnDeriv_smul_right' (ν μ : Measure α) [SigmaFinite ν] [SigmaFinite μ]
     {r : ℝ≥0} (hr : r ≠ 0) :
     ν.rnDeriv (r • μ) =ᵐ[μ] r⁻¹ • ν.rnDeriv μ := by
-  suffices ν.rnDeriv (r • μ) =ᵐ[r • μ] r⁻¹ • ν.rnDeriv μ by
-    suffices hμ : μ ≪ r • μ by exact hμ.ae_le this
-    refine absolutelyContinuous_of_le_smul (c := r⁻¹) ?_
-    rw [← ENNReal.coe_inv hr, ← ENNReal.smul_def, ← smul_assoc, smul_eq_mul,
-      inv_mul_cancel hr, one_smul]
+  refine (absolutelyContinuous_smul $ ENNReal.coe_ne_zero.2 hr).ae_le
+    (?_ : ν.rnDeriv (r • μ) =ᵐ[r • μ] r⁻¹ • ν.rnDeriv μ)
   rw [← withDensity_eq_iff_of_sigmaFinite]
   · simp_rw [ENNReal.smul_def]
     rw [withDensity_smul _ (measurable_rnDeriv _ _)]
chore: Remove nonterminal simp at (#7795)

Removes nonterminal uses of simp at. Replaces most of these with instances of simp? ... says.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Mario Carneiro <di.gama@gmail.com>

Diff
@@ -659,7 +659,10 @@ theorem exists_positive_of_not_mutuallySingular (μ ν : Measure α) [IsFiniteMe
       exact hA₃ n
     · rw [not_lt, le_zero_iff] at hb
       specialize hA₃ 0
-      simp [hb, le_zero_iff] at hA₃
+      simp? [hb, le_zero_iff] at hA₃ says
+        simp only [CharP.cast_eq_zero, zero_add, ne_eq, one_ne_zero, not_false_eq_true, div_self,
+          ENNReal.coe_one, hb, ENNReal.coe_zero, mul_zero, nonpos_iff_eq_zero,
+          ENNReal.coe_eq_zero] at hA₃
       assumption
   -- since `μ` and `ν` are not mutually singular, `μ A = 0` implies `ν Aᶜ > 0`
   rw [MutuallySingular] at h; push_neg at h
feat: exponentially tilted measures (#7676)

Define exponentially tilted measures. The exponential tilting of a measure μ on α by a function f : α → ℝ is the measure with density x ↦ exp (f x) / ∫ y, exp (f y) ∂μ with respect to μ.

Co-authored-by: Rémy Degenne <remydegenne@gmail.com> Co-authored-by: RemyDegenne <remydegenne@gmail.com>

Diff
@@ -495,10 +495,16 @@ lemma rnDeriv_self (μ : Measure α) [SigmaFinite μ] : μ.rnDeriv μ =ᵐ[μ] f
   (eq_rnDeriv (measurable_const) MutuallySingular.zero_left (by simp)).symm
 
 /-- The Radon-Nikodym derivative of `f ν` with respect to `ν` is `f`. -/
-theorem rnDeriv_withDensity (ν : Measure α) [SigmaFinite ν] {f : α → ℝ≥0∞} (hf : Measurable f) :
+theorem rnDeriv_withDensity₀ (ν : Measure α) [SigmaFinite ν] {f : α → ℝ≥0∞}
+    (hf : AEMeasurable f ν) :
     (ν.withDensity f).rnDeriv ν =ᵐ[ν] f :=
   haveI : ν.withDensity f = 0 + ν.withDensity f := by rw [zero_add]
-  (eq_rnDeriv hf MutuallySingular.zero_left this).symm
+  (eq_rnDeriv₀ hf MutuallySingular.zero_left this).symm
+
+/-- The Radon-Nikodym derivative of `f ν` with respect to `ν` is `f`. -/
+theorem rnDeriv_withDensity (ν : Measure α) [SigmaFinite ν] {f : α → ℝ≥0∞} (hf : Measurable f) :
+    (ν.withDensity f).rnDeriv ν =ᵐ[ν] f :=
+  rnDeriv_withDensity₀ ν hf.aemeasurable
 #align measure_theory.measure.rn_deriv_with_density MeasureTheory.Measure.rnDeriv_withDensity
 
 /-- The Radon-Nikodym derivative of the restriction of a measure to a measurable set is the
refactor(Probability/Density): define pdf using rnDeriv (#8544)

Defines pdf in terms of rnDeriv.

Main definition change:

/-- A random variable `X : Ω → E` is said to `HasPDF` with respect to the measure `ℙ` on `Ω` and
`μ` on `E` if the push-forward measure of `ℙ` along `X` is absolutely continuous with respect to
`μ` and they `HaveLebesgueDecomposition`. -/
class HasPDF {m : MeasurableSpace Ω} (X : Ω → E) (ℙ : Measure Ω)
    (μ : Measure E := by volume_tac) : Prop where
  pdf' : Measurable X ∧ HaveLebesgueDecomposition (map X ℙ) μ ∧ map X ℙ ≪ μ

/-- If `X` is a random variable that `HasPDF X ℙ μ`, then `pdf X` is the Radon–Nikodym
derivative of the push-forward measure of `ℙ` along `X` with respect to `μ`. -/
def pdf {_ : MeasurableSpace Ω} (X : Ω → E) (ℙ : Measure Ω) (μ : Measure E := by volume_tac) :
    E → ℝ≥0∞ :=
  if HasPDF X ℙ μ then (map X ℙ).rnDeriv μ else 0

The law of the unconscious statistician is first generalized to rnDeriv on a general Banach space (∫ x, (μ.rnDeriv ν x).toReal • f x ∂ν = ∫ x, f x ∂μ), and then proven for PDFs.

Zulip thread

Diff
@@ -141,6 +141,9 @@ instance haveLebesgueDecomposition_smul_right (μ ν : Measure α) [HaveLebesgue
       · simp [hr]
       · exact ENNReal.coe_ne_top
 
+theorem haveLebesgueDecomposition_withDensity (μ : Measure α) {f : α → ℝ≥0∞} (hf : Measurable f) :
+    (μ.withDensity f).HaveLebesgueDecomposition μ := ⟨⟨⟨0, f⟩, hf, .zero_left, (zero_add _).symm⟩⟩
+
 @[measurability]
 theorem measurable_rnDeriv (μ ν : Measure α) : Measurable <| μ.rnDeriv ν := by
   by_cases h : HaveLebesgueDecomposition μ ν
chore(MeasureTheory/Decomposition): simplify proof of eq_rnDeriv₀ (#8537)

Simplify proof of eq_rnDeriv₀ using withDensity_eq_iff

Diff
@@ -472,13 +472,9 @@ theorem eq_withDensity_rnDeriv₀ {μ ν : Measure α} {s : Measure α} {f : α
 
 theorem eq_rnDeriv₀ {μ ν : Measure α} [SigmaFinite ν] {s : Measure α} {f : α → ℝ≥0∞}
     (hf : AEMeasurable f ν) (hs : s ⟂ₘ ν) (hadd : μ = s + ν.withDensity f) :
-    f =ᵐ[ν] μ.rnDeriv ν := by
-  refine' ae_eq_of_forall_set_lintegral_eq_of_sigmaFinite₀ hf
-    (measurable_rnDeriv μ ν).aemeasurable _
-  intro a ha _
-  calc ∫⁻ x : α in a, f x ∂ν = ν.withDensity f a := (withDensity_apply f ha).symm
-    _ = ν.withDensity (μ.rnDeriv ν) a := by rw [eq_withDensity_rnDeriv₀ hf hs hadd]
-    _ = ∫⁻ x : α in a, μ.rnDeriv ν x ∂ν := withDensity_apply _ ha
+    f =ᵐ[ν] μ.rnDeriv ν :=
+  (withDensity_eq_iff_of_sigmaFinite hf (measurable_rnDeriv _ _).aemeasurable).mp
+    (eq_withDensity_rnDeriv₀ hf hs hadd)
 
 /-- Given measures `μ` and `ν`, if `s` is a measure mutually singular to `ν` and `f` is a
 measurable function such that `μ = s + fν`, then `f = μ.rnDeriv ν`.
chore: bump to v4.3.0-rc2 (#8366)

PR contents

This is the supremum of

along with some minor fixes from failures on nightly-testing as Mathlib master is merged into it.

Note that some PRs for changes that are already compatible with the current toolchain and will be necessary have already been split out: #8380.

I am hopeful that in future we will be able to progressively merge adaptation PRs into a bump/v4.X.0 branch, so we never end up with a "big merge" like this. However one of these adaptation PRs (#8056) predates my new scheme for combined CI, and it wasn't possible to keep that PR viable in the meantime.

Lean PRs involved in this bump

In particular this includes adjustments for the Lean PRs

leanprover/lean4#2778

We can get rid of all the

local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue [lean4#2220](https://github.com/leanprover/lean4/pull/2220)

macros across Mathlib (and in any projects that want to write natural number powers of reals).

leanprover/lean4#2722

Changes the default behaviour of simp to (config := {decide := false}). This makes simp (and consequentially norm_num) less powerful, but also more consistent, and less likely to blow up in long failures. This requires a variety of changes: changing some previously by simp or norm_num to decide or rfl, or adding (config := {decide := true}).

leanprover/lean4#2783

This changed the behaviour of simp so that simp [f] will only unfold "fully applied" occurrences of f. The old behaviour can be recovered with simp (config := { unfoldPartialApp := true }). We may in future add a syntax for this, e.g. simp [!f]; please provide feedback! In the meantime, we have made the following changes:

  • switching to using explicit lemmas that have the intended level of application
  • (config := { unfoldPartialApp := true }) in some places, to recover the old behaviour
  • Using @[eqns] to manually adjust the equation lemmas for a particular definition, recovering the old behaviour just for that definition. See #8371, where we do this for Function.comp and Function.flip.

This change in Lean may require further changes down the line (e.g. adding the !f syntax, and/or upstreaming the special treatment for Function.comp and Function.flip, and/or removing this special treatment). Please keep an open and skeptical mind about these changes!

Co-authored-by: leanprover-community-mathlib4-bot <leanprover-community-mathlib4-bot@users.noreply.github.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Mauricio Collares <mauricio@collares.org>

Diff
@@ -240,7 +240,8 @@ lemma MutuallySingular.rnDeriv_ae_eq_zero {μ ν : Measure α} (hμν : μ ⟂
     exact hμν
   · rw [rnDeriv_of_not_haveLebesgueDecomposition h]
 
-lemma rnDeriv_singularPart (μ ν : Measure α) : (μ.singularPart ν).rnDeriv ν =ᵐ[ν] 0 := by
+lemma rnDeriv_singularPart (μ ν : Measure α) :
+    (μ.singularPart ν).rnDeriv ν =ᵐ[ν] 0 := by
   rw [rnDeriv_eq_zero]
   exact mutuallySingular_singularPart μ ν
 
fix: remove unused arguments (#8380)

These are split from #8226 (and subsequent changes in #8366), and arise from the fact the latest Lean is better at detecting these due to better abstraction.

I can't comment on whether any of these should be concerning, but putting them in a small commit makes it easier for someone to find and review them later.

Co-authored-by: Kyle Miller <kmill31415@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -156,7 +156,7 @@ theorem mutuallySingular_singularPart (μ ν : Measure α) : μ.singularPart ν
     exact MutuallySingular.zero_left
 #align measure_theory.measure.mutually_singular_singular_part MeasureTheory.Measure.mutuallySingular_singularPart
 
-instance instHaveLebesgueDecomposition_singularPart [HaveLebesgueDecomposition μ ν] :
+instance instHaveLebesgueDecomposition_singularPart :
     HaveLebesgueDecomposition (μ.singularPart ν) ν :=
   ⟨⟨μ.singularPart ν, 0⟩, measurable_zero, mutuallySingular_singularPart μ ν, by simp⟩
 
@@ -240,8 +240,7 @@ lemma MutuallySingular.rnDeriv_ae_eq_zero {μ ν : Measure α} (hμν : μ ⟂
     exact hμν
   · rw [rnDeriv_of_not_haveLebesgueDecomposition h]
 
-lemma rnDeriv_singularPart (μ ν : Measure α) [μ.HaveLebesgueDecomposition ν] :
-    (μ.singularPart ν).rnDeriv ν =ᵐ[ν] 0 := by
+lemma rnDeriv_singularPart (μ ν : Measure α) : (μ.singularPart ν).rnDeriv ν =ᵐ[ν] 0 := by
   rw [rnDeriv_eq_zero]
   exact mutuallySingular_singularPart μ ν
 
feat(MeasureTheory): remove an AbsolutelyContinuous hypothesis from inv_rnDeriv (#8351)

In order to remove that hypothesis, we also:

  • add some basic lemmas about absolute continuity and mutually singular measures.
  • add HaveLebesgueDecomposition instances
  • rewrite the proof of withDensity_rnDeriv_eq to use the new API instead of unfolding the definitions
  • generalize rnDeriv_restrict and rnDeriv_withDensity to possibly different measures
Diff
@@ -99,6 +99,12 @@ theorem haveLebesgueDecomposition_spec (μ ν : Measure α) [h : HaveLebesgueDec
   exact Classical.choose_spec h.lebesgue_decomposition
 #align measure_theory.measure.have_lebesgue_decomposition_spec MeasureTheory.Measure.haveLebesgueDecomposition_spec
 
+instance instHaveLebesgueDecomposition_zero_left : HaveLebesgueDecomposition 0 ν where
+  lebesgue_decomposition := ⟨⟨0, 0⟩, measurable_zero, MutuallySingular.zero_left, by simp⟩
+
+instance instHaveLebesgueDecomposition_zero_right : HaveLebesgueDecomposition μ 0 where
+  lebesgue_decomposition := ⟨⟨μ, 0⟩, measurable_zero, MutuallySingular.zero_right, by simp⟩
+
 theorem haveLebesgueDecomposition_add (μ ν : Measure α) [HaveLebesgueDecomposition μ ν] :
     μ = μ.singularPart ν + ν.withDensity (μ.rnDeriv ν) :=
   (haveLebesgueDecomposition_spec μ ν).2.2
@@ -150,6 +156,10 @@ theorem mutuallySingular_singularPart (μ ν : Measure α) : μ.singularPart ν
     exact MutuallySingular.zero_left
 #align measure_theory.measure.mutually_singular_singular_part MeasureTheory.Measure.mutuallySingular_singularPart
 
+instance instHaveLebesgueDecomposition_singularPart [HaveLebesgueDecomposition μ ν] :
+    HaveLebesgueDecomposition (μ.singularPart ν) ν :=
+  ⟨⟨μ.singularPart ν, 0⟩, measurable_zero, mutuallySingular_singularPart μ ν, by simp⟩
+
 theorem singularPart_le (μ ν : Measure α) : μ.singularPart ν ≤ μ := by
   by_cases hl : HaveLebesgueDecomposition μ ν
   · cases' (haveLebesgueDecomposition_spec μ ν).2 with _ h
@@ -168,6 +178,38 @@ theorem withDensity_rnDeriv_le (μ ν : Measure α) : ν.withDensity (μ.rnDeriv
     exact Measure.zero_le μ
 #align measure_theory.measure.with_density_rn_deriv_le MeasureTheory.Measure.withDensity_rnDeriv_le
 
+lemma _root_.AEMeasurable.singularPart {β : Type*} {_ : MeasurableSpace β} {f : α → β}
+    (hf : AEMeasurable f μ) (ν : Measure α) :
+    AEMeasurable f (μ.singularPart ν) :=
+  AEMeasurable.mono_measure hf (Measure.singularPart_le _ _)
+
+lemma _root_.AEMeasurable.withDensity_rnDeriv {β : Type*} {_ : MeasurableSpace β} {f : α → β}
+    (hf : AEMeasurable f μ) (ν : Measure α) :
+    AEMeasurable f (ν.withDensity (μ.rnDeriv ν)) :=
+  AEMeasurable.mono_measure hf (Measure.withDensity_rnDeriv_le _ _)
+
+lemma MutuallySingular.singularPart (h : μ ⟂ₘ ν) (ν' : Measure α) :
+    μ.singularPart ν' ⟂ₘ ν :=
+  h.mono (singularPart_le μ ν') le_rfl
+
+lemma absolutelyContinuous_withDensity_rnDeriv {μ ν : Measure α} [HaveLebesgueDecomposition ν μ]
+    (hμν : μ ≪ ν) :
+    μ ≪ μ.withDensity (ν.rnDeriv μ) := by
+  rw [haveLebesgueDecomposition_add ν μ] at hμν
+  refine AbsolutelyContinuous.mk (fun s _ hνs ↦ ?_)
+  obtain ⟨t, _, ht1, ht2⟩ := mutuallySingular_singularPart ν μ
+  have hs_eq_union : s = s ∩ t ∪ s ∩ tᶜ := by ext x; simp
+  rw [hs_eq_union]
+  refine le_antisymm ((measure_union_le (s ∩ t) (s ∩ tᶜ)).trans ?_) (zero_le _)
+  simp only [nonpos_iff_eq_zero, add_eq_zero]
+  constructor
+  · refine hμν ?_
+    simp only [add_toOuterMeasure, OuterMeasure.coe_add, Pi.add_apply, add_eq_zero]
+    constructor
+    · exact measure_mono_null (Set.inter_subset_right _ _) ht1
+    · exact measure_mono_null (Set.inter_subset_left _ _) hνs
+  · exact measure_mono_null (Set.inter_subset_right _ _) ht2
+
 @[simp]
 lemma withDensity_rnDeriv_eq_zero (μ ν : Measure α) [μ.HaveLebesgueDecomposition ν] :
     ν.withDensity (μ.rnDeriv ν) = 0 ↔ μ ⟂ₘ ν := by
@@ -187,6 +229,10 @@ lemma rnDeriv_eq_zero (μ ν : Measure α) [μ.HaveLebesgueDecomposition ν] :
   rw [← withDensity_rnDeriv_eq_zero,
     withDensity_eq_zero_iff (measurable_rnDeriv _ _).aemeasurable]
 
+lemma rnDeriv_zero (ν : Measure α) : (0 : Measure α).rnDeriv ν =ᵐ[ν] 0 := by
+  rw [rnDeriv_eq_zero]
+  exact MutuallySingular.zero_left
+
 lemma MutuallySingular.rnDeriv_ae_eq_zero {μ ν : Measure α} (hμν : μ ⟂ₘ ν) :
     μ.rnDeriv ν =ᵐ[ν] 0 := by
   by_cases h : μ.HaveLebesgueDecomposition ν
@@ -194,6 +240,11 @@ lemma MutuallySingular.rnDeriv_ae_eq_zero {μ ν : Measure α} (hμν : μ ⟂
     exact hμν
   · rw [rnDeriv_of_not_haveLebesgueDecomposition h]
 
+lemma rnDeriv_singularPart (μ ν : Measure α) [μ.HaveLebesgueDecomposition ν] :
+    (μ.singularPart ν).rnDeriv ν =ᵐ[ν] 0 := by
+  rw [rnDeriv_eq_zero]
+  exact mutuallySingular_singularPart μ ν
+
 instance singularPart.instIsFiniteMeasure [IsFiniteMeasure μ] :
     IsFiniteMeasure (μ.singularPart ν) :=
   isFiniteMeasure_of_le μ <| singularPart_le μ ν
@@ -441,6 +492,9 @@ theorem eq_rnDeriv [SigmaFinite ν] {s : Measure α} {f : α → ℝ≥0∞} (hf
   eq_rnDeriv₀ hf.aemeasurable hs hadd
 #align measure_theory.measure.eq_rn_deriv MeasureTheory.Measure.eq_rnDeriv
 
+lemma rnDeriv_self (μ : Measure α) [SigmaFinite μ] : μ.rnDeriv μ =ᵐ[μ] fun _ ↦ 1 :=
+  (eq_rnDeriv (measurable_const) MutuallySingular.zero_left (by simp)).symm
+
 /-- The Radon-Nikodym derivative of `f ν` with respect to `ν` is `f`. -/
 theorem rnDeriv_withDensity (ν : Measure α) [SigmaFinite ν] {f : α → ℝ≥0∞} (hf : Measurable f) :
     (ν.withDensity f).rnDeriv ν =ᵐ[ν] f :=
@@ -450,11 +504,11 @@ theorem rnDeriv_withDensity (ν : Measure α) [SigmaFinite ν] {f : α → ℝ
 
 /-- The Radon-Nikodym derivative of the restriction of a measure to a measurable set is the
 indicator function of this set. -/
-theorem rnDeriv_restrict (ν : Measure α) [SigmaFinite ν] {s : Set α} (hs : MeasurableSet s) :
+theorem rnDeriv_restrict_self (ν : Measure α) [SigmaFinite ν] {s : Set α} (hs : MeasurableSet s) :
     (ν.restrict s).rnDeriv ν =ᵐ[ν] s.indicator 1 := by
   rw [← withDensity_indicator_one hs]
   exact rnDeriv_withDensity _ (measurable_one.indicator hs)
-#align measure_theory.measure.rn_deriv_restrict MeasureTheory.Measure.rnDeriv_restrict
+#align measure_theory.measure.rn_deriv_restrict MeasureTheory.Measure.rnDeriv_restrict_self
 
 /-- Radon-Nikodym derivative of the scalar multiple of a measure.
 See also `rnDeriv_smul_left'`, which requires sigma-finite `ν` and `μ`. -/
@@ -1008,6 +1062,12 @@ lemma rnDeriv_add' (ν₁ ν₂ μ : Measure α) [SigmaFinite ν₁] [SigmaFinit
   · exact (measurable_rnDeriv _ _).aemeasurable
   · exact ((measurable_rnDeriv _ _).add (measurable_rnDeriv _ _)).aemeasurable
 
+lemma rnDeriv_add_of_mutuallySingular (ν₁ ν₂ μ : Measure α)
+    [SigmaFinite ν₁] [SigmaFinite ν₂] [SigmaFinite μ] (h : ν₂ ⟂ₘ μ) :
+    (ν₁ + ν₂).rnDeriv μ =ᵐ[μ] ν₁.rnDeriv μ := by
+  filter_upwards [rnDeriv_add' ν₁ ν₂ μ, (rnDeriv_eq_zero ν₂ μ).mpr h] with x hx_add hx_zero
+  simp [hx_add, hx_zero]
+
 end rnDeriv
 
 end Measure
chore: split MeasureTheory.Decomposition.Lebesgue (#8272)

Put all results about decomposition of signed measures into a new file. This does not significantly change the imports of the original file, because signed measures are used in the proof of the Lebesgue decomposition theorem for Measure.

Diff
@@ -3,11 +3,9 @@ Copyright (c) 2021 Kexing Ying. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Kexing Ying
 -/
-import Mathlib.MeasureTheory.Measure.Complex
 import Mathlib.MeasureTheory.Measure.Sub
 import Mathlib.MeasureTheory.Decomposition.Jordan
 import Mathlib.MeasureTheory.Measure.WithDensityVectorMeasure
-import Mathlib.MeasureTheory.Function.AEEqOfIntegral
 
 #align_import measure_theory.decomposition.lebesgue from "leanprover-community/mathlib"@"b2ff9a3d7a15fd5b0f060b135421d6a89a999c2f"
 
@@ -31,16 +29,6 @@ The Lebesgue decomposition provides the Radon-Nikodym theorem readily.
 * `MeasureTheory.Measure.rnDeriv`: If a pair of measures
   `HaveLebesgueDecomposition`, then `rnDeriv` chooses the measurable function from
   `HaveLebesgueDecomposition`, otherwise it returns the zero function.
-* `MeasureTheory.SignedMeasure.HaveLebesgueDecomposition` : A signed measure `s` and a
-  measure `μ` is said to `HaveLebesgueDecomposition` if both the positive part and negative
-  part of `s` `HaveLebesgueDecomposition` with respect to `μ`.
-* `MeasureTheory.SignedMeasure.singularPart` : The singular part between a signed measure `s`
-  and a measure `μ` is simply the singular part of the positive part of `s` with respect to `μ`
-  minus the singular part of the negative part of `s` with respect to `μ`.
-* `MeasureTheory.SignedMeasure.rnDeriv` : The Radon-Nikodym derivative of a signed
-  measure `s` with respect to a measure `μ` is the Radon-Nikodym derivative of the positive part of
-  `s` with respect to `μ` minus the Radon-Nikodym derivative of the negative part of `s` with
-  respect to `μ`.
 
 ## Main results
 
@@ -52,10 +40,8 @@ The Lebesgue decomposition provides the Radon-Nikodym theorem readily.
 * `MeasureTheory.Measure.eq_rnDeriv` : Given measures `μ` and `ν`, if `s` is a
   measure mutually singular to `ν` and `f` is a measurable function such that `μ = s + fν`,
   then `f = μ.rnDeriv ν`.
-* `MeasureTheory.SignedMeasure.singularPart_add_withDensity_rnDeriv_eq` :
-  the Lebesgue decomposition theorem between a signed measure and a σ-finite positive measure.
 
-# Tags
+## Tags
 
 Lebesgue decomposition theorem
 -/
@@ -1026,481 +1012,4 @@ end rnDeriv
 
 end Measure
 
-namespace SignedMeasure
-
-open Measure
-
-/-- A signed measure `s` is said to `HaveLebesgueDecomposition` with respect to a measure `μ`
-if the positive part and the negative part of `s` both `HaveLebesgueDecomposition` with
-respect to `μ`. -/
-class HaveLebesgueDecomposition (s : SignedMeasure α) (μ : Measure α) : Prop where
-  posPart : s.toJordanDecomposition.posPart.HaveLebesgueDecomposition μ
-  negPart : s.toJordanDecomposition.negPart.HaveLebesgueDecomposition μ
-#align measure_theory.signed_measure.have_lebesgue_decomposition MeasureTheory.SignedMeasure.HaveLebesgueDecomposition
-#align measure_theory.signed_measure.have_lebesgue_decomposition.pos_part MeasureTheory.SignedMeasure.HaveLebesgueDecomposition.posPart
-#align measure_theory.signed_measure.have_lebesgue_decomposition.neg_part MeasureTheory.SignedMeasure.HaveLebesgueDecomposition.negPart
-
-attribute [instance] HaveLebesgueDecomposition.posPart
-
-attribute [instance] HaveLebesgueDecomposition.negPart
-
-theorem not_haveLebesgueDecomposition_iff (s : SignedMeasure α) (μ : Measure α) :
-    ¬s.HaveLebesgueDecomposition μ ↔
-      ¬s.toJordanDecomposition.posPart.HaveLebesgueDecomposition μ ∨
-        ¬s.toJordanDecomposition.negPart.HaveLebesgueDecomposition μ :=
-  ⟨fun h => not_or_of_imp fun hp hn => h ⟨hp, hn⟩, fun h hl => (not_and_or.2 h) ⟨hl.1, hl.2⟩⟩
-#align measure_theory.signed_measure.not_have_lebesgue_decomposition_iff MeasureTheory.SignedMeasure.not_haveLebesgueDecomposition_iff
-
--- `infer_instance` directly does not work
--- see Note [lower instance priority]
-instance (priority := 100) haveLebesgueDecomposition_of_sigmaFinite (s : SignedMeasure α)
-    (μ : Measure α) [SigmaFinite μ] : s.HaveLebesgueDecomposition μ where
-  posPart := inferInstance
-  negPart := inferInstance
-#align measure_theory.signed_measure.have_lebesgue_decomposition_of_sigma_finite MeasureTheory.SignedMeasure.haveLebesgueDecomposition_of_sigmaFinite
-
-instance haveLebesgueDecomposition_neg (s : SignedMeasure α) (μ : Measure α)
-    [s.HaveLebesgueDecomposition μ] : (-s).HaveLebesgueDecomposition μ where
-  posPart := by
-    rw [toJordanDecomposition_neg, JordanDecomposition.neg_posPart]
-    infer_instance
-  negPart := by
-    rw [toJordanDecomposition_neg, JordanDecomposition.neg_negPart]
-    infer_instance
-#align measure_theory.signed_measure.have_lebesgue_decomposition_neg MeasureTheory.SignedMeasure.haveLebesgueDecomposition_neg
-
-instance haveLebesgueDecomposition_smul (s : SignedMeasure α) (μ : Measure α)
-    [s.HaveLebesgueDecomposition μ] (r : ℝ≥0) : (r • s).HaveLebesgueDecomposition μ where
-  posPart := by
-    rw [toJordanDecomposition_smul, JordanDecomposition.smul_posPart]
-    infer_instance
-  negPart := by
-    rw [toJordanDecomposition_smul, JordanDecomposition.smul_negPart]
-    infer_instance
-#align measure_theory.signed_measure.have_lebesgue_decomposition_smul MeasureTheory.SignedMeasure.haveLebesgueDecomposition_smul
-
-instance haveLebesgueDecomposition_smul_real (s : SignedMeasure α) (μ : Measure α)
-    [s.HaveLebesgueDecomposition μ] (r : ℝ) : (r • s).HaveLebesgueDecomposition μ := by
-  by_cases hr : 0 ≤ r
-  · lift r to ℝ≥0 using hr
-    exact s.haveLebesgueDecomposition_smul μ _
-  · rw [not_le] at hr
-    refine'
-      { posPart := by
-          rw [toJordanDecomposition_smul_real, JordanDecomposition.real_smul_posPart_neg _ _ hr]
-          infer_instance
-        negPart := by
-          rw [toJordanDecomposition_smul_real, JordanDecomposition.real_smul_negPart_neg _ _ hr]
-          infer_instance }
-#align measure_theory.signed_measure.have_lebesgue_decomposition_smul_real MeasureTheory.SignedMeasure.haveLebesgueDecomposition_smul_real
-
-/-- Given a signed measure `s` and a measure `μ`, `s.singularPart μ` is the signed measure
-such that `s.singularPart μ + μ.withDensityᵥ (s.rnDeriv μ) = s` and
-`s.singularPart μ` is mutually singular with respect to `μ`. -/
-def singularPart (s : SignedMeasure α) (μ : Measure α) : SignedMeasure α :=
-  (s.toJordanDecomposition.posPart.singularPart μ).toSignedMeasure -
-    (s.toJordanDecomposition.negPart.singularPart μ).toSignedMeasure
-#align measure_theory.signed_measure.singular_part MeasureTheory.SignedMeasure.singularPart
-
-section
-
-theorem singularPart_mutuallySingular (s : SignedMeasure α) (μ : Measure α) :
-    s.toJordanDecomposition.posPart.singularPart μ ⟂ₘ
-      s.toJordanDecomposition.negPart.singularPart μ := by
-  by_cases hl : s.HaveLebesgueDecomposition μ
-  · haveI := hl
-    obtain ⟨i, hi, hpos, hneg⟩ := s.toJordanDecomposition.mutuallySingular
-    rw [s.toJordanDecomposition.posPart.haveLebesgueDecomposition_add μ] at hpos
-    rw [s.toJordanDecomposition.negPart.haveLebesgueDecomposition_add μ] at hneg
-    rw [add_apply, add_eq_zero_iff] at hpos hneg
-    exact ⟨i, hi, hpos.1, hneg.1⟩
-  · rw [not_haveLebesgueDecomposition_iff] at hl
-    cases' hl with hp hn
-    · rw [Measure.singularPart, dif_neg hp]
-      exact MutuallySingular.zero_left
-    · rw [Measure.singularPart, Measure.singularPart, dif_neg hn]
-      exact MutuallySingular.zero_right
-#align measure_theory.signed_measure.singular_part_mutually_singular MeasureTheory.SignedMeasure.singularPart_mutuallySingular
-
-theorem singularPart_totalVariation (s : SignedMeasure α) (μ : Measure α) :
-    (s.singularPart μ).totalVariation =
-      s.toJordanDecomposition.posPart.singularPart μ +
-        s.toJordanDecomposition.negPart.singularPart μ := by
-  have :
-    (s.singularPart μ).toJordanDecomposition =
-      ⟨s.toJordanDecomposition.posPart.singularPart μ,
-        s.toJordanDecomposition.negPart.singularPart μ, singularPart_mutuallySingular s μ⟩ := by
-    refine' JordanDecomposition.toSignedMeasure_injective _
-    rw [toSignedMeasure_toJordanDecomposition]
-    rfl
-  · rw [totalVariation, this]
-#align measure_theory.signed_measure.singular_part_total_variation MeasureTheory.SignedMeasure.singularPart_totalVariation
-
-nonrec theorem mutuallySingular_singularPart (s : SignedMeasure α) (μ : Measure α) :
-    singularPart s μ ⟂ᵥ μ.toENNRealVectorMeasure := by
-  rw [mutuallySingular_ennreal_iff, singularPart_totalVariation]
-  change _ ⟂ₘ VectorMeasure.equivMeasure.toFun (VectorMeasure.equivMeasure.invFun μ)
-  rw [VectorMeasure.equivMeasure.right_inv μ]
-  exact (mutuallySingular_singularPart _ _).add_left (mutuallySingular_singularPart _ _)
-#align measure_theory.signed_measure.mutually_singular_singular_part MeasureTheory.SignedMeasure.mutuallySingular_singularPart
-
-end
-
-/-- The Radon-Nikodym derivative between a signed measure and a positive measure.
-
-`rnDeriv s μ` satisfies `μ.withDensityᵥ (s.rnDeriv μ) = s`
-if and only if `s` is absolutely continuous with respect to `μ` and this fact is known as
-`MeasureTheory.SignedMeasure.absolutelyContinuous_iff_withDensity_rnDeriv_eq`
-and can be found in `MeasureTheory.Decomposition.RadonNikodym`. -/
-def rnDeriv (s : SignedMeasure α) (μ : Measure α) : α → ℝ := fun x =>
-  (s.toJordanDecomposition.posPart.rnDeriv μ x).toReal -
-    (s.toJordanDecomposition.negPart.rnDeriv μ x).toReal
-#align measure_theory.signed_measure.rn_deriv MeasureTheory.SignedMeasure.rnDeriv
-
--- Porting note: The generated equation theorem is the form of `rnDeriv s μ x`.
-
-theorem rnDeriv_def (s : SignedMeasure α) (μ : Measure α) : rnDeriv s μ = fun x =>
-    (s.toJordanDecomposition.posPart.rnDeriv μ x).toReal -
-      (s.toJordanDecomposition.negPart.rnDeriv μ x).toReal :=
-  rfl
-
-attribute [eqns rnDeriv_def] rnDeriv
-
-variable {s t : SignedMeasure α}
-
-@[measurability]
-theorem measurable_rnDeriv (s : SignedMeasure α) (μ : Measure α) : Measurable (rnDeriv s μ) := by
-  rw [rnDeriv]
-  measurability
-#align measure_theory.signed_measure.measurable_rn_deriv MeasureTheory.SignedMeasure.measurable_rnDeriv
-
-theorem integrable_rnDeriv (s : SignedMeasure α) (μ : Measure α) : Integrable (rnDeriv s μ) μ := by
-  refine' Integrable.sub _ _ <;>
-    · constructor
-      · apply Measurable.aestronglyMeasurable; measurability
-      exact hasFiniteIntegral_toReal_of_lintegral_ne_top (lintegral_rnDeriv_lt_top _ μ).ne
-#align measure_theory.signed_measure.integrable_rn_deriv MeasureTheory.SignedMeasure.integrable_rnDeriv
-
-variable (s μ)
-
-/-- **The Lebesgue Decomposition theorem between a signed measure and a measure**:
-Given a signed measure `s` and a σ-finite measure `μ`, there exist a signed measure `t` and a
-measurable and integrable function `f`, such that `t` is mutually singular with respect to `μ`
-and `s = t + μ.with_densityᵥ f`. In this case `t = s.singular_part μ` and
-`f = s.rn_deriv μ`. -/
-theorem singularPart_add_withDensity_rnDeriv_eq [s.HaveLebesgueDecomposition μ] :
-    s.singularPart μ + μ.withDensityᵥ (s.rnDeriv μ) = s := by
-  conv_rhs =>
-    rw [← toSignedMeasure_toJordanDecomposition s, JordanDecomposition.toSignedMeasure]
-  rw [singularPart, rnDeriv,
-    withDensityᵥ_sub' (integrable_toReal_of_lintegral_ne_top _ _)
-      (integrable_toReal_of_lintegral_ne_top _ _),
-    withDensityᵥ_toReal, withDensityᵥ_toReal, sub_eq_add_neg, sub_eq_add_neg,
-    add_comm (s.toJordanDecomposition.posPart.singularPart μ).toSignedMeasure, ← add_assoc,
-    add_assoc (-(s.toJordanDecomposition.negPart.singularPart μ).toSignedMeasure),
-    ← toSignedMeasure_add, add_comm, ← add_assoc, ← neg_add, ← toSignedMeasure_add, add_comm,
-    ← sub_eq_add_neg]
-  convert rfl
-  -- `convert rfl` much faster than `congr`
-  · exact s.toJordanDecomposition.posPart.haveLebesgueDecomposition_add μ
-  · rw [add_comm]
-    exact s.toJordanDecomposition.negPart.haveLebesgueDecomposition_add μ
-  all_goals
-    first
-    | exact (lintegral_rnDeriv_lt_top _ _).ne
-    | measurability
-#align measure_theory.signed_measure.singular_part_add_with_density_rn_deriv_eq MeasureTheory.SignedMeasure.singularPart_add_withDensity_rnDeriv_eq
-
-variable {s μ}
-
-theorem jordanDecomposition_add_withDensity_mutuallySingular {f : α → ℝ} (hf : Measurable f)
-    (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) :
-    (t.toJordanDecomposition.posPart + μ.withDensity fun x : α => ENNReal.ofReal (f x)) ⟂ₘ
-      t.toJordanDecomposition.negPart + μ.withDensity fun x : α => ENNReal.ofReal (-f x) := by
-  rw [mutuallySingular_ennreal_iff, totalVariation_mutuallySingular_iff] at htμ
-  change
-    _ ⟂ₘ VectorMeasure.equivMeasure.toFun (VectorMeasure.equivMeasure.invFun μ) ∧
-      _ ⟂ₘ VectorMeasure.equivMeasure.toFun (VectorMeasure.equivMeasure.invFun μ) at htμ
-  rw [VectorMeasure.equivMeasure.right_inv] at htμ
-  exact
-    ((JordanDecomposition.mutuallySingular _).add_right
-          (htμ.1.mono_ac (refl _) (withDensity_absolutelyContinuous _ _))).add_left
-      ((htμ.2.symm.mono_ac (withDensity_absolutelyContinuous _ _) (refl _)).add_right
-        (withDensity_ofReal_mutuallySingular hf))
-#align measure_theory.signed_measure.jordan_decomposition_add_with_density_mutually_singular MeasureTheory.SignedMeasure.jordanDecomposition_add_withDensity_mutuallySingular
-
-theorem toJordanDecomposition_eq_of_eq_add_withDensity {f : α → ℝ} (hf : Measurable f)
-    (hfi : Integrable f μ) (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
-    s.toJordanDecomposition =
-      @JordanDecomposition.mk α _
-        (t.toJordanDecomposition.posPart + μ.withDensity fun x => ENNReal.ofReal (f x))
-        (t.toJordanDecomposition.negPart + μ.withDensity fun x => ENNReal.ofReal (-f x))
-        (by haveI := isFiniteMeasure_withDensity_ofReal hfi.2; infer_instance)
-        (by haveI := isFiniteMeasure_withDensity_ofReal hfi.neg.2; infer_instance)
-        (jordanDecomposition_add_withDensity_mutuallySingular hf htμ) := by
-  haveI := isFiniteMeasure_withDensity_ofReal hfi.2
-  haveI := isFiniteMeasure_withDensity_ofReal hfi.neg.2
-  refine' toJordanDecomposition_eq _
-  simp_rw [JordanDecomposition.toSignedMeasure, hadd]
-  ext i hi
-  rw [VectorMeasure.sub_apply, toSignedMeasure_apply_measurable hi,
-      toSignedMeasure_apply_measurable hi, add_apply, add_apply, ENNReal.toReal_add,
-      ENNReal.toReal_add, add_sub_add_comm, ← toSignedMeasure_apply_measurable hi,
-      ← toSignedMeasure_apply_measurable hi, ← VectorMeasure.sub_apply,
-      ← JordanDecomposition.toSignedMeasure, toSignedMeasure_toJordanDecomposition,
-      VectorMeasure.add_apply, ← toSignedMeasure_apply_measurable hi,
-      ← toSignedMeasure_apply_measurable hi,
-      withDensityᵥ_eq_withDensity_pos_part_sub_withDensity_neg_part hfi,
-      VectorMeasure.sub_apply] <;>
-    exact (measure_lt_top _ _).ne
-#align measure_theory.signed_measure.to_jordan_decomposition_eq_of_eq_add_with_density MeasureTheory.SignedMeasure.toJordanDecomposition_eq_of_eq_add_withDensity
-
-private theorem haveLebesgueDecomposition_mk' (μ : Measure α) {f : α → ℝ} (hf : Measurable f)
-    (hfi : Integrable f μ) (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
-    s.HaveLebesgueDecomposition μ := by
-  have htμ' := htμ
-  rw [mutuallySingular_ennreal_iff] at htμ
-  change _ ⟂ₘ VectorMeasure.equivMeasure.toFun (VectorMeasure.equivMeasure.invFun μ) at htμ
-  rw [VectorMeasure.equivMeasure.right_inv, totalVariation_mutuallySingular_iff] at htμ
-  refine'
-    { posPart := by
-        use ⟨t.toJordanDecomposition.posPart, fun x => ENNReal.ofReal (f x)⟩
-        refine' ⟨hf.ennreal_ofReal, htμ.1, _⟩
-        rw [toJordanDecomposition_eq_of_eq_add_withDensity hf hfi htμ' hadd]
-      negPart := by
-        use ⟨t.toJordanDecomposition.negPart, fun x => ENNReal.ofReal (-f x)⟩
-        refine' ⟨hf.neg.ennreal_ofReal, htμ.2, _⟩
-        rw [toJordanDecomposition_eq_of_eq_add_withDensity hf hfi htμ' hadd] }
-
-theorem haveLebesgueDecomposition_mk (μ : Measure α) {f : α → ℝ} (hf : Measurable f)
-    (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
-    s.HaveLebesgueDecomposition μ := by
-  by_cases hfi : Integrable f μ
-  · exact haveLebesgueDecomposition_mk' μ hf hfi htμ hadd
-  · rw [withDensityᵥ, dif_neg hfi, add_zero] at hadd
-    refine' haveLebesgueDecomposition_mk' μ measurable_zero (integrable_zero _ _ μ) htμ _
-    rwa [withDensityᵥ_zero, add_zero]
-#align measure_theory.signed_measure.have_lebesgue_decomposition_mk MeasureTheory.SignedMeasure.haveLebesgueDecomposition_mk
-
-private theorem eq_singularPart' (t : SignedMeasure α) {f : α → ℝ} (hf : Measurable f)
-    (hfi : Integrable f μ) (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
-    t = s.singularPart μ := by
-  have htμ' := htμ
-  rw [mutuallySingular_ennreal_iff, totalVariation_mutuallySingular_iff] at htμ
-  change
-    _ ⟂ₘ VectorMeasure.equivMeasure.toFun (VectorMeasure.equivMeasure.invFun μ) ∧
-      _ ⟂ₘ VectorMeasure.equivMeasure.toFun (VectorMeasure.equivMeasure.invFun μ) at htμ
-  rw [VectorMeasure.equivMeasure.right_inv] at htμ
-  · rw [singularPart, ← t.toSignedMeasure_toJordanDecomposition,
-      JordanDecomposition.toSignedMeasure]
-    congr
-    · have hfpos : Measurable fun x => ENNReal.ofReal (f x) := by measurability
-      refine' eq_singularPart hfpos htμ.1 _
-      rw [toJordanDecomposition_eq_of_eq_add_withDensity hf hfi htμ' hadd]
-    · have hfneg : Measurable fun x => ENNReal.ofReal (-f x) := by measurability
-      refine' eq_singularPart hfneg htμ.2 _
-      rw [toJordanDecomposition_eq_of_eq_add_withDensity hf hfi htμ' hadd]
-
-/-- Given a measure `μ`, signed measures `s` and `t`, and a function `f` such that `t` is
-mutually singular with respect to `μ` and `s = t + μ.withDensityᵥ f`, we have
-`t = singularPart s μ`, i.e. `t` is the singular part of the Lebesgue decomposition between
-`s` and `μ`. -/
-theorem eq_singularPart (t : SignedMeasure α) (f : α → ℝ) (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure)
-    (hadd : s = t + μ.withDensityᵥ f) : t = s.singularPart μ := by
-  by_cases hfi : Integrable f μ
-  · refine' eq_singularPart' t hfi.1.measurable_mk (hfi.congr hfi.1.ae_eq_mk) htμ _
-    convert hadd using 2
-    exact WithDensityᵥEq.congr_ae hfi.1.ae_eq_mk.symm
-  · rw [withDensityᵥ, dif_neg hfi, add_zero] at hadd
-    refine' eq_singularPart' t measurable_zero (integrable_zero _ _ μ) htμ _
-    rwa [withDensityᵥ_zero, add_zero]
-#align measure_theory.signed_measure.eq_singular_part MeasureTheory.SignedMeasure.eq_singularPart
-
-theorem singularPart_zero (μ : Measure α) : (0 : SignedMeasure α).singularPart μ = 0 := by
-  refine' (eq_singularPart 0 0 VectorMeasure.MutuallySingular.zero_left _).symm
-  rw [zero_add, withDensityᵥ_zero]
-#align measure_theory.signed_measure.singular_part_zero MeasureTheory.SignedMeasure.singularPart_zero
-
-theorem singularPart_neg (s : SignedMeasure α) (μ : Measure α) :
-    (-s).singularPart μ = -s.singularPart μ := by
-  have h₁ :
-    ((-s).toJordanDecomposition.posPart.singularPart μ).toSignedMeasure =
-      (s.toJordanDecomposition.negPart.singularPart μ).toSignedMeasure := by
-    refine' toSignedMeasure_congr _
-    rw [toJordanDecomposition_neg, JordanDecomposition.neg_posPart]
-  have h₂ :
-    ((-s).toJordanDecomposition.negPart.singularPart μ).toSignedMeasure =
-      (s.toJordanDecomposition.posPart.singularPart μ).toSignedMeasure := by
-    refine' toSignedMeasure_congr _
-    rw [toJordanDecomposition_neg, JordanDecomposition.neg_negPart]
-  rw [singularPart, singularPart, neg_sub, h₁, h₂]
-#align measure_theory.signed_measure.singular_part_neg MeasureTheory.SignedMeasure.singularPart_neg
-
-theorem singularPart_smul_nnreal (s : SignedMeasure α) (μ : Measure α) (r : ℝ≥0) :
-    (r • s).singularPart μ = r • s.singularPart μ := by
-  rw [singularPart, singularPart, smul_sub, ← toSignedMeasure_smul, ← toSignedMeasure_smul]
-  conv_lhs =>
-    congr
-    · congr
-      · rw [toJordanDecomposition_smul, JordanDecomposition.smul_posPart, singularPart_smul]
-    · congr
-      rw [toJordanDecomposition_smul, JordanDecomposition.smul_negPart, singularPart_smul]
-#align measure_theory.signed_measure.singular_part_smul_nnreal MeasureTheory.SignedMeasure.singularPart_smul_nnreal
-
-nonrec theorem singularPart_smul (s : SignedMeasure α) (μ : Measure α) (r : ℝ) :
-    (r • s).singularPart μ = r • s.singularPart μ := by
-  by_cases hr : 0 ≤ r
-  · lift r to ℝ≥0 using hr
-    exact singularPart_smul_nnreal s μ r
-  · rw [singularPart, singularPart]
-    conv_lhs =>
-      congr
-      · congr
-        · rw [toJordanDecomposition_smul_real,
-            JordanDecomposition.real_smul_posPart_neg _ _ (not_le.1 hr), singularPart_smul]
-      · congr
-        · rw [toJordanDecomposition_smul_real,
-            JordanDecomposition.real_smul_negPart_neg _ _ (not_le.1 hr), singularPart_smul]
-    rw [toSignedMeasure_smul, toSignedMeasure_smul, ← neg_sub, ← smul_sub]
-    change -(((-r).toNNReal : ℝ) • (_ : SignedMeasure α)) = _
-    rw [← neg_smul, Real.coe_toNNReal _ (le_of_lt (neg_pos.mpr (not_le.1 hr))), neg_neg]
-#align measure_theory.signed_measure.singular_part_smul MeasureTheory.SignedMeasure.singularPart_smul
-
-theorem singularPart_add (s t : SignedMeasure α) (μ : Measure α) [s.HaveLebesgueDecomposition μ]
-    [t.HaveLebesgueDecomposition μ] :
-    (s + t).singularPart μ = s.singularPart μ + t.singularPart μ := by
-  refine'
-    (eq_singularPart _ (s.rnDeriv μ + t.rnDeriv μ)
-        ((mutuallySingular_singularPart s μ).add_left (mutuallySingular_singularPart t μ))
-        _).symm
-  erw [withDensityᵥ_add (integrable_rnDeriv s μ) (integrable_rnDeriv t μ)]
-  rw [add_assoc, add_comm (t.singularPart μ), add_assoc, add_comm _ (t.singularPart μ),
-    singularPart_add_withDensity_rnDeriv_eq, ← add_assoc,
-    singularPart_add_withDensity_rnDeriv_eq]
-#align measure_theory.signed_measure.singular_part_add MeasureTheory.SignedMeasure.singularPart_add
-
-theorem singularPart_sub (s t : SignedMeasure α) (μ : Measure α) [s.HaveLebesgueDecomposition μ]
-    [t.HaveLebesgueDecomposition μ] :
-    (s - t).singularPart μ = s.singularPart μ - t.singularPart μ := by
-  rw [sub_eq_add_neg, sub_eq_add_neg, singularPart_add, singularPart_neg]
-#align measure_theory.signed_measure.singular_part_sub MeasureTheory.SignedMeasure.singularPart_sub
-
-/-- Given a measure `μ`, signed measures `s` and `t`, and a function `f` such that `t` is
-mutually singular with respect to `μ` and `s = t + μ.withDensityᵥ f`, we have
-`f = rnDeriv s μ`, i.e. `f` is the Radon-Nikodym derivative of `s` and `μ`. -/
-theorem eq_rnDeriv (t : SignedMeasure α) (f : α → ℝ) (hfi : Integrable f μ)
-    (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
-    f =ᵐ[μ] s.rnDeriv μ := by
-  set f' := hfi.1.mk f
-  have hadd' : s = t + μ.withDensityᵥ f' := by
-    convert hadd using 2
-    exact WithDensityᵥEq.congr_ae hfi.1.ae_eq_mk.symm
-  haveI := haveLebesgueDecomposition_mk μ hfi.1.measurable_mk htμ hadd'
-  refine' (Integrable.ae_eq_of_withDensityᵥ_eq (integrable_rnDeriv _ _) hfi _).symm
-  rw [← add_right_inj t, ← hadd, eq_singularPart _ f htμ hadd,
-    singularPart_add_withDensity_rnDeriv_eq]
-#align measure_theory.signed_measure.eq_rn_deriv MeasureTheory.SignedMeasure.eq_rnDeriv
-
-theorem rnDeriv_neg (s : SignedMeasure α) (μ : Measure α) [s.HaveLebesgueDecomposition μ] :
-    (-s).rnDeriv μ =ᵐ[μ] -s.rnDeriv μ := by
-  refine'
-    Integrable.ae_eq_of_withDensityᵥ_eq (integrable_rnDeriv _ _) (integrable_rnDeriv _ _).neg _
-  rw [withDensityᵥ_neg, ← add_right_inj ((-s).singularPart μ),
-    singularPart_add_withDensity_rnDeriv_eq, singularPart_neg, ← neg_add,
-    singularPart_add_withDensity_rnDeriv_eq]
-#align measure_theory.signed_measure.rn_deriv_neg MeasureTheory.SignedMeasure.rnDeriv_neg
-
-theorem rnDeriv_smul (s : SignedMeasure α) (μ : Measure α) [s.HaveLebesgueDecomposition μ] (r : ℝ) :
-    (r • s).rnDeriv μ =ᵐ[μ] r • s.rnDeriv μ := by
-  refine'
-    Integrable.ae_eq_of_withDensityᵥ_eq (integrable_rnDeriv _ _)
-      ((integrable_rnDeriv _ _).smul r) _
-  change _ = μ.withDensityᵥ ((r : ℝ) • s.rnDeriv μ)
-  rw [withDensityᵥ_smul (rnDeriv s μ) (r : ℝ), ← add_right_inj ((r • s).singularPart μ),
-    singularPart_add_withDensity_rnDeriv_eq, singularPart_smul]
-  change _ = _ + r • _
-  rw [← smul_add, singularPart_add_withDensity_rnDeriv_eq]
-#align measure_theory.signed_measure.rn_deriv_smul MeasureTheory.SignedMeasure.rnDeriv_smul
-
-theorem rnDeriv_add (s t : SignedMeasure α) (μ : Measure α) [s.HaveLebesgueDecomposition μ]
-    [t.HaveLebesgueDecomposition μ] [(s + t).HaveLebesgueDecomposition μ] :
-    (s + t).rnDeriv μ =ᵐ[μ] s.rnDeriv μ + t.rnDeriv μ := by
-  refine'
-    Integrable.ae_eq_of_withDensityᵥ_eq (integrable_rnDeriv _ _)
-      ((integrable_rnDeriv _ _).add (integrable_rnDeriv _ _)) _
-  rw [← add_right_inj ((s + t).singularPart μ), singularPart_add_withDensity_rnDeriv_eq,
-    withDensityᵥ_add (integrable_rnDeriv _ _) (integrable_rnDeriv _ _), singularPart_add,
-    add_assoc, add_comm (t.singularPart μ), add_assoc, add_comm _ (t.singularPart μ),
-    singularPart_add_withDensity_rnDeriv_eq, ← add_assoc,
-    singularPart_add_withDensity_rnDeriv_eq]
-#align measure_theory.signed_measure.rn_deriv_add MeasureTheory.SignedMeasure.rnDeriv_add
-
-theorem rnDeriv_sub (s t : SignedMeasure α) (μ : Measure α) [s.HaveLebesgueDecomposition μ]
-    [t.HaveLebesgueDecomposition μ] [hst : (s - t).HaveLebesgueDecomposition μ] :
-    (s - t).rnDeriv μ =ᵐ[μ] s.rnDeriv μ - t.rnDeriv μ := by
-  rw [sub_eq_add_neg] at hst
-  rw [sub_eq_add_neg, sub_eq_add_neg]
-  exact ae_eq_trans (rnDeriv_add _ _ _) (Filter.EventuallyEq.add (ae_eq_refl _) (rnDeriv_neg _ _))
-#align measure_theory.signed_measure.rn_deriv_sub MeasureTheory.SignedMeasure.rnDeriv_sub
-
-end SignedMeasure
-
-namespace ComplexMeasure
-
-/-- A complex measure is said to `HaveLebesgueDecomposition` with respect to a positive measure
-if both its real and imaginary part `HaveLebesgueDecomposition` with respect to that measure. -/
-class HaveLebesgueDecomposition (c : ComplexMeasure α) (μ : Measure α) : Prop where
-  rePart : c.re.HaveLebesgueDecomposition μ
-  imPart : c.im.HaveLebesgueDecomposition μ
-#align measure_theory.complex_measure.have_lebesgue_decomposition MeasureTheory.ComplexMeasure.HaveLebesgueDecomposition
-#align measure_theory.complex_measure.have_lebesgue_decomposition.re_part MeasureTheory.ComplexMeasure.HaveLebesgueDecomposition.rePart
-#align measure_theory.complex_measure.have_lebesgue_decomposition.im_part MeasureTheory.ComplexMeasure.HaveLebesgueDecomposition.imPart
-
-attribute [instance] HaveLebesgueDecomposition.rePart
-
-attribute [instance] HaveLebesgueDecomposition.imPart
-
-/-- The singular part between a complex measure `c` and a positive measure `μ` is the complex
-measure satisfying `c.singularPart μ + μ.withDensityᵥ (c.rnDeriv μ) = c`. This property is given
-by `MeasureTheory.ComplexMeasure.singularPart_add_withDensity_rnDeriv_eq`. -/
-def singularPart (c : ComplexMeasure α) (μ : Measure α) : ComplexMeasure α :=
-  (c.re.singularPart μ).toComplexMeasure (c.im.singularPart μ)
-#align measure_theory.complex_measure.singular_part MeasureTheory.ComplexMeasure.singularPart
-
-/-- The Radon-Nikodym derivative between a complex measure and a positive measure. -/
-def rnDeriv (c : ComplexMeasure α) (μ : Measure α) : α → ℂ := fun x =>
-  ⟨c.re.rnDeriv μ x, c.im.rnDeriv μ x⟩
-#align measure_theory.complex_measure.rn_deriv MeasureTheory.ComplexMeasure.rnDeriv
-
-variable {c : ComplexMeasure α}
-
-theorem integrable_rnDeriv (c : ComplexMeasure α) (μ : Measure α) : Integrable (c.rnDeriv μ) μ := by
-  rw [← memℒp_one_iff_integrable, ← memℒp_re_im_iff]
-  exact
-    ⟨memℒp_one_iff_integrable.2 (SignedMeasure.integrable_rnDeriv _ _),
-      memℒp_one_iff_integrable.2 (SignedMeasure.integrable_rnDeriv _ _)⟩
-#align measure_theory.complex_measure.integrable_rn_deriv MeasureTheory.ComplexMeasure.integrable_rnDeriv
-
-theorem singularPart_add_withDensity_rnDeriv_eq [c.HaveLebesgueDecomposition μ] :
-    c.singularPart μ + μ.withDensityᵥ (c.rnDeriv μ) = c := by
-  conv_rhs => rw [← c.toComplexMeasure_to_signedMeasure]
-  ext i hi : 1
-  rw [VectorMeasure.add_apply, SignedMeasure.toComplexMeasure_apply]
-  ext
-  · rw [Complex.add_re, withDensityᵥ_apply (c.integrable_rnDeriv μ) hi, ← IsROrC.re_eq_complex_re,
-      ← integral_re (c.integrable_rnDeriv μ).integrableOn, IsROrC.re_eq_complex_re,
-      ← withDensityᵥ_apply _ hi]
-    · change (c.re.singularPart μ + μ.withDensityᵥ (c.re.rnDeriv μ)) i = _
-      rw [c.re.singularPart_add_withDensity_rnDeriv_eq μ]
-    · exact SignedMeasure.integrable_rnDeriv _ _
-  · rw [Complex.add_im, withDensityᵥ_apply (c.integrable_rnDeriv μ) hi, ← IsROrC.im_eq_complex_im,
-      ← integral_im (c.integrable_rnDeriv μ).integrableOn, IsROrC.im_eq_complex_im,
-      ← withDensityᵥ_apply _ hi]
-    · change (c.im.singularPart μ + μ.withDensityᵥ (c.im.rnDeriv μ)) i = _
-      rw [c.im.singularPart_add_withDensity_rnDeriv_eq μ]
-    · exact SignedMeasure.integrable_rnDeriv _ _
-#align measure_theory.complex_measure.singular_part_add_with_density_rn_deriv_eq MeasureTheory.ComplexMeasure.singularPart_add_withDensity_rnDeriv_eq
-
-end ComplexMeasure
-
 end MeasureTheory
feat: properties of rnDeriv (#7675)

Various results about rnDeriv, notably rnDeriv_add, rnDeriv_smul_left and rnDeriv_smul_right. These results describe the Radon-Nikodym derivatives of sums and scaling of measures.

These lemmas were already there for signed measures, but not for Measure. The proofs for signed measures use that addition is cancelative (μ + ν₁ = μ + ν₂ ↔ ν₁ = ν₂). This is not true in general for measures, but is true when μ is mutually singular with the two other measures or when μ is sigma-finite, which is enough for these proofs.

Co-authored-by: RemyDegenne <remydegenne@gmail.com> Co-authored-by: Mario Carneiro <di.gama@gmail.com>

Diff
@@ -96,6 +96,16 @@ irreducible_def rnDeriv (μ ν : Measure α) : α → ℝ≥0∞ :=
   if h : HaveLebesgueDecomposition μ ν then (Classical.choose h.lebesgue_decomposition).2 else 0
 #align measure_theory.measure.rn_deriv MeasureTheory.Measure.rnDeriv
 
+lemma singularPart_of_not_haveLebesgueDecomposition {μ ν : Measure α}
+    (h : ¬ HaveLebesgueDecomposition μ ν) :
+    μ.singularPart ν = 0 := by
+  rw [singularPart]; exact dif_neg h
+
+lemma rnDeriv_of_not_haveLebesgueDecomposition {μ ν : Measure α}
+    (h : ¬ HaveLebesgueDecomposition μ ν) :
+    μ.rnDeriv ν = 0 := by
+  rw [rnDeriv]; exact dif_neg h
+
 theorem haveLebesgueDecomposition_spec (μ ν : Measure α) [h : HaveLebesgueDecomposition μ ν] :
     Measurable (μ.rnDeriv ν) ∧
       μ.singularPart ν ⟂ₘ ν ∧ μ = μ.singularPart ν + ν.withDensity (μ.rnDeriv ν) := by
@@ -172,6 +182,32 @@ theorem withDensity_rnDeriv_le (μ ν : Measure α) : ν.withDensity (μ.rnDeriv
     exact Measure.zero_le μ
 #align measure_theory.measure.with_density_rn_deriv_le MeasureTheory.Measure.withDensity_rnDeriv_le
 
+@[simp]
+lemma withDensity_rnDeriv_eq_zero (μ ν : Measure α) [μ.HaveLebesgueDecomposition ν] :
+    ν.withDensity (μ.rnDeriv ν) = 0 ↔ μ ⟂ₘ ν := by
+  have h_dec := haveLebesgueDecomposition_add μ ν
+  refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
+  · rw [h, add_zero] at h_dec
+    rw [h_dec]
+    exact mutuallySingular_singularPart μ ν
+  · rw [← MutuallySingular.self_iff]
+    rw [h_dec, MutuallySingular.add_left_iff] at h
+    refine MutuallySingular.mono_ac h.2 AbsolutelyContinuous.rfl ?_
+    exact withDensity_absolutelyContinuous _ _
+
+@[simp]
+lemma rnDeriv_eq_zero (μ ν : Measure α) [μ.HaveLebesgueDecomposition ν] :
+    μ.rnDeriv ν =ᵐ[ν] 0 ↔ μ ⟂ₘ ν := by
+  rw [← withDensity_rnDeriv_eq_zero,
+    withDensity_eq_zero_iff (measurable_rnDeriv _ _).aemeasurable]
+
+lemma MutuallySingular.rnDeriv_ae_eq_zero {μ ν : Measure α} (hμν : μ ⟂ₘ ν) :
+    μ.rnDeriv ν =ᵐ[ν] 0 := by
+  by_cases h : μ.HaveLebesgueDecomposition ν
+  · rw [rnDeriv_eq_zero]
+    exact hμν
+  · rw [rnDeriv_of_not_haveLebesgueDecomposition h]
+
 instance singularPart.instIsFiniteMeasure [IsFiniteMeasure μ] :
     IsFiniteMeasure (μ.singularPart ν) :=
   isFiniteMeasure_of_le μ <| singularPart_le μ ν
@@ -202,7 +238,7 @@ instance withDensity.instIsLocallyFiniteMeasure [TopologicalSpace α] [IsLocally
 #align measure_theory.measure.with_density.measure_theory.is_locally_finite_measure MeasureTheory.Measure.withDensity.instIsLocallyFiniteMeasure
 
 theorem lintegral_rnDeriv_lt_top_of_measure_ne_top {μ : Measure α} (ν : Measure α) {s : Set α}
-    (hs : μ s ≠ ∞) : (∫⁻ x in s, μ.rnDeriv ν x ∂ν) < ∞ := by
+    (hs : μ s ≠ ∞) : ∫⁻ x in s, μ.rnDeriv ν x ∂ν < ∞ := by
   by_cases hl : HaveLebesgueDecomposition μ ν
   · haveI := hl
     obtain ⟨-, -, hadd⟩ := haveLebesgueDecomposition_spec μ ν
@@ -226,6 +262,11 @@ theorem lintegral_rnDeriv_lt_top (μ ν : Measure α) [IsFiniteMeasure μ] :
   exact lintegral_rnDeriv_lt_top_of_measure_ne_top _ (measure_lt_top _ _).ne
 #align measure_theory.measure.lintegral_rn_deriv_lt_top MeasureTheory.Measure.lintegral_rnDeriv_lt_top
 
+lemma integrable_toReal_rnDeriv {μ ν : Measure α} [IsFiniteMeasure μ] :
+    Integrable (fun x ↦ (μ.rnDeriv ν x).toReal) ν :=
+  integrable_toReal_of_lintegral_ne_top (Measure.measurable_rnDeriv _ _).aemeasurable
+    (Measure.lintegral_rnDeriv_lt_top _ _).ne
+
 /-- The Radon-Nikodym derivative of a sigma-finite measure `μ` with respect to another
 measure `ν` is `ν`-almost everywhere finite. -/
 theorem rnDeriv_lt_top (μ ν : Measure α) [SigmaFinite μ] : ∀ᵐ x ∂ν, μ.rnDeriv ν x < ∞ := by
@@ -238,6 +279,9 @@ theorem rnDeriv_lt_top (μ ν : Measure α) [SigmaFinite μ] : ∀ᵐ x ∂ν, 
   exact (measure_spanningSets_lt_top _ _).ne
 #align measure_theory.measure.rn_deriv_lt_top MeasureTheory.Measure.rnDeriv_lt_top
 
+lemma rnDeriv_ne_top (μ ν : Measure α) [SigmaFinite μ] : ∀ᵐ x ∂ν, μ.rnDeriv ν x ≠ ∞ := by
+  filter_upwards [Measure.rnDeriv_lt_top μ ν] with x hx using hx.ne
+
 /-- Given measures `μ` and `ν`, if `s` is a measure mutually singular to `ν` and `f` is a
 measurable function such that `μ = s + fν`, then `s = μ.singularPart μ`.
 
@@ -289,8 +333,7 @@ theorem singularPart_smul (μ ν : Measure α) (r : ℝ≥0) :
   by_cases hr : r = 0
   · rw [hr, zero_smul, zero_smul, singularPart_zero]
   by_cases hl : HaveLebesgueDecomposition μ ν
-  · haveI := hl
-    refine'
+  · refine'
       (eq_singularPart ((measurable_rnDeriv μ ν).const_smul (r : ℝ≥0∞))
           (MutuallySingular.smul r (haveLebesgueDecomposition_spec _ _).2.1) _).symm
     rw [withDensity_smul _ (measurable_rnDeriv _ _), ← smul_add,
@@ -384,6 +427,22 @@ theorem eq_withDensity_rnDeriv {s : Measure α} {f : α → ℝ≥0∞} (hf : Me
     restrict_apply hA, ← diff_eq, measure_inter_add_diff _ (hS₁.inter hT₁)]
 #align measure_theory.measure.eq_with_density_rn_deriv MeasureTheory.Measure.eq_withDensity_rnDeriv
 
+theorem eq_withDensity_rnDeriv₀ {μ ν : Measure α} {s : Measure α} {f : α → ℝ≥0∞}
+    (hf : AEMeasurable f ν) (hs : s ⟂ₘ ν) (hadd : μ = s + ν.withDensity f) :
+    ν.withDensity f = ν.withDensity (μ.rnDeriv ν) := by
+  rw [withDensity_congr_ae hf.ae_eq_mk] at hadd ⊢
+  exact eq_withDensity_rnDeriv hf.measurable_mk hs hadd
+
+theorem eq_rnDeriv₀ {μ ν : Measure α} [SigmaFinite ν] {s : Measure α} {f : α → ℝ≥0∞}
+    (hf : AEMeasurable f ν) (hs : s ⟂ₘ ν) (hadd : μ = s + ν.withDensity f) :
+    f =ᵐ[ν] μ.rnDeriv ν := by
+  refine' ae_eq_of_forall_set_lintegral_eq_of_sigmaFinite₀ hf
+    (measurable_rnDeriv μ ν).aemeasurable _
+  intro a ha _
+  calc ∫⁻ x : α in a, f x ∂ν = ν.withDensity f a := (withDensity_apply f ha).symm
+    _ = ν.withDensity (μ.rnDeriv ν) a := by rw [eq_withDensity_rnDeriv₀ hf hs hadd]
+    _ = ∫⁻ x : α in a, μ.rnDeriv ν x ∂ν := withDensity_apply _ ha
+
 /-- Given measures `μ` and `ν`, if `s` is a measure mutually singular to `ν` and `f` is a
 measurable function such that `μ = s + fν`, then `f = μ.rnDeriv ν`.
 
@@ -392,13 +451,8 @@ theorem, while `MeasureTheory.Measure.eq_singularPart` provides the uniqueness o
 `singularPart`. Here, the uniqueness is given in terms of the functions, while the uniqueness in
 terms of the functions is given in `eq_withDensity_rnDeriv`. -/
 theorem eq_rnDeriv [SigmaFinite ν] {s : Measure α} {f : α → ℝ≥0∞} (hf : Measurable f) (hs : s ⟂ₘ ν)
-    (hadd : μ = s + ν.withDensity f) : f =ᵐ[ν] μ.rnDeriv ν := by
-  refine' ae_eq_of_forall_set_lintegral_eq_of_sigmaFinite hf (measurable_rnDeriv μ ν) _
-  intro a ha _
-  calc
-    ∫⁻ x : α in a, f x ∂ν = ν.withDensity f a := (withDensity_apply f ha).symm
-    _ = ν.withDensity (μ.rnDeriv ν) a := by rw [eq_withDensity_rnDeriv hf hs hadd]
-    _ = ∫⁻ x : α in a, μ.rnDeriv ν x ∂ν := withDensity_apply _ ha
+    (hadd : μ = s + ν.withDensity f) : f =ᵐ[ν] μ.rnDeriv ν :=
+  eq_rnDeriv₀ hf.aemeasurable hs hadd
 #align measure_theory.measure.eq_rn_deriv MeasureTheory.Measure.eq_rnDeriv
 
 /-- The Radon-Nikodym derivative of `f ν` with respect to `ν` is `f`. -/
@@ -416,6 +470,93 @@ theorem rnDeriv_restrict (ν : Measure α) [SigmaFinite ν] {s : Set α} (hs : M
   exact rnDeriv_withDensity _ (measurable_one.indicator hs)
 #align measure_theory.measure.rn_deriv_restrict MeasureTheory.Measure.rnDeriv_restrict
 
+/-- Radon-Nikodym derivative of the scalar multiple of a measure.
+See also `rnDeriv_smul_left'`, which requires sigma-finite `ν` and `μ`. -/
+theorem rnDeriv_smul_left (ν μ : Measure α) [IsFiniteMeasure ν]
+    [ν.HaveLebesgueDecomposition μ] (r : ℝ≥0) :
+    (r • ν).rnDeriv μ =ᵐ[μ] r • ν.rnDeriv μ := by
+  rw [← withDensity_eq_iff]
+  · simp_rw [ENNReal.smul_def]
+    rw [withDensity_smul _ (measurable_rnDeriv _ _)]
+    suffices (r • ν).singularPart μ + withDensity μ (rnDeriv (r • ν) μ)
+        = (r • ν).singularPart μ + r • withDensity μ (rnDeriv ν μ) by
+      rwa [Measure.add_right_inj] at this
+    rw [← (r • ν).haveLebesgueDecomposition_add μ, singularPart_smul, ← smul_add,
+      ← ν.haveLebesgueDecomposition_add μ]
+  · exact (measurable_rnDeriv _ _).aemeasurable
+  · exact (measurable_rnDeriv _ _).aemeasurable.const_smul _
+  · exact (lintegral_rnDeriv_lt_top (r • ν) μ).ne
+
+/-- Radon-Nikodym derivative of the scalar multiple of a measure.
+See also `rnDeriv_smul_left_of_ne_top'`, which requires sigma-finite `ν` and `μ`. -/
+theorem rnDeriv_smul_left_of_ne_top (ν μ : Measure α) [IsFiniteMeasure ν]
+    [ν.HaveLebesgueDecomposition μ] {r : ℝ≥0∞} (hr : r ≠ ∞) :
+    (r • ν).rnDeriv μ =ᵐ[μ] r • ν.rnDeriv μ := by
+  have h : (r.toNNReal • ν).rnDeriv μ =ᵐ[μ] r.toNNReal • ν.rnDeriv μ :=
+    rnDeriv_smul_left ν μ r.toNNReal
+  simpa [ENNReal.smul_def, ENNReal.coe_toNNReal hr] using h
+
+/-- Radon-Nikodym derivative with respect to the scalar multiple of a measure.
+See also `rnDeriv_smul_right'`, which requires sigma-finite `ν` and `μ`. -/
+theorem rnDeriv_smul_right (ν μ : Measure α) [IsFiniteMeasure ν]
+    [ν.HaveLebesgueDecomposition μ] {r : ℝ≥0} (hr : r ≠ 0) :
+    ν.rnDeriv (r • μ) =ᵐ[μ] r⁻¹ • ν.rnDeriv μ := by
+  suffices ν.rnDeriv (r • μ) =ᵐ[r • μ] r⁻¹ • ν.rnDeriv μ by
+    suffices hμ : μ ≪ r • μ by exact hμ.ae_le this
+    refine absolutelyContinuous_of_le_smul (c := r⁻¹) ?_
+    rw [← ENNReal.coe_inv hr, ← ENNReal.smul_def, ← smul_assoc, smul_eq_mul,
+      inv_mul_cancel hr, one_smul]
+  rw [← withDensity_eq_iff]
+  rotate_left
+  · exact (measurable_rnDeriv _ _).aemeasurable
+  · exact (measurable_rnDeriv _ _).aemeasurable.const_smul _
+  · exact (lintegral_rnDeriv_lt_top ν _).ne
+  · simp_rw [ENNReal.smul_def]
+    rw [withDensity_smul _ (measurable_rnDeriv _ _)]
+    suffices ν.singularPart (r • μ) + withDensity (r • μ) (rnDeriv ν (r • μ))
+        = ν.singularPart (r • μ) + r⁻¹ • withDensity (r • μ) (rnDeriv ν μ) by
+      rwa [add_right_inj] at this
+    rw [← ν.haveLebesgueDecomposition_add (r • μ), singularPart_smul_right _ _ _ hr,
+      ENNReal.smul_def r, withDensity_smul_measure, ← ENNReal.smul_def, ← smul_assoc,
+      smul_eq_mul, inv_mul_cancel hr, one_smul]
+    exact ν.haveLebesgueDecomposition_add μ
+
+/-- Radon-Nikodym derivative with respect to the scalar multiple of a measure.
+See also `rnDeriv_smul_right_of_ne_top'`, which requires sigma-finite `ν` and `μ`. -/
+theorem rnDeriv_smul_right_of_ne_top (ν μ : Measure α) [IsFiniteMeasure ν]
+    [ν.HaveLebesgueDecomposition μ] {r : ℝ≥0∞} (hr : r ≠ 0) (hr_ne_top : r ≠ ∞) :
+    ν.rnDeriv (r • μ) =ᵐ[μ] r⁻¹ • ν.rnDeriv μ := by
+  have h : ν.rnDeriv (r.toNNReal • μ) =ᵐ[μ] r.toNNReal⁻¹ • ν.rnDeriv μ := by
+    refine rnDeriv_smul_right ν μ ?_
+    rw [ne_eq, ENNReal.toNNReal_eq_zero_iff]
+    simp [hr, hr_ne_top]
+  have : (r.toNNReal)⁻¹ • rnDeriv ν μ = r⁻¹ • rnDeriv ν μ := by
+    ext x
+    simp only [Pi.smul_apply, ENNReal.smul_def, ne_eq, smul_eq_mul]
+    rw [ENNReal.coe_inv, ENNReal.coe_toNNReal hr_ne_top]
+    rw [ne_eq, ENNReal.toNNReal_eq_zero_iff]
+    simp [hr, hr_ne_top]
+  simp_rw [this, ENNReal.smul_def, ENNReal.coe_toNNReal hr_ne_top] at h
+  exact h
+
+/-- Radon-Nikodym derivative of a sum of two measures.
+See also `rnDeriv_add'`, which requires sigma-finite `ν₁`, `ν₂` and `μ`. -/
+lemma rnDeriv_add (ν₁ ν₂ μ : Measure α) [IsFiniteMeasure ν₁] [IsFiniteMeasure ν₂]
+    [ν₁.HaveLebesgueDecomposition μ] [ν₂.HaveLebesgueDecomposition μ]
+    [(ν₁ + ν₂).HaveLebesgueDecomposition μ] :
+    (ν₁ + ν₂).rnDeriv μ =ᵐ[μ] ν₁.rnDeriv μ + ν₂.rnDeriv μ := by
+  rw [← withDensity_eq_iff]
+  · suffices (ν₁ + ν₂).singularPart μ + μ.withDensity ((ν₁ + ν₂).rnDeriv μ)
+        = (ν₁ + ν₂).singularPart μ + μ.withDensity (ν₁.rnDeriv μ + ν₂.rnDeriv μ) by
+      rwa [add_right_inj] at this
+    rw [← (ν₁ + ν₂).haveLebesgueDecomposition_add μ, singularPart_add,
+      withDensity_add_left (measurable_rnDeriv _ _), add_assoc,
+      add_comm (ν₂.singularPart μ), add_assoc, add_comm _ (ν₂.singularPart μ),
+      ← ν₂.haveLebesgueDecomposition_add μ, ← add_assoc, ← ν₁.haveLebesgueDecomposition_add μ]
+  · exact (measurable_rnDeriv _ _).aemeasurable
+  · exact ((measurable_rnDeriv _ _).add (measurable_rnDeriv _ _)).aemeasurable
+  · exact (lintegral_rnDeriv_lt_top (ν₁ + ν₂) μ).ne
+
 open VectorMeasure SignedMeasure
 
 /-- If two finite measures `μ` and `ν` are not mutually singular, there exists some `ε > 0` and
@@ -799,6 +940,90 @@ instance (priority := 100) haveLebesgueDecomposition_of_sigmaFinite (μ ν : Mea
       · exact fun n => Measurable.indicator (measurable_rnDeriv _ _) (S.set_mem n)⟩
 #align measure_theory.measure.have_lebesgue_decomposition_of_sigma_finite MeasureTheory.Measure.haveLebesgueDecomposition_of_sigmaFinite
 
+section rnDeriv
+
+/-- Radon-Nikodym derivative of the scalar multiple of a measure.
+See also `rnDeriv_smul_left`, which has no hypothesis on `μ` but requires finite `ν`. -/
+theorem rnDeriv_smul_left' (ν μ : Measure α) [SigmaFinite ν] [SigmaFinite μ] (r : ℝ≥0) :
+    (r • ν).rnDeriv μ =ᵐ[μ] r • ν.rnDeriv μ := by
+  rw [← withDensity_eq_iff_of_sigmaFinite]
+  · simp_rw [ENNReal.smul_def]
+    rw [withDensity_smul _ (measurable_rnDeriv _ _)]
+    suffices (r • ν).singularPart μ + withDensity μ (rnDeriv (r • ν) μ)
+        = (r • ν).singularPart μ + r • withDensity μ (rnDeriv ν μ) by
+      rwa [Measure.add_right_inj] at this
+    rw [← (r • ν).haveLebesgueDecomposition_add μ, singularPart_smul, ← smul_add,
+      ← ν.haveLebesgueDecomposition_add μ]
+  · exact (measurable_rnDeriv _ _).aemeasurable
+  · exact (measurable_rnDeriv _ _).aemeasurable.const_smul _
+
+/-- Radon-Nikodym derivative of the scalar multiple of a measure.
+See also `rnDeriv_smul_left_of_ne_top`, which has no hypothesis on `μ` but requires finite `ν`. -/
+theorem rnDeriv_smul_left_of_ne_top' (ν μ : Measure α) [SigmaFinite ν] [SigmaFinite μ]
+    {r : ℝ≥0∞} (hr : r ≠ ∞) :
+    (r • ν).rnDeriv μ =ᵐ[μ] r • ν.rnDeriv μ := by
+  have h : (r.toNNReal • ν).rnDeriv μ =ᵐ[μ] r.toNNReal • ν.rnDeriv μ :=
+    rnDeriv_smul_left' ν μ r.toNNReal
+  simpa [ENNReal.smul_def, ENNReal.coe_toNNReal hr] using h
+
+/-- Radon-Nikodym derivative with respect to the scalar multiple of a measure.
+See also `rnDeriv_smul_right`, which has no hypothesis on `μ` but requires finite `ν`. -/
+theorem rnDeriv_smul_right' (ν μ : Measure α) [SigmaFinite ν] [SigmaFinite μ]
+    {r : ℝ≥0} (hr : r ≠ 0) :
+    ν.rnDeriv (r • μ) =ᵐ[μ] r⁻¹ • ν.rnDeriv μ := by
+  suffices ν.rnDeriv (r • μ) =ᵐ[r • μ] r⁻¹ • ν.rnDeriv μ by
+    suffices hμ : μ ≪ r • μ by exact hμ.ae_le this
+    refine absolutelyContinuous_of_le_smul (c := r⁻¹) ?_
+    rw [← ENNReal.coe_inv hr, ← ENNReal.smul_def, ← smul_assoc, smul_eq_mul,
+      inv_mul_cancel hr, one_smul]
+  rw [← withDensity_eq_iff_of_sigmaFinite]
+  · simp_rw [ENNReal.smul_def]
+    rw [withDensity_smul _ (measurable_rnDeriv _ _)]
+    suffices ν.singularPart (r • μ) + withDensity (r • μ) (rnDeriv ν (r • μ))
+        = ν.singularPart (r • μ) + r⁻¹ • withDensity (r • μ) (rnDeriv ν μ) by
+      rwa [add_right_inj] at this
+    rw [← ν.haveLebesgueDecomposition_add (r • μ), singularPart_smul_right _ _ _ hr,
+      ENNReal.smul_def r, withDensity_smul_measure, ← ENNReal.smul_def, ← smul_assoc,
+      smul_eq_mul, inv_mul_cancel hr, one_smul]
+    exact ν.haveLebesgueDecomposition_add μ
+  · exact (measurable_rnDeriv _ _).aemeasurable
+  · exact (measurable_rnDeriv _ _).aemeasurable.const_smul _
+
+/-- Radon-Nikodym derivative with respect to the scalar multiple of a measure.
+See also `rnDeriv_smul_right_of_ne_top`, which has no hypothesis on `μ` but requires finite `ν`. -/
+theorem rnDeriv_smul_right_of_ne_top' (ν μ : Measure α) [SigmaFinite ν] [SigmaFinite μ]
+    {r : ℝ≥0∞} (hr : r ≠ 0) (hr_ne_top : r ≠ ∞) :
+    ν.rnDeriv (r • μ) =ᵐ[μ] r⁻¹ • ν.rnDeriv μ := by
+  have h : ν.rnDeriv (r.toNNReal • μ) =ᵐ[μ] r.toNNReal⁻¹ • ν.rnDeriv μ := by
+    refine rnDeriv_smul_right' ν μ ?_
+    rw [ne_eq, ENNReal.toNNReal_eq_zero_iff]
+    simp [hr, hr_ne_top]
+  have : (r.toNNReal)⁻¹ • rnDeriv ν μ = r⁻¹ • rnDeriv ν μ := by
+    ext x
+    simp only [Pi.smul_apply, ENNReal.smul_def, ne_eq, smul_eq_mul]
+    rw [ENNReal.coe_inv, ENNReal.coe_toNNReal hr_ne_top]
+    rw [ne_eq, ENNReal.toNNReal_eq_zero_iff]
+    simp [hr, hr_ne_top]
+  simp_rw [this, ENNReal.smul_def, ENNReal.coe_toNNReal hr_ne_top] at h
+  exact h
+
+/-- Radon-Nikodym derivative of a sum of two measures.
+See also `rnDeriv_add`, which has no hypothesis on `μ` but requires finite `ν₁` and `ν₂`. -/
+lemma rnDeriv_add' (ν₁ ν₂ μ : Measure α) [SigmaFinite ν₁] [SigmaFinite ν₂] [SigmaFinite μ] :
+    (ν₁ + ν₂).rnDeriv μ =ᵐ[μ] ν₁.rnDeriv μ + ν₂.rnDeriv μ := by
+  rw [← withDensity_eq_iff_of_sigmaFinite]
+  · suffices (ν₁ + ν₂).singularPart μ + μ.withDensity ((ν₁ + ν₂).rnDeriv μ)
+        = (ν₁ + ν₂).singularPart μ + μ.withDensity (ν₁.rnDeriv μ + ν₂.rnDeriv μ) by
+      rwa [add_right_inj] at this
+    rw [← (ν₁ + ν₂).haveLebesgueDecomposition_add μ, singularPart_add,
+      withDensity_add_left (measurable_rnDeriv _ _), add_assoc,
+      add_comm (ν₂.singularPart μ), add_assoc, add_comm _ (ν₂.singularPart μ),
+      ← ν₂.haveLebesgueDecomposition_add μ, ← add_assoc, ← ν₁.haveLebesgueDecomposition_add μ]
+  · exact (measurable_rnDeriv _ _).aemeasurable
+  · exact ((measurable_rnDeriv _ _).add (measurable_rnDeriv _ _)).aemeasurable
+
+end rnDeriv
+
 end Measure
 
 namespace SignedMeasure
feat(MeasureTheory): μ.singularPart (r • ν) = μ.singularPart ν (#8040)

Prove 3 lemmas:

  • an instance MeasurableSMul ℝ≥0 ℝ≥0∞
  • instance haveLebesgueDecomposition_smul_right (μ ν : Measure α) [HaveLebesgueDecomposition μ ν] (r : ℝ≥0) : μ.HaveLebesgueDecomposition (r • ν)
  • theorem singularPart_smul_right (μ ν : Measure α) (r : ℝ≥0) (hr : r ≠ 0) : μ.singularPart (r • ν) = μ.singularPart ν
Diff
@@ -120,6 +120,25 @@ instance haveLebesgueDecomposition_smul (μ ν : Measure α) [HaveLebesgueDecomp
       rfl
 #align measure_theory.measure.have_lebesgue_decomposition_smul MeasureTheory.Measure.haveLebesgueDecomposition_smul
 
+instance haveLebesgueDecomposition_smul_right (μ ν : Measure α) [HaveLebesgueDecomposition μ ν]
+    (r : ℝ≥0) :
+    μ.HaveLebesgueDecomposition (r • ν) where
+  lebesgue_decomposition := by
+    obtain ⟨hmeas, hsing, hadd⟩ := haveLebesgueDecomposition_spec μ ν
+    by_cases hr : r = 0
+    · exact ⟨⟨μ, 0⟩, measurable_const, by simp [hr], by simp⟩
+    refine ⟨⟨μ.singularPart ν, r⁻¹ • μ.rnDeriv ν⟩, ?_, ?_, ?_⟩
+    · change Measurable (r⁻¹ • μ.rnDeriv ν)
+      exact hmeas.const_smul _
+    · refine MutuallySingular.mono_ac hsing AbsolutelyContinuous.rfl ?_
+      exact absolutelyContinuous_of_le_smul le_rfl
+    · have : r⁻¹ • rnDeriv μ ν = ((r⁻¹ : ℝ≥0) : ℝ≥0∞) • rnDeriv μ ν := by simp [ENNReal.smul_def]
+      rw [this, withDensity_smul _ hmeas, ENNReal.smul_def r, withDensity_smul_measure,
+        ← smul_assoc, smul_eq_mul, ENNReal.coe_inv hr, ENNReal.inv_mul_cancel, one_smul]
+      · exact hadd
+      · simp [hr]
+      · exact ENNReal.coe_ne_top
+
 @[measurability]
 theorem measurable_rnDeriv (μ ν : Measure α) : Measurable <| μ.rnDeriv ν := by
   by_cases h : HaveLebesgueDecomposition μ ν
@@ -282,6 +301,23 @@ theorem singularPart_smul (μ ν : Measure α) (r : ℝ≥0) :
     exact @Measure.haveLebesgueDecomposition_smul _ _ _ _ hl' _
 #align measure_theory.measure.singular_part_smul MeasureTheory.Measure.singularPart_smul
 
+theorem singularPart_smul_right (μ ν : Measure α) (r : ℝ≥0) (hr : r ≠ 0) :
+    μ.singularPart (r • ν) = μ.singularPart ν := by
+  by_cases hl : HaveLebesgueDecomposition μ ν
+  · refine (eq_singularPart ((measurable_rnDeriv μ ν).const_smul r⁻¹) ?_ ?_).symm
+    · refine (mutuallySingular_singularPart μ ν).mono_ac AbsolutelyContinuous.rfl ?_
+      exact absolutelyContinuous_of_le_smul le_rfl
+    · rw [ENNReal.smul_def r, withDensity_smul_measure, ← withDensity_smul]
+      swap; · exact (measurable_rnDeriv _ _).const_smul _
+      convert haveLebesgueDecomposition_add μ ν
+      ext x
+      simp only [Pi.smul_apply, ne_eq]
+      rw [← ENNReal.smul_def, ← smul_assoc, smul_eq_mul, mul_inv_cancel hr, one_smul]
+  · rw [singularPart, singularPart, dif_neg hl, dif_neg]
+    refine fun hl' => hl ?_
+    rw [← inv_smul_smul₀ hr ν]
+    infer_instance
+
 theorem singularPart_add (μ₁ μ₂ ν : Measure α) [HaveLebesgueDecomposition μ₁ ν]
     [HaveLebesgueDecomposition μ₂ ν] :
     (μ₁ + μ₂).singularPart ν = μ₁.singularPart ν + μ₂.singularPart ν := by
chore: remove unused simps (#6632)

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -442,7 +442,7 @@ theorem exists_positive_of_not_mutuallySingular (μ ν : Measure α) [IsFiniteMe
   -- since `μ` and `ν` are not mutually singular, `μ A = 0` implies `ν Aᶜ > 0`
   rw [MutuallySingular] at h; push_neg at h
   have := h _ hAmeas hμ
-  simp_rw [hA₁, compl_iInter, compl_compl] at this
+  simp_rw [compl_iInter, compl_compl] at this
   -- as `Aᶜ = ⋃ n, f n`, `ν Aᶜ > 0` implies there exists some `n` such that `ν (f n) > 0`
   obtain ⟨n, hn⟩ := exists_measure_pos_of_not_measure_iUnion_null this
   -- thus, choosing `f n` as the set `E` suffices
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -67,7 +67,7 @@ open scoped Classical MeasureTheory NNReal ENNReal
 
 open Set
 
-variable {α β : Type _} {m : MeasurableSpace α} {μ ν : MeasureTheory.Measure α}
+variable {α β : Type*} {m : MeasurableSpace α} {μ ν : MeasureTheory.Measure α}
 
 namespace MeasureTheory
 
@@ -519,16 +519,16 @@ section SuprLemmas
 
 --TODO: these statements should be moved elsewhere
 
-theorem iSup_monotone {α : Type _} (f : ℕ → α → ℝ≥0∞) :
+theorem iSup_monotone {α : Type*} (f : ℕ → α → ℝ≥0∞) :
     Monotone fun n x => ⨆ (k) (_ : k ≤ n), f k x := fun _ _ hnm _ =>
   biSup_mono fun _ => ge_trans hnm
 #align measure_theory.measure.lebesgue_decomposition.supr_monotone MeasureTheory.Measure.LebesgueDecomposition.iSup_monotone
 
-theorem iSup_monotone' {α : Type _} (f : ℕ → α → ℝ≥0∞) (x : α) :
+theorem iSup_monotone' {α : Type*} (f : ℕ → α → ℝ≥0∞) (x : α) :
     Monotone fun n => ⨆ (k) (_ : k ≤ n), f k x := fun _ _ hnm => iSup_monotone f hnm x
 #align measure_theory.measure.lebesgue_decomposition.supr_monotone' MeasureTheory.Measure.LebesgueDecomposition.iSup_monotone'
 
-theorem iSup_le_le {α : Type _} (f : ℕ → α → ℝ≥0∞) (n k : ℕ) (hk : k ≤ n) :
+theorem iSup_le_le {α : Type*} (f : ℕ → α → ℝ≥0∞) (n k : ℕ) (hk : k ≤ n) :
     f k ≤ fun x => ⨆ (k) (_ : k ≤ n), f k x :=
   fun x => le_iSup₂ (f := fun k (_ : k ≤ n) => f k x) k hk
 #align measure_theory.measure.lebesgue_decomposition.supr_le_le MeasureTheory.Measure.LebesgueDecomposition.iSup_le_le
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,11 +2,6 @@
 Copyright (c) 2021 Kexing Ying. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Kexing Ying
-
-! This file was ported from Lean 3 source module measure_theory.decomposition.lebesgue
-! leanprover-community/mathlib commit b2ff9a3d7a15fd5b0f060b135421d6a89a999c2f
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.MeasureTheory.Measure.Complex
 import Mathlib.MeasureTheory.Measure.Sub
@@ -14,6 +9,8 @@ import Mathlib.MeasureTheory.Decomposition.Jordan
 import Mathlib.MeasureTheory.Measure.WithDensityVectorMeasure
 import Mathlib.MeasureTheory.Function.AEEqOfIntegral
 
+#align_import measure_theory.decomposition.lebesgue from "leanprover-community/mathlib"@"b2ff9a3d7a15fd5b0f060b135421d6a89a999c2f"
+
 /-!
 # Lebesgue decomposition
 
fix: precedences of ⨆⋃⋂⨅ (#5614)
Diff
@@ -479,7 +479,7 @@ theorem sup_mem_measurableLE {f g : α → ℝ≥0∞} (hf : f ∈ measurableLE
 #align measure_theory.measure.lebesgue_decomposition.sup_mem_measurable_le MeasureTheory.Measure.LebesgueDecomposition.sup_mem_measurableLE
 
 theorem iSup_succ_eq_sup {α} (f : ℕ → α → ℝ≥0∞) (m : ℕ) (a : α) :
-    (⨆ (k : ℕ) (_ : k ≤ m + 1), f k a) = f m.succ a ⊔ ⨆ (k : ℕ) (_ : k ≤ m), f k a := by
+    ⨆ (k : ℕ) (_ : k ≤ m + 1), f k a = f m.succ a ⊔ ⨆ (k : ℕ) (_ : k ≤ m), f k a := by
   refine Option.ext fun x => ?_
   simp only [Option.mem_def, ENNReal.some_eq_coe]
   constructor <;> intro h <;> rw [← h]; symm
fix: change compl precedence (#5586)

Co-authored-by: Yury G. Kudryashov <urkud@urkud.name>

Diff
@@ -234,11 +234,11 @@ theorem eq_singularPart {s : Measure α} {f : α → ℝ≥0∞} (hf : Measurabl
   obtain ⟨hmeas, hsing, hadd'⟩ := haveLebesgueDecomposition_spec μ ν
   obtain ⟨⟨S, hS₁, hS₂, hS₃⟩, ⟨T, hT₁, hT₂, hT₃⟩⟩ := hs, hsing
   rw [hadd'] at hadd
-  have hνinter : ν ((S ∩ T)ᶜ) = 0 := by
+  have hνinter : ν (S ∩ T)ᶜ = 0 := by
     rw [compl_inter]
     refine' nonpos_iff_eq_zero.1 (le_trans (measure_union_le _ _) _)
     rw [hT₃, hS₃, add_zero]
-  have heq : s.restrict ((S ∩ T)ᶜ) = (μ.singularPart ν).restrict ((S ∩ T)ᶜ) := by
+  have heq : s.restrict (S ∩ T)ᶜ = (μ.singularPart ν).restrict (S ∩ T)ᶜ := by
     ext1 A hA
     have hf : ν.withDensity f (A ∩ (S ∩ T)ᶜ) = 0 := by
       refine' withDensity_absolutelyContinuous ν _ _
@@ -250,7 +250,7 @@ theorem eq_singularPart {s : Measure α} {f : α → ℝ≥0∞} (hf : Measurabl
       exact hνinter ▸ measure_mono (inter_subset_right _ _)
     rw [restrict_apply hA, restrict_apply hA, ← add_zero (s (A ∩ (S ∩ T)ᶜ)), ← hf, ← add_apply, ←
       hadd, add_apply, hrn, add_zero]
-  have heq' : ∀ A : Set α, MeasurableSet A → s A = s.restrict ((S ∩ T)ᶜ) A := by
+  have heq' : ∀ A : Set α, MeasurableSet A → s A = s.restrict (S ∩ T)ᶜ A := by
     intro A hA
     have hsinter : s (A ∩ (S ∩ T)) = 0 := by
       rw [← nonpos_iff_eq_zero]
@@ -318,7 +318,7 @@ theorem eq_withDensity_rnDeriv {s : Measure α} {f : α → ℝ≥0∞} (hf : Me
   obtain ⟨hmeas, hsing, hadd'⟩ := haveLebesgueDecomposition_spec μ ν
   obtain ⟨⟨S, hS₁, hS₂, hS₃⟩, ⟨T, hT₁, hT₂, hT₃⟩⟩ := hs, hsing
   rw [hadd'] at hadd
-  have hνinter : ν ((S ∩ T)ᶜ) = 0 := by
+  have hνinter : ν (S ∩ T)ᶜ = 0 := by
     rw [compl_inter]
     refine' nonpos_iff_eq_zero.1 (le_trans (measure_union_le _ _) _)
     rw [hT₃, hS₃, add_zero]
@@ -404,7 +404,7 @@ theorem exists_positive_of_not_mutuallySingular (μ ν : Measure α) [IsFiniteMe
   choose f hf₁ hf₂ hf₃ using this
   -- set `A` to be the intersection of all the negative parts of obtained Hahn decompositions
   -- and we show that `μ A = 0`
-  set A := ⋂ n, f nᶜ with hA₁
+  set A := ⋂ n, (f n)ᶜ with hA₁
   have hAmeas : MeasurableSet A := MeasurableSet.iInter fun n => (hf₁ n).compl
   have hA₂ : ∀ n : ℕ, μ.toSignedMeasure - ((1 / (n + 1) : ℝ≥0) • ν).toSignedMeasure ≤[A] 0 := by
     intro n; exact restrict_le_restrict_subset _ _ (hf₁ n).compl (hf₃ n) (iInter_subset _ _)
@@ -722,7 +722,7 @@ instance (priority := 100) haveLebesgueDecomposition_of_sigmaFinite (μ ν : Mea
         · exact fun n => (S.set_mem n).inter (hA₁ n)
       -- We will now show `ν Bᶜ = 0`. This follows since `Bᶜ = ⋃ n, S.set n ∩ (A n)ᶜ` and thus,
       -- `ν Bᶜ = ∑ i, ν (S.set i ∩ (A i)ᶜ) = ∑ i, (νn i) (A i)ᶜ = 0`
-      · have hcompl : IsCompl (⋃ n, S.set n ∩ A n) (⋃ n, S.set n ∩ A nᶜ) := by
+      · have hcompl : IsCompl (⋃ n, S.set n ∩ A n) (⋃ n, S.set n ∩ (A n)ᶜ) := by
           constructor
           · rw [disjoint_iff_inf_le]
             rintro x ⟨hx₁, hx₂⟩; rw [mem_iUnion] at hx₁ hx₂
chore: remove superfluous parentheses around integrals (#5591)
Diff
@@ -363,7 +363,7 @@ theorem eq_rnDeriv [SigmaFinite ν] {s : Measure α} {f : α → ℝ≥0∞} (hf
   refine' ae_eq_of_forall_set_lintegral_eq_of_sigmaFinite hf (measurable_rnDeriv μ ν) _
   intro a ha _
   calc
-    (∫⁻ x : α in a, f x ∂ν) = ν.withDensity f a := (withDensity_apply f ha).symm
+    ∫⁻ x : α in a, f x ∂ν = ν.withDensity f a := (withDensity_apply f ha).symm
     _ = ν.withDensity (μ.rnDeriv ν) a := by rw [eq_withDensity_rnDeriv hf hs hadd]
     _ = ∫⁻ x : α in a, μ.rnDeriv ν x ∂ν := withDensity_apply _ ha
 #align measure_theory.measure.eq_rn_deriv MeasureTheory.Measure.eq_rnDeriv
feat: don't re-elaborate terms in set (#5386)

Fix the set tactic to not time out when dealing with slow to elaborate terms and many local hypotheses.

The root cause of this is that the rewrite [blah] at * tactic causes blah to be elaborated again and again for each local hypothesis, this is possibly a core issue that should be fixed separately, but in set we have the elaborated term already so we can just use it.

We also add some functionality to simply test / demonstrate failures when elaboration takes too long, namely sleepAtLeastHeartbeats and a sleep_heartbeats tactic.

@urkud was facing some slow running set's in https://github.com/leanprover-community/mathlib4/pull/4912, see https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/Timeout.20in.20.60set.20.2E.2E.20with.60/near/367958828 that this issue was minimized from and should fix.

Some other linter failures show up due to changes to the set internals so fix these too.

Co-authored-by: Jeremy Tan Jie Rui <reddeloostw@gmail.com>

Diff
@@ -484,8 +484,8 @@ theorem iSup_succ_eq_sup {α} (f : ℕ → α → ℝ≥0∞) (m : ℕ) (a : α)
   simp only [Option.mem_def, ENNReal.some_eq_coe]
   constructor <;> intro h <;> rw [← h]; symm
   all_goals
-    set c := ⨆ (k : ℕ) (hk : k ≤ m + 1), f k a with hc
-    set d := f m.succ a ⊔ ⨆ (k : ℕ) (hk : k ≤ m), f k a with hd
+    set c := ⨆ (k : ℕ) (_ : k ≤ m + 1), f k a with hc
+    set d := f m.succ a ⊔ ⨆ (k : ℕ) (_ : k ≤ m), f k a with hd
     rw [@le_antisymm_iff ℝ≥0∞, hc, hd]
     -- Specifying the type is weirdly necessary
     refine' ⟨_, _⟩
@@ -561,7 +561,7 @@ theorem haveLebesgueDecomposition_of_finiteMeasure [IsFiniteMeasure μ] [IsFinit
         ⟨0, 0, zero_mem_measurableLE, by simp⟩ (OrderTop.bddAbove _)
     choose g _ hg₂ f hf₁ hf₂ using h
     -- we set `ξ` to be the supremum of an increasing sequence of functions obtained from above
-    set ξ := ⨆ (n) (k) (hk : k ≤ n), f k with hξ
+    set ξ := ⨆ (n) (k) (_ : k ≤ n), f k with hξ
     -- we see that `ξ` has the largest integral among all functions in `measurableLE`
     have hξ₁ : sSup (measurableLEEval ν μ) = ∫⁻ a, ξ a ∂ν := by
       have :=
chore: bump Std4 (#5219)

Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au> Co-authored-by: Mario Carneiro <di.gama@gmail.com>

Diff
@@ -984,7 +984,7 @@ theorem toJordanDecomposition_eq_of_eq_add_withDensity {f : α → ℝ} (hf : Me
   haveI := isFiniteMeasure_withDensity_ofReal hfi.neg.2
   refine' toJordanDecomposition_eq _
   simp_rw [JordanDecomposition.toSignedMeasure, hadd]
-  ext i; intro hi
+  ext i hi
   rw [VectorMeasure.sub_apply, toSignedMeasure_apply_measurable hi,
       toSignedMeasure_apply_measurable hi, add_apply, add_apply, ENNReal.toReal_add,
       ENNReal.toReal_add, add_sub_add_comm, ← toSignedMeasure_apply_measurable hi,
@@ -1226,7 +1226,7 @@ theorem integrable_rnDeriv (c : ComplexMeasure α) (μ : Measure α) : Integrabl
 theorem singularPart_add_withDensity_rnDeriv_eq [c.HaveLebesgueDecomposition μ] :
     c.singularPart μ + μ.withDensityᵥ (c.rnDeriv μ) = c := by
   conv_rhs => rw [← c.toComplexMeasure_to_signedMeasure]
-  ext i : 1; intro hi
+  ext i hi : 1
   rw [VectorMeasure.add_apply, SignedMeasure.toComplexMeasure_apply]
   ext
   · rw [Complex.add_re, withDensityᵥ_apply (c.integrable_rnDeriv μ) hi, ← IsROrC.re_eq_complex_re,
chore: fix many typos (#4967)

These are all doc fixes

Diff
@@ -683,7 +683,7 @@ instance (priority := 100) haveLebesgueDecomposition_of_sigmaFinite (μ ν : Mea
     -- As `S` is finite with respect to both `μ` and `ν`, it is clear that `μn n` and `νn n` are
     -- finite measures for all `n : ℕ`. Thus, we may apply the finite Lebesgue decomposition theorem
     -- to `μn n` and `νn n`. We define `ξ` as the sum of the singular part of the Lebesgue
-    -- decompositions of `μn n` and `νn n`, and `f` as the sum of the Radon-Nikodym derviatives of
+    -- decompositions of `μn n` and `νn n`, and `f` as the sum of the Radon-Nikodym derivatives of
     -- `μn n` and `νn n` restricted on `S n`
     set ξ := sum fun n => singularPart (μn n) (νn n) with hξ
     set f := ∑' n, (S.set n).indicator (rnDeriv (μn n) (νn n))
feat: port MeasureTheory.Decomposition.Lebesgue (#4736)

Dependencies 12 + 978

979 files ported (98.8%)
448024 lines ported (98.8%)
Show graph

The unported dependencies are

The following 1 dependencies have changed in mathlib3 since they were ported, which may complicate porting this file