measure_theory.function.simple_func_dense_lpMathlib.MeasureTheory.Function.SimpleFuncDenseLp

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)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -385,7 +385,7 @@ theorem measure_preimage_lt_top_of_memℒp (hp_pos : p ≠ 0) (hp_ne_top : p ≠
 #align measure_theory.simple_func.measure_preimage_lt_top_of_mem_ℒp MeasureTheory.SimpleFunc.measure_preimage_lt_top_of_memℒp
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:641:2: warning: expanding binder collection (y «expr ≠ » 0) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:642:2: warning: expanding binder collection (y «expr ≠ » 0) -/
 #print MeasureTheory.SimpleFunc.memℒp_of_finite_measure_preimage /-
 theorem memℒp_of_finite_measure_preimage (p : ℝ≥0∞) {f : α →ₛ E}
     (hf : ∀ (y) (_ : y ≠ 0), μ (f ⁻¹' {y}) < ∞) : Memℒp f p μ :=
@@ -404,7 +404,7 @@ theorem memℒp_of_finite_measure_preimage (p : ℝ≥0∞) {f : α →ₛ E}
 #align measure_theory.simple_func.mem_ℒp_of_finite_measure_preimage MeasureTheory.SimpleFunc.memℒp_of_finite_measure_preimage
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:641:2: warning: expanding binder collection (y «expr ≠ » 0) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:642:2: warning: expanding binder collection (y «expr ≠ » 0) -/
 #print MeasureTheory.SimpleFunc.memℒp_iff /-
 theorem memℒp_iff {f : α →ₛ E} (hp_pos : p ≠ 0) (hp_ne_top : p ≠ ∞) :
     Memℒp f p μ ↔ ∀ (y) (_ : y ≠ 0), μ (f ⁻¹' {y}) < ∞ :=
@@ -413,7 +413,7 @@ theorem memℒp_iff {f : α →ₛ E} (hp_pos : p ≠ 0) (hp_ne_top : p ≠ ∞)
 #align measure_theory.simple_func.mem_ℒp_iff MeasureTheory.SimpleFunc.memℒp_iff
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:641:2: warning: expanding binder collection (y «expr ≠ » 0) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:642:2: warning: expanding binder collection (y «expr ≠ » 0) -/
 #print MeasureTheory.SimpleFunc.integrable_iff /-
 theorem integrable_iff {f : α →ₛ E} : Integrable f μ ↔ ∀ (y) (_ : y ≠ 0), μ (f ⁻¹' {y}) < ∞ :=
   memℒp_one_iff_integrable.symm.trans <| memℒp_iff one_ne_zero ENNReal.coe_ne_top
@@ -474,7 +474,7 @@ theorem measure_preimage_lt_top_of_integrable (f : α →ₛ E) (hf : Integrable
 #align measure_theory.simple_func.measure_preimage_lt_top_of_integrable MeasureTheory.SimpleFunc.measure_preimage_lt_top_of_integrable
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:641:2: warning: expanding binder collection (y «expr ≠ » 0) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:642:2: warning: expanding binder collection (y «expr ≠ » 0) -/
 #print MeasureTheory.SimpleFunc.measure_support_lt_top /-
 theorem measure_support_lt_top [Zero β] (f : α →ₛ β) (hf : ∀ (y) (_ : y ≠ 0), μ (f ⁻¹' {y}) < ∞) :
     μ (support f) < ∞ := by
Diff
@@ -73,8 +73,8 @@ theorem nnnorm_approxOn_le [OpensMeasurableSpace E] {f : β → E} (hf : Measura
     ‖approxOn f hf s y₀ h₀ n x - f x‖₊ ≤ ‖f x - y₀‖₊ :=
   by
   have := edist_approx_on_le hf h₀ x n
-  rw [edist_comm y₀] at this 
-  simp only [edist_nndist, nndist_eq_nnnorm] at this 
+  rw [edist_comm y₀] at this
+  simp only [edist_nndist, nndist_eq_nnnorm] at this
   exact_mod_cast this
 #align measure_theory.simple_func.nnnorm_approx_on_le MeasureTheory.SimpleFunc.nnnorm_approxOn_le
 -/
@@ -85,7 +85,7 @@ theorem norm_approxOn_y₀_le [OpensMeasurableSpace E] {f : β → E} (hf : Meas
     ‖approxOn f hf s y₀ h₀ n x - y₀‖ ≤ ‖f x - y₀‖ + ‖f x - y₀‖ :=
   by
   have := edist_approx_on_y0_le hf h₀ x n
-  repeat' rw [edist_comm y₀, edist_eq_coe_nnnorm_sub] at this 
+  repeat' rw [edist_comm y₀, edist_eq_coe_nnnorm_sub] at this
   exact_mod_cast this
 #align measure_theory.simple_func.norm_approx_on_y₀_le MeasureTheory.SimpleFunc.norm_approxOn_y₀_le
 -/
@@ -96,7 +96,7 @@ theorem norm_approxOn_zero_le [OpensMeasurableSpace E] {f : β → E} (hf : Meas
     ‖approxOn f hf s 0 h₀ n x‖ ≤ ‖f x‖ + ‖f x‖ :=
   by
   have := edist_approx_on_y0_le hf h₀ x n
-  simp [edist_comm (0 : E), edist_eq_coe_nnnorm] at this 
+  simp [edist_comm (0 : E), edist_eq_coe_nnnorm] at this
   exact_mod_cast this
 #align measure_theory.simple_func.norm_approx_on_zero_le MeasureTheory.SimpleFunc.norm_approxOn_zero_le
 -/
@@ -247,7 +247,7 @@ theorem MeasureTheory.Memℒp.exists_simpleFunc_snorm_sub_lt {E : Type _} [Norme
   rcases((tendsto_order.1 (tendsto_approx_on_range_Lp_snorm hp_ne_top f'meas hf'.2)).2 ε
         hε.bot_lt).exists with
     ⟨n, hn⟩
-  rw [← snorm_neg, neg_sub] at hn 
+  rw [← snorm_neg, neg_sub] at hn
   exact ⟨_, hn, mem_ℒp_approx_on_range f'meas hf' _⟩
 #align measure_theory.mem_ℒp.exists_simple_func_snorm_sub_lt MeasureTheory.Memℒp.exists_simpleFunc_snorm_sub_lt
 -/
@@ -364,7 +364,7 @@ theorem measure_preimage_lt_top_of_memℒp (hp_pos : p ≠ 0) (hp_ne_top : p ≠
   rw [snorm_eq_snorm' hp_pos hp_ne_top, f.snorm'_eq, ←
     @ENNReal.lt_rpow_one_div_iff _ _ (1 / p.to_real) (by simp [hp_pos_real]),
     @ENNReal.top_rpow_of_pos (1 / (1 / p.to_real)) (by simp [hp_pos_real]),
-    ENNReal.sum_lt_top_iff] at hf_snorm 
+    ENNReal.sum_lt_top_iff] at hf_snorm
   by_cases hyf : y ∈ f.range
   swap
   · suffices h_empty : f ⁻¹' {y} = ∅
@@ -375,7 +375,7 @@ theorem measure_preimage_lt_top_of_memℒp (hp_pos : p ≠ 0) (hp_ne_top : p ≠
     rw [mem_range, Set.mem_range]
     exact ⟨x, hxy⟩
   specialize hf_snorm y hyf
-  rw [ENNReal.mul_lt_top_iff] at hf_snorm 
+  rw [ENNReal.mul_lt_top_iff] at hf_snorm
   cases hf_snorm
   · exact hf_snorm.2
   cases hf_snorm
@@ -480,7 +480,7 @@ theorem measure_support_lt_top [Zero β] (f : α →ₛ β) (hf : ∀ (y) (_ : y
     μ (support f) < ∞ := by
   rw [support_eq]
   refine' (measure_bUnion_finset_le _ _).trans_lt (ennreal.sum_lt_top_iff.mpr fun y hy => _)
-  rw [Finset.mem_filter] at hy 
+  rw [Finset.mem_filter] at hy
   exact hf y hy.2
 #align measure_theory.simple_func.measure_support_lt_top MeasureTheory.SimpleFunc.measure_support_lt_top
 -/
@@ -1035,19 +1035,19 @@ theorem coeFn_nonneg (f : Lp.simpleFunc G p μ) : 0 ≤ᵐ[μ] f ↔ 0 ≤ f :=
 theorem exists_simpleFunc_nonneg_ae_eq {f : Lp.simpleFunc G p μ} (hf : 0 ≤ f) :
     ∃ f' : α →ₛ G, 0 ≤ f' ∧ f =ᵐ[μ] f' :=
   by
-  rw [← Lp.simple_func.coe_fn_nonneg] at hf 
+  rw [← Lp.simple_func.coe_fn_nonneg] at hf
   have hf_ae : 0 ≤ᵐ[μ] simple_func.to_simple_func f := by
     filter_upwards [to_simple_func_eq_to_fun f, hf] with _ h1 _; rwa [h1]
   let s := to_measurable μ {x | ¬0 ≤ simple_func.to_simple_func f x}ᶜ
   have hs_zero : μ (sᶜ) = 0 := by rw [compl_compl, measure_to_measurable];
-    rwa [eventually_le, ae_iff] at hf_ae 
+    rwa [eventually_le, ae_iff] at hf_ae
   have hfs_nonneg : ∀ x ∈ s, 0 ≤ simple_func.to_simple_func f x :=
     by
     intro x hxs
-    rw [mem_compl_iff] at hxs 
+    rw [mem_compl_iff] at hxs
     have hx' : x ∉ {a : α | ¬0 ≤ simple_func.to_simple_func f a} := fun h =>
       hxs (subset_to_measurable μ _ h)
-    rwa [Set.nmem_setOf_iff, Classical.not_not] at hx' 
+    rwa [Set.nmem_setOf_iff, Classical.not_not] at hx'
   let f' :=
     simple_func.piecewise s (measurable_set_to_measurable μ _).compl (simple_func.to_simple_func f)
       (simple_func.const α (0 : G))
@@ -1208,7 +1208,7 @@ theorem Memℒp.induction [_i : Fact (1 ≤ p)] (hp_ne_top : p ≠ ∞) (P : (α
       exact h_ind c hs (simple_func.measure_lt_top_of_mem_ℒp_indicator hp_pos hp_ne_top hc hs h)
     · intro f g hfg hf hg int_fg
       rw [simple_func.coe_add,
-        mem_ℒp_add_of_disjoint hfg f.strongly_measurable g.strongly_measurable] at int_fg 
+        mem_ℒp_add_of_disjoint hfg f.strongly_measurable g.strongly_measurable] at int_fg
       refine' h_add hfg int_fg.1 int_fg.2 (hf int_fg.1) (hg int_fg.2)
   have : ∀ f : Lp.simple_func E p μ, P f := by
     intro f
@@ -1252,7 +1252,7 @@ theorem Memℒp.induction_dense (hp_ne_top : p ≠ ∞) (P : (α → E) → Prop
     rcases eq_or_ne c 0 with (rfl | hc)
     · rcases h0P (0 : E) MeasurableSet.empty (by simp only [measure_empty, WithTop.zero_lt_top])
           εpos with ⟨g, hg, Pg⟩
-      rw [← snorm_neg, neg_sub] at hg 
+      rw [← snorm_neg, neg_sub] at hg
       refine' ⟨g, _, Pg⟩
       convert hg
       ext x
@@ -1260,12 +1260,12 @@ theorem Memℒp.induction_dense (hp_ne_top : p ≠ ∞) (P : (α → E) → Prop
         piecewise_eq_indicator, indicator_zero', Pi.zero_apply, indicator_zero]
     · have : μ s < ∞ := simple_func.measure_lt_top_of_mem_ℒp_indicator hp_pos hp_ne_top hc hs Hs
       rcases h0P c hs this εpos with ⟨g, hg, Pg⟩
-      rw [← snorm_neg, neg_sub] at hg 
+      rw [← snorm_neg, neg_sub] at hg
       exact ⟨g, hg, Pg⟩
   · intro f f' hff' hf hf' δ δpos int_ff'
     obtain ⟨η, ηpos, hη⟩ := exists_Lp_half E μ p δpos
     rw [simple_func.coe_add,
-      mem_ℒp_add_of_disjoint hff' f.strongly_measurable f'.strongly_measurable] at int_ff' 
+      mem_ℒp_add_of_disjoint hff' f.strongly_measurable f'.strongly_measurable] at int_ff'
     rcases hf η ηpos.ne' int_ff'.1 with ⟨g, hg, Pg⟩
     rcases hf' η ηpos.ne' int_ff'.2 with ⟨g', hg', Pg'⟩
     refine' ⟨g + g', _, h1P g g' Pg Pg'⟩
Diff
@@ -3,8 +3,8 @@ Copyright (c) 2022 Zhouhang Zhou. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Zhouhang Zhou, Yury Kudryashov, Heather Macbeth
 -/
-import Mathbin.MeasureTheory.Function.L1Space
-import Mathbin.MeasureTheory.Function.SimpleFuncDense
+import MeasureTheory.Function.L1Space
+import MeasureTheory.Function.SimpleFuncDense
 
 #align_import measure_theory.function.simple_func_dense_lp from "leanprover-community/mathlib"@"af471b9e3ce868f296626d33189b4ce730fa4c00"
 
@@ -385,7 +385,7 @@ theorem measure_preimage_lt_top_of_memℒp (hp_pos : p ≠ 0) (hp_ne_top : p ≠
 #align measure_theory.simple_func.measure_preimage_lt_top_of_mem_ℒp MeasureTheory.SimpleFunc.measure_preimage_lt_top_of_memℒp
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (y «expr ≠ » 0) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:641:2: warning: expanding binder collection (y «expr ≠ » 0) -/
 #print MeasureTheory.SimpleFunc.memℒp_of_finite_measure_preimage /-
 theorem memℒp_of_finite_measure_preimage (p : ℝ≥0∞) {f : α →ₛ E}
     (hf : ∀ (y) (_ : y ≠ 0), μ (f ⁻¹' {y}) < ∞) : Memℒp f p μ :=
@@ -404,7 +404,7 @@ theorem memℒp_of_finite_measure_preimage (p : ℝ≥0∞) {f : α →ₛ E}
 #align measure_theory.simple_func.mem_ℒp_of_finite_measure_preimage MeasureTheory.SimpleFunc.memℒp_of_finite_measure_preimage
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (y «expr ≠ » 0) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:641:2: warning: expanding binder collection (y «expr ≠ » 0) -/
 #print MeasureTheory.SimpleFunc.memℒp_iff /-
 theorem memℒp_iff {f : α →ₛ E} (hp_pos : p ≠ 0) (hp_ne_top : p ≠ ∞) :
     Memℒp f p μ ↔ ∀ (y) (_ : y ≠ 0), μ (f ⁻¹' {y}) < ∞ :=
@@ -413,7 +413,7 @@ theorem memℒp_iff {f : α →ₛ E} (hp_pos : p ≠ 0) (hp_ne_top : p ≠ ∞)
 #align measure_theory.simple_func.mem_ℒp_iff MeasureTheory.SimpleFunc.memℒp_iff
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (y «expr ≠ » 0) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:641:2: warning: expanding binder collection (y «expr ≠ » 0) -/
 #print MeasureTheory.SimpleFunc.integrable_iff /-
 theorem integrable_iff {f : α →ₛ E} : Integrable f μ ↔ ∀ (y) (_ : y ≠ 0), μ (f ⁻¹' {y}) < ∞ :=
   memℒp_one_iff_integrable.symm.trans <| memℒp_iff one_ne_zero ENNReal.coe_ne_top
@@ -474,7 +474,7 @@ theorem measure_preimage_lt_top_of_integrable (f : α →ₛ E) (hf : Integrable
 #align measure_theory.simple_func.measure_preimage_lt_top_of_integrable MeasureTheory.SimpleFunc.measure_preimage_lt_top_of_integrable
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (y «expr ≠ » 0) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:641:2: warning: expanding binder collection (y «expr ≠ » 0) -/
 #print MeasureTheory.SimpleFunc.measure_support_lt_top /-
 theorem measure_support_lt_top [Zero β] (f : α →ₛ β) (hf : ∀ (y) (_ : y ≠ 0), μ (f ⁻¹' {y}) < ∞) :
     μ (support f) < ∞ := by
Diff
@@ -603,7 +603,7 @@ instance as it is (as of writing) used only in the construction of the Bochner i
 protected def module : Module 𝕜 (Lp.simpleFunc E p μ)
     where
   one_smul f := by ext1; exact one_smul _ _
-  mul_smul x y f := by ext1; exact mul_smul _ _ _
+  hMul_smul x y f := by ext1; exact mul_smul _ _ _
   smul_add x f g := by ext1; exact smul_add _ _ _
   smul_zero x := by ext1; exact smul_zero _
   add_smul x y f := by ext1; exact add_smul _ _ _
Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2022 Zhouhang Zhou. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Zhouhang Zhou, Yury Kudryashov, Heather Macbeth
-
-! This file was ported from Lean 3 source module measure_theory.function.simple_func_dense_lp
-! leanprover-community/mathlib commit af471b9e3ce868f296626d33189b4ce730fa4c00
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.MeasureTheory.Function.L1Space
 import Mathbin.MeasureTheory.Function.SimpleFuncDense
 
+#align_import measure_theory.function.simple_func_dense_lp from "leanprover-community/mathlib"@"af471b9e3ce868f296626d33189b4ce730fa4c00"
+
 /-!
 # Density of simple functions
 
@@ -388,7 +385,7 @@ theorem measure_preimage_lt_top_of_memℒp (hp_pos : p ≠ 0) (hp_ne_top : p ≠
 #align measure_theory.simple_func.measure_preimage_lt_top_of_mem_ℒp MeasureTheory.SimpleFunc.measure_preimage_lt_top_of_memℒp
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (y «expr ≠ » 0) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (y «expr ≠ » 0) -/
 #print MeasureTheory.SimpleFunc.memℒp_of_finite_measure_preimage /-
 theorem memℒp_of_finite_measure_preimage (p : ℝ≥0∞) {f : α →ₛ E}
     (hf : ∀ (y) (_ : y ≠ 0), μ (f ⁻¹' {y}) < ∞) : Memℒp f p μ :=
@@ -407,7 +404,7 @@ theorem memℒp_of_finite_measure_preimage (p : ℝ≥0∞) {f : α →ₛ E}
 #align measure_theory.simple_func.mem_ℒp_of_finite_measure_preimage MeasureTheory.SimpleFunc.memℒp_of_finite_measure_preimage
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (y «expr ≠ » 0) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (y «expr ≠ » 0) -/
 #print MeasureTheory.SimpleFunc.memℒp_iff /-
 theorem memℒp_iff {f : α →ₛ E} (hp_pos : p ≠ 0) (hp_ne_top : p ≠ ∞) :
     Memℒp f p μ ↔ ∀ (y) (_ : y ≠ 0), μ (f ⁻¹' {y}) < ∞ :=
@@ -416,7 +413,7 @@ theorem memℒp_iff {f : α →ₛ E} (hp_pos : p ≠ 0) (hp_ne_top : p ≠ ∞)
 #align measure_theory.simple_func.mem_ℒp_iff MeasureTheory.SimpleFunc.memℒp_iff
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (y «expr ≠ » 0) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (y «expr ≠ » 0) -/
 #print MeasureTheory.SimpleFunc.integrable_iff /-
 theorem integrable_iff {f : α →ₛ E} : Integrable f μ ↔ ∀ (y) (_ : y ≠ 0), μ (f ⁻¹' {y}) < ∞ :=
   memℒp_one_iff_integrable.symm.trans <| memℒp_iff one_ne_zero ENNReal.coe_ne_top
@@ -477,7 +474,7 @@ theorem measure_preimage_lt_top_of_integrable (f : α →ₛ E) (hf : Integrable
 #align measure_theory.simple_func.measure_preimage_lt_top_of_integrable MeasureTheory.SimpleFunc.measure_preimage_lt_top_of_integrable
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (y «expr ≠ » 0) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (y «expr ≠ » 0) -/
 #print MeasureTheory.SimpleFunc.measure_support_lt_top /-
 theorem measure_support_lt_top [Zero β] (f : α →ₛ β) (hf : ∀ (y) (_ : y ≠ 0), μ (f ⁻¹' {y}) < ∞) :
     μ (support f) < ∞ := by
Diff
@@ -58,7 +58,6 @@ variable {α β ι E F 𝕜 : Type _}
 
 namespace MeasureTheory
 
--- mathport name: «expr →ₛ »
 local infixr:25 " →ₛ " => SimpleFunc
 
 namespace SimpleFunc
@@ -71,6 +70,7 @@ section Lp
 variable [MeasurableSpace β] [MeasurableSpace E] [NormedAddCommGroup E] [NormedAddCommGroup F]
   {q : ℝ} {p : ℝ≥0∞}
 
+#print MeasureTheory.SimpleFunc.nnnorm_approxOn_le /-
 theorem nnnorm_approxOn_le [OpensMeasurableSpace E] {f : β → E} (hf : Measurable f) {s : Set E}
     {y₀ : E} (h₀ : y₀ ∈ s) [SeparableSpace s] (x : β) (n : ℕ) :
     ‖approxOn f hf s y₀ h₀ n x - f x‖₊ ≤ ‖f x - y₀‖₊ :=
@@ -80,7 +80,9 @@ theorem nnnorm_approxOn_le [OpensMeasurableSpace E] {f : β → E} (hf : Measura
   simp only [edist_nndist, nndist_eq_nnnorm] at this 
   exact_mod_cast this
 #align measure_theory.simple_func.nnnorm_approx_on_le MeasureTheory.SimpleFunc.nnnorm_approxOn_le
+-/
 
+#print MeasureTheory.SimpleFunc.norm_approxOn_y₀_le /-
 theorem norm_approxOn_y₀_le [OpensMeasurableSpace E] {f : β → E} (hf : Measurable f) {s : Set E}
     {y₀ : E} (h₀ : y₀ ∈ s) [SeparableSpace s] (x : β) (n : ℕ) :
     ‖approxOn f hf s y₀ h₀ n x - y₀‖ ≤ ‖f x - y₀‖ + ‖f x - y₀‖ :=
@@ -89,7 +91,9 @@ theorem norm_approxOn_y₀_le [OpensMeasurableSpace E] {f : β → E} (hf : Meas
   repeat' rw [edist_comm y₀, edist_eq_coe_nnnorm_sub] at this 
   exact_mod_cast this
 #align measure_theory.simple_func.norm_approx_on_y₀_le MeasureTheory.SimpleFunc.norm_approxOn_y₀_le
+-/
 
+#print MeasureTheory.SimpleFunc.norm_approxOn_zero_le /-
 theorem norm_approxOn_zero_le [OpensMeasurableSpace E] {f : β → E} (hf : Measurable f) {s : Set E}
     (h₀ : (0 : E) ∈ s) [SeparableSpace s] (x : β) (n : ℕ) :
     ‖approxOn f hf s 0 h₀ n x‖ ≤ ‖f x‖ + ‖f x‖ :=
@@ -98,7 +102,9 @@ theorem norm_approxOn_zero_le [OpensMeasurableSpace E] {f : β → E} (hf : Meas
   simp [edist_comm (0 : E), edist_eq_coe_nnnorm] at this 
   exact_mod_cast this
 #align measure_theory.simple_func.norm_approx_on_zero_le MeasureTheory.SimpleFunc.norm_approxOn_zero_le
+-/
 
+#print MeasureTheory.SimpleFunc.tendsto_approxOn_Lp_snorm /-
 theorem tendsto_approxOn_Lp_snorm [OpensMeasurableSpace E] {f : β → E} (hf : Measurable f)
     {s : Set E} {y₀ : E} (h₀ : y₀ ∈ s) [SeparableSpace s] (hp_ne_top : p ≠ ∞) {μ : Measure β}
     (hμ : ∀ᵐ x ∂μ, f x ∈ closure s) (hi : snorm (fun x => f x - y₀) p μ < ∞) :
@@ -144,6 +150,7 @@ theorem tendsto_approxOn_Lp_snorm [OpensMeasurableSpace E] {f : β → E} (hf :
   -- Then we apply the Dominated Convergence Theorem
   simpa using tendsto_lintegral_of_dominated_convergence _ hF_meas h_bound h_fin h_lim
 #align measure_theory.simple_func.tendsto_approx_on_Lp_snorm MeasureTheory.SimpleFunc.tendsto_approxOn_Lp_snorm
+-/
 
 #print MeasureTheory.SimpleFunc.memℒp_approxOn /-
 theorem memℒp_approxOn [BorelSpace E] {f : β → E} {μ : Measure β} (fmeas : Measurable f)
@@ -184,6 +191,7 @@ theorem memℒp_approxOn [BorelSpace E] {f : β → E} {μ : Measure β} (fmeas
 #align measure_theory.simple_func.mem_ℒp_approx_on MeasureTheory.SimpleFunc.memℒp_approxOn
 -/
 
+#print MeasureTheory.SimpleFunc.tendsto_approxOn_range_Lp_snorm /-
 theorem tendsto_approxOn_range_Lp_snorm [BorelSpace E] {f : β → E} (hp_ne_top : p ≠ ∞)
     {μ : Measure β} (fmeas : Measurable f) [SeparableSpace (range f ∪ {0} : Set E)]
     (hf : snorm f p μ < ∞) :
@@ -196,13 +204,17 @@ theorem tendsto_approxOn_range_Lp_snorm [BorelSpace E] {f : β → E} (hp_ne_top
     simp
   · simpa using hf
 #align measure_theory.simple_func.tendsto_approx_on_range_Lp_snorm MeasureTheory.SimpleFunc.tendsto_approxOn_range_Lp_snorm
+-/
 
+#print MeasureTheory.SimpleFunc.memℒp_approxOn_range /-
 theorem memℒp_approxOn_range [BorelSpace E] {f : β → E} {μ : Measure β} (fmeas : Measurable f)
     [SeparableSpace (range f ∪ {0} : Set E)] (hf : Memℒp f p μ) (n : ℕ) :
     Memℒp (approxOn f fmeas (range f ∪ {0}) 0 (by simp) n) p μ :=
   memℒp_approxOn fmeas hf (by simp) zero_memℒp n
 #align measure_theory.simple_func.mem_ℒp_approx_on_range MeasureTheory.SimpleFunc.memℒp_approxOn_range
+-/
 
+#print MeasureTheory.SimpleFunc.tendsto_approxOn_range_Lp /-
 theorem tendsto_approxOn_range_Lp [BorelSpace E] {f : β → E} [hp : Fact (1 ≤ p)] (hp_ne_top : p ≠ ∞)
     {μ : Measure β} (fmeas : Measurable f) [SeparableSpace (range f ∪ {0} : Set E)]
     (hf : Memℒp f p μ) :
@@ -214,7 +226,9 @@ theorem tendsto_approxOn_range_Lp [BorelSpace E] {f : β → E} [hp : Fact (1 
   simpa only [Lp.tendsto_Lp_iff_tendsto_ℒp''] using
     tendsto_approx_on_range_Lp_snorm hp_ne_top fmeas hf.2
 #align measure_theory.simple_func.tendsto_approx_on_range_Lp MeasureTheory.SimpleFunc.tendsto_approxOn_range_Lp
+-/
 
+#print MeasureTheory.Memℒp.exists_simpleFunc_snorm_sub_lt /-
 /-- Any function in `ℒp` can be approximated by a simple function if `p < ∞`. -/
 theorem MeasureTheory.Memℒp.exists_simpleFunc_snorm_sub_lt {E : Type _} [NormedAddCommGroup E]
     {f : β → E} {μ : Measure β} (hf : Memℒp f p μ) (hp_ne_top : p ≠ ∞) {ε : ℝ≥0∞} (hε : ε ≠ 0) :
@@ -239,6 +253,7 @@ theorem MeasureTheory.Memℒp.exists_simpleFunc_snorm_sub_lt {E : Type _} [Norme
   rw [← snorm_neg, neg_sub] at hn 
   exact ⟨_, hn, mem_ℒp_approx_on_range f'meas hf' _⟩
 #align measure_theory.mem_ℒp.exists_simple_func_snorm_sub_lt MeasureTheory.Memℒp.exists_simpleFunc_snorm_sub_lt
+-/
 
 end Lp
 
@@ -251,6 +266,7 @@ variable [MeasurableSpace β]
 
 variable [MeasurableSpace E] [NormedAddCommGroup E]
 
+#print MeasureTheory.SimpleFunc.tendsto_approxOn_L1_nnnorm /-
 theorem tendsto_approxOn_L1_nnnorm [OpensMeasurableSpace E] {f : β → E} (hf : Measurable f)
     {s : Set E} {y₀ : E} (h₀ : y₀ ∈ s) [SeparableSpace s] {μ : Measure β}
     (hμ : ∀ᵐ x ∂μ, f x ∈ closure s) (hi : HasFiniteIntegral (fun x => f x - y₀) μ) :
@@ -259,6 +275,7 @@ theorem tendsto_approxOn_L1_nnnorm [OpensMeasurableSpace E] {f : β → E} (hf :
     tendsto_approx_on_Lp_snorm hf h₀ one_ne_top hμ
       (by simpa [snorm_one_eq_lintegral_nnnorm] using hi)
 #align measure_theory.simple_func.tendsto_approx_on_L1_nnnorm MeasureTheory.SimpleFunc.tendsto_approxOn_L1_nnnorm
+-/
 
 #print MeasureTheory.SimpleFunc.integrable_approxOn /-
 theorem integrable_approxOn [BorelSpace E] {f : β → E} {μ : Measure β} (fmeas : Measurable f)
@@ -270,6 +287,7 @@ theorem integrable_approxOn [BorelSpace E] {f : β → E} {μ : Measure β} (fme
 #align measure_theory.simple_func.integrable_approx_on MeasureTheory.SimpleFunc.integrable_approxOn
 -/
 
+#print MeasureTheory.SimpleFunc.tendsto_approxOn_range_L1_nnnorm /-
 theorem tendsto_approxOn_range_L1_nnnorm [OpensMeasurableSpace E] {f : β → E} {μ : Measure β}
     [SeparableSpace (range f ∪ {0} : Set E)] (fmeas : Measurable f) (hf : Integrable f μ) :
     Tendsto (fun n => ∫⁻ x, ‖approxOn f fmeas (range f ∪ {0}) 0 (by simp) n x - f x‖₊ ∂μ) atTop
@@ -282,12 +300,15 @@ theorem tendsto_approxOn_range_L1_nnnorm [OpensMeasurableSpace E] {f : β → E}
     simp
   · simpa using hf.2
 #align measure_theory.simple_func.tendsto_approx_on_range_L1_nnnorm MeasureTheory.SimpleFunc.tendsto_approxOn_range_L1_nnnorm
+-/
 
+#print MeasureTheory.SimpleFunc.integrable_approxOn_range /-
 theorem integrable_approxOn_range [BorelSpace E] {f : β → E} {μ : Measure β} (fmeas : Measurable f)
     [SeparableSpace (range f ∪ {0} : Set E)] (hf : Integrable f μ) (n : ℕ) :
     Integrable (approxOn f fmeas (range f ∪ {0}) 0 (by simp) n) μ :=
   integrable_approxOn fmeas hf _ (integrable_zero _ _ _) n
 #align measure_theory.simple_func.integrable_approx_on_range MeasureTheory.SimpleFunc.integrable_approxOn_range
+-/
 
 end Integrable
 
@@ -309,26 +330,35 @@ A simple function `f : α →ₛ E` into a normed group `E` verifies, for a meas
 -/
 
 
+#print MeasureTheory.SimpleFunc.exists_forall_norm_le /-
 theorem exists_forall_norm_le (f : α →ₛ F) : ∃ C, ∀ x, ‖f x‖ ≤ C :=
   exists_forall_le (f.map fun x => ‖x‖)
 #align measure_theory.simple_func.exists_forall_norm_le MeasureTheory.SimpleFunc.exists_forall_norm_le
+-/
 
+#print MeasureTheory.SimpleFunc.memℒp_zero /-
 theorem memℒp_zero (f : α →ₛ E) (μ : Measure α) : Memℒp f 0 μ :=
   memℒp_zero_iff_aestronglyMeasurable.mpr f.AEStronglyMeasurable
 #align measure_theory.simple_func.mem_ℒp_zero MeasureTheory.SimpleFunc.memℒp_zero
+-/
 
+#print MeasureTheory.SimpleFunc.memℒp_top /-
 theorem memℒp_top (f : α →ₛ E) (μ : Measure α) : Memℒp f ∞ μ :=
   let ⟨C, hfC⟩ := f.exists_forall_norm_le
   memℒp_top_of_bound f.AEStronglyMeasurable C <| eventually_of_forall hfC
 #align measure_theory.simple_func.mem_ℒp_top MeasureTheory.SimpleFunc.memℒp_top
+-/
 
+#print MeasureTheory.SimpleFunc.snorm'_eq /-
 protected theorem snorm'_eq {p : ℝ} (f : α →ₛ F) (μ : Measure α) :
     snorm' f p μ = (∑ y in f.range, (‖y‖₊ : ℝ≥0∞) ^ p * μ (f ⁻¹' {y})) ^ (1 / p) :=
   by
   have h_map : (fun a => (‖f a‖₊ : ℝ≥0∞) ^ p) = f.map fun a : F => (‖a‖₊ : ℝ≥0∞) ^ p := by simp
   rw [snorm', h_map, lintegral_eq_lintegral, map_lintegral]
 #align measure_theory.simple_func.snorm'_eq MeasureTheory.SimpleFunc.snorm'_eq
+-/
 
+#print MeasureTheory.SimpleFunc.measure_preimage_lt_top_of_memℒp /-
 theorem measure_preimage_lt_top_of_memℒp (hp_pos : p ≠ 0) (hp_ne_top : p ≠ ∞) (f : α →ₛ E)
     (hf : Memℒp f p μ) (y : E) (hy_ne : y ≠ 0) : μ (f ⁻¹' {y}) < ∞ :=
   by
@@ -356,8 +386,10 @@ theorem measure_preimage_lt_top_of_memℒp (hp_pos : p ≠ 0) (hp_ne_top : p ≠
     simpa [hp_pos_real] using hf_snorm
   · simp [hf_snorm]
 #align measure_theory.simple_func.measure_preimage_lt_top_of_mem_ℒp MeasureTheory.SimpleFunc.measure_preimage_lt_top_of_memℒp
+-/
 
 /- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (y «expr ≠ » 0) -/
+#print MeasureTheory.SimpleFunc.memℒp_of_finite_measure_preimage /-
 theorem memℒp_of_finite_measure_preimage (p : ℝ≥0∞) {f : α →ₛ E}
     (hf : ∀ (y) (_ : y ≠ 0), μ (f ⁻¹' {y}) < ∞) : Memℒp f p μ :=
   by
@@ -373,58 +405,80 @@ theorem memℒp_of_finite_measure_preimage (p : ℝ≥0∞) {f : α →ₛ E}
   · refine' ENNReal.mul_lt_top _ (hf y hy0).Ne
     exact (ENNReal.rpow_lt_top_of_nonneg ENNReal.toReal_nonneg ENNReal.coe_ne_top).Ne
 #align measure_theory.simple_func.mem_ℒp_of_finite_measure_preimage MeasureTheory.SimpleFunc.memℒp_of_finite_measure_preimage
+-/
 
 /- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (y «expr ≠ » 0) -/
+#print MeasureTheory.SimpleFunc.memℒp_iff /-
 theorem memℒp_iff {f : α →ₛ E} (hp_pos : p ≠ 0) (hp_ne_top : p ≠ ∞) :
     Memℒp f p μ ↔ ∀ (y) (_ : y ≠ 0), μ (f ⁻¹' {y}) < ∞ :=
   ⟨fun h => measure_preimage_lt_top_of_memℒp hp_pos hp_ne_top f h, fun h =>
     memℒp_of_finite_measure_preimage p h⟩
 #align measure_theory.simple_func.mem_ℒp_iff MeasureTheory.SimpleFunc.memℒp_iff
+-/
 
 /- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (y «expr ≠ » 0) -/
+#print MeasureTheory.SimpleFunc.integrable_iff /-
 theorem integrable_iff {f : α →ₛ E} : Integrable f μ ↔ ∀ (y) (_ : y ≠ 0), μ (f ⁻¹' {y}) < ∞ :=
   memℒp_one_iff_integrable.symm.trans <| memℒp_iff one_ne_zero ENNReal.coe_ne_top
 #align measure_theory.simple_func.integrable_iff MeasureTheory.SimpleFunc.integrable_iff
+-/
 
+#print MeasureTheory.SimpleFunc.memℒp_iff_integrable /-
 theorem memℒp_iff_integrable {f : α →ₛ E} (hp_pos : p ≠ 0) (hp_ne_top : p ≠ ∞) :
     Memℒp f p μ ↔ Integrable f μ :=
   (memℒp_iff hp_pos hp_ne_top).trans integrable_iff.symm
 #align measure_theory.simple_func.mem_ℒp_iff_integrable MeasureTheory.SimpleFunc.memℒp_iff_integrable
+-/
 
+#print MeasureTheory.SimpleFunc.memℒp_iff_finMeasSupp /-
 theorem memℒp_iff_finMeasSupp {f : α →ₛ E} (hp_pos : p ≠ 0) (hp_ne_top : p ≠ ∞) :
     Memℒp f p μ ↔ f.FinMeasSupp μ :=
   (memℒp_iff hp_pos hp_ne_top).trans finMeasSupp_iff.symm
 #align measure_theory.simple_func.mem_ℒp_iff_fin_meas_supp MeasureTheory.SimpleFunc.memℒp_iff_finMeasSupp
+-/
 
+#print MeasureTheory.SimpleFunc.integrable_iff_finMeasSupp /-
 theorem integrable_iff_finMeasSupp {f : α →ₛ E} : Integrable f μ ↔ f.FinMeasSupp μ :=
   integrable_iff.trans finMeasSupp_iff.symm
 #align measure_theory.simple_func.integrable_iff_fin_meas_supp MeasureTheory.SimpleFunc.integrable_iff_finMeasSupp
+-/
 
+#print MeasureTheory.SimpleFunc.FinMeasSupp.integrable /-
 theorem FinMeasSupp.integrable {f : α →ₛ E} (h : f.FinMeasSupp μ) : Integrable f μ :=
   integrable_iff_finMeasSupp.2 h
 #align measure_theory.simple_func.fin_meas_supp.integrable MeasureTheory.SimpleFunc.FinMeasSupp.integrable
+-/
 
+#print MeasureTheory.SimpleFunc.integrable_pair /-
 theorem integrable_pair {f : α →ₛ E} {g : α →ₛ F} :
     Integrable f μ → Integrable g μ → Integrable (pair f g) μ := by
   simpa only [integrable_iff_fin_meas_supp] using fin_meas_supp.pair
 #align measure_theory.simple_func.integrable_pair MeasureTheory.SimpleFunc.integrable_pair
+-/
 
+#print MeasureTheory.SimpleFunc.memℒp_of_isFiniteMeasure /-
 theorem memℒp_of_isFiniteMeasure (f : α →ₛ E) (p : ℝ≥0∞) (μ : Measure α) [IsFiniteMeasure μ] :
     Memℒp f p μ :=
   let ⟨C, hfC⟩ := f.exists_forall_norm_le
   Memℒp.of_bound f.AEStronglyMeasurable C <| eventually_of_forall hfC
 #align measure_theory.simple_func.mem_ℒp_of_is_finite_measure MeasureTheory.SimpleFunc.memℒp_of_isFiniteMeasure
+-/
 
+#print MeasureTheory.SimpleFunc.integrable_of_isFiniteMeasure /-
 theorem integrable_of_isFiniteMeasure [IsFiniteMeasure μ] (f : α →ₛ E) : Integrable f μ :=
   memℒp_one_iff_integrable.mp (f.memℒp_of_isFiniteMeasure 1 μ)
 #align measure_theory.simple_func.integrable_of_is_finite_measure MeasureTheory.SimpleFunc.integrable_of_isFiniteMeasure
+-/
 
+#print MeasureTheory.SimpleFunc.measure_preimage_lt_top_of_integrable /-
 theorem measure_preimage_lt_top_of_integrable (f : α →ₛ E) (hf : Integrable f μ) {x : E}
     (hx : x ≠ 0) : μ (f ⁻¹' {x}) < ∞ :=
   integrable_iff.mp hf x hx
 #align measure_theory.simple_func.measure_preimage_lt_top_of_integrable MeasureTheory.SimpleFunc.measure_preimage_lt_top_of_integrable
+-/
 
 /- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (y «expr ≠ » 0) -/
+#print MeasureTheory.SimpleFunc.measure_support_lt_top /-
 theorem measure_support_lt_top [Zero β] (f : α →ₛ β) (hf : ∀ (y) (_ : y ≠ 0), μ (f ⁻¹' {y}) < ∞) :
     μ (support f) < ∞ := by
   rw [support_eq]
@@ -432,17 +486,23 @@ theorem measure_support_lt_top [Zero β] (f : α →ₛ β) (hf : ∀ (y) (_ : y
   rw [Finset.mem_filter] at hy 
   exact hf y hy.2
 #align measure_theory.simple_func.measure_support_lt_top MeasureTheory.SimpleFunc.measure_support_lt_top
+-/
 
+#print MeasureTheory.SimpleFunc.measure_support_lt_top_of_memℒp /-
 theorem measure_support_lt_top_of_memℒp (f : α →ₛ E) (hf : Memℒp f p μ) (hp_ne_zero : p ≠ 0)
     (hp_ne_top : p ≠ ∞) : μ (support f) < ∞ :=
   f.measure_support_lt_top ((memℒp_iff hp_ne_zero hp_ne_top).mp hf)
 #align measure_theory.simple_func.measure_support_lt_top_of_mem_ℒp MeasureTheory.SimpleFunc.measure_support_lt_top_of_memℒp
+-/
 
+#print MeasureTheory.SimpleFunc.measure_support_lt_top_of_integrable /-
 theorem measure_support_lt_top_of_integrable (f : α →ₛ E) (hf : Integrable f μ) :
     μ (support f) < ∞ :=
   f.measure_support_lt_top (integrable_iff.mp hf)
 #align measure_theory.simple_func.measure_support_lt_top_of_integrable MeasureTheory.SimpleFunc.measure_support_lt_top_of_integrable
+-/
 
+#print MeasureTheory.SimpleFunc.measure_lt_top_of_memℒp_indicator /-
 theorem measure_lt_top_of_memℒp_indicator (hp_pos : p ≠ 0) (hp_ne_top : p ≠ ∞) {c : E} (hc : c ≠ 0)
     {s : Set α} (hs : MeasurableSet s) (hcs : Memℒp ((const α c).piecewise s hs (const α 0)) p μ) :
     μ s < ⊤ :=
@@ -451,6 +511,7 @@ theorem measure_lt_top_of_memℒp_indicator (hp_pos : p ≠ 0) (hp_ne_top : p 
   simpa only [mem_ℒp_iff_fin_meas_supp hp_pos hp_ne_top, fin_meas_supp_iff_support,
     support_indicator, Set.inter_univ, this] using hcs
 #align measure_theory.simple_func.measure_lt_top_of_mem_ℒp_indicator MeasureTheory.SimpleFunc.measure_lt_top_of_memℒp_indicator
+-/
 
 end SimpleFuncProperties
 
@@ -468,6 +529,7 @@ variable [MeasurableSpace α] [NormedAddCommGroup E] [NormedAddCommGroup F] (p :
 
 variable (E)
 
+#print MeasureTheory.Lp.simpleFunc /-
 /-- `Lp.simple_func` is a subspace of Lp consisting of equivalence classes of an integrable simple
     function. -/
 def simpleFunc : AddSubgroup (Lp E p μ)
@@ -483,6 +545,7 @@ def simpleFunc : AddSubgroup (Lp E p μ)
       simp only [← hs, ae_eq_fun.neg_mk, simple_func.coe_neg, ae_eq_fun.mk_eq_mk,
         AddSubgroup.coe_neg]⟩
 #align measure_theory.Lp.simple_func MeasureTheory.Lp.simpleFunc
+-/
 
 variable {E p μ}
 
@@ -498,9 +561,11 @@ theorem coe_coe (f : Lp.simpleFunc E p μ) : ⇑(f : Lp E p μ) = f :=
   rfl
 #align measure_theory.Lp.simple_func.coe_coe MeasureTheory.Lp.simpleFunc.coe_coe
 
+#print MeasureTheory.Lp.simpleFunc.eq' /-
 protected theorem eq' {f g : Lp.simpleFunc E p μ} : (f : α →ₘ[μ] E) = (g : α →ₘ[μ] E) → f = g :=
   Subtype.eq ∘ Subtype.eq
 #align measure_theory.Lp.simple_func.eq' MeasureTheory.Lp.simpleFunc.eq'
+-/
 
 /-! Implementation note:  If `Lp.simple_func E p μ` were defined as a `𝕜`-submodule of `Lp E p μ`,
 then the next few lemmas, putting a normed `𝕜`-group structure on `Lp.simple_func E p μ`, would be
@@ -511,6 +576,7 @@ i.e. has no scalar action). -/
 
 variable [NormedRing 𝕜] [Module 𝕜 E] [BoundedSMul 𝕜 E]
 
+#print MeasureTheory.Lp.simpleFunc.smul /-
 /-- If `E` is a normed space, `Lp.simple_func E p μ` is a `has_smul`. Not declared as an
 instance as it is (as of writing) used only in the construction of the Bochner integral. -/
 protected def smul : SMul 𝕜 (Lp.simpleFunc E p μ) :=
@@ -522,15 +588,19 @@ protected def smul : SMul 𝕜 (Lp.simpleFunc E p μ) :=
       rw [hs]
       rfl⟩⟩
 #align measure_theory.Lp.simple_func.has_smul MeasureTheory.Lp.simpleFunc.smul
+-/
 
 attribute [local instance] simple_func.has_smul
 
+#print MeasureTheory.Lp.simpleFunc.coe_smul /-
 @[simp, norm_cast]
 theorem coe_smul (c : 𝕜) (f : Lp.simpleFunc E p μ) :
     ((c • f : Lp.simpleFunc E p μ) : Lp E p μ) = c • (f : Lp E p μ) :=
   rfl
 #align measure_theory.Lp.simple_func.coe_smul MeasureTheory.Lp.simpleFunc.coe_smul
+-/
 
+#print MeasureTheory.Lp.simpleFunc.module /-
 /-- If `E` is a normed space, `Lp.simple_func E p μ` is a module. Not declared as an
 instance as it is (as of writing) used only in the construction of the Bochner integral. -/
 protected def module : Module 𝕜 (Lp.simpleFunc E p μ)
@@ -542,23 +612,28 @@ protected def module : Module 𝕜 (Lp.simpleFunc E p μ)
   add_smul x y f := by ext1; exact add_smul _ _ _
   zero_smul f := by ext1; exact zero_smul _ _
 #align measure_theory.Lp.simple_func.module MeasureTheory.Lp.simpleFunc.module
+-/
 
 attribute [local instance] simple_func.module
 
+#print MeasureTheory.Lp.simpleFunc.boundedSMul /-
 /-- If `E` is a normed space, `Lp.simple_func E p μ` is a normed space. Not declared as an
 instance as it is (as of writing) used only in the construction of the Bochner integral. -/
 protected theorem boundedSMul [Fact (1 ≤ p)] : BoundedSMul 𝕜 (Lp.simpleFunc E p μ) :=
   BoundedSMul.of_norm_smul_le fun r f => (norm_smul_le r (f : Lp E p μ) : _)
 #align measure_theory.Lp.simple_func.has_bounded_smul MeasureTheory.Lp.simpleFunc.boundedSMul
+-/
 
 attribute [local instance] simple_func.has_bounded_smul
 
+#print MeasureTheory.Lp.simpleFunc.normedSpace /-
 /-- If `E` is a normed space, `Lp.simple_func E p μ` is a normed space. Not declared as an
 instance as it is (as of writing) used only in the construction of the Bochner integral. -/
 protected def normedSpace {𝕜} [NormedField 𝕜] [NormedSpace 𝕜 E] [Fact (1 ≤ p)] :
     NormedSpace 𝕜 (Lp.simpleFunc E p μ) :=
   ⟨norm_smul_le⟩
 #align measure_theory.Lp.simple_func.normed_space MeasureTheory.Lp.simpleFunc.normedSpace
+-/
 
 end Instances
 
@@ -566,83 +641,112 @@ attribute [local instance] simple_func.module simple_func.normed_space simple_fu
 
 section ToLp
 
+#print MeasureTheory.Lp.simpleFunc.toLp /-
 /-- Construct the equivalence class `[f]` of a simple function `f` satisfying `mem_ℒp`. -/
 @[reducible]
 def toLp (f : α →ₛ E) (hf : Memℒp f p μ) : Lp.simpleFunc E p μ :=
   ⟨hf.toLp f, ⟨f, rfl⟩⟩
 #align measure_theory.Lp.simple_func.to_Lp MeasureTheory.Lp.simpleFunc.toLp
+-/
 
+#print MeasureTheory.Lp.simpleFunc.toLp_eq_toLp /-
 theorem toLp_eq_toLp (f : α →ₛ E) (hf : Memℒp f p μ) : (toLp f hf : Lp E p μ) = hf.toLp f :=
   rfl
 #align measure_theory.Lp.simple_func.to_Lp_eq_to_Lp MeasureTheory.Lp.simpleFunc.toLp_eq_toLp
+-/
 
+#print MeasureTheory.Lp.simpleFunc.toLp_eq_mk /-
 theorem toLp_eq_mk (f : α →ₛ E) (hf : Memℒp f p μ) :
     (toLp f hf : α →ₘ[μ] E) = AEEqFun.mk f f.AEStronglyMeasurable :=
   rfl
 #align measure_theory.Lp.simple_func.to_Lp_eq_mk MeasureTheory.Lp.simpleFunc.toLp_eq_mk
+-/
 
+#print MeasureTheory.Lp.simpleFunc.toLp_zero /-
 theorem toLp_zero : toLp (0 : α →ₛ E) zero_memℒp = (0 : Lp.simpleFunc E p μ) :=
   rfl
 #align measure_theory.Lp.simple_func.to_Lp_zero MeasureTheory.Lp.simpleFunc.toLp_zero
+-/
 
+#print MeasureTheory.Lp.simpleFunc.toLp_add /-
 theorem toLp_add (f g : α →ₛ E) (hf : Memℒp f p μ) (hg : Memℒp g p μ) :
     toLp (f + g) (hf.add hg) = toLp f hf + toLp g hg :=
   rfl
 #align measure_theory.Lp.simple_func.to_Lp_add MeasureTheory.Lp.simpleFunc.toLp_add
+-/
 
+#print MeasureTheory.Lp.simpleFunc.toLp_neg /-
 theorem toLp_neg (f : α →ₛ E) (hf : Memℒp f p μ) : toLp (-f) hf.neg = -toLp f hf :=
   rfl
 #align measure_theory.Lp.simple_func.to_Lp_neg MeasureTheory.Lp.simpleFunc.toLp_neg
+-/
 
+#print MeasureTheory.Lp.simpleFunc.toLp_sub /-
 theorem toLp_sub (f g : α →ₛ E) (hf : Memℒp f p μ) (hg : Memℒp g p μ) :
     toLp (f - g) (hf.sub hg) = toLp f hf - toLp g hg := by
   simp only [sub_eq_add_neg, ← to_Lp_neg, ← to_Lp_add]; rfl
 #align measure_theory.Lp.simple_func.to_Lp_sub MeasureTheory.Lp.simpleFunc.toLp_sub
+-/
 
 variable [NormedRing 𝕜] [Module 𝕜 E] [BoundedSMul 𝕜 E]
 
+#print MeasureTheory.Lp.simpleFunc.toLp_smul /-
 theorem toLp_smul (f : α →ₛ E) (hf : Memℒp f p μ) (c : 𝕜) :
     toLp (c • f) (hf.const_smul c) = c • toLp f hf :=
   rfl
 #align measure_theory.Lp.simple_func.to_Lp_smul MeasureTheory.Lp.simpleFunc.toLp_smul
+-/
 
+#print MeasureTheory.Lp.simpleFunc.norm_toLp /-
 theorem norm_toLp [Fact (1 ≤ p)] (f : α →ₛ E) (hf : Memℒp f p μ) :
     ‖toLp f hf‖ = ENNReal.toReal (snorm f p μ) :=
   norm_toLp f hf
 #align measure_theory.Lp.simple_func.norm_to_Lp MeasureTheory.Lp.simpleFunc.norm_toLp
+-/
 
 end ToLp
 
 section ToSimpleFunc
 
+#print MeasureTheory.Lp.simpleFunc.toSimpleFunc /-
 /-- Find a representative of a `Lp.simple_func`. -/
 def toSimpleFunc (f : Lp.simpleFunc E p μ) : α →ₛ E :=
   Classical.choose f.2
 #align measure_theory.Lp.simple_func.to_simple_func MeasureTheory.Lp.simpleFunc.toSimpleFunc
+-/
 
+#print MeasureTheory.Lp.simpleFunc.measurable /-
 /-- `(to_simple_func f)` is measurable. -/
 @[measurability]
 protected theorem measurable [MeasurableSpace E] (f : Lp.simpleFunc E p μ) :
     Measurable (toSimpleFunc f) :=
   (toSimpleFunc f).Measurable
 #align measure_theory.Lp.simple_func.measurable MeasureTheory.Lp.simpleFunc.measurable
+-/
 
+#print MeasureTheory.Lp.simpleFunc.stronglyMeasurable /-
 protected theorem stronglyMeasurable (f : Lp.simpleFunc E p μ) :
     StronglyMeasurable (toSimpleFunc f) :=
   (toSimpleFunc f).StronglyMeasurable
 #align measure_theory.Lp.simple_func.strongly_measurable MeasureTheory.Lp.simpleFunc.stronglyMeasurable
+-/
 
+#print MeasureTheory.Lp.simpleFunc.aemeasurable /-
 @[measurability]
 protected theorem aemeasurable [MeasurableSpace E] (f : Lp.simpleFunc E p μ) :
     AEMeasurable (toSimpleFunc f) μ :=
   (simpleFunc.measurable f).AEMeasurable
 #align measure_theory.Lp.simple_func.ae_measurable MeasureTheory.Lp.simpleFunc.aemeasurable
+-/
 
+#print MeasureTheory.Lp.simpleFunc.aestronglyMeasurable /-
 protected theorem aestronglyMeasurable (f : Lp.simpleFunc E p μ) :
     AEStronglyMeasurable (toSimpleFunc f) μ :=
   (simpleFunc.stronglyMeasurable f).AEStronglyMeasurable
 #align measure_theory.Lp.simple_func.ae_strongly_measurable MeasureTheory.Lp.simpleFunc.aestronglyMeasurable
+-/
 
+#print MeasureTheory.Lp.simpleFunc.toSimpleFunc_eq_toFun /-
 theorem toSimpleFunc_eq_toFun (f : Lp.simpleFunc E p μ) : toSimpleFunc f =ᵐ[μ] f :=
   show ⇑(toSimpleFunc f) =ᵐ[μ] ⇑(f : α →ₘ[μ] E)
     by
@@ -650,32 +754,42 @@ theorem toSimpleFunc_eq_toFun (f : Lp.simpleFunc E p μ) : toSimpleFunc f =ᵐ[
       (ae_eq_fun.coe_fn_mk (to_simple_func f) (to_simple_func f).AEStronglyMeasurable).symm using 2
     exact (Classical.choose_spec f.2).symm
 #align measure_theory.Lp.simple_func.to_simple_func_eq_to_fun MeasureTheory.Lp.simpleFunc.toSimpleFunc_eq_toFun
+-/
 
+#print MeasureTheory.Lp.simpleFunc.memℒp /-
 /-- `to_simple_func f` satisfies the predicate `mem_ℒp`. -/
 protected theorem memℒp (f : Lp.simpleFunc E p μ) : Memℒp (toSimpleFunc f) p μ :=
   Memℒp.ae_eq (toSimpleFunc_eq_toFun f).symm <| mem_Lp_iff_memℒp.mp (f : Lp E p μ).2
 #align measure_theory.Lp.simple_func.mem_ℒp MeasureTheory.Lp.simpleFunc.memℒp
+-/
 
+#print MeasureTheory.Lp.simpleFunc.toLp_toSimpleFunc /-
 theorem toLp_toSimpleFunc (f : Lp.simpleFunc E p μ) :
     toLp (toSimpleFunc f) (simpleFunc.memℒp f) = f :=
   simpleFunc.eq' (Classical.choose_spec f.2)
 #align measure_theory.Lp.simple_func.to_Lp_to_simple_func MeasureTheory.Lp.simpleFunc.toLp_toSimpleFunc
+-/
 
+#print MeasureTheory.Lp.simpleFunc.toSimpleFunc_toLp /-
 theorem toSimpleFunc_toLp (f : α →ₛ E) (hfi : Memℒp f p μ) : toSimpleFunc (toLp f hfi) =ᵐ[μ] f := by
   rw [← ae_eq_fun.mk_eq_mk]; exact Classical.choose_spec (to_Lp f hfi).2
 #align measure_theory.Lp.simple_func.to_simple_func_to_Lp MeasureTheory.Lp.simpleFunc.toSimpleFunc_toLp
+-/
 
 variable (E μ)
 
+#print MeasureTheory.Lp.simpleFunc.zero_toSimpleFunc /-
 theorem zero_toSimpleFunc : toSimpleFunc (0 : Lp.simpleFunc E p μ) =ᵐ[μ] 0 :=
   by
   filter_upwards [to_simple_func_eq_to_fun (0 : Lp.simple_func E p μ), Lp.coe_fn_zero E 1 μ] with _
     h₁ _
   rwa [h₁]
 #align measure_theory.Lp.simple_func.zero_to_simple_func MeasureTheory.Lp.simpleFunc.zero_toSimpleFunc
+-/
 
 variable {E μ}
 
+#print MeasureTheory.Lp.simpleFunc.add_toSimpleFunc /-
 theorem add_toSimpleFunc (f g : Lp.simpleFunc E p μ) :
     toSimpleFunc (f + g) =ᵐ[μ] toSimpleFunc f + toSimpleFunc g :=
   by
@@ -684,7 +798,9 @@ theorem add_toSimpleFunc (f g : Lp.simpleFunc E p μ) :
   simp only [← coe_coe, AddSubgroup.coe_add, Pi.add_apply]
   iterate 4 intro h; rw [h]
 #align measure_theory.Lp.simple_func.add_to_simple_func MeasureTheory.Lp.simpleFunc.add_toSimpleFunc
+-/
 
+#print MeasureTheory.Lp.simpleFunc.neg_toSimpleFunc /-
 theorem neg_toSimpleFunc (f : Lp.simpleFunc E p μ) : toSimpleFunc (-f) =ᵐ[μ] -toSimpleFunc f :=
   by
   filter_upwards [to_simple_func_eq_to_fun (-f), to_simple_func_eq_to_fun f,
@@ -692,7 +808,9 @@ theorem neg_toSimpleFunc (f : Lp.simpleFunc E p μ) : toSimpleFunc (-f) =ᵐ[μ]
   simp only [Pi.neg_apply, AddSubgroup.coe_neg, ← coe_coe]
   repeat' intro h; rw [h]
 #align measure_theory.Lp.simple_func.neg_to_simple_func MeasureTheory.Lp.simpleFunc.neg_toSimpleFunc
+-/
 
+#print MeasureTheory.Lp.simpleFunc.sub_toSimpleFunc /-
 theorem sub_toSimpleFunc (f g : Lp.simpleFunc E p μ) :
     toSimpleFunc (f - g) =ᵐ[μ] toSimpleFunc f - toSimpleFunc g :=
   by
@@ -701,9 +819,11 @@ theorem sub_toSimpleFunc (f g : Lp.simpleFunc E p μ) :
   simp only [AddSubgroup.coe_sub, Pi.sub_apply, ← coe_coe]
   repeat' intro h; rw [h]
 #align measure_theory.Lp.simple_func.sub_to_simple_func MeasureTheory.Lp.simpleFunc.sub_toSimpleFunc
+-/
 
 variable [NormedRing 𝕜] [Module 𝕜 E] [BoundedSMul 𝕜 E]
 
+#print MeasureTheory.Lp.simpleFunc.smul_toSimpleFunc /-
 theorem smul_toSimpleFunc (k : 𝕜) (f : Lp.simpleFunc E p μ) :
     toSimpleFunc (k • f) =ᵐ[μ] k • toSimpleFunc f :=
   by
@@ -712,11 +832,14 @@ theorem smul_toSimpleFunc (k : 𝕜) (f : Lp.simpleFunc E p μ) :
   simp only [Pi.smul_apply, coe_smul, ← coe_coe]
   repeat' intro h; rw [h]
 #align measure_theory.Lp.simple_func.smul_to_simple_func MeasureTheory.Lp.simpleFunc.smul_toSimpleFunc
+-/
 
+#print MeasureTheory.Lp.simpleFunc.norm_toSimpleFunc /-
 theorem norm_toSimpleFunc [Fact (1 ≤ p)] (f : Lp.simpleFunc E p μ) :
     ‖f‖ = ENNReal.toReal (snorm (toSimpleFunc f) p μ) := by
   simpa [to_Lp_to_simple_func] using norm_to_Lp (to_simple_func f) (simple_func.mem_ℒp f)
 #align measure_theory.Lp.simple_func.norm_to_simple_func MeasureTheory.Lp.simpleFunc.norm_toSimpleFunc
+-/
 
 end ToSimpleFunc
 
@@ -724,6 +847,7 @@ section Induction
 
 variable (p)
 
+#print MeasureTheory.Lp.simpleFunc.indicatorConst /-
 /-- The characteristic function of a finite-measure measurable set `s`, as an `Lp` simple function.
 -/
 def indicatorConst {s : Set α} (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (c : E) :
@@ -731,21 +855,27 @@ def indicatorConst {s : Set α} (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (c
   toLp ((SimpleFunc.const _ c).piecewise s hs (SimpleFunc.const _ 0))
     (memℒp_indicator_const p hs c (Or.inr hμs))
 #align measure_theory.Lp.simple_func.indicator_const MeasureTheory.Lp.simpleFunc.indicatorConst
+-/
 
 variable {p}
 
+#print MeasureTheory.Lp.simpleFunc.coe_indicatorConst /-
 @[simp]
 theorem coe_indicatorConst {s : Set α} (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (c : E) :
     (↑(indicatorConst p hs hμs c) : Lp E p μ) = indicatorConstLp p hs hμs c :=
   rfl
 #align measure_theory.Lp.simple_func.coe_indicator_const MeasureTheory.Lp.simpleFunc.coe_indicatorConst
+-/
 
+#print MeasureTheory.Lp.simpleFunc.toSimpleFunc_indicatorConst /-
 theorem toSimpleFunc_indicatorConst {s : Set α} (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (c : E) :
     toSimpleFunc (indicatorConst p hs hμs c) =ᵐ[μ]
       (SimpleFunc.const _ c).piecewise s hs (SimpleFunc.const _ 0) :=
   Lp.simpleFunc.toSimpleFunc_toLp _ _
 #align measure_theory.Lp.simple_func.to_simple_func_indicator_const MeasureTheory.Lp.simpleFunc.toSimpleFunc_indicatorConst
+-/
 
+#print MeasureTheory.Lp.simpleFunc.induction /-
 /-- To prove something for an arbitrary `Lp` simple function, with `0 < p < ∞`, it suffices to show
 that the property holds for (multiples of) characteristic functions of finite-measure measurable
 sets and is closed under addition (of functions with disjoint support). -/
@@ -780,6 +910,7 @@ protected theorem induction (hp_pos : p ≠ 0) (hp_ne_top : p ≠ ∞) {P : Lp.s
       (mem_ℒp_add_of_disjoint hfg f.strongly_measurable g.strongly_measurable).mp hfg'
     exact h_add hf' hg' hfg (hf hf') (hg hg')
 #align measure_theory.Lp.simple_func.induction MeasureTheory.Lp.simpleFunc.induction
+-/
 
 end Induction
 
@@ -787,18 +918,25 @@ section CoeToLp
 
 variable [Fact (1 ≤ p)]
 
+#print MeasureTheory.Lp.simpleFunc.uniformContinuous /-
 protected theorem uniformContinuous : UniformContinuous (coe : Lp.simpleFunc E p μ → Lp E p μ) :=
   uniformContinuous_comap
 #align measure_theory.Lp.simple_func.uniform_continuous MeasureTheory.Lp.simpleFunc.uniformContinuous
+-/
 
+#print MeasureTheory.Lp.simpleFunc.uniformEmbedding /-
 protected theorem uniformEmbedding : UniformEmbedding (coe : Lp.simpleFunc E p μ → Lp E p μ) :=
   uniformEmbedding_comap Subtype.val_injective
 #align measure_theory.Lp.simple_func.uniform_embedding MeasureTheory.Lp.simpleFunc.uniformEmbedding
+-/
 
+#print MeasureTheory.Lp.simpleFunc.uniformInducing /-
 protected theorem uniformInducing : UniformInducing (coe : Lp.simpleFunc E p μ → Lp E p μ) :=
   simpleFunc.uniformEmbedding.to_uniformInducing
 #align measure_theory.Lp.simple_func.uniform_inducing MeasureTheory.Lp.simpleFunc.uniformInducing
+-/
 
+#print MeasureTheory.Lp.simpleFunc.denseEmbedding /-
 protected theorem denseEmbedding (hp_ne_top : p ≠ ∞) :
     DenseEmbedding (coe : Lp.simpleFunc E p μ → Lp E p μ) :=
   by
@@ -820,21 +958,27 @@ protected theorem denseEmbedding (hp_ne_top : p ≠ ∞) :
     simple_func.tendsto_approx_on_range_Lp hp_ne_top (Lp.strongly_measurable f).Measurable hfi'
   rw [to_Lp_coe_fn f (Lp.mem_ℒp f)]
 #align measure_theory.Lp.simple_func.dense_embedding MeasureTheory.Lp.simpleFunc.denseEmbedding
+-/
 
+#print MeasureTheory.Lp.simpleFunc.denseInducing /-
 protected theorem denseInducing (hp_ne_top : p ≠ ∞) :
     DenseInducing (coe : Lp.simpleFunc E p μ → Lp E p μ) :=
   (simpleFunc.denseEmbedding hp_ne_top).to_denseInducing
 #align measure_theory.Lp.simple_func.dense_inducing MeasureTheory.Lp.simpleFunc.denseInducing
+-/
 
+#print MeasureTheory.Lp.simpleFunc.denseRange /-
 protected theorem denseRange (hp_ne_top : p ≠ ∞) :
     DenseRange (coe : Lp.simpleFunc E p μ → Lp E p μ) :=
   (simpleFunc.denseInducing hp_ne_top).dense
 #align measure_theory.Lp.simple_func.dense_range MeasureTheory.Lp.simpleFunc.denseRange
+-/
 
 variable [NormedRing 𝕜] [Module 𝕜 E] [BoundedSMul 𝕜 E]
 
 variable (α E 𝕜)
 
+#print MeasureTheory.Lp.simpleFunc.coeToLp /-
 /-- The embedding of Lp simple functions into Lp functions, as a continuous linear map. -/
 def coeToLp : Lp.simpleFunc E p μ →L[𝕜] Lp E p μ :=
   {
@@ -843,6 +987,7 @@ def coeToLp : Lp.simpleFunc E p μ →L[𝕜] Lp E p μ :=
     map_smul' := fun k f => rfl
     cont := Lp.simpleFunc.uniformContinuous.Continuous }
 #align measure_theory.Lp.simple_func.coe_to_Lp MeasureTheory.Lp.simpleFunc.coeToLp
+-/
 
 variable {α E 𝕜}
 
@@ -852,9 +997,11 @@ section Order
 
 variable {G : Type _} [NormedLatticeAddCommGroup G]
 
+#print MeasureTheory.Lp.simpleFunc.coeFn_le /-
 theorem coeFn_le (f g : Lp.simpleFunc G p μ) : f ≤ᵐ[μ] g ↔ f ≤ g := by
   rw [← Subtype.coe_le_coe, ← Lp.coe_fn_le, coeFn_coe_base', coeFn_coe_base' g]
 #align measure_theory.Lp.simple_func.coe_fn_le MeasureTheory.Lp.simpleFunc.coeFn_le
+-/
 
 instance : CovariantClass (Lp.simpleFunc G p μ) (Lp.simpleFunc G p μ) (· + ·) (· ≤ ·) :=
   by
@@ -868,12 +1015,15 @@ instance : CovariantClass (Lp.simpleFunc G p μ) (Lp.simpleFunc G p μ) (· + ·
 
 variable (p μ G)
 
+#print MeasureTheory.Lp.simpleFunc.coeFn_zero /-
 theorem coeFn_zero : (0 : Lp.simpleFunc G p μ) =ᵐ[μ] (0 : α → G) :=
   Lp.coeFn_zero _ _ _
 #align measure_theory.Lp.simple_func.coe_fn_zero MeasureTheory.Lp.simpleFunc.coeFn_zero
+-/
 
 variable {p μ G}
 
+#print MeasureTheory.Lp.simpleFunc.coeFn_nonneg /-
 theorem coeFn_nonneg (f : Lp.simpleFunc G p μ) : 0 ≤ᵐ[μ] f ↔ 0 ≤ f :=
   by
   rw [← Lp.simple_func.coe_fn_le]
@@ -882,7 +1032,9 @@ theorem coeFn_nonneg (f : Lp.simpleFunc G p μ) : 0 ≤ᵐ[μ] f ↔ 0 ≤ f :=
   · rwa [h2]
   · rwa [← h2]
 #align measure_theory.Lp.simple_func.coe_fn_nonneg MeasureTheory.Lp.simpleFunc.coeFn_nonneg
+-/
 
+#print MeasureTheory.Lp.simpleFunc.exists_simpleFunc_nonneg_ae_eq /-
 theorem exists_simpleFunc_nonneg_ae_eq {f : Lp.simpleFunc G p μ} (hf : 0 ≤ f) :
     ∃ f' : α →ₛ G, 0 ≤ f' ∧ f =ᵐ[μ] f' :=
   by
@@ -916,14 +1068,18 @@ theorem exists_simpleFunc_nonneg_ae_eq {f : Lp.simpleFunc G p μ} (hf : 0 ≤ f)
     refine' eventually_eq.trans _ (piecewise_ae_eq_of_ae_eq_set this.symm)
     simp only [simple_func.const_zero, indicator_univ, piecewise_eq_indicator, simple_func.coe_zero]
 #align measure_theory.Lp.simple_func.exists_simple_func_nonneg_ae_eq MeasureTheory.Lp.simpleFunc.exists_simpleFunc_nonneg_ae_eq
+-/
 
 variable (p μ G)
 
+#print MeasureTheory.Lp.simpleFunc.coeSimpleFuncNonnegToLpNonneg /-
 /-- Coercion from nonnegative simple functions of Lp to nonnegative functions of Lp. -/
 def coeSimpleFuncNonnegToLpNonneg :
     { g : Lp.simpleFunc G p μ // 0 ≤ g } → { g : Lp G p μ // 0 ≤ g } := fun g => ⟨g, g.2⟩
 #align measure_theory.Lp.simple_func.coe_simple_func_nonneg_to_Lp_nonneg MeasureTheory.Lp.simpleFunc.coeSimpleFuncNonnegToLpNonneg
+-/
 
+#print MeasureTheory.Lp.simpleFunc.denseRange_coeSimpleFuncNonnegToLpNonneg /-
 theorem denseRange_coeSimpleFuncNonnegToLpNonneg [hp : Fact (1 ≤ p)] (hp_ne_top : p ≠ ∞) :
     DenseRange (coeSimpleFuncNonnegToLpNonneg p μ G) :=
   by
@@ -984,6 +1140,7 @@ theorem denseRange_coeSimpleFuncNonnegToLpNonneg [hp : Fact (1 ≤ p)] (hp_ne_to
     exact h_to_Lp n
   · rw [← coeFn_coeBase]
 #align measure_theory.Lp.simple_func.dense_range_coe_simple_func_nonneg_to_Lp_nonneg MeasureTheory.Lp.simpleFunc.denseRange_coeSimpleFuncNonnegToLpNonneg
+-/
 
 variable {p μ G}
 
@@ -995,6 +1152,7 @@ end Lp
 
 variable [MeasurableSpace α] [NormedAddCommGroup E] {f : α → E} {p : ℝ≥0∞} {μ : Measure α}
 
+#print MeasureTheory.Lp.induction /-
 /-- To prove something for an arbitrary `Lp` function in a second countable Borel normed group, it
 suffices to show that
 * the property holds for (multiples of) characteristic functions;
@@ -1019,7 +1177,9 @@ theorem Lp.induction [_i : Fact (1 ≤ p)] (hp_ne_top : p ≠ ∞) (P : Lp E p 
   · exact fun c s => h_ind c
   · exact fun f g hf hg => h_add hf hg
 #align measure_theory.Lp.induction MeasureTheory.Lp.induction
+-/
 
+#print MeasureTheory.Memℒp.induction /-
 /-- To prove something for an arbitrary `mem_ℒp` function in a second countable
 Borel normed group, it suffices to show that
 * the property holds for (multiples of) characteristic functions;
@@ -1062,7 +1222,9 @@ theorem Memℒp.induction [_i : Fact (1 ≤ p)] (hp_ne_top : p ≠ ∞) (P : (α
     (Lp.simple_func.dense_range hp_ne_top).inductionOn f h_closed this
   exact fun f hf => h_ae hf.coeFn_toLp (Lp.mem_ℒp _) (this (hf.toLp f))
 #align measure_theory.mem_ℒp.induction MeasureTheory.Memℒp.induction
+-/
 
+#print MeasureTheory.Memℒp.induction_dense /-
 /-- If a set of ae strongly measurable functions is stable under addition and approximates
 characteristic functions in `ℒp`, then it is dense in `ℒp`. -/
 theorem Memℒp.induction_dense (hp_ne_top : p ≠ ∞) (P : (α → E) → Prop)
@@ -1115,22 +1277,27 @@ theorem Memℒp.induction_dense (hp_ne_top : p ≠ ∞) (P : (α → E) → Prop
           hg hg').le
     abel
 #align measure_theory.mem_ℒp.induction_dense MeasureTheory.Memℒp.induction_dense
+-/
 
 section Integrable
 
--- mathport name: «expr →₁ₛ[ ] »
 notation:25 α " →₁ₛ[" μ "] " E => @MeasureTheory.Lp.simpleFunc α E _ _ 1 μ
 
+#print MeasureTheory.L1.SimpleFunc.toLp_one_eq_toL1 /-
 theorem L1.SimpleFunc.toLp_one_eq_toL1 (f : α →ₛ E) (hf : Integrable f μ) :
     (Lp.simpleFunc.toLp f (memℒp_one_iff_integrable.2 hf) : α →₁[μ] E) = hf.toL1 f :=
   rfl
 #align measure_theory.L1.simple_func.to_Lp_one_eq_to_L1 MeasureTheory.L1.SimpleFunc.toLp_one_eq_toL1
+-/
 
+#print MeasureTheory.L1.SimpleFunc.integrable /-
 protected theorem L1.SimpleFunc.integrable (f : α →₁ₛ[μ] E) :
     Integrable (Lp.simpleFunc.toSimpleFunc f) μ := by rw [← mem_ℒp_one_iff_integrable];
   exact Lp.simple_func.mem_ℒp f
 #align measure_theory.L1.simple_func.integrable MeasureTheory.L1.SimpleFunc.integrable
+-/
 
+#print MeasureTheory.Integrable.induction /-
 /-- To prove something for an arbitrary integrable function in a normed group,
 it suffices to show that
 * the property holds for (multiples of) characteristic functions;
@@ -1156,6 +1323,7 @@ theorem Integrable.induction (P : (α → E) → Prop)
   simp only [← mem_ℒp_one_iff_integrable] at *
   exact mem_ℒp.induction one_ne_top P h_ind h_add h_closed h_ae
 #align measure_theory.integrable.induction MeasureTheory.Integrable.induction
+-/
 
 end Integrable
 
Diff
@@ -128,7 +128,7 @@ theorem tendsto_approxOn_Lp_snorm [OpensMeasurableSpace E] {f : β → E} (hf :
     eventually_of_forall fun x =>
       rpow_le_rpow (coe_mono (nnnorm_approx_on_le hf h₀ x n)) to_real_nonneg
   -- (3) The bounding function `λ x, ‖f x - y₀‖ ^ p.to_real` has finite integral
-  have h_fin : (∫⁻ a : β, ‖f a - y₀‖₊ ^ p.to_real ∂μ) ≠ ⊤ :=
+  have h_fin : ∫⁻ a : β, ‖f a - y₀‖₊ ^ p.to_real ∂μ ≠ ⊤ :=
     (lintegral_rpow_nnnorm_lt_top_of_snorm_lt_top hp_zero hp_ne_top hi).Ne
   -- (4) The functions "`p`-th power of distance between `f` and the approximation" tend pointwise
   -- to zero
Diff
@@ -181,7 +181,6 @@ theorem memℒp_approxOn [BorelSpace E] {f : β → E} {μ : Measure β} (fmeas
         snorm (fun x => ‖f x - y₀‖ + ‖f x - y₀‖) p μ :=
       snorm_mono_ae this
     _ < ⊤ := snorm_add_lt_top hf' hf'
-    
 #align measure_theory.simple_func.mem_ℒp_approx_on MeasureTheory.SimpleFunc.memℒp_approxOn
 -/
 
Diff
@@ -358,7 +358,7 @@ theorem measure_preimage_lt_top_of_memℒp (hp_pos : p ≠ 0) (hp_ne_top : p ≠
   · simp [hf_snorm]
 #align measure_theory.simple_func.measure_preimage_lt_top_of_mem_ℒp MeasureTheory.SimpleFunc.measure_preimage_lt_top_of_memℒp
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (y «expr ≠ » 0) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (y «expr ≠ » 0) -/
 theorem memℒp_of_finite_measure_preimage (p : ℝ≥0∞) {f : α →ₛ E}
     (hf : ∀ (y) (_ : y ≠ 0), μ (f ⁻¹' {y}) < ∞) : Memℒp f p μ :=
   by
@@ -375,14 +375,14 @@ theorem memℒp_of_finite_measure_preimage (p : ℝ≥0∞) {f : α →ₛ E}
     exact (ENNReal.rpow_lt_top_of_nonneg ENNReal.toReal_nonneg ENNReal.coe_ne_top).Ne
 #align measure_theory.simple_func.mem_ℒp_of_finite_measure_preimage MeasureTheory.SimpleFunc.memℒp_of_finite_measure_preimage
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (y «expr ≠ » 0) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (y «expr ≠ » 0) -/
 theorem memℒp_iff {f : α →ₛ E} (hp_pos : p ≠ 0) (hp_ne_top : p ≠ ∞) :
     Memℒp f p μ ↔ ∀ (y) (_ : y ≠ 0), μ (f ⁻¹' {y}) < ∞ :=
   ⟨fun h => measure_preimage_lt_top_of_memℒp hp_pos hp_ne_top f h, fun h =>
     memℒp_of_finite_measure_preimage p h⟩
 #align measure_theory.simple_func.mem_ℒp_iff MeasureTheory.SimpleFunc.memℒp_iff
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (y «expr ≠ » 0) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (y «expr ≠ » 0) -/
 theorem integrable_iff {f : α →ₛ E} : Integrable f μ ↔ ∀ (y) (_ : y ≠ 0), μ (f ⁻¹' {y}) < ∞ :=
   memℒp_one_iff_integrable.symm.trans <| memℒp_iff one_ne_zero ENNReal.coe_ne_top
 #align measure_theory.simple_func.integrable_iff MeasureTheory.SimpleFunc.integrable_iff
@@ -425,7 +425,7 @@ theorem measure_preimage_lt_top_of_integrable (f : α →ₛ E) (hf : Integrable
   integrable_iff.mp hf x hx
 #align measure_theory.simple_func.measure_preimage_lt_top_of_integrable MeasureTheory.SimpleFunc.measure_preimage_lt_top_of_integrable
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (y «expr ≠ » 0) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (y «expr ≠ » 0) -/
 theorem measure_support_lt_top [Zero β] (f : α →ₛ β) (hf : ∀ (y) (_ : y ≠ 0), μ (f ⁻¹' {y}) < ∞) :
     μ (support f) < ∞ := by
   rw [support_eq]
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Zhouhang Zhou, Yury Kudryashov, Heather Macbeth
 
 ! This file was ported from Lean 3 source module measure_theory.function.simple_func_dense_lp
-! leanprover-community/mathlib commit 5a2df4cd59cb31e97a516d4603a14bed5c2f9425
+! leanprover-community/mathlib commit af471b9e3ce868f296626d33189b4ce730fa4c00
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -14,6 +14,9 @@ import Mathbin.MeasureTheory.Function.SimpleFuncDense
 /-!
 # Density of simple functions
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 Show that each `Lᵖ` Borel measurable function can be approximated in `Lᵖ` norm
 by a sequence of simple functions.
 
@@ -133,7 +136,7 @@ theorem tendsto_approxOn_Lp_snorm [OpensMeasurableSpace E] {f : β → E} (hf :
     ∀ᵐ a : β ∂μ,
       tendsto (fun n => (‖approx_on f hf s y₀ h₀ n a - f a‖₊ : ℝ≥0∞) ^ p.to_real) at_top (𝓝 0) :=
     by
-    filter_upwards [hμ]with a ha
+    filter_upwards [hμ] with a ha
     have : tendsto (fun n => (approx_on f hf s y₀ h₀ n) a - f a) at_top (𝓝 (f a - f a)) :=
       (tendsto_approx_on hf h₀ ha).sub tendsto_const_nhds
     convert continuous_rpow_const.continuous_at.tendsto.comp (tendsto_coe.mpr this.nnnorm)
@@ -142,6 +145,7 @@ theorem tendsto_approxOn_Lp_snorm [OpensMeasurableSpace E] {f : β → E} (hf :
   simpa using tendsto_lintegral_of_dominated_convergence _ hF_meas h_bound h_fin h_lim
 #align measure_theory.simple_func.tendsto_approx_on_Lp_snorm MeasureTheory.SimpleFunc.tendsto_approxOn_Lp_snorm
 
+#print MeasureTheory.SimpleFunc.memℒp_approxOn /-
 theorem memℒp_approxOn [BorelSpace E] {f : β → E} {μ : Measure β} (fmeas : Measurable f)
     (hf : Memℒp f p μ) {s : Set E} {y₀ : E} (h₀ : y₀ ∈ s) [SeparableSpace s]
     (hi₀ : Memℒp (fun x => y₀) p μ) (n : ℕ) : Memℒp (approxOn f fmeas s y₀ h₀ n) p μ :=
@@ -179,6 +183,7 @@ theorem memℒp_approxOn [BorelSpace E] {f : β → E} {μ : Measure β} (fmeas
     _ < ⊤ := snorm_add_lt_top hf' hf'
     
 #align measure_theory.simple_func.mem_ℒp_approx_on MeasureTheory.SimpleFunc.memℒp_approxOn
+-/
 
 theorem tendsto_approxOn_range_Lp_snorm [BorelSpace E] {f : β → E} (hp_ne_top : p ≠ ∞)
     {μ : Measure β} (fmeas : Measurable f) [SeparableSpace (range f ∪ {0} : Set E)]
@@ -199,7 +204,7 @@ theorem memℒp_approxOn_range [BorelSpace E] {f : β → E} {μ : Measure β} (
   memℒp_approxOn fmeas hf (by simp) zero_memℒp n
 #align measure_theory.simple_func.mem_ℒp_approx_on_range MeasureTheory.SimpleFunc.memℒp_approxOn_range
 
-theorem tendsto_approxOn_range_lp [BorelSpace E] {f : β → E} [hp : Fact (1 ≤ p)] (hp_ne_top : p ≠ ∞)
+theorem tendsto_approxOn_range_Lp [BorelSpace E] {f : β → E} [hp : Fact (1 ≤ p)] (hp_ne_top : p ≠ ∞)
     {μ : Measure β} (fmeas : Measurable f) [SeparableSpace (range f ∪ {0} : Set E)]
     (hf : Memℒp f p μ) :
     Tendsto
@@ -209,7 +214,7 @@ theorem tendsto_approxOn_range_lp [BorelSpace E] {f : β → E} [hp : Fact (1 
   by
   simpa only [Lp.tendsto_Lp_iff_tendsto_ℒp''] using
     tendsto_approx_on_range_Lp_snorm hp_ne_top fmeas hf.2
-#align measure_theory.simple_func.tendsto_approx_on_range_Lp MeasureTheory.SimpleFunc.tendsto_approxOn_range_lp
+#align measure_theory.simple_func.tendsto_approx_on_range_Lp MeasureTheory.SimpleFunc.tendsto_approxOn_range_Lp
 
 /-- Any function in `ℒp` can be approximated by a simple function if `p < ∞`. -/
 theorem MeasureTheory.Memℒp.exists_simpleFunc_snorm_sub_lt {E : Type _} [NormedAddCommGroup E]
@@ -223,7 +228,7 @@ theorem MeasureTheory.Memℒp.exists_simpleFunc_snorm_sub_lt {E : Type _} [Norme
     refine' ⟨g, _, g_mem⟩
     convert hg using 1
     apply snorm_congr_ae
-    filter_upwards [hf.1.ae_eq_mk]with x hx
+    filter_upwards [hf.1.ae_eq_mk] with x hx
     simpa only [Pi.sub_apply, sub_left_inj] using hx
   have hf' : mem_ℒp f' p μ := hf.ae_eq hf.1.ae_eq_mk
   have f'meas : Measurable f' := hf.1.measurable_mk
@@ -256,6 +261,7 @@ theorem tendsto_approxOn_L1_nnnorm [OpensMeasurableSpace E] {f : β → E} (hf :
       (by simpa [snorm_one_eq_lintegral_nnnorm] using hi)
 #align measure_theory.simple_func.tendsto_approx_on_L1_nnnorm MeasureTheory.SimpleFunc.tendsto_approxOn_L1_nnnorm
 
+#print MeasureTheory.SimpleFunc.integrable_approxOn /-
 theorem integrable_approxOn [BorelSpace E] {f : β → E} {μ : Measure β} (fmeas : Measurable f)
     (hf : Integrable f μ) {s : Set E} {y₀ : E} (h₀ : y₀ ∈ s) [SeparableSpace s]
     (hi₀ : Integrable (fun x => y₀) μ) (n : ℕ) : Integrable (approxOn f fmeas s y₀ h₀ n) μ :=
@@ -263,6 +269,7 @@ theorem integrable_approxOn [BorelSpace E] {f : β → E} {μ : Measure β} (fme
   rw [← mem_ℒp_one_iff_integrable] at hf hi₀ ⊢
   exact mem_ℒp_approx_on fmeas hf h₀ hi₀ n
 #align measure_theory.simple_func.integrable_approx_on MeasureTheory.SimpleFunc.integrable_approxOn
+-/
 
 theorem tendsto_approxOn_range_L1_nnnorm [OpensMeasurableSpace E] {f : β → E} {μ : Measure β}
     [SeparableSpace (range f ∪ {0} : Set E)] (fmeas : Measurable f) (hf : Integrable f μ) :
@@ -403,15 +410,15 @@ theorem integrable_pair {f : α →ₛ E} {g : α →ₛ F} :
   simpa only [integrable_iff_fin_meas_supp] using fin_meas_supp.pair
 #align measure_theory.simple_func.integrable_pair MeasureTheory.SimpleFunc.integrable_pair
 
-theorem memℒp_of_finiteMeasure (f : α →ₛ E) (p : ℝ≥0∞) (μ : Measure α) [FiniteMeasure μ] :
+theorem memℒp_of_isFiniteMeasure (f : α →ₛ E) (p : ℝ≥0∞) (μ : Measure α) [IsFiniteMeasure μ] :
     Memℒp f p μ :=
   let ⟨C, hfC⟩ := f.exists_forall_norm_le
   Memℒp.of_bound f.AEStronglyMeasurable C <| eventually_of_forall hfC
-#align measure_theory.simple_func.mem_ℒp_of_is_finite_measure MeasureTheory.SimpleFunc.memℒp_of_finiteMeasure
+#align measure_theory.simple_func.mem_ℒp_of_is_finite_measure MeasureTheory.SimpleFunc.memℒp_of_isFiniteMeasure
 
-theorem integrable_of_finiteMeasure [FiniteMeasure μ] (f : α →ₛ E) : Integrable f μ :=
-  memℒp_one_iff_integrable.mp (f.memℒp_of_finiteMeasure 1 μ)
-#align measure_theory.simple_func.integrable_of_is_finite_measure MeasureTheory.SimpleFunc.integrable_of_finiteMeasure
+theorem integrable_of_isFiniteMeasure [IsFiniteMeasure μ] (f : α →ₛ E) : Integrable f μ :=
+  memℒp_one_iff_integrable.mp (f.memℒp_of_isFiniteMeasure 1 μ)
+#align measure_theory.simple_func.integrable_of_is_finite_measure MeasureTheory.SimpleFunc.integrable_of_isFiniteMeasure
 
 theorem measure_preimage_lt_top_of_integrable (f : α →ₛ E) (hf : Integrable f μ) {x : E}
     (hx : x ≠ 0) : μ (f ⁻¹' {x}) < ∞ :=
@@ -466,7 +473,7 @@ variable (E)
     function. -/
 def simpleFunc : AddSubgroup (Lp E p μ)
     where
-  carrier := { f : Lp E p μ | ∃ s : α →ₛ E, (AEEqFun.mk s s.AEStronglyMeasurable : α →ₘ[μ] E) = f }
+  carrier := {f : Lp E p μ | ∃ s : α →ₛ E, (AEEqFun.mk s s.AEStronglyMeasurable : α →ₘ[μ] E) = f}
   zero_mem' := ⟨0, rfl⟩
   add_mem' := fun f g ⟨s, hs⟩ ⟨t, ht⟩ =>
     ⟨s + t, by
@@ -507,7 +514,7 @@ variable [NormedRing 𝕜] [Module 𝕜 E] [BoundedSMul 𝕜 E]
 
 /-- If `E` is a normed space, `Lp.simple_func E p μ` is a `has_smul`. Not declared as an
 instance as it is (as of writing) used only in the construction of the Bochner integral. -/
-protected def hasSmul : SMul 𝕜 (Lp.simpleFunc E p μ) :=
+protected def smul : SMul 𝕜 (Lp.simpleFunc E p μ) :=
   ⟨fun k f =>
     ⟨k • f, by
       rcases f with ⟨f, ⟨s, hs⟩⟩
@@ -515,7 +522,7 @@ protected def hasSmul : SMul 𝕜 (Lp.simpleFunc E p μ) :=
       apply Eq.trans (ae_eq_fun.smul_mk k s s.ae_strongly_measurable).symm _
       rw [hs]
       rfl⟩⟩
-#align measure_theory.Lp.simple_func.has_smul MeasureTheory.Lp.simpleFunc.hasSmul
+#align measure_theory.Lp.simple_func.has_smul MeasureTheory.Lp.simpleFunc.smul
 
 attribute [local instance] simple_func.has_smul
 
@@ -627,28 +634,27 @@ protected theorem stronglyMeasurable (f : Lp.simpleFunc E p μ) :
 #align measure_theory.Lp.simple_func.strongly_measurable MeasureTheory.Lp.simpleFunc.stronglyMeasurable
 
 @[measurability]
-protected theorem aEMeasurable [MeasurableSpace E] (f : Lp.simpleFunc E p μ) :
+protected theorem aemeasurable [MeasurableSpace E] (f : Lp.simpleFunc E p μ) :
     AEMeasurable (toSimpleFunc f) μ :=
   (simpleFunc.measurable f).AEMeasurable
-#align measure_theory.Lp.simple_func.ae_measurable MeasureTheory.Lp.simpleFunc.aEMeasurable
+#align measure_theory.Lp.simple_func.ae_measurable MeasureTheory.Lp.simpleFunc.aemeasurable
 
-protected theorem aEStronglyMeasurable (f : Lp.simpleFunc E p μ) :
+protected theorem aestronglyMeasurable (f : Lp.simpleFunc E p μ) :
     AEStronglyMeasurable (toSimpleFunc f) μ :=
   (simpleFunc.stronglyMeasurable f).AEStronglyMeasurable
-#align measure_theory.Lp.simple_func.ae_strongly_measurable MeasureTheory.Lp.simpleFunc.aEStronglyMeasurable
+#align measure_theory.Lp.simple_func.ae_strongly_measurable MeasureTheory.Lp.simpleFunc.aestronglyMeasurable
 
-theorem toSimpleFunc_eq_to_fun (f : Lp.simpleFunc E p μ) : toSimpleFunc f =ᵐ[μ] f :=
+theorem toSimpleFunc_eq_toFun (f : Lp.simpleFunc E p μ) : toSimpleFunc f =ᵐ[μ] f :=
   show ⇑(toSimpleFunc f) =ᵐ[μ] ⇑(f : α →ₘ[μ] E)
     by
-    convert(ae_eq_fun.coe_fn_mk (to_simple_func f)
-          (to_simple_func f).AEStronglyMeasurable).symm using
-      2
+    convert
+      (ae_eq_fun.coe_fn_mk (to_simple_func f) (to_simple_func f).AEStronglyMeasurable).symm using 2
     exact (Classical.choose_spec f.2).symm
-#align measure_theory.Lp.simple_func.to_simple_func_eq_to_fun MeasureTheory.Lp.simpleFunc.toSimpleFunc_eq_to_fun
+#align measure_theory.Lp.simple_func.to_simple_func_eq_to_fun MeasureTheory.Lp.simpleFunc.toSimpleFunc_eq_toFun
 
 /-- `to_simple_func f` satisfies the predicate `mem_ℒp`. -/
 protected theorem memℒp (f : Lp.simpleFunc E p μ) : Memℒp (toSimpleFunc f) p μ :=
-  Memℒp.ae_eq (toSimpleFunc_eq_to_fun f).symm <| mem_Lp_iff_memℒp.mp (f : Lp E p μ).2
+  Memℒp.ae_eq (toSimpleFunc_eq_toFun f).symm <| mem_Lp_iff_memℒp.mp (f : Lp E p μ).2
 #align measure_theory.Lp.simple_func.mem_ℒp MeasureTheory.Lp.simpleFunc.memℒp
 
 theorem toLp_toSimpleFunc (f : Lp.simpleFunc E p μ) :
@@ -664,8 +670,8 @@ variable (E μ)
 
 theorem zero_toSimpleFunc : toSimpleFunc (0 : Lp.simpleFunc E p μ) =ᵐ[μ] 0 :=
   by
-  filter_upwards [to_simple_func_eq_to_fun (0 : Lp.simple_func E p μ),
-    Lp.coe_fn_zero E 1 μ]with _ h₁ _
+  filter_upwards [to_simple_func_eq_to_fun (0 : Lp.simple_func E p μ), Lp.coe_fn_zero E 1 μ] with _
+    h₁ _
   rwa [h₁]
 #align measure_theory.Lp.simple_func.zero_to_simple_func MeasureTheory.Lp.simpleFunc.zero_toSimpleFunc
 
@@ -675,7 +681,7 @@ theorem add_toSimpleFunc (f g : Lp.simpleFunc E p μ) :
     toSimpleFunc (f + g) =ᵐ[μ] toSimpleFunc f + toSimpleFunc g :=
   by
   filter_upwards [to_simple_func_eq_to_fun (f + g), to_simple_func_eq_to_fun f,
-    to_simple_func_eq_to_fun g, Lp.coe_fn_add (f : Lp E p μ) g]with _
+    to_simple_func_eq_to_fun g, Lp.coe_fn_add (f : Lp E p μ) g] with _
   simp only [← coe_coe, AddSubgroup.coe_add, Pi.add_apply]
   iterate 4 intro h; rw [h]
 #align measure_theory.Lp.simple_func.add_to_simple_func MeasureTheory.Lp.simpleFunc.add_toSimpleFunc
@@ -683,7 +689,7 @@ theorem add_toSimpleFunc (f g : Lp.simpleFunc E p μ) :
 theorem neg_toSimpleFunc (f : Lp.simpleFunc E p μ) : toSimpleFunc (-f) =ᵐ[μ] -toSimpleFunc f :=
   by
   filter_upwards [to_simple_func_eq_to_fun (-f), to_simple_func_eq_to_fun f,
-    Lp.coe_fn_neg (f : Lp E p μ)]with _
+    Lp.coe_fn_neg (f : Lp E p μ)] with _
   simp only [Pi.neg_apply, AddSubgroup.coe_neg, ← coe_coe]
   repeat' intro h; rw [h]
 #align measure_theory.Lp.simple_func.neg_to_simple_func MeasureTheory.Lp.simpleFunc.neg_toSimpleFunc
@@ -692,7 +698,7 @@ theorem sub_toSimpleFunc (f g : Lp.simpleFunc E p μ) :
     toSimpleFunc (f - g) =ᵐ[μ] toSimpleFunc f - toSimpleFunc g :=
   by
   filter_upwards [to_simple_func_eq_to_fun (f - g), to_simple_func_eq_to_fun f,
-    to_simple_func_eq_to_fun g, Lp.coe_fn_sub (f : Lp E p μ) g]with _
+    to_simple_func_eq_to_fun g, Lp.coe_fn_sub (f : Lp E p μ) g] with _
   simp only [AddSubgroup.coe_sub, Pi.sub_apply, ← coe_coe]
   repeat' intro h; rw [h]
 #align measure_theory.Lp.simple_func.sub_to_simple_func MeasureTheory.Lp.simpleFunc.sub_toSimpleFunc
@@ -703,7 +709,7 @@ theorem smul_toSimpleFunc (k : 𝕜) (f : Lp.simpleFunc E p μ) :
     toSimpleFunc (k • f) =ᵐ[μ] k • toSimpleFunc f :=
   by
   filter_upwards [to_simple_func_eq_to_fun (k • f), to_simple_func_eq_to_fun f,
-    Lp.coe_fn_smul k (f : Lp E p μ)]with _
+    Lp.coe_fn_smul k (f : Lp E p μ)] with _
   simp only [Pi.smul_apply, coe_smul, ← coe_coe]
   repeat' intro h; rw [h]
 #align measure_theory.Lp.simple_func.smul_to_simple_func MeasureTheory.Lp.simpleFunc.smul_toSimpleFunc
@@ -811,8 +817,8 @@ protected theorem denseEmbedding (hp_ne_top : p ≠ ∞) :
             n)
           (simple_func.mem_ℒp_approx_on_range (Lp.strongly_measurable f).Measurable hfi' n)),
       fun n => mem_range_self _, _⟩
-  convert simple_func.tendsto_approx_on_range_Lp hp_ne_top (Lp.strongly_measurable f).Measurable
-      hfi'
+  convert
+    simple_func.tendsto_approx_on_range_Lp hp_ne_top (Lp.strongly_measurable f).Measurable hfi'
   rw [to_Lp_coe_fn f (Lp.mem_ℒp f)]
 #align measure_theory.Lp.simple_func.dense_embedding MeasureTheory.Lp.simpleFunc.denseEmbedding
 
@@ -857,7 +863,7 @@ instance : CovariantClass (Lp.simpleFunc G p μ) (Lp.simpleFunc G p μ) (· + ·
   rw [← Lp.simple_func.coe_fn_le] at hg₁₂ ⊢
   have h_add_1 : ⇑(f + g₁) =ᵐ[μ] f + g₁ := Lp.coe_fn_add _ _
   have h_add_2 : ⇑(f + g₂) =ᵐ[μ] f + g₂ := Lp.coe_fn_add _ _
-  filter_upwards [h_add_1, h_add_2, hg₁₂]with _ h1 h2 h3
+  filter_upwards [h_add_1, h_add_2, hg₁₂] with _ h1 h2 h3
   rw [h1, h2, Pi.add_apply, Pi.add_apply]
   exact add_le_add le_rfl h3
 
@@ -873,7 +879,7 @@ theorem coeFn_nonneg (f : Lp.simpleFunc G p μ) : 0 ≤ᵐ[μ] f ↔ 0 ≤ f :=
   by
   rw [← Lp.simple_func.coe_fn_le]
   have h0 : (0 : Lp.simple_func G p μ) =ᵐ[μ] (0 : α → G) := Lp.simple_func.coe_fn_zero p μ G
-  constructor <;> intro h <;> filter_upwards [h, h0]with _ _ h2
+  constructor <;> intro h <;> filter_upwards [h, h0] with _ _ h2
   · rwa [h2]
   · rwa [← h2]
 #align measure_theory.Lp.simple_func.coe_fn_nonneg MeasureTheory.Lp.simpleFunc.coeFn_nonneg
@@ -883,15 +889,15 @@ theorem exists_simpleFunc_nonneg_ae_eq {f : Lp.simpleFunc G p μ} (hf : 0 ≤ f)
   by
   rw [← Lp.simple_func.coe_fn_nonneg] at hf 
   have hf_ae : 0 ≤ᵐ[μ] simple_func.to_simple_func f := by
-    filter_upwards [to_simple_func_eq_to_fun f, hf]with _ h1 _; rwa [h1]
-  let s := to_measurable μ { x | ¬0 ≤ simple_func.to_simple_func f x }ᶜ
+    filter_upwards [to_simple_func_eq_to_fun f, hf] with _ h1 _; rwa [h1]
+  let s := to_measurable μ {x | ¬0 ≤ simple_func.to_simple_func f x}ᶜ
   have hs_zero : μ (sᶜ) = 0 := by rw [compl_compl, measure_to_measurable];
     rwa [eventually_le, ae_iff] at hf_ae 
   have hfs_nonneg : ∀ x ∈ s, 0 ≤ simple_func.to_simple_func f x :=
     by
     intro x hxs
     rw [mem_compl_iff] at hxs 
-    have hx' : x ∉ { a : α | ¬0 ≤ simple_func.to_simple_func f a } := fun h =>
+    have hx' : x ∉ {a : α | ¬0 ≤ simple_func.to_simple_func f a} := fun h =>
       hxs (subset_to_measurable μ _ h)
     rwa [Set.nmem_setOf_iff, Classical.not_not] at hx' 
   let f' :=
@@ -926,10 +932,10 @@ theorem denseRange_coeSimpleFuncNonnegToLpNonneg [hp : Fact (1 ≤ p)] (hp_ne_to
   intro g
   rw [mem_closure_iff_seq_limit]
   have hg_mem_ℒp : mem_ℒp g p μ := Lp.mem_ℒp g
-  have zero_mem : (0 : G) ∈ (range g ∪ {0} : Set G) ∩ { y | 0 ≤ y } := by
+  have zero_mem : (0 : G) ∈ (range g ∪ {0} : Set G) ∩ {y | 0 ≤ y} := by
     simp only [union_singleton, mem_inter_iff, mem_insert_iff, eq_self_iff_true, true_or_iff,
       mem_set_of_eq, le_refl, and_self_iff]
-  have : separable_space ((range g ∪ {0}) ∩ { y | 0 ≤ y } : Set G) :=
+  have : separable_space ((range g ∪ {0}) ∩ {y | 0 ≤ y} : Set G) :=
     by
     apply is_separable.separable_space
     apply is_separable.mono _ (Set.inter_subset_left _ _)
@@ -937,11 +943,11 @@ theorem denseRange_coeSimpleFuncNonnegToLpNonneg [hp : Fact (1 ≤ p)] (hp_ne_to
       (Lp.strongly_measurable (g : Lp G p μ)).isSeparable_range.union
         (finite_singleton _).IsSeparable
   have g_meas : Measurable g := (Lp.strongly_measurable (g : Lp G p μ)).Measurable
-  let x n := simple_func.approx_on g g_meas ((range g ∪ {0}) ∩ { y | 0 ≤ y }) 0 zero_mem n
+  let x n := simple_func.approx_on g g_meas ((range g ∪ {0}) ∩ {y | 0 ≤ y}) 0 zero_mem n
   have hx_nonneg : ∀ n, 0 ≤ x n := by
     intro n a
-    change x n a ∈ { y : G | 0 ≤ y }
-    have A : (range g ∪ {0} : Set G) ∩ { y | 0 ≤ y } ⊆ { y | 0 ≤ y } := inter_subset_right _ _
+    change x n a ∈ {y : G | 0 ≤ y}
+    have A : (range g ∪ {0} : Set G) ∩ {y | 0 ≤ y} ⊆ {y | 0 ≤ y} := inter_subset_right _ _
     apply A
     exact simple_func.approx_on_mem g_meas _ n a
   have hx_mem_ℒp : ∀ n, mem_ℒp (x n) p μ :=
@@ -953,7 +959,7 @@ theorem denseRange_coeSimpleFuncNonnegToLpNonneg [hp : Fact (1 ≤ p)] (hp_ne_to
     rw [← Lp.simple_func.coe_fn_le, coeFn_coe_base' (simple_func.to_Lp (x n) _),
       Lp.simple_func.to_Lp_eq_to_Lp]
     have h0 := Lp.simple_func.coe_fn_zero p μ G
-    filter_upwards [Lp.simple_func.coe_fn_zero p μ G, h_to_Lp n]with a ha0 ha_to_Lp
+    filter_upwards [Lp.simple_func.coe_fn_zero p μ G, h_to_Lp n] with a ha0 ha_to_Lp
     rw [ha0, ha_to_Lp]
     exact hx_nonneg n a
   have hx_tendsto : tendsto (fun n : ℕ => snorm (x n - g) p μ) at_top (𝓝 0) :=
@@ -1007,7 +1013,7 @@ theorem Lp.induction [_i : Fact (1 ≤ p)] (hp_ne_top : p ≠ ∞) (P : Lp E p 
           ∀ hg : Memℒp g p μ,
             Disjoint (support f) (support g) →
               P (hf.toLp f) → P (hg.toLp g) → P (hf.toLp f + hg.toLp g))
-    (h_closed : IsClosed { f : Lp E p μ | P f }) : ∀ f : Lp E p μ, P f :=
+    (h_closed : IsClosed {f : Lp E p μ | P f}) : ∀ f : Lp E p μ, P f :=
   by
   refine' fun f => (Lp.simple_func.dense_range hp_ne_top).inductionOn f h_closed _
   refine' Lp.simple_func.induction (lt_of_lt_of_le zero_lt_one _i.elim).ne' hp_ne_top _ _
@@ -1033,7 +1039,7 @@ theorem Memℒp.induction [_i : Fact (1 ≤ p)] (hp_ne_top : p ≠ ∞) (P : (α
     (h_add :
       ∀ ⦃f g : α → E⦄,
         Disjoint (support f) (support g) → Memℒp f p μ → Memℒp g p μ → P f → P g → P (f + g))
-    (h_closed : IsClosed { f : Lp E p μ | P f })
+    (h_closed : IsClosed {f : Lp E p μ | P f})
     (h_ae : ∀ ⦃f g⦄, f =ᵐ[μ] g → Memℒp f p μ → P f → P g) : ∀ ⦃f : α → E⦄ (hf : Memℒp f p μ), P f :=
   by
   have : ∀ f : simple_func α E, mem_ℒp f p μ → P f :=
@@ -1079,7 +1085,8 @@ theorem Memℒp.induction_dense (hp_ne_top : p ≠ ∞) (P : (α → E) → Prop
     rcases hf.exists_simple_func_snorm_sub_lt hp_ne_top ηpos.ne' with ⟨f', hf', f'_mem⟩
     rcases H f' η ηpos.ne' f'_mem with ⟨g, hg, Pg⟩
     refine' ⟨g, _, Pg⟩
-    convert(hη _ _ (hf.ae_strongly_measurable.sub f'.ae_strongly_measurable)
+    convert
+      (hη _ _ (hf.ae_strongly_measurable.sub f'.ae_strongly_measurable)
           (f'.ae_strongly_measurable.sub (h2P g Pg)) hf'.le hg).le
     simp only [sub_add_sub_cancel]
   refine' simple_func.induction _ _
@@ -1104,8 +1111,9 @@ theorem Memℒp.induction_dense (hp_ne_top : p ≠ ∞) (P : (α → E) → Prop
     rcases hf η ηpos.ne' int_ff'.1 with ⟨g, hg, Pg⟩
     rcases hf' η ηpos.ne' int_ff'.2 with ⟨g', hg', Pg'⟩
     refine' ⟨g + g', _, h1P g g' Pg Pg'⟩
-    convert(hη _ _ (f.ae_strongly_measurable.sub (h2P g Pg))
-          (f'.ae_strongly_measurable.sub (h2P g' Pg')) hg hg').le
+    convert
+      (hη _ _ (f.ae_strongly_measurable.sub (h2P g Pg)) (f'.ae_strongly_measurable.sub (h2P g' Pg'))
+          hg hg').le
     abel
 #align measure_theory.mem_ℒp.induction_dense MeasureTheory.Memℒp.induction_dense
 
@@ -1142,7 +1150,7 @@ theorem Integrable.induction (P : (α → E) → Prop)
     (h_add :
       ∀ ⦃f g : α → E⦄,
         Disjoint (support f) (support g) → Integrable f μ → Integrable g μ → P f → P g → P (f + g))
-    (h_closed : IsClosed { f : α →₁[μ] E | P f })
+    (h_closed : IsClosed {f : α →₁[μ] E | P f})
     (h_ae : ∀ ⦃f g⦄, f =ᵐ[μ] g → Integrable f μ → P f → P g) :
     ∀ ⦃f : α → E⦄ (hf : Integrable f μ), P f :=
   by
Diff
@@ -73,8 +73,8 @@ theorem nnnorm_approxOn_le [OpensMeasurableSpace E] {f : β → E} (hf : Measura
     ‖approxOn f hf s y₀ h₀ n x - f x‖₊ ≤ ‖f x - y₀‖₊ :=
   by
   have := edist_approx_on_le hf h₀ x n
-  rw [edist_comm y₀] at this
-  simp only [edist_nndist, nndist_eq_nnnorm] at this
+  rw [edist_comm y₀] at this 
+  simp only [edist_nndist, nndist_eq_nnnorm] at this 
   exact_mod_cast this
 #align measure_theory.simple_func.nnnorm_approx_on_le MeasureTheory.SimpleFunc.nnnorm_approxOn_le
 
@@ -83,7 +83,7 @@ theorem norm_approxOn_y₀_le [OpensMeasurableSpace E] {f : β → E} (hf : Meas
     ‖approxOn f hf s y₀ h₀ n x - y₀‖ ≤ ‖f x - y₀‖ + ‖f x - y₀‖ :=
   by
   have := edist_approx_on_y0_le hf h₀ x n
-  repeat' rw [edist_comm y₀, edist_eq_coe_nnnorm_sub] at this
+  repeat' rw [edist_comm y₀, edist_eq_coe_nnnorm_sub] at this 
   exact_mod_cast this
 #align measure_theory.simple_func.norm_approx_on_y₀_le MeasureTheory.SimpleFunc.norm_approxOn_y₀_le
 
@@ -92,7 +92,7 @@ theorem norm_approxOn_zero_le [OpensMeasurableSpace E] {f : β → E} (hf : Meas
     ‖approxOn f hf s 0 h₀ n x‖ ≤ ‖f x‖ + ‖f x‖ :=
   by
   have := edist_approx_on_y0_le hf h₀ x n
-  simp [edist_comm (0 : E), edist_eq_coe_nnnorm] at this
+  simp [edist_comm (0 : E), edist_eq_coe_nnnorm] at this 
   exact_mod_cast this
 #align measure_theory.simple_func.norm_approx_on_zero_le MeasureTheory.SimpleFunc.norm_approxOn_zero_le
 
@@ -232,7 +232,7 @@ theorem MeasureTheory.Memℒp.exists_simpleFunc_snorm_sub_lt {E : Type _} [Norme
   rcases((tendsto_order.1 (tendsto_approx_on_range_Lp_snorm hp_ne_top f'meas hf'.2)).2 ε
         hε.bot_lt).exists with
     ⟨n, hn⟩
-  rw [← snorm_neg, neg_sub] at hn
+  rw [← snorm_neg, neg_sub] at hn 
   exact ⟨_, hn, mem_ℒp_approx_on_range f'meas hf' _⟩
 #align measure_theory.mem_ℒp.exists_simple_func_snorm_sub_lt MeasureTheory.Memℒp.exists_simpleFunc_snorm_sub_lt
 
@@ -260,7 +260,7 @@ theorem integrable_approxOn [BorelSpace E] {f : β → E} {μ : Measure β} (fme
     (hf : Integrable f μ) {s : Set E} {y₀ : E} (h₀ : y₀ ∈ s) [SeparableSpace s]
     (hi₀ : Integrable (fun x => y₀) μ) (n : ℕ) : Integrable (approxOn f fmeas s y₀ h₀ n) μ :=
   by
-  rw [← mem_ℒp_one_iff_integrable] at hf hi₀⊢
+  rw [← mem_ℒp_one_iff_integrable] at hf hi₀ ⊢
   exact mem_ℒp_approx_on fmeas hf h₀ hi₀ n
 #align measure_theory.simple_func.integrable_approx_on MeasureTheory.SimpleFunc.integrable_approxOn
 
@@ -331,7 +331,7 @@ theorem measure_preimage_lt_top_of_memℒp (hp_pos : p ≠ 0) (hp_ne_top : p ≠
   rw [snorm_eq_snorm' hp_pos hp_ne_top, f.snorm'_eq, ←
     @ENNReal.lt_rpow_one_div_iff _ _ (1 / p.to_real) (by simp [hp_pos_real]),
     @ENNReal.top_rpow_of_pos (1 / (1 / p.to_real)) (by simp [hp_pos_real]),
-    ENNReal.sum_lt_top_iff] at hf_snorm
+    ENNReal.sum_lt_top_iff] at hf_snorm 
   by_cases hyf : y ∈ f.range
   swap
   · suffices h_empty : f ⁻¹' {y} = ∅
@@ -342,7 +342,7 @@ theorem measure_preimage_lt_top_of_memℒp (hp_pos : p ≠ 0) (hp_ne_top : p ≠
     rw [mem_range, Set.mem_range]
     exact ⟨x, hxy⟩
   specialize hf_snorm y hyf
-  rw [ENNReal.mul_lt_top_iff] at hf_snorm
+  rw [ENNReal.mul_lt_top_iff] at hf_snorm 
   cases hf_snorm
   · exact hf_snorm.2
   cases hf_snorm
@@ -423,7 +423,7 @@ theorem measure_support_lt_top [Zero β] (f : α →ₛ β) (hf : ∀ (y) (_ : y
     μ (support f) < ∞ := by
   rw [support_eq]
   refine' (measure_bUnion_finset_le _ _).trans_lt (ennreal.sum_lt_top_iff.mpr fun y hy => _)
-  rw [Finset.mem_filter] at hy
+  rw [Finset.mem_filter] at hy 
   exact hf y hy.2
 #align measure_theory.simple_func.measure_support_lt_top MeasureTheory.SimpleFunc.measure_support_lt_top
 
@@ -854,7 +854,7 @@ theorem coeFn_le (f g : Lp.simpleFunc G p μ) : f ≤ᵐ[μ] g ↔ f ≤ g := by
 instance : CovariantClass (Lp.simpleFunc G p μ) (Lp.simpleFunc G p μ) (· + ·) (· ≤ ·) :=
   by
   refine' ⟨fun f g₁ g₂ hg₁₂ => _⟩
-  rw [← Lp.simple_func.coe_fn_le] at hg₁₂⊢
+  rw [← Lp.simple_func.coe_fn_le] at hg₁₂ ⊢
   have h_add_1 : ⇑(f + g₁) =ᵐ[μ] f + g₁ := Lp.coe_fn_add _ _
   have h_add_2 : ⇑(f + g₂) =ᵐ[μ] f + g₂ := Lp.coe_fn_add _ _
   filter_upwards [h_add_1, h_add_2, hg₁₂]with _ h1 h2 h3
@@ -881,19 +881,19 @@ theorem coeFn_nonneg (f : Lp.simpleFunc G p μ) : 0 ≤ᵐ[μ] f ↔ 0 ≤ f :=
 theorem exists_simpleFunc_nonneg_ae_eq {f : Lp.simpleFunc G p μ} (hf : 0 ≤ f) :
     ∃ f' : α →ₛ G, 0 ≤ f' ∧ f =ᵐ[μ] f' :=
   by
-  rw [← Lp.simple_func.coe_fn_nonneg] at hf
+  rw [← Lp.simple_func.coe_fn_nonneg] at hf 
   have hf_ae : 0 ≤ᵐ[μ] simple_func.to_simple_func f := by
     filter_upwards [to_simple_func_eq_to_fun f, hf]with _ h1 _; rwa [h1]
   let s := to_measurable μ { x | ¬0 ≤ simple_func.to_simple_func f x }ᶜ
   have hs_zero : μ (sᶜ) = 0 := by rw [compl_compl, measure_to_measurable];
-    rwa [eventually_le, ae_iff] at hf_ae
+    rwa [eventually_le, ae_iff] at hf_ae 
   have hfs_nonneg : ∀ x ∈ s, 0 ≤ simple_func.to_simple_func f x :=
     by
     intro x hxs
-    rw [mem_compl_iff] at hxs
+    rw [mem_compl_iff] at hxs 
     have hx' : x ∉ { a : α | ¬0 ≤ simple_func.to_simple_func f a } := fun h =>
       hxs (subset_to_measurable μ _ h)
-    rwa [Set.nmem_setOf_iff, Classical.not_not] at hx'
+    rwa [Set.nmem_setOf_iff, Classical.not_not] at hx' 
   let f' :=
     simple_func.piecewise s (measurable_set_to_measurable μ _).compl (simple_func.to_simple_func f)
       (simple_func.const α (0 : G))
@@ -969,7 +969,7 @@ theorem denseRange_coeSimpleFuncNonnegToLpNonneg [hp : Fact (1 ≤ p)] (hp_ne_to
       fun n => mem_range_self _, _⟩
   suffices tendsto (fun n : ℕ => ↑(to_Lp (x n) (hx_mem_ℒp n))) at_top (𝓝 (g : Lp G p μ))
     by
-    rw [tendsto_iff_dist_tendsto_zero] at this⊢
+    rw [tendsto_iff_dist_tendsto_zero] at this ⊢
     simp_rw [Subtype.dist_eq]
     convert this
   rw [Lp.tendsto_Lp_iff_tendsto_ℒp']
@@ -1046,7 +1046,7 @@ theorem Memℒp.induction [_i : Fact (1 ≤ p)] (hp_ne_top : p ≠ ∞) (P : (α
       exact h_ind c hs (simple_func.measure_lt_top_of_mem_ℒp_indicator hp_pos hp_ne_top hc hs h)
     · intro f g hfg hf hg int_fg
       rw [simple_func.coe_add,
-        mem_ℒp_add_of_disjoint hfg f.strongly_measurable g.strongly_measurable] at int_fg
+        mem_ℒp_add_of_disjoint hfg f.strongly_measurable g.strongly_measurable] at int_fg 
       refine' h_add hfg int_fg.1 int_fg.2 (hf int_fg.1) (hg int_fg.2)
   have : ∀ f : Lp.simple_func E p μ, P f := by
     intro f
@@ -1087,7 +1087,7 @@ theorem Memℒp.induction_dense (hp_ne_top : p ≠ ∞) (P : (α → E) → Prop
     rcases eq_or_ne c 0 with (rfl | hc)
     · rcases h0P (0 : E) MeasurableSet.empty (by simp only [measure_empty, WithTop.zero_lt_top])
           εpos with ⟨g, hg, Pg⟩
-      rw [← snorm_neg, neg_sub] at hg
+      rw [← snorm_neg, neg_sub] at hg 
       refine' ⟨g, _, Pg⟩
       convert hg
       ext x
@@ -1095,12 +1095,12 @@ theorem Memℒp.induction_dense (hp_ne_top : p ≠ ∞) (P : (α → E) → Prop
         piecewise_eq_indicator, indicator_zero', Pi.zero_apply, indicator_zero]
     · have : μ s < ∞ := simple_func.measure_lt_top_of_mem_ℒp_indicator hp_pos hp_ne_top hc hs Hs
       rcases h0P c hs this εpos with ⟨g, hg, Pg⟩
-      rw [← snorm_neg, neg_sub] at hg
+      rw [← snorm_neg, neg_sub] at hg 
       exact ⟨g, hg, Pg⟩
   · intro f f' hff' hf hf' δ δpos int_ff'
     obtain ⟨η, ηpos, hη⟩ := exists_Lp_half E μ p δpos
     rw [simple_func.coe_add,
-      mem_ℒp_add_of_disjoint hff' f.strongly_measurable f'.strongly_measurable] at int_ff'
+      mem_ℒp_add_of_disjoint hff' f.strongly_measurable f'.strongly_measurable] at int_ff' 
     rcases hf η ηpos.ne' int_ff'.1 with ⟨g, hg, Pg⟩
     rcases hf' η ηpos.ne' int_ff'.2 with ⟨g', hg', Pg'⟩
     refine' ⟨g + g', _, h1P g g' Pg Pg'⟩
Diff
@@ -464,9 +464,9 @@ variable (E)
 
 /-- `Lp.simple_func` is a subspace of Lp consisting of equivalence classes of an integrable simple
     function. -/
-def simpleFunc : AddSubgroup (lp E p μ)
+def simpleFunc : AddSubgroup (Lp E p μ)
     where
-  carrier := { f : lp E p μ | ∃ s : α →ₛ E, (AEEqFun.mk s s.AEStronglyMeasurable : α →ₘ[μ] E) = f }
+  carrier := { f : Lp E p μ | ∃ s : α →ₛ E, (AEEqFun.mk s s.AEStronglyMeasurable : α →ₘ[μ] E) = f }
   zero_mem' := ⟨0, rfl⟩
   add_mem' := fun f g ⟨s, hs⟩ ⟨t, ht⟩ =>
     ⟨s + t, by
@@ -476,7 +476,7 @@ def simpleFunc : AddSubgroup (lp E p μ)
     ⟨-s, by
       simp only [← hs, ae_eq_fun.neg_mk, simple_func.coe_neg, ae_eq_fun.mk_eq_mk,
         AddSubgroup.coe_neg]⟩
-#align measure_theory.Lp.simple_func MeasureTheory.lp.simpleFunc
+#align measure_theory.Lp.simple_func MeasureTheory.Lp.simpleFunc
 
 variable {E p μ}
 
@@ -488,13 +488,13 @@ section Instances
 
 
 @[norm_cast]
-theorem coe_coe (f : lp.simpleFunc E p μ) : ⇑(f : lp E p μ) = f :=
+theorem coe_coe (f : Lp.simpleFunc E p μ) : ⇑(f : Lp E p μ) = f :=
   rfl
-#align measure_theory.Lp.simple_func.coe_coe MeasureTheory.lp.simpleFunc.coe_coe
+#align measure_theory.Lp.simple_func.coe_coe MeasureTheory.Lp.simpleFunc.coe_coe
 
-protected theorem eq' {f g : lp.simpleFunc E p μ} : (f : α →ₘ[μ] E) = (g : α →ₘ[μ] E) → f = g :=
+protected theorem eq' {f g : Lp.simpleFunc E p μ} : (f : α →ₘ[μ] E) = (g : α →ₘ[μ] E) → f = g :=
   Subtype.eq ∘ Subtype.eq
-#align measure_theory.Lp.simple_func.eq' MeasureTheory.lp.simpleFunc.eq'
+#align measure_theory.Lp.simple_func.eq' MeasureTheory.Lp.simpleFunc.eq'
 
 /-! Implementation note:  If `Lp.simple_func E p μ` were defined as a `𝕜`-submodule of `Lp E p μ`,
 then the next few lemmas, putting a normed `𝕜`-group structure on `Lp.simple_func E p μ`, would be
@@ -507,7 +507,7 @@ variable [NormedRing 𝕜] [Module 𝕜 E] [BoundedSMul 𝕜 E]
 
 /-- If `E` is a normed space, `Lp.simple_func E p μ` is a `has_smul`. Not declared as an
 instance as it is (as of writing) used only in the construction of the Bochner integral. -/
-protected def hasSmul : SMul 𝕜 (lp.simpleFunc E p μ) :=
+protected def hasSmul : SMul 𝕜 (Lp.simpleFunc E p μ) :=
   ⟨fun k f =>
     ⟨k • f, by
       rcases f with ⟨f, ⟨s, hs⟩⟩
@@ -515,19 +515,19 @@ protected def hasSmul : SMul 𝕜 (lp.simpleFunc E p μ) :=
       apply Eq.trans (ae_eq_fun.smul_mk k s s.ae_strongly_measurable).symm _
       rw [hs]
       rfl⟩⟩
-#align measure_theory.Lp.simple_func.has_smul MeasureTheory.lp.simpleFunc.hasSmul
+#align measure_theory.Lp.simple_func.has_smul MeasureTheory.Lp.simpleFunc.hasSmul
 
 attribute [local instance] simple_func.has_smul
 
 @[simp, norm_cast]
-theorem coe_smul (c : 𝕜) (f : lp.simpleFunc E p μ) :
-    ((c • f : lp.simpleFunc E p μ) : lp E p μ) = c • (f : lp E p μ) :=
+theorem coe_smul (c : 𝕜) (f : Lp.simpleFunc E p μ) :
+    ((c • f : Lp.simpleFunc E p μ) : Lp E p μ) = c • (f : Lp E p μ) :=
   rfl
-#align measure_theory.Lp.simple_func.coe_smul MeasureTheory.lp.simpleFunc.coe_smul
+#align measure_theory.Lp.simple_func.coe_smul MeasureTheory.Lp.simpleFunc.coe_smul
 
 /-- If `E` is a normed space, `Lp.simple_func E p μ` is a module. Not declared as an
 instance as it is (as of writing) used only in the construction of the Bochner integral. -/
-protected def module : Module 𝕜 (lp.simpleFunc E p μ)
+protected def module : Module 𝕜 (Lp.simpleFunc E p μ)
     where
   one_smul f := by ext1; exact one_smul _ _
   mul_smul x y f := by ext1; exact mul_smul _ _ _
@@ -535,24 +535,24 @@ protected def module : Module 𝕜 (lp.simpleFunc E p μ)
   smul_zero x := by ext1; exact smul_zero _
   add_smul x y f := by ext1; exact add_smul _ _ _
   zero_smul f := by ext1; exact zero_smul _ _
-#align measure_theory.Lp.simple_func.module MeasureTheory.lp.simpleFunc.module
+#align measure_theory.Lp.simple_func.module MeasureTheory.Lp.simpleFunc.module
 
 attribute [local instance] simple_func.module
 
 /-- If `E` is a normed space, `Lp.simple_func E p μ` is a normed space. Not declared as an
 instance as it is (as of writing) used only in the construction of the Bochner integral. -/
-protected theorem boundedSMul [Fact (1 ≤ p)] : BoundedSMul 𝕜 (lp.simpleFunc E p μ) :=
-  BoundedSMul.of_norm_smul_le fun r f => (norm_smul_le r (f : lp E p μ) : _)
-#align measure_theory.Lp.simple_func.has_bounded_smul MeasureTheory.lp.simpleFunc.boundedSMul
+protected theorem boundedSMul [Fact (1 ≤ p)] : BoundedSMul 𝕜 (Lp.simpleFunc E p μ) :=
+  BoundedSMul.of_norm_smul_le fun r f => (norm_smul_le r (f : Lp E p μ) : _)
+#align measure_theory.Lp.simple_func.has_bounded_smul MeasureTheory.Lp.simpleFunc.boundedSMul
 
 attribute [local instance] simple_func.has_bounded_smul
 
 /-- If `E` is a normed space, `Lp.simple_func E p μ` is a normed space. Not declared as an
 instance as it is (as of writing) used only in the construction of the Bochner integral. -/
 protected def normedSpace {𝕜} [NormedField 𝕜] [NormedSpace 𝕜 E] [Fact (1 ≤ p)] :
-    NormedSpace 𝕜 (lp.simpleFunc E p μ) :=
+    NormedSpace 𝕜 (Lp.simpleFunc E p μ) :=
   ⟨norm_smul_le⟩
-#align measure_theory.Lp.simple_func.normed_space MeasureTheory.lp.simpleFunc.normedSpace
+#align measure_theory.Lp.simple_func.normed_space MeasureTheory.Lp.simpleFunc.normedSpace
 
 end Instances
 
@@ -562,156 +562,156 @@ section ToLp
 
 /-- Construct the equivalence class `[f]` of a simple function `f` satisfying `mem_ℒp`. -/
 @[reducible]
-def toLp (f : α →ₛ E) (hf : Memℒp f p μ) : lp.simpleFunc E p μ :=
+def toLp (f : α →ₛ E) (hf : Memℒp f p μ) : Lp.simpleFunc E p μ :=
   ⟨hf.toLp f, ⟨f, rfl⟩⟩
-#align measure_theory.Lp.simple_func.to_Lp MeasureTheory.lp.simpleFunc.toLp
+#align measure_theory.Lp.simple_func.to_Lp MeasureTheory.Lp.simpleFunc.toLp
 
-theorem toLp_eq_toLp (f : α →ₛ E) (hf : Memℒp f p μ) : (toLp f hf : lp E p μ) = hf.toLp f :=
+theorem toLp_eq_toLp (f : α →ₛ E) (hf : Memℒp f p μ) : (toLp f hf : Lp E p μ) = hf.toLp f :=
   rfl
-#align measure_theory.Lp.simple_func.to_Lp_eq_to_Lp MeasureTheory.lp.simpleFunc.toLp_eq_toLp
+#align measure_theory.Lp.simple_func.to_Lp_eq_to_Lp MeasureTheory.Lp.simpleFunc.toLp_eq_toLp
 
 theorem toLp_eq_mk (f : α →ₛ E) (hf : Memℒp f p μ) :
     (toLp f hf : α →ₘ[μ] E) = AEEqFun.mk f f.AEStronglyMeasurable :=
   rfl
-#align measure_theory.Lp.simple_func.to_Lp_eq_mk MeasureTheory.lp.simpleFunc.toLp_eq_mk
+#align measure_theory.Lp.simple_func.to_Lp_eq_mk MeasureTheory.Lp.simpleFunc.toLp_eq_mk
 
-theorem toLp_zero : toLp (0 : α →ₛ E) zero_memℒp = (0 : lp.simpleFunc E p μ) :=
+theorem toLp_zero : toLp (0 : α →ₛ E) zero_memℒp = (0 : Lp.simpleFunc E p μ) :=
   rfl
-#align measure_theory.Lp.simple_func.to_Lp_zero MeasureTheory.lp.simpleFunc.toLp_zero
+#align measure_theory.Lp.simple_func.to_Lp_zero MeasureTheory.Lp.simpleFunc.toLp_zero
 
 theorem toLp_add (f g : α →ₛ E) (hf : Memℒp f p μ) (hg : Memℒp g p μ) :
     toLp (f + g) (hf.add hg) = toLp f hf + toLp g hg :=
   rfl
-#align measure_theory.Lp.simple_func.to_Lp_add MeasureTheory.lp.simpleFunc.toLp_add
+#align measure_theory.Lp.simple_func.to_Lp_add MeasureTheory.Lp.simpleFunc.toLp_add
 
 theorem toLp_neg (f : α →ₛ E) (hf : Memℒp f p μ) : toLp (-f) hf.neg = -toLp f hf :=
   rfl
-#align measure_theory.Lp.simple_func.to_Lp_neg MeasureTheory.lp.simpleFunc.toLp_neg
+#align measure_theory.Lp.simple_func.to_Lp_neg MeasureTheory.Lp.simpleFunc.toLp_neg
 
 theorem toLp_sub (f g : α →ₛ E) (hf : Memℒp f p μ) (hg : Memℒp g p μ) :
     toLp (f - g) (hf.sub hg) = toLp f hf - toLp g hg := by
   simp only [sub_eq_add_neg, ← to_Lp_neg, ← to_Lp_add]; rfl
-#align measure_theory.Lp.simple_func.to_Lp_sub MeasureTheory.lp.simpleFunc.toLp_sub
+#align measure_theory.Lp.simple_func.to_Lp_sub MeasureTheory.Lp.simpleFunc.toLp_sub
 
 variable [NormedRing 𝕜] [Module 𝕜 E] [BoundedSMul 𝕜 E]
 
 theorem toLp_smul (f : α →ₛ E) (hf : Memℒp f p μ) (c : 𝕜) :
     toLp (c • f) (hf.const_smul c) = c • toLp f hf :=
   rfl
-#align measure_theory.Lp.simple_func.to_Lp_smul MeasureTheory.lp.simpleFunc.toLp_smul
+#align measure_theory.Lp.simple_func.to_Lp_smul MeasureTheory.Lp.simpleFunc.toLp_smul
 
 theorem norm_toLp [Fact (1 ≤ p)] (f : α →ₛ E) (hf : Memℒp f p μ) :
     ‖toLp f hf‖ = ENNReal.toReal (snorm f p μ) :=
   norm_toLp f hf
-#align measure_theory.Lp.simple_func.norm_to_Lp MeasureTheory.lp.simpleFunc.norm_toLp
+#align measure_theory.Lp.simple_func.norm_to_Lp MeasureTheory.Lp.simpleFunc.norm_toLp
 
 end ToLp
 
 section ToSimpleFunc
 
 /-- Find a representative of a `Lp.simple_func`. -/
-def toSimpleFunc (f : lp.simpleFunc E p μ) : α →ₛ E :=
+def toSimpleFunc (f : Lp.simpleFunc E p μ) : α →ₛ E :=
   Classical.choose f.2
-#align measure_theory.Lp.simple_func.to_simple_func MeasureTheory.lp.simpleFunc.toSimpleFunc
+#align measure_theory.Lp.simple_func.to_simple_func MeasureTheory.Lp.simpleFunc.toSimpleFunc
 
 /-- `(to_simple_func f)` is measurable. -/
 @[measurability]
-protected theorem measurable [MeasurableSpace E] (f : lp.simpleFunc E p μ) :
+protected theorem measurable [MeasurableSpace E] (f : Lp.simpleFunc E p μ) :
     Measurable (toSimpleFunc f) :=
   (toSimpleFunc f).Measurable
-#align measure_theory.Lp.simple_func.measurable MeasureTheory.lp.simpleFunc.measurable
+#align measure_theory.Lp.simple_func.measurable MeasureTheory.Lp.simpleFunc.measurable
 
-protected theorem stronglyMeasurable (f : lp.simpleFunc E p μ) :
+protected theorem stronglyMeasurable (f : Lp.simpleFunc E p μ) :
     StronglyMeasurable (toSimpleFunc f) :=
   (toSimpleFunc f).StronglyMeasurable
-#align measure_theory.Lp.simple_func.strongly_measurable MeasureTheory.lp.simpleFunc.stronglyMeasurable
+#align measure_theory.Lp.simple_func.strongly_measurable MeasureTheory.Lp.simpleFunc.stronglyMeasurable
 
 @[measurability]
-protected theorem aEMeasurable [MeasurableSpace E] (f : lp.simpleFunc E p μ) :
+protected theorem aEMeasurable [MeasurableSpace E] (f : Lp.simpleFunc E p μ) :
     AEMeasurable (toSimpleFunc f) μ :=
   (simpleFunc.measurable f).AEMeasurable
-#align measure_theory.Lp.simple_func.ae_measurable MeasureTheory.lp.simpleFunc.aEMeasurable
+#align measure_theory.Lp.simple_func.ae_measurable MeasureTheory.Lp.simpleFunc.aEMeasurable
 
-protected theorem aEStronglyMeasurable (f : lp.simpleFunc E p μ) :
+protected theorem aEStronglyMeasurable (f : Lp.simpleFunc E p μ) :
     AEStronglyMeasurable (toSimpleFunc f) μ :=
   (simpleFunc.stronglyMeasurable f).AEStronglyMeasurable
-#align measure_theory.Lp.simple_func.ae_strongly_measurable MeasureTheory.lp.simpleFunc.aEStronglyMeasurable
+#align measure_theory.Lp.simple_func.ae_strongly_measurable MeasureTheory.Lp.simpleFunc.aEStronglyMeasurable
 
-theorem toSimpleFunc_eq_to_fun (f : lp.simpleFunc E p μ) : toSimpleFunc f =ᵐ[μ] f :=
+theorem toSimpleFunc_eq_to_fun (f : Lp.simpleFunc E p μ) : toSimpleFunc f =ᵐ[μ] f :=
   show ⇑(toSimpleFunc f) =ᵐ[μ] ⇑(f : α →ₘ[μ] E)
     by
     convert(ae_eq_fun.coe_fn_mk (to_simple_func f)
           (to_simple_func f).AEStronglyMeasurable).symm using
       2
     exact (Classical.choose_spec f.2).symm
-#align measure_theory.Lp.simple_func.to_simple_func_eq_to_fun MeasureTheory.lp.simpleFunc.toSimpleFunc_eq_to_fun
+#align measure_theory.Lp.simple_func.to_simple_func_eq_to_fun MeasureTheory.Lp.simpleFunc.toSimpleFunc_eq_to_fun
 
 /-- `to_simple_func f` satisfies the predicate `mem_ℒp`. -/
-protected theorem memℒp (f : lp.simpleFunc E p μ) : Memℒp (toSimpleFunc f) p μ :=
-  Memℒp.ae_eq (toSimpleFunc_eq_to_fun f).symm <| mem_lp_iff_memℒp.mp (f : lp E p μ).2
-#align measure_theory.Lp.simple_func.mem_ℒp MeasureTheory.lp.simpleFunc.memℒp
+protected theorem memℒp (f : Lp.simpleFunc E p μ) : Memℒp (toSimpleFunc f) p μ :=
+  Memℒp.ae_eq (toSimpleFunc_eq_to_fun f).symm <| mem_Lp_iff_memℒp.mp (f : Lp E p μ).2
+#align measure_theory.Lp.simple_func.mem_ℒp MeasureTheory.Lp.simpleFunc.memℒp
 
-theorem toLp_toSimpleFunc (f : lp.simpleFunc E p μ) :
+theorem toLp_toSimpleFunc (f : Lp.simpleFunc E p μ) :
     toLp (toSimpleFunc f) (simpleFunc.memℒp f) = f :=
   simpleFunc.eq' (Classical.choose_spec f.2)
-#align measure_theory.Lp.simple_func.to_Lp_to_simple_func MeasureTheory.lp.simpleFunc.toLp_toSimpleFunc
+#align measure_theory.Lp.simple_func.to_Lp_to_simple_func MeasureTheory.Lp.simpleFunc.toLp_toSimpleFunc
 
 theorem toSimpleFunc_toLp (f : α →ₛ E) (hfi : Memℒp f p μ) : toSimpleFunc (toLp f hfi) =ᵐ[μ] f := by
   rw [← ae_eq_fun.mk_eq_mk]; exact Classical.choose_spec (to_Lp f hfi).2
-#align measure_theory.Lp.simple_func.to_simple_func_to_Lp MeasureTheory.lp.simpleFunc.toSimpleFunc_toLp
+#align measure_theory.Lp.simple_func.to_simple_func_to_Lp MeasureTheory.Lp.simpleFunc.toSimpleFunc_toLp
 
 variable (E μ)
 
-theorem zero_toSimpleFunc : toSimpleFunc (0 : lp.simpleFunc E p μ) =ᵐ[μ] 0 :=
+theorem zero_toSimpleFunc : toSimpleFunc (0 : Lp.simpleFunc E p μ) =ᵐ[μ] 0 :=
   by
   filter_upwards [to_simple_func_eq_to_fun (0 : Lp.simple_func E p μ),
     Lp.coe_fn_zero E 1 μ]with _ h₁ _
   rwa [h₁]
-#align measure_theory.Lp.simple_func.zero_to_simple_func MeasureTheory.lp.simpleFunc.zero_toSimpleFunc
+#align measure_theory.Lp.simple_func.zero_to_simple_func MeasureTheory.Lp.simpleFunc.zero_toSimpleFunc
 
 variable {E μ}
 
-theorem add_toSimpleFunc (f g : lp.simpleFunc E p μ) :
+theorem add_toSimpleFunc (f g : Lp.simpleFunc E p μ) :
     toSimpleFunc (f + g) =ᵐ[μ] toSimpleFunc f + toSimpleFunc g :=
   by
   filter_upwards [to_simple_func_eq_to_fun (f + g), to_simple_func_eq_to_fun f,
     to_simple_func_eq_to_fun g, Lp.coe_fn_add (f : Lp E p μ) g]with _
   simp only [← coe_coe, AddSubgroup.coe_add, Pi.add_apply]
   iterate 4 intro h; rw [h]
-#align measure_theory.Lp.simple_func.add_to_simple_func MeasureTheory.lp.simpleFunc.add_toSimpleFunc
+#align measure_theory.Lp.simple_func.add_to_simple_func MeasureTheory.Lp.simpleFunc.add_toSimpleFunc
 
-theorem neg_toSimpleFunc (f : lp.simpleFunc E p μ) : toSimpleFunc (-f) =ᵐ[μ] -toSimpleFunc f :=
+theorem neg_toSimpleFunc (f : Lp.simpleFunc E p μ) : toSimpleFunc (-f) =ᵐ[μ] -toSimpleFunc f :=
   by
   filter_upwards [to_simple_func_eq_to_fun (-f), to_simple_func_eq_to_fun f,
     Lp.coe_fn_neg (f : Lp E p μ)]with _
   simp only [Pi.neg_apply, AddSubgroup.coe_neg, ← coe_coe]
   repeat' intro h; rw [h]
-#align measure_theory.Lp.simple_func.neg_to_simple_func MeasureTheory.lp.simpleFunc.neg_toSimpleFunc
+#align measure_theory.Lp.simple_func.neg_to_simple_func MeasureTheory.Lp.simpleFunc.neg_toSimpleFunc
 
-theorem sub_toSimpleFunc (f g : lp.simpleFunc E p μ) :
+theorem sub_toSimpleFunc (f g : Lp.simpleFunc E p μ) :
     toSimpleFunc (f - g) =ᵐ[μ] toSimpleFunc f - toSimpleFunc g :=
   by
   filter_upwards [to_simple_func_eq_to_fun (f - g), to_simple_func_eq_to_fun f,
     to_simple_func_eq_to_fun g, Lp.coe_fn_sub (f : Lp E p μ) g]with _
   simp only [AddSubgroup.coe_sub, Pi.sub_apply, ← coe_coe]
   repeat' intro h; rw [h]
-#align measure_theory.Lp.simple_func.sub_to_simple_func MeasureTheory.lp.simpleFunc.sub_toSimpleFunc
+#align measure_theory.Lp.simple_func.sub_to_simple_func MeasureTheory.Lp.simpleFunc.sub_toSimpleFunc
 
 variable [NormedRing 𝕜] [Module 𝕜 E] [BoundedSMul 𝕜 E]
 
-theorem smul_toSimpleFunc (k : 𝕜) (f : lp.simpleFunc E p μ) :
+theorem smul_toSimpleFunc (k : 𝕜) (f : Lp.simpleFunc E p μ) :
     toSimpleFunc (k • f) =ᵐ[μ] k • toSimpleFunc f :=
   by
   filter_upwards [to_simple_func_eq_to_fun (k • f), to_simple_func_eq_to_fun f,
     Lp.coe_fn_smul k (f : Lp E p μ)]with _
   simp only [Pi.smul_apply, coe_smul, ← coe_coe]
   repeat' intro h; rw [h]
-#align measure_theory.Lp.simple_func.smul_to_simple_func MeasureTheory.lp.simpleFunc.smul_toSimpleFunc
+#align measure_theory.Lp.simple_func.smul_to_simple_func MeasureTheory.Lp.simpleFunc.smul_toSimpleFunc
 
-theorem norm_toSimpleFunc [Fact (1 ≤ p)] (f : lp.simpleFunc E p μ) :
+theorem norm_toSimpleFunc [Fact (1 ≤ p)] (f : Lp.simpleFunc E p μ) :
     ‖f‖ = ENNReal.toReal (snorm (toSimpleFunc f) p μ) := by
   simpa [to_Lp_to_simple_func] using norm_to_Lp (to_simple_func f) (simple_func.mem_ℒp f)
-#align measure_theory.Lp.simple_func.norm_to_simple_func MeasureTheory.lp.simpleFunc.norm_toSimpleFunc
+#align measure_theory.Lp.simple_func.norm_to_simple_func MeasureTheory.Lp.simpleFunc.norm_toSimpleFunc
 
 end ToSimpleFunc
 
@@ -722,41 +722,41 @@ variable (p)
 /-- The characteristic function of a finite-measure measurable set `s`, as an `Lp` simple function.
 -/
 def indicatorConst {s : Set α} (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (c : E) :
-    lp.simpleFunc E p μ :=
+    Lp.simpleFunc E p μ :=
   toLp ((SimpleFunc.const _ c).piecewise s hs (SimpleFunc.const _ 0))
     (memℒp_indicator_const p hs c (Or.inr hμs))
-#align measure_theory.Lp.simple_func.indicator_const MeasureTheory.lp.simpleFunc.indicatorConst
+#align measure_theory.Lp.simple_func.indicator_const MeasureTheory.Lp.simpleFunc.indicatorConst
 
 variable {p}
 
 @[simp]
 theorem coe_indicatorConst {s : Set α} (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (c : E) :
-    (↑(indicatorConst p hs hμs c) : lp E p μ) = indicatorConstLp p hs hμs c :=
+    (↑(indicatorConst p hs hμs c) : Lp E p μ) = indicatorConstLp p hs hμs c :=
   rfl
-#align measure_theory.Lp.simple_func.coe_indicator_const MeasureTheory.lp.simpleFunc.coe_indicatorConst
+#align measure_theory.Lp.simple_func.coe_indicator_const MeasureTheory.Lp.simpleFunc.coe_indicatorConst
 
 theorem toSimpleFunc_indicatorConst {s : Set α} (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (c : E) :
     toSimpleFunc (indicatorConst p hs hμs c) =ᵐ[μ]
       (SimpleFunc.const _ c).piecewise s hs (SimpleFunc.const _ 0) :=
-  lp.simpleFunc.toSimpleFunc_toLp _ _
-#align measure_theory.Lp.simple_func.to_simple_func_indicator_const MeasureTheory.lp.simpleFunc.toSimpleFunc_indicatorConst
+  Lp.simpleFunc.toSimpleFunc_toLp _ _
+#align measure_theory.Lp.simple_func.to_simple_func_indicator_const MeasureTheory.Lp.simpleFunc.toSimpleFunc_indicatorConst
 
 /-- To prove something for an arbitrary `Lp` simple function, with `0 < p < ∞`, it suffices to show
 that the property holds for (multiples of) characteristic functions of finite-measure measurable
 sets and is closed under addition (of functions with disjoint support). -/
 @[elab_as_elim]
-protected theorem induction (hp_pos : p ≠ 0) (hp_ne_top : p ≠ ∞) {P : lp.simpleFunc E p μ → Prop}
+protected theorem induction (hp_pos : p ≠ 0) (hp_ne_top : p ≠ ∞) {P : Lp.simpleFunc E p μ → Prop}
     (h_ind :
       ∀ (c : E) {s : Set α} (hs : MeasurableSet s) (hμs : μ s < ∞),
-        P (lp.simpleFunc.indicatorConst p hs hμs.Ne c))
+        P (Lp.simpleFunc.indicatorConst p hs hμs.Ne c))
     (h_add :
       ∀ ⦃f g : α →ₛ E⦄,
         ∀ hf : Memℒp f p μ,
           ∀ hg : Memℒp g p μ,
             Disjoint (support f) (support g) →
-              P (lp.simpleFunc.toLp f hf) →
-                P (lp.simpleFunc.toLp g hg) → P (lp.simpleFunc.toLp f hf + lp.simpleFunc.toLp g hg))
-    (f : lp.simpleFunc E p μ) : P f :=
+              P (Lp.simpleFunc.toLp f hf) →
+                P (Lp.simpleFunc.toLp g hg) → P (Lp.simpleFunc.toLp f hf + Lp.simpleFunc.toLp g hg))
+    (f : Lp.simpleFunc E p μ) : P f :=
   by
   suffices ∀ f : α →ₛ E, ∀ hf : mem_ℒp f p μ, P (to_Lp f hf)
     by
@@ -774,7 +774,7 @@ protected theorem induction (hp_pos : p ≠ 0) (hp_ne_top : p ≠ ∞) {P : lp.s
     obtain ⟨hf', hg'⟩ : mem_ℒp f p μ ∧ mem_ℒp g p μ :=
       (mem_ℒp_add_of_disjoint hfg f.strongly_measurable g.strongly_measurable).mp hfg'
     exact h_add hf' hg' hfg (hf hf') (hg hg')
-#align measure_theory.Lp.simple_func.induction MeasureTheory.lp.simpleFunc.induction
+#align measure_theory.Lp.simple_func.induction MeasureTheory.Lp.simpleFunc.induction
 
 end Induction
 
@@ -782,20 +782,20 @@ section CoeToLp
 
 variable [Fact (1 ≤ p)]
 
-protected theorem uniformContinuous : UniformContinuous (coe : lp.simpleFunc E p μ → lp E p μ) :=
+protected theorem uniformContinuous : UniformContinuous (coe : Lp.simpleFunc E p μ → Lp E p μ) :=
   uniformContinuous_comap
-#align measure_theory.Lp.simple_func.uniform_continuous MeasureTheory.lp.simpleFunc.uniformContinuous
+#align measure_theory.Lp.simple_func.uniform_continuous MeasureTheory.Lp.simpleFunc.uniformContinuous
 
-protected theorem uniformEmbedding : UniformEmbedding (coe : lp.simpleFunc E p μ → lp E p μ) :=
+protected theorem uniformEmbedding : UniformEmbedding (coe : Lp.simpleFunc E p μ → Lp E p μ) :=
   uniformEmbedding_comap Subtype.val_injective
-#align measure_theory.Lp.simple_func.uniform_embedding MeasureTheory.lp.simpleFunc.uniformEmbedding
+#align measure_theory.Lp.simple_func.uniform_embedding MeasureTheory.Lp.simpleFunc.uniformEmbedding
 
-protected theorem uniformInducing : UniformInducing (coe : lp.simpleFunc E p μ → lp E p μ) :=
+protected theorem uniformInducing : UniformInducing (coe : Lp.simpleFunc E p μ → Lp E p μ) :=
   simpleFunc.uniformEmbedding.to_uniformInducing
-#align measure_theory.Lp.simple_func.uniform_inducing MeasureTheory.lp.simpleFunc.uniformInducing
+#align measure_theory.Lp.simple_func.uniform_inducing MeasureTheory.Lp.simpleFunc.uniformInducing
 
 protected theorem denseEmbedding (hp_ne_top : p ≠ ∞) :
-    DenseEmbedding (coe : lp.simpleFunc E p μ → lp E p μ) :=
+    DenseEmbedding (coe : Lp.simpleFunc E p μ → Lp E p μ) :=
   by
   borelize E
   apply simple_func.uniform_embedding.dense_embedding
@@ -814,30 +814,30 @@ protected theorem denseEmbedding (hp_ne_top : p ≠ ∞) :
   convert simple_func.tendsto_approx_on_range_Lp hp_ne_top (Lp.strongly_measurable f).Measurable
       hfi'
   rw [to_Lp_coe_fn f (Lp.mem_ℒp f)]
-#align measure_theory.Lp.simple_func.dense_embedding MeasureTheory.lp.simpleFunc.denseEmbedding
+#align measure_theory.Lp.simple_func.dense_embedding MeasureTheory.Lp.simpleFunc.denseEmbedding
 
 protected theorem denseInducing (hp_ne_top : p ≠ ∞) :
-    DenseInducing (coe : lp.simpleFunc E p μ → lp E p μ) :=
+    DenseInducing (coe : Lp.simpleFunc E p μ → Lp E p μ) :=
   (simpleFunc.denseEmbedding hp_ne_top).to_denseInducing
-#align measure_theory.Lp.simple_func.dense_inducing MeasureTheory.lp.simpleFunc.denseInducing
+#align measure_theory.Lp.simple_func.dense_inducing MeasureTheory.Lp.simpleFunc.denseInducing
 
 protected theorem denseRange (hp_ne_top : p ≠ ∞) :
-    DenseRange (coe : lp.simpleFunc E p μ → lp E p μ) :=
+    DenseRange (coe : Lp.simpleFunc E p μ → Lp E p μ) :=
   (simpleFunc.denseInducing hp_ne_top).dense
-#align measure_theory.Lp.simple_func.dense_range MeasureTheory.lp.simpleFunc.denseRange
+#align measure_theory.Lp.simple_func.dense_range MeasureTheory.Lp.simpleFunc.denseRange
 
 variable [NormedRing 𝕜] [Module 𝕜 E] [BoundedSMul 𝕜 E]
 
 variable (α E 𝕜)
 
 /-- The embedding of Lp simple functions into Lp functions, as a continuous linear map. -/
-def coeToLp : lp.simpleFunc E p μ →L[𝕜] lp E p μ :=
+def coeToLp : Lp.simpleFunc E p μ →L[𝕜] Lp E p μ :=
   {
     AddSubgroup.subtype
-      (lp.simpleFunc E p μ) with
+      (Lp.simpleFunc E p μ) with
     map_smul' := fun k f => rfl
-    cont := lp.simpleFunc.uniformContinuous.Continuous }
-#align measure_theory.Lp.simple_func.coe_to_Lp MeasureTheory.lp.simpleFunc.coeToLp
+    cont := Lp.simpleFunc.uniformContinuous.Continuous }
+#align measure_theory.Lp.simple_func.coe_to_Lp MeasureTheory.Lp.simpleFunc.coeToLp
 
 variable {α E 𝕜}
 
@@ -847,11 +847,11 @@ section Order
 
 variable {G : Type _} [NormedLatticeAddCommGroup G]
 
-theorem coeFn_le (f g : lp.simpleFunc G p μ) : f ≤ᵐ[μ] g ↔ f ≤ g := by
+theorem coeFn_le (f g : Lp.simpleFunc G p μ) : f ≤ᵐ[μ] g ↔ f ≤ g := by
   rw [← Subtype.coe_le_coe, ← Lp.coe_fn_le, coeFn_coe_base', coeFn_coe_base' g]
-#align measure_theory.Lp.simple_func.coe_fn_le MeasureTheory.lp.simpleFunc.coeFn_le
+#align measure_theory.Lp.simple_func.coe_fn_le MeasureTheory.Lp.simpleFunc.coeFn_le
 
-instance : CovariantClass (lp.simpleFunc G p μ) (lp.simpleFunc G p μ) (· + ·) (· ≤ ·) :=
+instance : CovariantClass (Lp.simpleFunc G p μ) (Lp.simpleFunc G p μ) (· + ·) (· ≤ ·) :=
   by
   refine' ⟨fun f g₁ g₂ hg₁₂ => _⟩
   rw [← Lp.simple_func.coe_fn_le] at hg₁₂⊢
@@ -863,22 +863,22 @@ instance : CovariantClass (lp.simpleFunc G p μ) (lp.simpleFunc G p μ) (· + ·
 
 variable (p μ G)
 
-theorem coeFn_zero : (0 : lp.simpleFunc G p μ) =ᵐ[μ] (0 : α → G) :=
-  lp.coeFn_zero _ _ _
-#align measure_theory.Lp.simple_func.coe_fn_zero MeasureTheory.lp.simpleFunc.coeFn_zero
+theorem coeFn_zero : (0 : Lp.simpleFunc G p μ) =ᵐ[μ] (0 : α → G) :=
+  Lp.coeFn_zero _ _ _
+#align measure_theory.Lp.simple_func.coe_fn_zero MeasureTheory.Lp.simpleFunc.coeFn_zero
 
 variable {p μ G}
 
-theorem coeFn_nonneg (f : lp.simpleFunc G p μ) : 0 ≤ᵐ[μ] f ↔ 0 ≤ f :=
+theorem coeFn_nonneg (f : Lp.simpleFunc G p μ) : 0 ≤ᵐ[μ] f ↔ 0 ≤ f :=
   by
   rw [← Lp.simple_func.coe_fn_le]
   have h0 : (0 : Lp.simple_func G p μ) =ᵐ[μ] (0 : α → G) := Lp.simple_func.coe_fn_zero p μ G
   constructor <;> intro h <;> filter_upwards [h, h0]with _ _ h2
   · rwa [h2]
   · rwa [← h2]
-#align measure_theory.Lp.simple_func.coe_fn_nonneg MeasureTheory.lp.simpleFunc.coeFn_nonneg
+#align measure_theory.Lp.simple_func.coe_fn_nonneg MeasureTheory.Lp.simpleFunc.coeFn_nonneg
 
-theorem exists_simpleFunc_nonneg_ae_eq {f : lp.simpleFunc G p μ} (hf : 0 ≤ f) :
+theorem exists_simpleFunc_nonneg_ae_eq {f : Lp.simpleFunc G p μ} (hf : 0 ≤ f) :
     ∃ f' : α →ₛ G, 0 ≤ f' ∧ f =ᵐ[μ] f' :=
   by
   rw [← Lp.simple_func.coe_fn_nonneg] at hf
@@ -910,14 +910,14 @@ theorem exists_simpleFunc_nonneg_ae_eq {f : lp.simpleFunc G p μ} (hf : 0 ≤ f)
     refine' eventually_eq.trans (to_simple_func_eq_to_fun f).symm _
     refine' eventually_eq.trans _ (piecewise_ae_eq_of_ae_eq_set this.symm)
     simp only [simple_func.const_zero, indicator_univ, piecewise_eq_indicator, simple_func.coe_zero]
-#align measure_theory.Lp.simple_func.exists_simple_func_nonneg_ae_eq MeasureTheory.lp.simpleFunc.exists_simpleFunc_nonneg_ae_eq
+#align measure_theory.Lp.simple_func.exists_simple_func_nonneg_ae_eq MeasureTheory.Lp.simpleFunc.exists_simpleFunc_nonneg_ae_eq
 
 variable (p μ G)
 
 /-- Coercion from nonnegative simple functions of Lp to nonnegative functions of Lp. -/
 def coeSimpleFuncNonnegToLpNonneg :
-    { g : lp.simpleFunc G p μ // 0 ≤ g } → { g : lp G p μ // 0 ≤ g } := fun g => ⟨g, g.2⟩
-#align measure_theory.Lp.simple_func.coe_simple_func_nonneg_to_Lp_nonneg MeasureTheory.lp.simpleFunc.coeSimpleFuncNonnegToLpNonneg
+    { g : Lp.simpleFunc G p μ // 0 ≤ g } → { g : Lp G p μ // 0 ≤ g } := fun g => ⟨g, g.2⟩
+#align measure_theory.Lp.simple_func.coe_simple_func_nonneg_to_Lp_nonneg MeasureTheory.Lp.simpleFunc.coeSimpleFuncNonnegToLpNonneg
 
 theorem denseRange_coeSimpleFuncNonnegToLpNonneg [hp : Fact (1 ≤ p)] (hp_ne_top : p ≠ ∞) :
     DenseRange (coeSimpleFuncNonnegToLpNonneg p μ G) :=
@@ -978,7 +978,7 @@ theorem denseRange_coeSimpleFuncNonnegToLpNonneg [hp : Fact (1 ≤ p)] (hp_ne_to
   · rw [Lp.simple_func.to_Lp_eq_to_Lp]
     exact h_to_Lp n
   · rw [← coeFn_coeBase]
-#align measure_theory.Lp.simple_func.dense_range_coe_simple_func_nonneg_to_Lp_nonneg MeasureTheory.lp.simpleFunc.denseRange_coeSimpleFuncNonnegToLpNonneg
+#align measure_theory.Lp.simple_func.dense_range_coe_simple_func_nonneg_to_Lp_nonneg MeasureTheory.Lp.simpleFunc.denseRange_coeSimpleFuncNonnegToLpNonneg
 
 variable {p μ G}
 
@@ -997,23 +997,23 @@ suffices to show that
 * the set of functions in `Lp` for which the property holds is closed.
 -/
 @[elab_as_elim]
-theorem lp.induction [_i : Fact (1 ≤ p)] (hp_ne_top : p ≠ ∞) (P : lp E p μ → Prop)
+theorem Lp.induction [_i : Fact (1 ≤ p)] (hp_ne_top : p ≠ ∞) (P : Lp E p μ → Prop)
     (h_ind :
       ∀ (c : E) {s : Set α} (hs : MeasurableSet s) (hμs : μ s < ∞),
-        P (lp.simpleFunc.indicatorConst p hs hμs.Ne c))
+        P (Lp.simpleFunc.indicatorConst p hs hμs.Ne c))
     (h_add :
       ∀ ⦃f g⦄,
         ∀ hf : Memℒp f p μ,
           ∀ hg : Memℒp g p μ,
             Disjoint (support f) (support g) →
               P (hf.toLp f) → P (hg.toLp g) → P (hf.toLp f + hg.toLp g))
-    (h_closed : IsClosed { f : lp E p μ | P f }) : ∀ f : lp E p μ, P f :=
+    (h_closed : IsClosed { f : Lp E p μ | P f }) : ∀ f : Lp E p μ, P f :=
   by
   refine' fun f => (Lp.simple_func.dense_range hp_ne_top).inductionOn f h_closed _
   refine' Lp.simple_func.induction (lt_of_lt_of_le zero_lt_one _i.elim).ne' hp_ne_top _ _
   · exact fun c s => h_ind c
   · exact fun f g hf hg => h_add hf hg
-#align measure_theory.Lp.induction MeasureTheory.lp.induction
+#align measure_theory.Lp.induction MeasureTheory.Lp.induction
 
 /-- To prove something for an arbitrary `mem_ℒp` function in a second countable
 Borel normed group, it suffices to show that
@@ -1033,7 +1033,7 @@ theorem Memℒp.induction [_i : Fact (1 ≤ p)] (hp_ne_top : p ≠ ∞) (P : (α
     (h_add :
       ∀ ⦃f g : α → E⦄,
         Disjoint (support f) (support g) → Memℒp f p μ → Memℒp g p μ → P f → P g → P (f + g))
-    (h_closed : IsClosed { f : lp E p μ | P f })
+    (h_closed : IsClosed { f : Lp E p μ | P f })
     (h_ae : ∀ ⦃f g⦄, f =ᵐ[μ] g → Memℒp f p μ → P f → P g) : ∀ ⦃f : α → E⦄ (hf : Memℒp f p μ), P f :=
   by
   have : ∀ f : simple_func α E, mem_ℒp f p μ → P f :=
@@ -1112,15 +1112,15 @@ theorem Memℒp.induction_dense (hp_ne_top : p ≠ ∞) (P : (α → E) → Prop
 section Integrable
 
 -- mathport name: «expr →₁ₛ[ ] »
-notation:25 α " →₁ₛ[" μ "] " E => @MeasureTheory.lp.simpleFunc α E _ _ 1 μ
+notation:25 α " →₁ₛ[" μ "] " E => @MeasureTheory.Lp.simpleFunc α E _ _ 1 μ
 
 theorem L1.SimpleFunc.toLp_one_eq_toL1 (f : α →ₛ E) (hf : Integrable f μ) :
-    (lp.simpleFunc.toLp f (memℒp_one_iff_integrable.2 hf) : α →₁[μ] E) = hf.toL1 f :=
+    (Lp.simpleFunc.toLp f (memℒp_one_iff_integrable.2 hf) : α →₁[μ] E) = hf.toL1 f :=
   rfl
 #align measure_theory.L1.simple_func.to_Lp_one_eq_to_L1 MeasureTheory.L1.SimpleFunc.toLp_one_eq_toL1
 
 protected theorem L1.SimpleFunc.integrable (f : α →₁ₛ[μ] E) :
-    Integrable (lp.simpleFunc.toSimpleFunc f) μ := by rw [← mem_ℒp_one_iff_integrable];
+    Integrable (Lp.simpleFunc.toSimpleFunc f) μ := by rw [← mem_ℒp_one_iff_integrable];
   exact Lp.simple_func.mem_ℒp f
 #align measure_theory.L1.simple_func.integrable MeasureTheory.L1.SimpleFunc.integrable
 
Diff
@@ -308,7 +308,7 @@ theorem exists_forall_norm_le (f : α →ₛ F) : ∃ C, ∀ x, ‖f x‖ ≤ C
 #align measure_theory.simple_func.exists_forall_norm_le MeasureTheory.SimpleFunc.exists_forall_norm_le
 
 theorem memℒp_zero (f : α →ₛ E) (μ : Measure α) : Memℒp f 0 μ :=
-  memℒp_zero_iff_aEStronglyMeasurable.mpr f.AEStronglyMeasurable
+  memℒp_zero_iff_aestronglyMeasurable.mpr f.AEStronglyMeasurable
 #align measure_theory.simple_func.mem_ℒp_zero MeasureTheory.SimpleFunc.memℒp_zero
 
 theorem memℒp_top (f : α →ₛ E) (μ : Measure α) : Memℒp f ∞ μ :=
Diff
@@ -49,7 +49,7 @@ noncomputable section
 
 open Set Function Filter TopologicalSpace ENNReal Emetric Finset
 
-open Classical Topology ENNReal MeasureTheory BigOperators
+open scoped Classical Topology ENNReal MeasureTheory BigOperators
 
 variable {α β ι E F 𝕜 : Type _}
 
Diff
@@ -335,8 +335,7 @@ theorem measure_preimage_lt_top_of_memℒp (hp_pos : p ≠ 0) (hp_ne_top : p ≠
   by_cases hyf : y ∈ f.range
   swap
   · suffices h_empty : f ⁻¹' {y} = ∅
-    · rw [h_empty, measure_empty]
-      exact ENNReal.coe_lt_top
+    · rw [h_empty, measure_empty]; exact ENNReal.coe_lt_top
     ext1 x
     rw [Set.mem_preimage, Set.mem_singleton_iff, mem_empty_iff_false, iff_false_iff]
     refine' fun hxy => hyf _
@@ -357,11 +356,9 @@ theorem memℒp_of_finite_measure_preimage (p : ℝ≥0∞) {f : α →ₛ E}
     (hf : ∀ (y) (_ : y ≠ 0), μ (f ⁻¹' {y}) < ∞) : Memℒp f p μ :=
   by
   by_cases hp0 : p = 0
-  · rw [hp0, mem_ℒp_zero_iff_ae_strongly_measurable]
-    exact f.ae_strongly_measurable
+  · rw [hp0, mem_ℒp_zero_iff_ae_strongly_measurable]; exact f.ae_strongly_measurable
   by_cases hp_top : p = ∞
-  · rw [hp_top]
-    exact mem_ℒp_top f μ
+  · rw [hp_top]; exact mem_ℒp_top f μ
   refine' ⟨f.ae_strongly_measurable, _⟩
   rw [snorm_eq_snorm' hp0 hp_top, f.snorm'_eq]
   refine' ENNReal.rpow_lt_top_of_nonneg (by simp) (ennreal.sum_lt_top_iff.mpr fun y hy => _).Ne
@@ -532,24 +529,12 @@ theorem coe_smul (c : 𝕜) (f : lp.simpleFunc E p μ) :
 instance as it is (as of writing) used only in the construction of the Bochner integral. -/
 protected def module : Module 𝕜 (lp.simpleFunc E p μ)
     where
-  one_smul f := by
-    ext1
-    exact one_smul _ _
-  mul_smul x y f := by
-    ext1
-    exact mul_smul _ _ _
-  smul_add x f g := by
-    ext1
-    exact smul_add _ _ _
-  smul_zero x := by
-    ext1
-    exact smul_zero _
-  add_smul x y f := by
-    ext1
-    exact add_smul _ _ _
-  zero_smul f := by
-    ext1
-    exact zero_smul _ _
+  one_smul f := by ext1; exact one_smul _ _
+  mul_smul x y f := by ext1; exact mul_smul _ _ _
+  smul_add x f g := by ext1; exact smul_add _ _ _
+  smul_zero x := by ext1; exact smul_zero _
+  add_smul x y f := by ext1; exact add_smul _ _ _
+  zero_smul f := by ext1; exact zero_smul _ _
 #align measure_theory.Lp.simple_func.module MeasureTheory.lp.simpleFunc.module
 
 attribute [local instance] simple_func.module
@@ -604,10 +589,8 @@ theorem toLp_neg (f : α →ₛ E) (hf : Memℒp f p μ) : toLp (-f) hf.neg = -t
 #align measure_theory.Lp.simple_func.to_Lp_neg MeasureTheory.lp.simpleFunc.toLp_neg
 
 theorem toLp_sub (f g : α →ₛ E) (hf : Memℒp f p μ) (hg : Memℒp g p μ) :
-    toLp (f - g) (hf.sub hg) = toLp f hf - toLp g hg :=
-  by
-  simp only [sub_eq_add_neg, ← to_Lp_neg, ← to_Lp_add]
-  rfl
+    toLp (f - g) (hf.sub hg) = toLp f hf - toLp g hg := by
+  simp only [sub_eq_add_neg, ← to_Lp_neg, ← to_Lp_add]; rfl
 #align measure_theory.Lp.simple_func.to_Lp_sub MeasureTheory.lp.simpleFunc.toLp_sub
 
 variable [NormedRing 𝕜] [Module 𝕜 E] [BoundedSMul 𝕜 E]
@@ -673,10 +656,8 @@ theorem toLp_toSimpleFunc (f : lp.simpleFunc E p μ) :
   simpleFunc.eq' (Classical.choose_spec f.2)
 #align measure_theory.Lp.simple_func.to_Lp_to_simple_func MeasureTheory.lp.simpleFunc.toLp_toSimpleFunc
 
-theorem toSimpleFunc_toLp (f : α →ₛ E) (hfi : Memℒp f p μ) : toSimpleFunc (toLp f hfi) =ᵐ[μ] f :=
-  by
-  rw [← ae_eq_fun.mk_eq_mk]
-  exact Classical.choose_spec (to_Lp f hfi).2
+theorem toSimpleFunc_toLp (f : α →ₛ E) (hfi : Memℒp f p μ) : toSimpleFunc (toLp f hfi) =ᵐ[μ] f := by
+  rw [← ae_eq_fun.mk_eq_mk]; exact Classical.choose_spec (to_Lp f hfi).2
 #align measure_theory.Lp.simple_func.to_simple_func_to_Lp MeasureTheory.lp.simpleFunc.toSimpleFunc_toLp
 
 variable (E μ)
@@ -901,13 +882,10 @@ theorem exists_simpleFunc_nonneg_ae_eq {f : lp.simpleFunc G p μ} (hf : 0 ≤ f)
     ∃ f' : α →ₛ G, 0 ≤ f' ∧ f =ᵐ[μ] f' :=
   by
   rw [← Lp.simple_func.coe_fn_nonneg] at hf
-  have hf_ae : 0 ≤ᵐ[μ] simple_func.to_simple_func f :=
-    by
-    filter_upwards [to_simple_func_eq_to_fun f, hf]with _ h1 _
-    rwa [h1]
+  have hf_ae : 0 ≤ᵐ[μ] simple_func.to_simple_func f := by
+    filter_upwards [to_simple_func_eq_to_fun f, hf]with _ h1 _; rwa [h1]
   let s := to_measurable μ { x | ¬0 ≤ simple_func.to_simple_func f x }ᶜ
-  have hs_zero : μ (sᶜ) = 0 := by
-    rw [compl_compl, measure_to_measurable]
+  have hs_zero : μ (sᶜ) = 0 := by rw [compl_compl, measure_to_measurable];
     rwa [eventually_le, ae_iff] at hf_ae
   have hfs_nonneg : ∀ x ∈ s, 0 ≤ simple_func.to_simple_func f x :=
     by
@@ -984,8 +962,7 @@ theorem denseRange_coeSimpleFuncNonnegToLpNonneg [hp : Fact (1 ≤ p)] (hp_ne_to
     · have hg_nonneg : 0 ≤ᵐ[μ] g := (Lp.coe_fn_nonneg _).mpr g.2
       refine' hg_nonneg.mono fun a ha => subset_closure _
       simpa using ha
-    · simp_rw [sub_zero]
-      exact hg_mem_ℒp.snorm_lt_top
+    · simp_rw [sub_zero]; exact hg_mem_ℒp.snorm_lt_top
   refine'
     ⟨fun n =>
       (coe_simple_func_nonneg_to_Lp_nonneg p μ G) ⟨to_Lp (x n) (hx_mem_ℒp n), hx_nonneg_Lp n⟩,
@@ -1064,10 +1041,7 @@ theorem Memℒp.induction [_i : Fact (1 ≤ p)] (hp_ne_top : p ≠ ∞) (P : (α
     refine' simple_func.induction _ _
     · intro c s hs h
       by_cases hc : c = 0
-      · subst hc
-        convert h_ind 0 MeasurableSet.empty (by simp) using 1
-        ext
-        simp [const]
+      · subst hc; convert h_ind 0 MeasurableSet.empty (by simp) using 1; ext; simp [const]
       have hp_pos : p ≠ 0 := (lt_of_lt_of_le zero_lt_one _i.elim).ne'
       exact h_ind c hs (simple_func.measure_lt_top_of_mem_ℒp_indicator hp_pos hp_ne_top hc hs h)
     · intro f g hfg hf hg int_fg
@@ -1146,9 +1120,7 @@ theorem L1.SimpleFunc.toLp_one_eq_toL1 (f : α →ₛ E) (hf : Integrable f μ)
 #align measure_theory.L1.simple_func.to_Lp_one_eq_to_L1 MeasureTheory.L1.SimpleFunc.toLp_one_eq_toL1
 
 protected theorem L1.SimpleFunc.integrable (f : α →₁ₛ[μ] E) :
-    Integrable (lp.simpleFunc.toSimpleFunc f) μ :=
-  by
-  rw [← mem_ℒp_one_iff_integrable]
+    Integrable (lp.simpleFunc.toSimpleFunc f) μ := by rw [← mem_ℒp_one_iff_integrable];
   exact Lp.simple_func.mem_ℒp f
 #align measure_theory.L1.simple_func.integrable MeasureTheory.L1.SimpleFunc.integrable
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Zhouhang Zhou, Yury Kudryashov, Heather Macbeth
 
 ! This file was ported from Lean 3 source module measure_theory.function.simple_func_dense_lp
-! leanprover-community/mathlib commit 13bf7613c96a9fd66a81b9020a82cad9a6ea1fcf
+! leanprover-community/mathlib commit 5a2df4cd59cb31e97a516d4603a14bed5c2f9425
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -506,7 +506,7 @@ which does not permit this (but has the advantage of working when `E` itself is
 i.e. has no scalar action). -/
 
 
-variable [NormedField 𝕜] [NormedSpace 𝕜 E]
+variable [NormedRing 𝕜] [Module 𝕜 E] [BoundedSMul 𝕜 E]
 
 /-- If `E` is a normed space, `Lp.simple_func E p μ` is a `has_smul`. Not declared as an
 instance as it is (as of writing) used only in the construction of the Bochner integral. -/
@@ -556,13 +556,22 @@ attribute [local instance] simple_func.module
 
 /-- If `E` is a normed space, `Lp.simple_func E p μ` is a normed space. Not declared as an
 instance as it is (as of writing) used only in the construction of the Bochner integral. -/
-protected def normedSpace [Fact (1 ≤ p)] : NormedSpace 𝕜 (lp.simpleFunc E p μ) :=
-  ⟨fun c f => by rw [AddSubgroup.coe_norm, AddSubgroup.coe_norm, coe_smul, norm_smul]⟩
+protected theorem boundedSMul [Fact (1 ≤ p)] : BoundedSMul 𝕜 (lp.simpleFunc E p μ) :=
+  BoundedSMul.of_norm_smul_le fun r f => (norm_smul_le r (f : lp E p μ) : _)
+#align measure_theory.Lp.simple_func.has_bounded_smul MeasureTheory.lp.simpleFunc.boundedSMul
+
+attribute [local instance] simple_func.has_bounded_smul
+
+/-- If `E` is a normed space, `Lp.simple_func E p μ` is a normed space. Not declared as an
+instance as it is (as of writing) used only in the construction of the Bochner integral. -/
+protected def normedSpace {𝕜} [NormedField 𝕜] [NormedSpace 𝕜 E] [Fact (1 ≤ p)] :
+    NormedSpace 𝕜 (lp.simpleFunc E p μ) :=
+  ⟨norm_smul_le⟩
 #align measure_theory.Lp.simple_func.normed_space MeasureTheory.lp.simpleFunc.normedSpace
 
 end Instances
 
-attribute [local instance] simple_func.module simple_func.normed_space
+attribute [local instance] simple_func.module simple_func.normed_space simple_func.has_bounded_smul
 
 section ToLp
 
@@ -601,7 +610,7 @@ theorem toLp_sub (f g : α →ₛ E) (hf : Memℒp f p μ) (hg : Memℒp g p μ)
   rfl
 #align measure_theory.Lp.simple_func.to_Lp_sub MeasureTheory.lp.simpleFunc.toLp_sub
 
-variable [NormedField 𝕜] [NormedSpace 𝕜 E]
+variable [NormedRing 𝕜] [Module 𝕜 E] [BoundedSMul 𝕜 E]
 
 theorem toLp_smul (f : α →ₛ E) (hf : Memℒp f p μ) (c : 𝕜) :
     toLp (c • f) (hf.const_smul c) = c • toLp f hf :=
@@ -707,7 +716,7 @@ theorem sub_toSimpleFunc (f g : lp.simpleFunc E p μ) :
   repeat' intro h; rw [h]
 #align measure_theory.Lp.simple_func.sub_to_simple_func MeasureTheory.lp.simpleFunc.sub_toSimpleFunc
 
-variable [NormedField 𝕜] [NormedSpace 𝕜 E]
+variable [NormedRing 𝕜] [Module 𝕜 E] [BoundedSMul 𝕜 E]
 
 theorem smul_toSimpleFunc (k : 𝕜) (f : lp.simpleFunc E p μ) :
     toSimpleFunc (k • f) =ᵐ[μ] k • toSimpleFunc f :=
@@ -836,7 +845,7 @@ protected theorem denseRange (hp_ne_top : p ≠ ∞) :
   (simpleFunc.denseInducing hp_ne_top).dense
 #align measure_theory.Lp.simple_func.dense_range MeasureTheory.lp.simpleFunc.denseRange
 
-variable [NormedField 𝕜] [NormedSpace 𝕜 E]
+variable [NormedRing 𝕜] [Module 𝕜 E] [BoundedSMul 𝕜 E]
 
 variable (α E 𝕜)
 
Diff
@@ -469,7 +469,7 @@ variable (E)
     function. -/
 def simpleFunc : AddSubgroup (lp E p μ)
     where
-  carrier := { f : lp E p μ | ∃ s : α →ₛ E, (AeEqFun.mk s s.AEStronglyMeasurable : α →ₘ[μ] E) = f }
+  carrier := { f : lp E p μ | ∃ s : α →ₛ E, (AEEqFun.mk s s.AEStronglyMeasurable : α →ₘ[μ] E) = f }
   zero_mem' := ⟨0, rfl⟩
   add_mem' := fun f g ⟨s, hs⟩ ⟨t, ht⟩ =>
     ⟨s + t, by
@@ -577,7 +577,7 @@ theorem toLp_eq_toLp (f : α →ₛ E) (hf : Memℒp f p μ) : (toLp f hf : lp E
 #align measure_theory.Lp.simple_func.to_Lp_eq_to_Lp MeasureTheory.lp.simpleFunc.toLp_eq_toLp
 
 theorem toLp_eq_mk (f : α →ₛ E) (hf : Memℒp f p μ) :
-    (toLp f hf : α →ₘ[μ] E) = AeEqFun.mk f f.AEStronglyMeasurable :=
+    (toLp f hf : α →ₘ[μ] E) = AEEqFun.mk f f.AEStronglyMeasurable :=
   rfl
 #align measure_theory.Lp.simple_func.to_Lp_eq_mk MeasureTheory.lp.simpleFunc.toLp_eq_mk
 
Diff
@@ -146,11 +146,11 @@ theorem memℒp_approxOn [BorelSpace E] {f : β → E} {μ : Measure β} (fmeas
     (hf : Memℒp f p μ) {s : Set E} {y₀ : E} (h₀ : y₀ ∈ s) [SeparableSpace s]
     (hi₀ : Memℒp (fun x => y₀) p μ) (n : ℕ) : Memℒp (approxOn f fmeas s y₀ h₀ n) p μ :=
   by
-  refine' ⟨(approx_on f fmeas s y₀ h₀ n).AeStronglyMeasurable, _⟩
+  refine' ⟨(approx_on f fmeas s y₀ h₀ n).AEStronglyMeasurable, _⟩
   suffices snorm (fun x => approx_on f fmeas s y₀ h₀ n x - y₀) p μ < ⊤
     by
     have : mem_ℒp (fun x => approx_on f fmeas s y₀ h₀ n x - y₀) p μ :=
-      ⟨(approx_on f fmeas s y₀ h₀ n - const β y₀).AeStronglyMeasurable, this⟩
+      ⟨(approx_on f fmeas s y₀ h₀ n - const β y₀).AEStronglyMeasurable, this⟩
     convert snorm_add_lt_top this hi₀
     ext x
     simp
@@ -308,12 +308,12 @@ theorem exists_forall_norm_le (f : α →ₛ F) : ∃ C, ∀ x, ‖f x‖ ≤ C
 #align measure_theory.simple_func.exists_forall_norm_le MeasureTheory.SimpleFunc.exists_forall_norm_le
 
 theorem memℒp_zero (f : α →ₛ E) (μ : Measure α) : Memℒp f 0 μ :=
-  memℒp_zero_iff_aeStronglyMeasurable.mpr f.AeStronglyMeasurable
+  memℒp_zero_iff_aEStronglyMeasurable.mpr f.AEStronglyMeasurable
 #align measure_theory.simple_func.mem_ℒp_zero MeasureTheory.SimpleFunc.memℒp_zero
 
 theorem memℒp_top (f : α →ₛ E) (μ : Measure α) : Memℒp f ∞ μ :=
   let ⟨C, hfC⟩ := f.exists_forall_norm_le
-  memℒp_top_of_bound f.AeStronglyMeasurable C <| eventually_of_forall hfC
+  memℒp_top_of_bound f.AEStronglyMeasurable C <| eventually_of_forall hfC
 #align measure_theory.simple_func.mem_ℒp_top MeasureTheory.SimpleFunc.memℒp_top
 
 protected theorem snorm'_eq {p : ℝ} (f : α →ₛ F) (μ : Measure α) :
@@ -409,7 +409,7 @@ theorem integrable_pair {f : α →ₛ E} {g : α →ₛ F} :
 theorem memℒp_of_finiteMeasure (f : α →ₛ E) (p : ℝ≥0∞) (μ : Measure α) [FiniteMeasure μ] :
     Memℒp f p μ :=
   let ⟨C, hfC⟩ := f.exists_forall_norm_le
-  Memℒp.of_bound f.AeStronglyMeasurable C <| eventually_of_forall hfC
+  Memℒp.of_bound f.AEStronglyMeasurable C <| eventually_of_forall hfC
 #align measure_theory.simple_func.mem_ℒp_of_is_finite_measure MeasureTheory.SimpleFunc.memℒp_of_finiteMeasure
 
 theorem integrable_of_finiteMeasure [FiniteMeasure μ] (f : α →ₛ E) : Integrable f μ :=
@@ -469,7 +469,7 @@ variable (E)
     function. -/
 def simpleFunc : AddSubgroup (lp E p μ)
     where
-  carrier := { f : lp E p μ | ∃ s : α →ₛ E, (AeEqFun.mk s s.AeStronglyMeasurable : α →ₘ[μ] E) = f }
+  carrier := { f : lp E p μ | ∃ s : α →ₛ E, (AeEqFun.mk s s.AEStronglyMeasurable : α →ₘ[μ] E) = f }
   zero_mem' := ⟨0, rfl⟩
   add_mem' := fun f g ⟨s, hs⟩ ⟨t, ht⟩ =>
     ⟨s + t, by
@@ -577,7 +577,7 @@ theorem toLp_eq_toLp (f : α →ₛ E) (hf : Memℒp f p μ) : (toLp f hf : lp E
 #align measure_theory.Lp.simple_func.to_Lp_eq_to_Lp MeasureTheory.lp.simpleFunc.toLp_eq_toLp
 
 theorem toLp_eq_mk (f : α →ₛ E) (hf : Memℒp f p μ) :
-    (toLp f hf : α →ₘ[μ] E) = AeEqFun.mk f f.AeStronglyMeasurable :=
+    (toLp f hf : α →ₘ[μ] E) = AeEqFun.mk f f.AEStronglyMeasurable :=
   rfl
 #align measure_theory.Lp.simple_func.to_Lp_eq_mk MeasureTheory.lp.simpleFunc.toLp_eq_mk
 
@@ -640,16 +640,16 @@ protected theorem aEMeasurable [MeasurableSpace E] (f : lp.simpleFunc E p μ) :
   (simpleFunc.measurable f).AEMeasurable
 #align measure_theory.Lp.simple_func.ae_measurable MeasureTheory.lp.simpleFunc.aEMeasurable
 
-protected theorem aeStronglyMeasurable (f : lp.simpleFunc E p μ) :
-    AeStronglyMeasurable (toSimpleFunc f) μ :=
-  (simpleFunc.stronglyMeasurable f).AeStronglyMeasurable
-#align measure_theory.Lp.simple_func.ae_strongly_measurable MeasureTheory.lp.simpleFunc.aeStronglyMeasurable
+protected theorem aEStronglyMeasurable (f : lp.simpleFunc E p μ) :
+    AEStronglyMeasurable (toSimpleFunc f) μ :=
+  (simpleFunc.stronglyMeasurable f).AEStronglyMeasurable
+#align measure_theory.Lp.simple_func.ae_strongly_measurable MeasureTheory.lp.simpleFunc.aEStronglyMeasurable
 
 theorem toSimpleFunc_eq_to_fun (f : lp.simpleFunc E p μ) : toSimpleFunc f =ᵐ[μ] f :=
   show ⇑(toSimpleFunc f) =ᵐ[μ] ⇑(f : α →ₘ[μ] E)
     by
     convert(ae_eq_fun.coe_fn_mk (to_simple_func f)
-          (to_simple_func f).AeStronglyMeasurable).symm using
+          (to_simple_func f).AEStronglyMeasurable).symm using
       2
     exact (Classical.choose_spec f.2).symm
 #align measure_theory.Lp.simple_func.to_simple_func_eq_to_fun MeasureTheory.lp.simpleFunc.toSimpleFunc_eq_to_fun
@@ -1083,7 +1083,7 @@ theorem Memℒp.induction_dense (hp_ne_top : p ≠ ∞) (P : (α → E) → Prop
         MeasurableSet s →
           μ s < ∞ →
             ∀ {ε : ℝ≥0∞}, ε ≠ 0 → ∃ g : α → E, snorm (g - s.indicator fun x => c) p μ ≤ ε ∧ P g)
-    (h1P : ∀ f g, P f → P g → P (f + g)) (h2P : ∀ f, P f → AeStronglyMeasurable f μ) {f : α → E}
+    (h1P : ∀ f g, P f → P g → P (f + g)) (h2P : ∀ f, P f → AEStronglyMeasurable f μ) {f : α → E}
     (hf : Memℒp f p μ) {ε : ℝ≥0∞} (hε : ε ≠ 0) : ∃ g : α → E, snorm (f - g) p μ ≤ ε ∧ P g :=
   by
   rcases eq_or_ne p 0 with (rfl | hp_pos)
Diff
@@ -406,15 +406,15 @@ theorem integrable_pair {f : α →ₛ E} {g : α →ₛ F} :
   simpa only [integrable_iff_fin_meas_supp] using fin_meas_supp.pair
 #align measure_theory.simple_func.integrable_pair MeasureTheory.SimpleFunc.integrable_pair
 
-theorem memℒp_of_isFiniteMeasure (f : α →ₛ E) (p : ℝ≥0∞) (μ : Measure α) [IsFiniteMeasure μ] :
+theorem memℒp_of_finiteMeasure (f : α →ₛ E) (p : ℝ≥0∞) (μ : Measure α) [FiniteMeasure μ] :
     Memℒp f p μ :=
   let ⟨C, hfC⟩ := f.exists_forall_norm_le
   Memℒp.of_bound f.AeStronglyMeasurable C <| eventually_of_forall hfC
-#align measure_theory.simple_func.mem_ℒp_of_is_finite_measure MeasureTheory.SimpleFunc.memℒp_of_isFiniteMeasure
+#align measure_theory.simple_func.mem_ℒp_of_is_finite_measure MeasureTheory.SimpleFunc.memℒp_of_finiteMeasure
 
-theorem integrable_of_isFiniteMeasure [IsFiniteMeasure μ] (f : α →ₛ E) : Integrable f μ :=
-  memℒp_one_iff_integrable.mp (f.memℒp_of_isFiniteMeasure 1 μ)
-#align measure_theory.simple_func.integrable_of_is_finite_measure MeasureTheory.SimpleFunc.integrable_of_isFiniteMeasure
+theorem integrable_of_finiteMeasure [FiniteMeasure μ] (f : α →ₛ E) : Integrable f μ :=
+  memℒp_one_iff_integrable.mp (f.memℒp_of_finiteMeasure 1 μ)
+#align measure_theory.simple_func.integrable_of_is_finite_measure MeasureTheory.SimpleFunc.integrable_of_finiteMeasure
 
 theorem measure_preimage_lt_top_of_integrable (f : α →ₛ E) (hf : Integrable f μ) {x : E}
     (hx : x ≠ 0) : μ (f ⁻¹' {x}) < ∞ :=
Diff
@@ -142,7 +142,7 @@ theorem tendsto_approxOn_Lp_snorm [OpensMeasurableSpace E] {f : β → E} (hf :
   simpa using tendsto_lintegral_of_dominated_convergence _ hF_meas h_bound h_fin h_lim
 #align measure_theory.simple_func.tendsto_approx_on_Lp_snorm MeasureTheory.SimpleFunc.tendsto_approxOn_Lp_snorm
 
-theorem memℒpApproxOn [BorelSpace E] {f : β → E} {μ : Measure β} (fmeas : Measurable f)
+theorem memℒp_approxOn [BorelSpace E] {f : β → E} {μ : Measure β} (fmeas : Measurable f)
     (hf : Memℒp f p μ) {s : Set E} {y₀ : E} (h₀ : y₀ ∈ s) [SeparableSpace s]
     (hi₀ : Memℒp (fun x => y₀) p μ) (n : ℕ) : Memℒp (approxOn f fmeas s y₀ h₀ n) p μ :=
   by
@@ -178,7 +178,7 @@ theorem memℒpApproxOn [BorelSpace E] {f : β → E} {μ : Measure β} (fmeas :
       snorm_mono_ae this
     _ < ⊤ := snorm_add_lt_top hf' hf'
     
-#align measure_theory.simple_func.mem_ℒp_approx_on MeasureTheory.SimpleFunc.memℒpApproxOn
+#align measure_theory.simple_func.mem_ℒp_approx_on MeasureTheory.SimpleFunc.memℒp_approxOn
 
 theorem tendsto_approxOn_range_Lp_snorm [BorelSpace E] {f : β → E} (hp_ne_top : p ≠ ∞)
     {μ : Measure β} (fmeas : Measurable f) [SeparableSpace (range f ∪ {0} : Set E)]
@@ -193,18 +193,18 @@ theorem tendsto_approxOn_range_Lp_snorm [BorelSpace E] {f : β → E} (hp_ne_top
   · simpa using hf
 #align measure_theory.simple_func.tendsto_approx_on_range_Lp_snorm MeasureTheory.SimpleFunc.tendsto_approxOn_range_Lp_snorm
 
-theorem memℒpApproxOnRange [BorelSpace E] {f : β → E} {μ : Measure β} (fmeas : Measurable f)
+theorem memℒp_approxOn_range [BorelSpace E] {f : β → E} {μ : Measure β} (fmeas : Measurable f)
     [SeparableSpace (range f ∪ {0} : Set E)] (hf : Memℒp f p μ) (n : ℕ) :
     Memℒp (approxOn f fmeas (range f ∪ {0}) 0 (by simp) n) p μ :=
-  memℒpApproxOn fmeas hf (by simp) zeroMemℒp n
-#align measure_theory.simple_func.mem_ℒp_approx_on_range MeasureTheory.SimpleFunc.memℒpApproxOnRange
+  memℒp_approxOn fmeas hf (by simp) zero_memℒp n
+#align measure_theory.simple_func.mem_ℒp_approx_on_range MeasureTheory.SimpleFunc.memℒp_approxOn_range
 
 theorem tendsto_approxOn_range_lp [BorelSpace E] {f : β → E} [hp : Fact (1 ≤ p)] (hp_ne_top : p ≠ ∞)
     {μ : Measure β} (fmeas : Measurable f) [SeparableSpace (range f ∪ {0} : Set E)]
     (hf : Memℒp f p μ) :
     Tendsto
       (fun n =>
-        (memℒpApproxOnRange fmeas hf n).toLp (approxOn f fmeas (range f ∪ {0}) 0 (by simp) n))
+        (memℒp_approxOn_range fmeas hf n).toLp (approxOn f fmeas (range f ∪ {0}) 0 (by simp) n))
       atTop (𝓝 (hf.toLp f)) :=
   by
   simpa only [Lp.tendsto_Lp_iff_tendsto_ℒp''] using
@@ -256,13 +256,13 @@ theorem tendsto_approxOn_L1_nnnorm [OpensMeasurableSpace E] {f : β → E} (hf :
       (by simpa [snorm_one_eq_lintegral_nnnorm] using hi)
 #align measure_theory.simple_func.tendsto_approx_on_L1_nnnorm MeasureTheory.SimpleFunc.tendsto_approxOn_L1_nnnorm
 
-theorem integrableApproxOn [BorelSpace E] {f : β → E} {μ : Measure β} (fmeas : Measurable f)
+theorem integrable_approxOn [BorelSpace E] {f : β → E} {μ : Measure β} (fmeas : Measurable f)
     (hf : Integrable f μ) {s : Set E} {y₀ : E} (h₀ : y₀ ∈ s) [SeparableSpace s]
     (hi₀ : Integrable (fun x => y₀) μ) (n : ℕ) : Integrable (approxOn f fmeas s y₀ h₀ n) μ :=
   by
   rw [← mem_ℒp_one_iff_integrable] at hf hi₀⊢
   exact mem_ℒp_approx_on fmeas hf h₀ hi₀ n
-#align measure_theory.simple_func.integrable_approx_on MeasureTheory.SimpleFunc.integrableApproxOn
+#align measure_theory.simple_func.integrable_approx_on MeasureTheory.SimpleFunc.integrable_approxOn
 
 theorem tendsto_approxOn_range_L1_nnnorm [OpensMeasurableSpace E] {f : β → E} {μ : Measure β}
     [SeparableSpace (range f ∪ {0} : Set E)] (fmeas : Measurable f) (hf : Integrable f μ) :
@@ -277,11 +277,11 @@ theorem tendsto_approxOn_range_L1_nnnorm [OpensMeasurableSpace E] {f : β → E}
   · simpa using hf.2
 #align measure_theory.simple_func.tendsto_approx_on_range_L1_nnnorm MeasureTheory.SimpleFunc.tendsto_approxOn_range_L1_nnnorm
 
-theorem integrableApproxOnRange [BorelSpace E] {f : β → E} {μ : Measure β} (fmeas : Measurable f)
+theorem integrable_approxOn_range [BorelSpace E] {f : β → E} {μ : Measure β} (fmeas : Measurable f)
     [SeparableSpace (range f ∪ {0} : Set E)] (hf : Integrable f μ) (n : ℕ) :
     Integrable (approxOn f fmeas (range f ∪ {0}) 0 (by simp) n) μ :=
-  integrableApproxOn fmeas hf _ (integrableZero _ _ _) n
-#align measure_theory.simple_func.integrable_approx_on_range MeasureTheory.SimpleFunc.integrableApproxOnRange
+  integrable_approxOn fmeas hf _ (integrable_zero _ _ _) n
+#align measure_theory.simple_func.integrable_approx_on_range MeasureTheory.SimpleFunc.integrable_approxOn_range
 
 end Integrable
 
@@ -307,14 +307,14 @@ theorem exists_forall_norm_le (f : α →ₛ F) : ∃ C, ∀ x, ‖f x‖ ≤ C
   exists_forall_le (f.map fun x => ‖x‖)
 #align measure_theory.simple_func.exists_forall_norm_le MeasureTheory.SimpleFunc.exists_forall_norm_le
 
-theorem memℒpZero (f : α →ₛ E) (μ : Measure α) : Memℒp f 0 μ :=
+theorem memℒp_zero (f : α →ₛ E) (μ : Measure α) : Memℒp f 0 μ :=
   memℒp_zero_iff_aeStronglyMeasurable.mpr f.AeStronglyMeasurable
-#align measure_theory.simple_func.mem_ℒp_zero MeasureTheory.SimpleFunc.memℒpZero
+#align measure_theory.simple_func.mem_ℒp_zero MeasureTheory.SimpleFunc.memℒp_zero
 
-theorem memℒpTop (f : α →ₛ E) (μ : Measure α) : Memℒp f ∞ μ :=
+theorem memℒp_top (f : α →ₛ E) (μ : Measure α) : Memℒp f ∞ μ :=
   let ⟨C, hfC⟩ := f.exists_forall_norm_le
-  memℒpTopOfBound f.AeStronglyMeasurable C <| eventually_of_forall hfC
-#align measure_theory.simple_func.mem_ℒp_top MeasureTheory.SimpleFunc.memℒpTop
+  memℒp_top_of_bound f.AeStronglyMeasurable C <| eventually_of_forall hfC
+#align measure_theory.simple_func.mem_ℒp_top MeasureTheory.SimpleFunc.memℒp_top
 
 protected theorem snorm'_eq {p : ℝ} (f : α →ₛ F) (μ : Measure α) :
     snorm' f p μ = (∑ y in f.range, (‖y‖₊ : ℝ≥0∞) ^ p * μ (f ⁻¹' {y})) ^ (1 / p) :=
@@ -353,7 +353,7 @@ theorem measure_preimage_lt_top_of_memℒp (hp_pos : p ≠ 0) (hp_ne_top : p ≠
 #align measure_theory.simple_func.measure_preimage_lt_top_of_mem_ℒp MeasureTheory.SimpleFunc.measure_preimage_lt_top_of_memℒp
 
 /- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (y «expr ≠ » 0) -/
-theorem memℒpOfFiniteMeasurePreimage (p : ℝ≥0∞) {f : α →ₛ E}
+theorem memℒp_of_finite_measure_preimage (p : ℝ≥0∞) {f : α →ₛ E}
     (hf : ∀ (y) (_ : y ≠ 0), μ (f ⁻¹' {y}) < ∞) : Memℒp f p μ :=
   by
   by_cases hp0 : p = 0
@@ -369,13 +369,13 @@ theorem memℒpOfFiniteMeasurePreimage (p : ℝ≥0∞) {f : α →ₛ E}
   · simp [hy0, ENNReal.toReal_pos hp0 hp_top]
   · refine' ENNReal.mul_lt_top _ (hf y hy0).Ne
     exact (ENNReal.rpow_lt_top_of_nonneg ENNReal.toReal_nonneg ENNReal.coe_ne_top).Ne
-#align measure_theory.simple_func.mem_ℒp_of_finite_measure_preimage MeasureTheory.SimpleFunc.memℒpOfFiniteMeasurePreimage
+#align measure_theory.simple_func.mem_ℒp_of_finite_measure_preimage MeasureTheory.SimpleFunc.memℒp_of_finite_measure_preimage
 
 /- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (y «expr ≠ » 0) -/
 theorem memℒp_iff {f : α →ₛ E} (hp_pos : p ≠ 0) (hp_ne_top : p ≠ ∞) :
     Memℒp f p μ ↔ ∀ (y) (_ : y ≠ 0), μ (f ⁻¹' {y}) < ∞ :=
   ⟨fun h => measure_preimage_lt_top_of_memℒp hp_pos hp_ne_top f h, fun h =>
-    memℒpOfFiniteMeasurePreimage p h⟩
+    memℒp_of_finite_measure_preimage p h⟩
 #align measure_theory.simple_func.mem_ℒp_iff MeasureTheory.SimpleFunc.memℒp_iff
 
 /- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (y «expr ≠ » 0) -/
@@ -401,20 +401,20 @@ theorem FinMeasSupp.integrable {f : α →ₛ E} (h : f.FinMeasSupp μ) : Integr
   integrable_iff_finMeasSupp.2 h
 #align measure_theory.simple_func.fin_meas_supp.integrable MeasureTheory.SimpleFunc.FinMeasSupp.integrable
 
-theorem integrablePair {f : α →ₛ E} {g : α →ₛ F} :
+theorem integrable_pair {f : α →ₛ E} {g : α →ₛ F} :
     Integrable f μ → Integrable g μ → Integrable (pair f g) μ := by
   simpa only [integrable_iff_fin_meas_supp] using fin_meas_supp.pair
-#align measure_theory.simple_func.integrable_pair MeasureTheory.SimpleFunc.integrablePair
+#align measure_theory.simple_func.integrable_pair MeasureTheory.SimpleFunc.integrable_pair
 
-theorem memℒpOfIsFiniteMeasure (f : α →ₛ E) (p : ℝ≥0∞) (μ : Measure α) [IsFiniteMeasure μ] :
+theorem memℒp_of_isFiniteMeasure (f : α →ₛ E) (p : ℝ≥0∞) (μ : Measure α) [IsFiniteMeasure μ] :
     Memℒp f p μ :=
   let ⟨C, hfC⟩ := f.exists_forall_norm_le
-  Memℒp.ofBound f.AeStronglyMeasurable C <| eventually_of_forall hfC
-#align measure_theory.simple_func.mem_ℒp_of_is_finite_measure MeasureTheory.SimpleFunc.memℒpOfIsFiniteMeasure
+  Memℒp.of_bound f.AeStronglyMeasurable C <| eventually_of_forall hfC
+#align measure_theory.simple_func.mem_ℒp_of_is_finite_measure MeasureTheory.SimpleFunc.memℒp_of_isFiniteMeasure
 
-theorem integrableOfIsFiniteMeasure [IsFiniteMeasure μ] (f : α →ₛ E) : Integrable f μ :=
-  memℒp_one_iff_integrable.mp (f.memℒpOfIsFiniteMeasure 1 μ)
-#align measure_theory.simple_func.integrable_of_is_finite_measure MeasureTheory.SimpleFunc.integrableOfIsFiniteMeasure
+theorem integrable_of_isFiniteMeasure [IsFiniteMeasure μ] (f : α →ₛ E) : Integrable f μ :=
+  memℒp_one_iff_integrable.mp (f.memℒp_of_isFiniteMeasure 1 μ)
+#align measure_theory.simple_func.integrable_of_is_finite_measure MeasureTheory.SimpleFunc.integrable_of_isFiniteMeasure
 
 theorem measure_preimage_lt_top_of_integrable (f : α →ₛ E) (hf : Integrable f μ) {x : E}
     (hx : x ≠ 0) : μ (f ⁻¹' {x}) < ∞ :=
@@ -581,7 +581,7 @@ theorem toLp_eq_mk (f : α →ₛ E) (hf : Memℒp f p μ) :
   rfl
 #align measure_theory.Lp.simple_func.to_Lp_eq_mk MeasureTheory.lp.simpleFunc.toLp_eq_mk
 
-theorem toLp_zero : toLp (0 : α →ₛ E) zeroMemℒp = (0 : lp.simpleFunc E p μ) :=
+theorem toLp_zero : toLp (0 : α →ₛ E) zero_memℒp = (0 : lp.simpleFunc E p μ) :=
   rfl
 #align measure_theory.Lp.simple_func.to_Lp_zero MeasureTheory.lp.simpleFunc.toLp_zero
 
@@ -635,10 +635,10 @@ protected theorem stronglyMeasurable (f : lp.simpleFunc E p μ) :
 #align measure_theory.Lp.simple_func.strongly_measurable MeasureTheory.lp.simpleFunc.stronglyMeasurable
 
 @[measurability]
-protected theorem aeMeasurable [MeasurableSpace E] (f : lp.simpleFunc E p μ) :
-    AeMeasurable (toSimpleFunc f) μ :=
-  (simpleFunc.measurable f).AeMeasurable
-#align measure_theory.Lp.simple_func.ae_measurable MeasureTheory.lp.simpleFunc.aeMeasurable
+protected theorem aEMeasurable [MeasurableSpace E] (f : lp.simpleFunc E p μ) :
+    AEMeasurable (toSimpleFunc f) μ :=
+  (simpleFunc.measurable f).AEMeasurable
+#align measure_theory.Lp.simple_func.ae_measurable MeasureTheory.lp.simpleFunc.aEMeasurable
 
 protected theorem aeStronglyMeasurable (f : lp.simpleFunc E p μ) :
     AeStronglyMeasurable (toSimpleFunc f) μ :=
@@ -656,7 +656,7 @@ theorem toSimpleFunc_eq_to_fun (f : lp.simpleFunc E p μ) : toSimpleFunc f =ᵐ[
 
 /-- `to_simple_func f` satisfies the predicate `mem_ℒp`. -/
 protected theorem memℒp (f : lp.simpleFunc E p μ) : Memℒp (toSimpleFunc f) p μ :=
-  Memℒp.aeEq (toSimpleFunc_eq_to_fun f).symm <| mem_lp_iff_memℒp.mp (f : lp E p μ).2
+  Memℒp.ae_eq (toSimpleFunc_eq_to_fun f).symm <| mem_lp_iff_memℒp.mp (f : lp E p μ).2
 #align measure_theory.Lp.simple_func.mem_ℒp MeasureTheory.lp.simpleFunc.memℒp
 
 theorem toLp_toSimpleFunc (f : lp.simpleFunc E p μ) :
@@ -734,7 +734,7 @@ variable (p)
 def indicatorConst {s : Set α} (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (c : E) :
     lp.simpleFunc E p μ :=
   toLp ((SimpleFunc.const _ c).piecewise s hs (SimpleFunc.const _ 0))
-    (memℒpIndicatorConst p hs c (Or.inr hμs))
+    (memℒp_indicator_const p hs c (Or.inr hμs))
 #align measure_theory.Lp.simple_func.indicator_const MeasureTheory.lp.simpleFunc.indicatorConst
 
 variable {p}
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Zhouhang Zhou, Yury Kudryashov, Heather Macbeth
 
 ! This file was ported from Lean 3 source module measure_theory.function.simple_func_dense_lp
-! leanprover-community/mathlib commit a8c97ed34c07fcfd7ebc6b83179b8f687275eba9
+! leanprover-community/mathlib commit 13bf7613c96a9fd66a81b9020a82cad9a6ea1fcf
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -211,6 +211,31 @@ theorem tendsto_approxOn_range_lp [BorelSpace E] {f : β → E} [hp : Fact (1 
     tendsto_approx_on_range_Lp_snorm hp_ne_top fmeas hf.2
 #align measure_theory.simple_func.tendsto_approx_on_range_Lp MeasureTheory.SimpleFunc.tendsto_approxOn_range_lp
 
+/-- Any function in `ℒp` can be approximated by a simple function if `p < ∞`. -/
+theorem MeasureTheory.Memℒp.exists_simpleFunc_snorm_sub_lt {E : Type _} [NormedAddCommGroup E]
+    {f : β → E} {μ : Measure β} (hf : Memℒp f p μ) (hp_ne_top : p ≠ ∞) {ε : ℝ≥0∞} (hε : ε ≠ 0) :
+    ∃ g : β →ₛ E, snorm (f - g) p μ < ε ∧ Memℒp g p μ :=
+  by
+  borelize E
+  let f' := hf.1.mk f
+  suffices H : ∃ g : β →ₛ E, snorm (f' - g) p μ < ε ∧ mem_ℒp g p μ
+  · rcases H with ⟨g, hg, g_mem⟩
+    refine' ⟨g, _, g_mem⟩
+    convert hg using 1
+    apply snorm_congr_ae
+    filter_upwards [hf.1.ae_eq_mk]with x hx
+    simpa only [Pi.sub_apply, sub_left_inj] using hx
+  have hf' : mem_ℒp f' p μ := hf.ae_eq hf.1.ae_eq_mk
+  have f'meas : Measurable f' := hf.1.measurable_mk
+  have : separable_space (range f' ∪ {0} : Set E) :=
+    strongly_measurable.separable_space_range_union_singleton hf.1.stronglyMeasurable_mk
+  rcases((tendsto_order.1 (tendsto_approx_on_range_Lp_snorm hp_ne_top f'meas hf'.2)).2 ε
+        hε.bot_lt).exists with
+    ⟨n, hn⟩
+  rw [← snorm_neg, neg_sub] at hn
+  exact ⟨_, hn, mem_ℒp_approx_on_range f'meas hf' _⟩
+#align measure_theory.mem_ℒp.exists_simple_func_snorm_sub_lt MeasureTheory.Memℒp.exists_simpleFunc_snorm_sub_lt
+
 end Lp
 
 /-! ### L1 approximation by simple functions -/
@@ -1052,7 +1077,7 @@ theorem Memℒp.induction [_i : Fact (1 ≤ p)] (hp_ne_top : p ≠ ∞) (P : (α
 
 /-- If a set of ae strongly measurable functions is stable under addition and approximates
 characteristic functions in `ℒp`, then it is dense in `ℒp`. -/
-theorem Memℒp.induction_dense (hp_ne_top : p ≠ ∞) (h'p : 1 ≤ p) (P : (α → E) → Prop)
+theorem Memℒp.induction_dense (hp_ne_top : p ≠ ∞) (P : (α → E) → Prop)
     (h0P :
       ∀ (c : E) ⦃s : Set α⦄,
         MeasurableSet s →
@@ -1061,52 +1086,44 @@ theorem Memℒp.induction_dense (hp_ne_top : p ≠ ∞) (h'p : 1 ≤ p) (P : (α
     (h1P : ∀ f g, P f → P g → P (f + g)) (h2P : ∀ f, P f → AeStronglyMeasurable f μ) {f : α → E}
     (hf : Memℒp f p μ) {ε : ℝ≥0∞} (hε : ε ≠ 0) : ∃ g : α → E, snorm (f - g) p μ ≤ ε ∧ P g :=
   by
-  haveI : Fact (1 ≤ p) := ⟨h'p⟩
-  revert f hf ε
-  refine' mem_ℒp.induction hp_ne_top _ _ _ _ _
-  · intro c s hs hμs ε εpos
-    rcases h0P c hs hμs εpos with ⟨g, hg, Pg⟩
-    rw [← snorm_neg, neg_sub] at hg
-    exact ⟨g, hg, Pg⟩
-  · intro f f' hff' hf hf' Hf Hf' ε εpos
-    have A : ε / 2 ≠ 0 := by simp [εpos]
-    rcases Hf A with ⟨g, hfg, Pg⟩
-    rcases Hf' A with ⟨g', hf'g', Pg'⟩
-    refine' ⟨g + g', _, h1P g g' Pg Pg'⟩
-    calc
-      snorm (f + f' - (g + g')) p μ = snorm (f - g + (f' - g')) p μ :=
-        by
-        congr 1
-        abel
-      _ ≤ snorm (f - g) p μ + snorm (f' - g') p μ :=
-        (snorm_add_le (hf.ae_strongly_measurable.sub (h2P g Pg))
-          (hf'.ae_strongly_measurable.sub (h2P g' Pg')) h'p)
-      _ ≤ ε / 2 + ε / 2 := (add_le_add hfg hf'g')
-      _ = ε := ENNReal.add_halves _
-      
-  · rw [isClosed_iff_nhds]
-    intro f hf ε εpos
-    have A : ε / 2 ≠ 0 := by simp [εpos]
-    rcases hf (EMetric.ball f (ε / 2)) (EMetric.ball_mem_nhds _ A.bot_lt) with ⟨f', hf', h'f'⟩
-    rcases h'f' A with ⟨g, hg, Pg⟩
+  rcases eq_or_ne p 0 with (rfl | hp_pos)
+  · rcases h0P (0 : E) MeasurableSet.empty (by simp only [measure_empty, WithTop.zero_lt_top])
+        hε with ⟨g, hg, Pg⟩
+    exact ⟨g, by simp only [snorm_exponent_zero, zero_le'], Pg⟩
+  suffices H :
+    ∀ (f' : α →ₛ E) (δ : ℝ≥0∞) (hδ : δ ≠ 0), mem_ℒp f' p μ → ∃ g, snorm (f' - g) p μ ≤ δ ∧ P g
+  · obtain ⟨η, ηpos, hη⟩ := exists_Lp_half E μ p hε
+    rcases hf.exists_simple_func_snorm_sub_lt hp_ne_top ηpos.ne' with ⟨f', hf', f'_mem⟩
+    rcases H f' η ηpos.ne' f'_mem with ⟨g, hg, Pg⟩
     refine' ⟨g, _, Pg⟩
-    calc
-      snorm (f - g) p μ = snorm (f - f' + (f' - g)) p μ := by simp only [sub_add_sub_cancel]
-      _ ≤ snorm (f - f') p μ + snorm (f' - g) p μ :=
-        (snorm_add_le ((Lp.mem_ℒp f).sub (Lp.mem_ℒp f')).AeStronglyMeasurable
-          ((Lp.mem_ℒp f').AeStronglyMeasurable.sub (h2P g Pg)) h'p)
-      _ ≤ ε / 2 + ε / 2 := by
-        refine' add_le_add _ hg
-        rw [← snorm_neg, neg_sub]
-        simp only [Lp.edist_def, EMetric.mem_ball] at hf'
-        exact hf'.le
-      _ = ε := ENNReal.add_halves _
-      
-  · intro f f' hff' hf Hf ε εpos
-    rcases Hf εpos with ⟨g, hg, Pg⟩
-    refine' ⟨g, _, Pg⟩
-    have : f - g =ᵐ[μ] f' - g := hff'.sub (filter.germ.coe_eq.mp rfl)
-    rwa [← snorm_congr_ae this]
+    convert(hη _ _ (hf.ae_strongly_measurable.sub f'.ae_strongly_measurable)
+          (f'.ae_strongly_measurable.sub (h2P g Pg)) hf'.le hg).le
+    simp only [sub_add_sub_cancel]
+  refine' simple_func.induction _ _
+  · intro c s hs ε εpos Hs
+    rcases eq_or_ne c 0 with (rfl | hc)
+    · rcases h0P (0 : E) MeasurableSet.empty (by simp only [measure_empty, WithTop.zero_lt_top])
+          εpos with ⟨g, hg, Pg⟩
+      rw [← snorm_neg, neg_sub] at hg
+      refine' ⟨g, _, Pg⟩
+      convert hg
+      ext x
+      simp only [simple_func.const_zero, simple_func.coe_piecewise, simple_func.coe_zero,
+        piecewise_eq_indicator, indicator_zero', Pi.zero_apply, indicator_zero]
+    · have : μ s < ∞ := simple_func.measure_lt_top_of_mem_ℒp_indicator hp_pos hp_ne_top hc hs Hs
+      rcases h0P c hs this εpos with ⟨g, hg, Pg⟩
+      rw [← snorm_neg, neg_sub] at hg
+      exact ⟨g, hg, Pg⟩
+  · intro f f' hff' hf hf' δ δpos int_ff'
+    obtain ⟨η, ηpos, hη⟩ := exists_Lp_half E μ p δpos
+    rw [simple_func.coe_add,
+      mem_ℒp_add_of_disjoint hff' f.strongly_measurable f'.strongly_measurable] at int_ff'
+    rcases hf η ηpos.ne' int_ff'.1 with ⟨g, hg, Pg⟩
+    rcases hf' η ηpos.ne' int_ff'.2 with ⟨g', hg', Pg'⟩
+    refine' ⟨g + g', _, h1P g g' Pg Pg'⟩
+    convert(hη _ _ (f.ae_strongly_measurable.sub (h2P g Pg))
+          (f'.ae_strongly_measurable.sub (h2P g' Pg')) hg hg').le
+    abel
 #align measure_theory.mem_ℒp.induction_dense MeasureTheory.Memℒp.induction_dense
 
 section Integrable
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Zhouhang Zhou, Yury Kudryashov, Heather Macbeth
 
 ! This file was ported from Lean 3 source module measure_theory.function.simple_func_dense_lp
-! leanprover-community/mathlib commit 57ac39bd365c2f80589a700f9fbb664d3a1a30c2
+! leanprover-community/mathlib commit a8c97ed34c07fcfd7ebc6b83179b8f687275eba9
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -1050,6 +1050,65 @@ theorem Memℒp.induction [_i : Fact (1 ≤ p)] (hp_ne_top : p ≠ ∞) (P : (α
   exact fun f hf => h_ae hf.coeFn_toLp (Lp.mem_ℒp _) (this (hf.toLp f))
 #align measure_theory.mem_ℒp.induction MeasureTheory.Memℒp.induction
 
+/-- If a set of ae strongly measurable functions is stable under addition and approximates
+characteristic functions in `ℒp`, then it is dense in `ℒp`. -/
+theorem Memℒp.induction_dense (hp_ne_top : p ≠ ∞) (h'p : 1 ≤ p) (P : (α → E) → Prop)
+    (h0P :
+      ∀ (c : E) ⦃s : Set α⦄,
+        MeasurableSet s →
+          μ s < ∞ →
+            ∀ {ε : ℝ≥0∞}, ε ≠ 0 → ∃ g : α → E, snorm (g - s.indicator fun x => c) p μ ≤ ε ∧ P g)
+    (h1P : ∀ f g, P f → P g → P (f + g)) (h2P : ∀ f, P f → AeStronglyMeasurable f μ) {f : α → E}
+    (hf : Memℒp f p μ) {ε : ℝ≥0∞} (hε : ε ≠ 0) : ∃ g : α → E, snorm (f - g) p μ ≤ ε ∧ P g :=
+  by
+  haveI : Fact (1 ≤ p) := ⟨h'p⟩
+  revert f hf ε
+  refine' mem_ℒp.induction hp_ne_top _ _ _ _ _
+  · intro c s hs hμs ε εpos
+    rcases h0P c hs hμs εpos with ⟨g, hg, Pg⟩
+    rw [← snorm_neg, neg_sub] at hg
+    exact ⟨g, hg, Pg⟩
+  · intro f f' hff' hf hf' Hf Hf' ε εpos
+    have A : ε / 2 ≠ 0 := by simp [εpos]
+    rcases Hf A with ⟨g, hfg, Pg⟩
+    rcases Hf' A with ⟨g', hf'g', Pg'⟩
+    refine' ⟨g + g', _, h1P g g' Pg Pg'⟩
+    calc
+      snorm (f + f' - (g + g')) p μ = snorm (f - g + (f' - g')) p μ :=
+        by
+        congr 1
+        abel
+      _ ≤ snorm (f - g) p μ + snorm (f' - g') p μ :=
+        (snorm_add_le (hf.ae_strongly_measurable.sub (h2P g Pg))
+          (hf'.ae_strongly_measurable.sub (h2P g' Pg')) h'p)
+      _ ≤ ε / 2 + ε / 2 := (add_le_add hfg hf'g')
+      _ = ε := ENNReal.add_halves _
+      
+  · rw [isClosed_iff_nhds]
+    intro f hf ε εpos
+    have A : ε / 2 ≠ 0 := by simp [εpos]
+    rcases hf (EMetric.ball f (ε / 2)) (EMetric.ball_mem_nhds _ A.bot_lt) with ⟨f', hf', h'f'⟩
+    rcases h'f' A with ⟨g, hg, Pg⟩
+    refine' ⟨g, _, Pg⟩
+    calc
+      snorm (f - g) p μ = snorm (f - f' + (f' - g)) p μ := by simp only [sub_add_sub_cancel]
+      _ ≤ snorm (f - f') p μ + snorm (f' - g) p μ :=
+        (snorm_add_le ((Lp.mem_ℒp f).sub (Lp.mem_ℒp f')).AeStronglyMeasurable
+          ((Lp.mem_ℒp f').AeStronglyMeasurable.sub (h2P g Pg)) h'p)
+      _ ≤ ε / 2 + ε / 2 := by
+        refine' add_le_add _ hg
+        rw [← snorm_neg, neg_sub]
+        simp only [Lp.edist_def, EMetric.mem_ball] at hf'
+        exact hf'.le
+      _ = ε := ENNReal.add_halves _
+      
+  · intro f f' hff' hf Hf ε εpos
+    rcases Hf εpos with ⟨g, hg, Pg⟩
+    refine' ⟨g, _, Pg⟩
+    have : f - g =ᵐ[μ] f' - g := hff'.sub (filter.germ.coe_eq.mp rfl)
+    rwa [← snorm_congr_ae this]
+#align measure_theory.mem_ℒp.induction_dense MeasureTheory.Memℒp.induction_dense
+
 section Integrable
 
 -- mathport name: «expr →₁ₛ[ ] »
Diff
@@ -623,8 +623,9 @@ protected theorem aeStronglyMeasurable (f : lp.simpleFunc E p μ) :
 theorem toSimpleFunc_eq_to_fun (f : lp.simpleFunc E p μ) : toSimpleFunc f =ᵐ[μ] f :=
   show ⇑(toSimpleFunc f) =ᵐ[μ] ⇑(f : α →ₘ[μ] E)
     by
-    convert
-      (ae_eq_fun.coe_fn_mk (to_simple_func f) (to_simple_func f).AeStronglyMeasurable).symm using 2
+    convert(ae_eq_fun.coe_fn_mk (to_simple_func f)
+          (to_simple_func f).AeStronglyMeasurable).symm using
+      2
     exact (Classical.choose_spec f.2).symm
 #align measure_theory.Lp.simple_func.to_simple_func_eq_to_fun MeasureTheory.lp.simpleFunc.toSimpleFunc_eq_to_fun
 
@@ -795,8 +796,8 @@ protected theorem denseEmbedding (hp_ne_top : p ≠ ∞) :
             n)
           (simple_func.mem_ℒp_approx_on_range (Lp.strongly_measurable f).Measurable hfi' n)),
       fun n => mem_range_self _, _⟩
-  convert
-    simple_func.tendsto_approx_on_range_Lp hp_ne_top (Lp.strongly_measurable f).Measurable hfi'
+  convert simple_func.tendsto_approx_on_range_Lp hp_ne_top (Lp.strongly_measurable f).Measurable
+      hfi'
   rw [to_Lp_coe_fn f (Lp.mem_ℒp f)]
 #align measure_theory.Lp.simple_func.dense_embedding MeasureTheory.lp.simpleFunc.denseEmbedding
 
Diff
@@ -327,7 +327,7 @@ theorem measure_preimage_lt_top_of_memℒp (hp_pos : p ≠ 0) (hp_ne_top : p ≠
   · simp [hf_snorm]
 #align measure_theory.simple_func.measure_preimage_lt_top_of_mem_ℒp MeasureTheory.SimpleFunc.measure_preimage_lt_top_of_memℒp
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:628:2: warning: expanding binder collection (y «expr ≠ » 0) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (y «expr ≠ » 0) -/
 theorem memℒpOfFiniteMeasurePreimage (p : ℝ≥0∞) {f : α →ₛ E}
     (hf : ∀ (y) (_ : y ≠ 0), μ (f ⁻¹' {y}) < ∞) : Memℒp f p μ :=
   by
@@ -346,14 +346,14 @@ theorem memℒpOfFiniteMeasurePreimage (p : ℝ≥0∞) {f : α →ₛ E}
     exact (ENNReal.rpow_lt_top_of_nonneg ENNReal.toReal_nonneg ENNReal.coe_ne_top).Ne
 #align measure_theory.simple_func.mem_ℒp_of_finite_measure_preimage MeasureTheory.SimpleFunc.memℒpOfFiniteMeasurePreimage
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:628:2: warning: expanding binder collection (y «expr ≠ » 0) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (y «expr ≠ » 0) -/
 theorem memℒp_iff {f : α →ₛ E} (hp_pos : p ≠ 0) (hp_ne_top : p ≠ ∞) :
     Memℒp f p μ ↔ ∀ (y) (_ : y ≠ 0), μ (f ⁻¹' {y}) < ∞ :=
   ⟨fun h => measure_preimage_lt_top_of_memℒp hp_pos hp_ne_top f h, fun h =>
     memℒpOfFiniteMeasurePreimage p h⟩
 #align measure_theory.simple_func.mem_ℒp_iff MeasureTheory.SimpleFunc.memℒp_iff
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:628:2: warning: expanding binder collection (y «expr ≠ » 0) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (y «expr ≠ » 0) -/
 theorem integrable_iff {f : α →ₛ E} : Integrable f μ ↔ ∀ (y) (_ : y ≠ 0), μ (f ⁻¹' {y}) < ∞ :=
   memℒp_one_iff_integrable.symm.trans <| memℒp_iff one_ne_zero ENNReal.coe_ne_top
 #align measure_theory.simple_func.integrable_iff MeasureTheory.SimpleFunc.integrable_iff
@@ -396,7 +396,7 @@ theorem measure_preimage_lt_top_of_integrable (f : α →ₛ E) (hf : Integrable
   integrable_iff.mp hf x hx
 #align measure_theory.simple_func.measure_preimage_lt_top_of_integrable MeasureTheory.SimpleFunc.measure_preimage_lt_top_of_integrable
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:628:2: warning: expanding binder collection (y «expr ≠ » 0) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (y «expr ≠ » 0) -/
 theorem measure_support_lt_top [Zero β] (f : α →ₛ β) (hf : ∀ (y) (_ : y ≠ 0), μ (f ⁻¹' {y}) < ∞) :
     μ (support f) < ∞ := by
   rw [support_eq]
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Zhouhang Zhou, Yury Kudryashov, Heather Macbeth
 
 ! This file was ported from Lean 3 source module measure_theory.function.simple_func_dense_lp
-! leanprover-community/mathlib commit f2ce6086713c78a7f880485f7917ea547a215982
+! leanprover-community/mathlib commit 57ac39bd365c2f80589a700f9fbb664d3a1a30c2
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -355,7 +355,7 @@ theorem memℒp_iff {f : α →ₛ E} (hp_pos : p ≠ 0) (hp_ne_top : p ≠ ∞)
 
 /- ./././Mathport/Syntax/Translate/Basic.lean:628:2: warning: expanding binder collection (y «expr ≠ » 0) -/
 theorem integrable_iff {f : α →ₛ E} : Integrable f μ ↔ ∀ (y) (_ : y ≠ 0), μ (f ⁻¹' {y}) < ∞ :=
-  memℒp_one_iff_integrable.symm.trans <| memℒp_iff ENNReal.zero_lt_one.ne' ENNReal.coe_ne_top
+  memℒp_one_iff_integrable.symm.trans <| memℒp_iff one_ne_zero ENNReal.coe_ne_top
 #align measure_theory.simple_func.integrable_iff MeasureTheory.SimpleFunc.integrable_iff
 
 theorem memℒp_iff_integrable {f : α →ₛ E} (hp_pos : p ≠ 0) (hp_ne_top : p ≠ ∞) :
@@ -998,7 +998,7 @@ theorem lp.induction [_i : Fact (1 ≤ p)] (hp_ne_top : p ≠ ∞) (P : lp E p 
     (h_closed : IsClosed { f : lp E p μ | P f }) : ∀ f : lp E p μ, P f :=
   by
   refine' fun f => (Lp.simple_func.dense_range hp_ne_top).inductionOn f h_closed _
-  refine' Lp.simple_func.induction (lt_of_lt_of_le ENNReal.zero_lt_one _i.elim).ne' hp_ne_top _ _
+  refine' Lp.simple_func.induction (lt_of_lt_of_le zero_lt_one _i.elim).ne' hp_ne_top _ _
   · exact fun c s => h_ind c
   · exact fun f g hf hg => h_add hf hg
 #align measure_theory.Lp.induction MeasureTheory.lp.induction
@@ -1033,7 +1033,7 @@ theorem Memℒp.induction [_i : Fact (1 ≤ p)] (hp_ne_top : p ≠ ∞) (P : (α
         convert h_ind 0 MeasurableSet.empty (by simp) using 1
         ext
         simp [const]
-      have hp_pos : p ≠ 0 := (lt_of_lt_of_le ENNReal.zero_lt_one _i.elim).ne'
+      have hp_pos : p ≠ 0 := (lt_of_lt_of_le zero_lt_one _i.elim).ne'
       exact h_ind c hs (simple_func.measure_lt_top_of_mem_ℒp_indicator hp_pos hp_ne_top hc hs h)
     · intro f g hfg hf hg int_fg
       rw [simple_func.coe_add,
Diff
@@ -47,9 +47,9 @@ For `E` finite-dimensional, simple functions `α →ₛ E` are dense in L^∞ --
 
 noncomputable section
 
-open Set Function Filter TopologicalSpace Ennreal Emetric Finset
+open Set Function Filter TopologicalSpace ENNReal Emetric Finset
 
-open Classical Topology Ennreal MeasureTheory BigOperators
+open Classical Topology ENNReal MeasureTheory BigOperators
 
 variable {α β ι E F 𝕜 : Type _}
 
@@ -301,24 +301,24 @@ protected theorem snorm'_eq {p : ℝ} (f : α →ₛ F) (μ : Measure α) :
 theorem measure_preimage_lt_top_of_memℒp (hp_pos : p ≠ 0) (hp_ne_top : p ≠ ∞) (f : α →ₛ E)
     (hf : Memℒp f p μ) (y : E) (hy_ne : y ≠ 0) : μ (f ⁻¹' {y}) < ∞ :=
   by
-  have hp_pos_real : 0 < p.to_real := Ennreal.toReal_pos hp_pos hp_ne_top
+  have hp_pos_real : 0 < p.to_real := ENNReal.toReal_pos hp_pos hp_ne_top
   have hf_snorm := mem_ℒp.snorm_lt_top hf
   rw [snorm_eq_snorm' hp_pos hp_ne_top, f.snorm'_eq, ←
-    @Ennreal.lt_rpow_one_div_iff _ _ (1 / p.to_real) (by simp [hp_pos_real]),
-    @Ennreal.top_rpow_of_pos (1 / (1 / p.to_real)) (by simp [hp_pos_real]),
-    Ennreal.sum_lt_top_iff] at hf_snorm
+    @ENNReal.lt_rpow_one_div_iff _ _ (1 / p.to_real) (by simp [hp_pos_real]),
+    @ENNReal.top_rpow_of_pos (1 / (1 / p.to_real)) (by simp [hp_pos_real]),
+    ENNReal.sum_lt_top_iff] at hf_snorm
   by_cases hyf : y ∈ f.range
   swap
   · suffices h_empty : f ⁻¹' {y} = ∅
     · rw [h_empty, measure_empty]
-      exact Ennreal.coe_lt_top
+      exact ENNReal.coe_lt_top
     ext1 x
     rw [Set.mem_preimage, Set.mem_singleton_iff, mem_empty_iff_false, iff_false_iff]
     refine' fun hxy => hyf _
     rw [mem_range, Set.mem_range]
     exact ⟨x, hxy⟩
   specialize hf_snorm y hyf
-  rw [Ennreal.mul_lt_top_iff] at hf_snorm
+  rw [ENNReal.mul_lt_top_iff] at hf_snorm
   cases hf_snorm
   · exact hf_snorm.2
   cases hf_snorm
@@ -339,11 +339,11 @@ theorem memℒpOfFiniteMeasurePreimage (p : ℝ≥0∞) {f : α →ₛ E}
     exact mem_ℒp_top f μ
   refine' ⟨f.ae_strongly_measurable, _⟩
   rw [snorm_eq_snorm' hp0 hp_top, f.snorm'_eq]
-  refine' Ennreal.rpow_lt_top_of_nonneg (by simp) (ennreal.sum_lt_top_iff.mpr fun y hy => _).Ne
+  refine' ENNReal.rpow_lt_top_of_nonneg (by simp) (ennreal.sum_lt_top_iff.mpr fun y hy => _).Ne
   by_cases hy0 : y = 0
-  · simp [hy0, Ennreal.toReal_pos hp0 hp_top]
-  · refine' Ennreal.mul_lt_top _ (hf y hy0).Ne
-    exact (Ennreal.rpow_lt_top_of_nonneg Ennreal.toReal_nonneg Ennreal.coe_ne_top).Ne
+  · simp [hy0, ENNReal.toReal_pos hp0 hp_top]
+  · refine' ENNReal.mul_lt_top _ (hf y hy0).Ne
+    exact (ENNReal.rpow_lt_top_of_nonneg ENNReal.toReal_nonneg ENNReal.coe_ne_top).Ne
 #align measure_theory.simple_func.mem_ℒp_of_finite_measure_preimage MeasureTheory.SimpleFunc.memℒpOfFiniteMeasurePreimage
 
 /- ./././Mathport/Syntax/Translate/Basic.lean:628:2: warning: expanding binder collection (y «expr ≠ » 0) -/
@@ -355,7 +355,7 @@ theorem memℒp_iff {f : α →ₛ E} (hp_pos : p ≠ 0) (hp_ne_top : p ≠ ∞)
 
 /- ./././Mathport/Syntax/Translate/Basic.lean:628:2: warning: expanding binder collection (y «expr ≠ » 0) -/
 theorem integrable_iff {f : α →ₛ E} : Integrable f μ ↔ ∀ (y) (_ : y ≠ 0), μ (f ⁻¹' {y}) < ∞ :=
-  memℒp_one_iff_integrable.symm.trans <| memℒp_iff Ennreal.zero_lt_one.ne' Ennreal.coe_ne_top
+  memℒp_one_iff_integrable.symm.trans <| memℒp_iff ENNReal.zero_lt_one.ne' ENNReal.coe_ne_top
 #align measure_theory.simple_func.integrable_iff MeasureTheory.SimpleFunc.integrable_iff
 
 theorem memℒp_iff_integrable {f : α →ₛ E} (hp_pos : p ≠ 0) (hp_ne_top : p ≠ ∞) :
@@ -584,7 +584,7 @@ theorem toLp_smul (f : α →ₛ E) (hf : Memℒp f p μ) (c : 𝕜) :
 #align measure_theory.Lp.simple_func.to_Lp_smul MeasureTheory.lp.simpleFunc.toLp_smul
 
 theorem norm_toLp [Fact (1 ≤ p)] (f : α →ₛ E) (hf : Memℒp f p μ) :
-    ‖toLp f hf‖ = Ennreal.toReal (snorm f p μ) :=
+    ‖toLp f hf‖ = ENNReal.toReal (snorm f p μ) :=
   norm_toLp f hf
 #align measure_theory.Lp.simple_func.norm_to_Lp MeasureTheory.lp.simpleFunc.norm_toLp
 
@@ -693,7 +693,7 @@ theorem smul_toSimpleFunc (k : 𝕜) (f : lp.simpleFunc E p μ) :
 #align measure_theory.Lp.simple_func.smul_to_simple_func MeasureTheory.lp.simpleFunc.smul_toSimpleFunc
 
 theorem norm_toSimpleFunc [Fact (1 ≤ p)] (f : lp.simpleFunc E p μ) :
-    ‖f‖ = Ennreal.toReal (snorm (toSimpleFunc f) p μ) := by
+    ‖f‖ = ENNReal.toReal (snorm (toSimpleFunc f) p μ) := by
   simpa [to_Lp_to_simple_func] using norm_to_Lp (to_simple_func f) (simple_func.mem_ℒp f)
 #align measure_theory.Lp.simple_func.norm_to_simple_func MeasureTheory.lp.simpleFunc.norm_toSimpleFunc
 
@@ -998,7 +998,7 @@ theorem lp.induction [_i : Fact (1 ≤ p)] (hp_ne_top : p ≠ ∞) (P : lp E p 
     (h_closed : IsClosed { f : lp E p μ | P f }) : ∀ f : lp E p μ, P f :=
   by
   refine' fun f => (Lp.simple_func.dense_range hp_ne_top).inductionOn f h_closed _
-  refine' Lp.simple_func.induction (lt_of_lt_of_le Ennreal.zero_lt_one _i.elim).ne' hp_ne_top _ _
+  refine' Lp.simple_func.induction (lt_of_lt_of_le ENNReal.zero_lt_one _i.elim).ne' hp_ne_top _ _
   · exact fun c s => h_ind c
   · exact fun f g hf hg => h_add hf hg
 #align measure_theory.Lp.induction MeasureTheory.lp.induction
@@ -1033,7 +1033,7 @@ theorem Memℒp.induction [_i : Fact (1 ≤ p)] (hp_ne_top : p ≠ ∞) (P : (α
         convert h_ind 0 MeasurableSet.empty (by simp) using 1
         ext
         simp [const]
-      have hp_pos : p ≠ 0 := (lt_of_lt_of_le Ennreal.zero_lt_one _i.elim).ne'
+      have hp_pos : p ≠ 0 := (lt_of_lt_of_le ENNReal.zero_lt_one _i.elim).ne'
       exact h_ind c hs (simple_func.measure_lt_top_of_mem_ℒp_indicator hp_pos hp_ne_top hc hs h)
     · intro f g hfg hf hg int_fg
       rw [simple_func.coe_add,

Changes in mathlib4

mathlib3
mathlib4
chore: adapt to multiple goal linter 2 (#12361)

A PR analogous to #12338: reformatting proofs following the multiple goals linter of #12339.

Diff
@@ -78,7 +78,7 @@ theorem norm_approxOn_y₀_le [OpensMeasurableSpace E] {f : β → E} (hf : Meas
     {y₀ : E} (h₀ : y₀ ∈ s) [SeparableSpace s] (x : β) (n : ℕ) :
     ‖approxOn f hf s y₀ h₀ n x - y₀‖ ≤ ‖f x - y₀‖ + ‖f x - y₀‖ := by
   have := edist_approxOn_y0_le hf h₀ x n
-  repeat' rw [edist_comm y₀, edist_eq_coe_nnnorm_sub] at this
+  repeat rw [edist_comm y₀, edist_eq_coe_nnnorm_sub] at this
   exact mod_cast this
 #align measure_theory.simple_func.norm_approx_on_y₀_le MeasureTheory.SimpleFunc.norm_approxOn_y₀_le
 
chore: remove mathport name: <expression> lines (#11928)

Quoting [@digama0](https://github.com/digama0):

These were actually never meant to go in the file, they are basically debugging information and only useful on significantly broken mathport files. You can safely remove all of them.

Diff
@@ -54,7 +54,6 @@ variable {α β ι E F 𝕜 : Type*}
 
 namespace MeasureTheory
 
--- mathport name: «expr →ₛ »
 local infixr:25 " →ₛ " => SimpleFunc
 
 namespace SimpleFunc
@@ -1017,7 +1016,6 @@ theorem Memℒp.induction_dense (hp_ne_top : p ≠ ∞) (P : (α → E) → Prop
 
 section Integrable
 
--- mathport name: «expr →₁ₛ[ ] »
 @[inherit_doc MeasureTheory.Lp.simpleFunc]
 notation:25 α " →₁ₛ[" μ "] " E => @MeasureTheory.Lp.simpleFunc α E _ _ 1 μ
 
chore: golf using filter_upwards (#11208)

This is presumably not exhaustive, but covers about a hundred instances.

Style opinions (e.g., why a particular change is great/not a good idea) are very welcome; I'm still forming my own.

Diff
@@ -155,8 +155,7 @@ theorem memℒp_approxOn [BorelSpace E] {f : β → E} {μ : Measure β} (fmeas
     convert snorm_add_lt_top hf hi₀.neg with x
     simp [sub_eq_add_neg]
   have : ∀ᵐ x ∂μ, ‖approxOn f fmeas s y₀ h₀ n x - y₀‖ ≤ ‖‖f x - y₀‖ + ‖f x - y₀‖‖ := by
-    refine' eventually_of_forall _
-    intro x
+    filter_upwards with x
     convert norm_approxOn_y₀_le fmeas h₀ x n using 1
     rw [Real.norm_eq_abs, abs_of_nonneg]
     positivity
@@ -173,10 +172,7 @@ theorem tendsto_approxOn_range_Lp_snorm [BorelSpace E] {f : β → E} (hp_ne_top
     Tendsto (fun n => snorm (⇑(approxOn f fmeas (range f ∪ {0}) 0 (by simp) n) - f) p μ)
       atTop (𝓝 0) := by
   refine' tendsto_approxOn_Lp_snorm fmeas _ hp_ne_top _ _
-  · apply eventually_of_forall
-    intro x
-    apply subset_closure
-    simp
+  · filter_upwards with x using subset_closure (by simp)
   · simpa using hf
 #align measure_theory.simple_func.tendsto_approx_on_range_Lp_snorm MeasureTheory.SimpleFunc.tendsto_approxOn_range_Lp_snorm
 
@@ -250,10 +246,7 @@ theorem tendsto_approxOn_range_L1_nnnorm [OpensMeasurableSpace E] {f : β → E}
     Tendsto (fun n => ∫⁻ x, ‖approxOn f fmeas (range f ∪ {0}) 0 (by simp) n x - f x‖₊ ∂μ) atTop
       (𝓝 0) := by
   apply tendsto_approxOn_L1_nnnorm fmeas
-  · apply eventually_of_forall
-    intro x
-    apply subset_closure
-    simp
+  · filter_upwards with x using subset_closure (by simp)
   · simpa using hf.2
 #align measure_theory.simple_func.tendsto_approx_on_range_L1_nnnorm MeasureTheory.SimpleFunc.tendsto_approxOn_range_L1_nnnorm
 
chore(*): remove empty lines between variable statements (#11418)

Empty lines were removed by executing the following Python script twice

import os
import re


# Loop through each file in the repository
for dir_path, dirs, files in os.walk('.'):
  for filename in files:
    if filename.endswith('.lean'):
      file_path = os.path.join(dir_path, filename)

      # Open the file and read its contents
      with open(file_path, 'r') as file:
        content = file.read()

      # Use a regular expression to replace sequences of "variable" lines separated by empty lines
      # with sequences without empty lines
      modified_content = re.sub(r'(variable.*\n)\n(variable(?! .* in))', r'\1\2', content)

      # Write the modified content back to the file
      with open(file_path, 'w') as file:
        file.write(modified_content)
Diff
@@ -227,7 +227,6 @@ end Lp
 section Integrable
 
 variable [MeasurableSpace β]
-
 variable [MeasurableSpace E] [NormedAddCommGroup E]
 
 theorem tendsto_approxOn_L1_nnnorm [OpensMeasurableSpace E] {f : β → E} (hf : Measurable f)
@@ -269,9 +268,7 @@ end Integrable
 section SimpleFuncProperties
 
 variable [MeasurableSpace α]
-
 variable [NormedAddCommGroup E] [NormedAddCommGroup F]
-
 variable {μ : Measure α} {p : ℝ≥0∞}
 
 /-!
@@ -789,7 +786,6 @@ protected theorem denseRange (hp_ne_top : p ≠ ∞) :
 #align measure_theory.Lp.simple_func.dense_range MeasureTheory.Lp.simpleFunc.denseRange
 
 variable [NormedRing 𝕜] [Module 𝕜 E] [BoundedSMul 𝕜 E]
-
 variable (α E 𝕜)
 
 /-- The embedding of Lp simple functions into Lp functions, as a continuous linear map. -/
chore: remove terminal, terminal refines (#10762)

I replaced a few "terminal" refine/refine's with exact.

The strategy was very simple-minded: essentially any refine whose following line had smaller indentation got replaced by exact and then I cleaned up the mess.

This PR certainly leaves some further terminal refines, but maybe the current change is beneficial.

Diff
@@ -964,7 +964,7 @@ theorem Memℒp.induction [_i : Fact (1 ≤ p)] (hp_ne_top : p ≠ ∞) (P : (α
     · intro f g hfg hf hg int_fg
       rw [SimpleFunc.coe_add,
         memℒp_add_of_disjoint hfg f.stronglyMeasurable g.stronglyMeasurable] at int_fg
-      refine' h_add hfg int_fg.1 int_fg.2 (hf int_fg.1) (hg int_fg.2)
+      exact h_add hfg int_fg.1 int_fg.2 (hf int_fg.1) (hg int_fg.2)
   have : ∀ f : Lp.simpleFunc E p μ, P f := by
     intro f
     exact
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
@@ -314,8 +314,8 @@ theorem measure_preimage_lt_top_of_memℒp (hp_pos : p ≠ 0) (hp_ne_top : p ≠
     ENNReal.sum_lt_top_iff] at hf_snorm
   by_cases hyf : y ∈ f.range
   swap
-  · suffices h_empty : f ⁻¹' {y} = ∅
-    · rw [h_empty, measure_empty]; exact ENNReal.coe_lt_top
+  · suffices h_empty : f ⁻¹' {y} = ∅ by
+      rw [h_empty, measure_empty]; exact ENNReal.coe_lt_top
     ext1 x
     rw [Set.mem_preimage, Set.mem_singleton_iff, mem_empty_iff_false, iff_false_iff]
     refine' fun hxy => hyf _
@@ -989,9 +989,9 @@ theorem Memℒp.induction_dense (hp_ne_top : p ≠ ∞) (P : (α → E) → Prop
   · rcases h0P (0 : E) MeasurableSet.empty (by simp only [measure_empty, zero_lt_top])
         hε with ⟨g, _, Pg⟩
     exact ⟨g, by simp only [snorm_exponent_zero, zero_le'], Pg⟩
-  suffices H :
-    ∀ (f' : α →ₛ E) (δ : ℝ≥0∞) (hδ : δ ≠ 0), Memℒp f' p μ → ∃ g, snorm (⇑f' - g) p μ ≤ δ ∧ P g
-  · obtain ⟨η, ηpos, hη⟩ := exists_Lp_half E μ p hε
+  suffices H : ∀ (f' : α →ₛ E) (δ : ℝ≥0∞) (hδ : δ ≠ 0), Memℒp f' p μ →
+      ∃ g, snorm (⇑f' - g) p μ ≤ δ ∧ P g by
+    obtain ⟨η, ηpos, hη⟩ := exists_Lp_half E μ p hε
     rcases hf.exists_simpleFunc_snorm_sub_lt hp_ne_top ηpos.ne' with ⟨f', hf', f'_mem⟩
     rcases H f' η ηpos.ne' f'_mem with ⟨g, hg, Pg⟩
     refine' ⟨g, _, Pg⟩
feat: golf using gcongr throughout the library (#8752)

Following on from previous gcongr golfing PRs #4702 and #4784.

This is a replacement for #7901: this round of golfs, first introduced there, there exposed some performance issues in gcongr, hopefully fixed by #8731, and I am opening a new PR so that the performance can be checked against current master rather than master at the time of #7901.

Diff
@@ -159,7 +159,7 @@ theorem memℒp_approxOn [BorelSpace E] {f : β → E} {μ : Measure β} (fmeas
     intro x
     convert norm_approxOn_y₀_le fmeas h₀ x n using 1
     rw [Real.norm_eq_abs, abs_of_nonneg]
-    exact add_nonneg (norm_nonneg _) (norm_nonneg _)
+    positivity
   calc
     snorm (fun x => approxOn f fmeas s y₀ h₀ n x - y₀) p μ ≤
         snorm (fun x => ‖f x - y₀‖ + ‖f x - y₀‖) p μ :=
chore: replace exact_mod_cast tactic with mod_cast elaborator where possible (#8404)

We still have the exact_mod_cast tactic, used in a few places, which somehow (?) works a little bit harder to prevent the expected type influencing the elaboration of the term. I would like to get to the bottom of this, and it will be easier once the only usages of exact_mod_cast are the ones that don't work using the term elaborator by itself.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -72,7 +72,7 @@ theorem nnnorm_approxOn_le [OpensMeasurableSpace E] {f : β → E} (hf : Measura
   have := edist_approxOn_le hf h₀ x n
   rw [edist_comm y₀] at this
   simp only [edist_nndist, nndist_eq_nnnorm] at this
-  exact_mod_cast this
+  exact mod_cast this
 #align measure_theory.simple_func.nnnorm_approx_on_le MeasureTheory.SimpleFunc.nnnorm_approxOn_le
 
 theorem norm_approxOn_y₀_le [OpensMeasurableSpace E] {f : β → E} (hf : Measurable f) {s : Set E}
@@ -80,7 +80,7 @@ theorem norm_approxOn_y₀_le [OpensMeasurableSpace E] {f : β → E} (hf : Meas
     ‖approxOn f hf s y₀ h₀ n x - y₀‖ ≤ ‖f x - y₀‖ + ‖f x - y₀‖ := by
   have := edist_approxOn_y0_le hf h₀ x n
   repeat' rw [edist_comm y₀, edist_eq_coe_nnnorm_sub] at this
-  exact_mod_cast this
+  exact mod_cast this
 #align measure_theory.simple_func.norm_approx_on_y₀_le MeasureTheory.SimpleFunc.norm_approxOn_y₀_le
 
 theorem norm_approxOn_zero_le [OpensMeasurableSpace E] {f : β → E} (hf : Measurable f) {s : Set E}
@@ -88,7 +88,7 @@ theorem norm_approxOn_zero_le [OpensMeasurableSpace E] {f : β → E} (hf : Meas
     ‖approxOn f hf s 0 h₀ n x‖ ≤ ‖f x‖ + ‖f x‖ := by
   have := edist_approxOn_y0_le hf h₀ x n
   simp [edist_comm (0 : E), edist_eq_coe_nnnorm] at this
-  exact_mod_cast this
+  exact mod_cast this
 #align measure_theory.simple_func.norm_approx_on_zero_le MeasureTheory.SimpleFunc.norm_approxOn_zero_le
 
 theorem tendsto_approxOn_Lp_snorm [OpensMeasurableSpace E] {f : β → E} (hf : Measurable f)
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
@@ -986,7 +986,7 @@ theorem Memℒp.induction_dense (hp_ne_top : p ≠ ∞) (P : (α → E) → Prop
     (h1P : ∀ f g, P f → P g → P (f + g)) (h2P : ∀ f, P f → AEStronglyMeasurable f μ) {f : α → E}
     (hf : Memℒp f p μ) {ε : ℝ≥0∞} (hε : ε ≠ 0) : ∃ g : α → E, snorm (f - g) p μ ≤ ε ∧ P g := by
   rcases eq_or_ne p 0 with (rfl | hp_pos)
-  · rcases h0P (0 : E) MeasurableSet.empty (by simp only [measure_empty, WithTop.zero_lt_top])
+  · rcases h0P (0 : E) MeasurableSet.empty (by simp only [measure_empty, zero_lt_top])
         hε with ⟨g, _, Pg⟩
     exact ⟨g, by simp only [snorm_exponent_zero, zero_le'], Pg⟩
   suffices H :
@@ -1001,7 +1001,7 @@ theorem Memℒp.induction_dense (hp_ne_top : p ≠ ∞) (P : (α → E) → Prop
   apply SimpleFunc.induction
   · intro c s hs ε εpos Hs
     rcases eq_or_ne c 0 with (rfl | hc)
-    · rcases h0P (0 : E) MeasurableSet.empty (by simp only [measure_empty, WithTop.zero_lt_top])
+    · rcases h0P (0 : E) MeasurableSet.empty (by simp only [measure_empty, zero_lt_top])
           εpos with ⟨g, hg, Pg⟩
       rw [← snorm_neg, neg_sub] at hg
       refine' ⟨g, _, Pg⟩
chore: update/remove heart beat bumps (#6860)

We clean up heart beat bumps after #6474.

Diff
@@ -667,7 +667,6 @@ theorem sub_toSimpleFunc (f g : Lp.simpleFunc E p μ) :
 
 variable [NormedRing 𝕜] [Module 𝕜 E] [BoundedSMul 𝕜 E]
 
-set_option synthInstance.maxHeartbeats 30000 in
 theorem smul_toSimpleFunc (k : 𝕜) (f : Lp.simpleFunc E p μ) :
     toSimpleFunc (k • f) =ᵐ[μ] k • ⇑(toSimpleFunc f) := by
   filter_upwards [toSimpleFunc_eq_toFun (k • f), toSimpleFunc_eq_toFun f,
chore(MeasureTheory): golf (#6641)
  • Golf some proofs.
  • Rename MeasureTheory.indicatorConst_empty to MeasureTheory.indicatorConstLp_empty.
  • Change some linebreaks.
Diff
@@ -61,7 +61,6 @@ namespace SimpleFunc
 
 /-! ### Lp approximation by simple functions -/
 
-
 section Lp
 
 variable [MeasurableSpace β] [MeasurableSpace E] [NormedAddCommGroup E] [NormedAddCommGroup F]
@@ -204,9 +203,8 @@ theorem _root_.MeasureTheory.Memℒp.exists_simpleFunc_snorm_sub_lt {E : Type*}
     {ε : ℝ≥0∞} (hε : ε ≠ 0) : ∃ g : β →ₛ E, snorm (f - ⇑g) p μ < ε ∧ Memℒp g p μ := by
   borelize E
   let f' := hf.1.mk f
-  suffices H : ∃ g : β →ₛ E, snorm (f' - ⇑g) p μ < ε ∧ Memℒp g p μ
-  · rcases H with ⟨g, hg, g_mem⟩
-    refine' ⟨g, _, g_mem⟩
+  rsuffices ⟨g, hg, g_mem⟩ : ∃ g : β →ₛ E, snorm (f' - ⇑g) p μ < ε ∧ Memℒp g p μ
+  · refine' ⟨g, _, g_mem⟩
     suffices snorm (f - ⇑g) p μ = snorm (f' - ⇑g) p μ by rwa [this]
     apply snorm_congr_ae
     filter_upwards [hf.1.ae_eq_mk] with x hx
@@ -215,9 +213,8 @@ theorem _root_.MeasureTheory.Memℒp.exists_simpleFunc_snorm_sub_lt {E : Type*}
   have f'meas : Measurable f' := hf.1.measurable_mk
   have : SeparableSpace (range f' ∪ {0} : Set E) :=
     StronglyMeasurable.separableSpace_range_union_singleton hf.1.stronglyMeasurable_mk
-  rcases((tendsto_order.1 (tendsto_approxOn_range_Lp_snorm hp_ne_top f'meas hf'.2)).2 ε
-        hε.bot_lt).exists with
-    ⟨n, hn⟩
+  rcases ((tendsto_approxOn_range_Lp_snorm hp_ne_top f'meas hf'.2).eventually <|
+    gt_mem_nhds hε.bot_lt).exists with ⟨n, hn⟩
   rw [← snorm_neg, neg_sub] at hn
   exact ⟨_, hn, memℒp_approxOn_range f'meas hf' _⟩
 #align measure_theory.mem_ℒp.exists_simple_func_snorm_sub_lt MeasureTheory.Memℒp.exists_simpleFunc_snorm_sub_lt
@@ -835,45 +832,15 @@ theorem coeFn_zero : (0 : Lp.simpleFunc G p μ) =ᵐ[μ] (0 : α → G) :=
 variable {p μ G}
 
 theorem coeFn_nonneg (f : Lp.simpleFunc G p μ) : (0 : α → G) ≤ᵐ[μ] f ↔ 0 ≤ f := by
-  rw [← Lp.simpleFunc.coeFn_le]
-  have h0 : (0 : Lp.simpleFunc G p μ) =ᵐ[μ] (0 : α → G) := Lp.simpleFunc.coeFn_zero p μ G
-  constructor <;> intro h <;> filter_upwards [h, h0] with _ _ h2
-  · rwa [h2]
-  · rwa [← h2]
+  rw [← Subtype.coe_le_coe, Lp.coeFn_nonneg, AddSubmonoid.coe_zero]
 #align measure_theory.Lp.simple_func.coe_fn_nonneg MeasureTheory.Lp.simpleFunc.coeFn_nonneg
 
 theorem exists_simpleFunc_nonneg_ae_eq {f : Lp.simpleFunc G p μ} (hf : 0 ≤ f) :
     ∃ f' : α →ₛ G, 0 ≤ f' ∧ f =ᵐ[μ] f' := by
-  rw [← Lp.simpleFunc.coeFn_nonneg] at hf
-  have hf_ae : 0 ≤ᵐ[μ] simpleFunc.toSimpleFunc f := by
-    filter_upwards [toSimpleFunc_eq_toFun f, hf] with _ h1 _; rwa [h1]
-  let s := (toMeasurable μ { x | ¬0 ≤ simpleFunc.toSimpleFunc f x })ᶜ
-  have hs_zero : μ sᶜ = 0 := by
-    rw [compl_compl, measure_toMeasurable]; rwa [EventuallyLE, ae_iff] at hf_ae
-  have hfs_nonneg : ∀ x ∈ s, 0 ≤ simpleFunc.toSimpleFunc f x := by
-    intro x hxs
-    rw [mem_compl_iff] at hxs
-    have hx' : x ∉ { a : α | ¬0 ≤ simpleFunc.toSimpleFunc f a } := fun h =>
-      hxs (subset_toMeasurable μ _ h)
-    rwa [Set.nmem_setOf_iff, Classical.not_not] at hx'
-  let f' :=
-    SimpleFunc.piecewise s (measurableSet_toMeasurable μ _).compl (simpleFunc.toSimpleFunc f)
-      (SimpleFunc.const α (0 : G))
-  refine' ⟨f', fun x => _, _⟩
-  · rw [SimpleFunc.piecewise_apply]
-    by_cases hxs : x ∈ s
-    · simp only [hxs, hfs_nonneg x hxs, if_true, Pi.zero_apply, SimpleFunc.coe_zero]
-    · simp only [hxs, SimpleFunc.const_zero, if_false]; rfl
-  · rw [SimpleFunc.coe_piecewise]
-    have : s =ᵐ[μ] univ := by
-      rw [ae_eq_set]
-      simp only [true_and_iff, measure_empty, eq_self_iff_true, diff_univ, ← compl_eq_univ_diff]
-      exact hs_zero
-    refine' EventuallyEq.trans (toSimpleFunc_eq_toFun f).symm _
-    refine' EventuallyEq.trans _ (piecewise_ae_eq_of_ae_eq_set this.symm)
-    letI : DecidablePred (· ∈ (univ : Set α)) := fun _ => Classical.propDecidable _
-    simp only [SimpleFunc.const_zero, indicator_univ, piecewise_eq_indicator, SimpleFunc.coe_zero]
-    rfl
+  rcases f with ⟨⟨f, hp⟩, g, (rfl : _ = f)⟩
+  change 0 ≤ᵐ[μ] g at hf
+  refine ⟨g ⊔ 0, le_sup_right, (AEEqFun.coeFn_mk _ _).trans ?_⟩
+  exact hf.mono fun x hx ↦ (sup_of_le_left hx).symm
 #align measure_theory.Lp.simple_func.exists_simple_func_nonneg_ae_eq MeasureTheory.Lp.simpleFunc.exists_simpleFunc_nonneg_ae_eq
 
 variable (p μ G)
@@ -884,9 +851,8 @@ def coeSimpleFuncNonnegToLpNonneg :
 #align measure_theory.Lp.simple_func.coe_simple_func_nonneg_to_Lp_nonneg MeasureTheory.Lp.simpleFunc.coeSimpleFuncNonnegToLpNonneg
 
 theorem denseRange_coeSimpleFuncNonnegToLpNonneg [hp : Fact (1 ≤ p)] (hp_ne_top : p ≠ ∞) :
-    DenseRange (coeSimpleFuncNonnegToLpNonneg p μ G) := by
+    DenseRange (coeSimpleFuncNonnegToLpNonneg p μ G) := fun g ↦ by
   borelize G
-  intro g
   rw [mem_closure_iff_seq_limit]
   have hg_memℒp : Memℒp (g : α → G) p μ := Lp.memℒp (g : Lp G p μ)
   have zero_mem : (0 : G) ∈ (range (g : α → G) ∪ {0} : Set G) ∩ { y | 0 ≤ y } := by
@@ -957,15 +923,10 @@ suffices to show that
 -/
 @[elab_as_elim]
 theorem Lp.induction [_i : Fact (1 ≤ p)] (hp_ne_top : p ≠ ∞) (P : Lp E p μ → Prop)
-    (h_ind :
-      ∀ (c : E) {s : Set α} (hs : MeasurableSet s) (hμs : μ s < ∞),
-        P (Lp.simpleFunc.indicatorConst p hs hμs.ne c))
-    (h_add :
-      ∀ ⦃f g⦄,
-        ∀ hf : Memℒp f p μ,
-          ∀ hg : Memℒp g p μ,
-            Disjoint (support f) (support g) →
-              P (hf.toLp f) → P (hg.toLp g) → P (hf.toLp f + hg.toLp g))
+    (h_ind : ∀ (c : E) {s : Set α} (hs : MeasurableSet s) (hμs : μ s < ∞),
+      P (Lp.simpleFunc.indicatorConst p hs hμs.ne c))
+    (h_add : ∀ ⦃f g⦄, ∀ hf : Memℒp f p μ, ∀ hg : Memℒp g p μ, Disjoint (support f) (support g) →
+      P (hf.toLp f) → P (hg.toLp g) → P (hf.toLp f + hg.toLp g))
     (h_closed : IsClosed { f : Lp E p μ | P f }) : ∀ f : Lp E p μ, P f := by
   refine' fun f => (Lp.simpleFunc.denseRange hp_ne_top).induction_on f h_closed _
   refine' Lp.simpleFunc.induction (α := α) (E := E) (lt_of_lt_of_le zero_lt_one _i.elim).ne'
@@ -989,9 +950,8 @@ of their images is a subset of `{0}`).
 @[elab_as_elim]
 theorem Memℒp.induction [_i : Fact (1 ≤ p)] (hp_ne_top : p ≠ ∞) (P : (α → E) → Prop)
     (h_ind : ∀ (c : E) ⦃s⦄, MeasurableSet s → μ s < ∞ → P (s.indicator fun _ => c))
-    (h_add :
-      ∀ ⦃f g : α → E⦄,
-        Disjoint (support f) (support g) → Memℒp f p μ → Memℒp g p μ → P f → P g → P (f + g))
+    (h_add : ∀ ⦃f g : α → E⦄, Disjoint (support f) (support g) → Memℒp f p μ → Memℒp g p μ →
+      P f → P g → P (f + g))
     (h_closed : IsClosed { f : Lp E p μ | P f })
     (h_ae : ∀ ⦃f g⦄, f =ᵐ[μ] g → Memℒp f p μ → P f → P g) :
     ∀ ⦃f : α → E⦄, Memℒp f p μ → P f := by
chore: drop some unneeded maxHeartbeats (#6564)
Diff
@@ -572,7 +572,6 @@ theorem toLp_sub (f g : α →ₛ E) (hf : Memℒp f p μ) (hg : Memℒp g p μ)
 
 variable [NormedRing 𝕜] [Module 𝕜 E] [BoundedSMul 𝕜 E]
 
-set_option synthInstance.maxHeartbeats 30000 in
 theorem toLp_smul (f : α →ₛ E) (hf : Memℒp f p μ) (c : 𝕜) :
     toLp (c • f) (hf.const_smul c) = c • toLp f hf :=
   rfl
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
@@ -50,7 +50,7 @@ open Set Function Filter TopologicalSpace ENNReal EMetric Finset
 
 open scoped Classical Topology ENNReal MeasureTheory BigOperators
 
-variable {α β ι E F 𝕜 : Type _}
+variable {α β ι E F 𝕜 : Type*}
 
 namespace MeasureTheory
 
@@ -199,7 +199,7 @@ theorem tendsto_approxOn_range_Lp [BorelSpace E] {f : β → E} [hp : Fact (1 
 #align measure_theory.simple_func.tendsto_approx_on_range_Lp MeasureTheory.SimpleFunc.tendsto_approxOn_range_Lp
 
 /-- Any function in `ℒp` can be approximated by a simple function if `p < ∞`. -/
-theorem _root_.MeasureTheory.Memℒp.exists_simpleFunc_snorm_sub_lt {E : Type _}
+theorem _root_.MeasureTheory.Memℒp.exists_simpleFunc_snorm_sub_lt {E : Type*}
     [NormedAddCommGroup E] {f : β → E} {μ : Measure β} (hf : Memℒp f p μ) (hp_ne_top : p ≠ ∞)
     {ε : ℝ≥0∞} (hε : ε ≠ 0) : ∃ g : β →ₛ E, snorm (f - ⇑g) p μ < ε ∧ Memℒp g p μ := by
   borelize E
@@ -810,7 +810,7 @@ end CoeToLp
 
 section Order
 
-variable {G : Type _} [NormedLatticeAddCommGroup G]
+variable {G : Type*} [NormedLatticeAddCommGroup G]
 
 theorem coeFn_le (f g : Lp.simpleFunc G p μ) : (f : α → G) ≤ᵐ[μ] g ↔ f ≤ g := by
   rw [← Subtype.coe_le_coe, ← Lp.coeFn_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,15 +2,12 @@
 Copyright (c) 2022 Zhouhang Zhou. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Zhouhang Zhou, Yury Kudryashov, Heather Macbeth
-
-! This file was ported from Lean 3 source module measure_theory.function.simple_func_dense_lp
-! leanprover-community/mathlib commit 5a2df4cd59cb31e97a516d4603a14bed5c2f9425
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.MeasureTheory.Function.L1Space
 import Mathlib.MeasureTheory.Function.SimpleFuncDense
 
+#align_import measure_theory.function.simple_func_dense_lp from "leanprover-community/mathlib"@"5a2df4cd59cb31e97a516d4603a14bed5c2f9425"
+
 /-!
 # Density of simple functions
 
fix: change compl precedence (#5586)

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

Diff
@@ -851,8 +851,8 @@ theorem exists_simpleFunc_nonneg_ae_eq {f : Lp.simpleFunc G p μ} (hf : 0 ≤ f)
   rw [← Lp.simpleFunc.coeFn_nonneg] at hf
   have hf_ae : 0 ≤ᵐ[μ] simpleFunc.toSimpleFunc f := by
     filter_upwards [toSimpleFunc_eq_toFun f, hf] with _ h1 _; rwa [h1]
-  let s := toMeasurable μ { x | ¬0 ≤ simpleFunc.toSimpleFunc f x }ᶜ
-  have hs_zero : μ (sᶜ) = 0 := by
+  let s := (toMeasurable μ { x | ¬0 ≤ simpleFunc.toSimpleFunc f x })ᶜ
+  have hs_zero : μ sᶜ = 0 := by
     rw [compl_compl, measure_toMeasurable]; rwa [EventuallyLE, ae_iff] at hf_ae
   have hfs_nonneg : ∀ x ∈ s, 0 ≤ simpleFunc.toSimpleFunc f x := by
     intro x hxs
chore: clean up spacing around at and goals (#5387)

Changes are of the form

  • some_tactic at h⊢ -> some_tactic at h ⊢
  • some_tactic at h -> some_tactic at h
Diff
@@ -248,7 +248,7 @@ theorem tendsto_approxOn_L1_nnnorm [OpensMeasurableSpace E] {f : β → E} (hf :
 theorem integrable_approxOn [BorelSpace E] {f : β → E} {μ : Measure β} (fmeas : Measurable f)
     (hf : Integrable f μ) {s : Set E} {y₀ : E} (h₀ : y₀ ∈ s) [SeparableSpace s]
     (hi₀ : Integrable (fun _ => y₀) μ) (n : ℕ) : Integrable (approxOn f fmeas s y₀ h₀ n) μ := by
-  rw [← memℒp_one_iff_integrable] at hf hi₀⊢
+  rw [← memℒp_one_iff_integrable] at hf hi₀ ⊢
   exact memℒp_approxOn fmeas hf h₀ hi₀ n
 #align measure_theory.simple_func.integrable_approx_on MeasureTheory.SimpleFunc.integrable_approxOn
 
chore: tidy various files (#4757)
Diff
@@ -444,6 +444,8 @@ variable [MeasurableSpace α] [NormedAddCommGroup E] [NormedAddCommGroup F] (p :
 
 variable (E)
 
+-- Porting note: the proofs were rewritten in tactic mode to avoid an
+-- "unknown free variable '_uniq.546677'" error.
 /-- `Lp.simpleFunc` is a subspace of Lp consisting of equivalence classes of an integrable simple
     function. -/
 def simpleFunc : AddSubgroup (Lp E p μ) where
style: recover Is of Foo which is ported from is_foo (#4639)

I have misported is_foo to Foo because I misunderstood the rule for IsLawfulFoo. This PR recover Is of Foo which is ported from is_foo. This PR also renames some misported theorems.

Diff
@@ -387,15 +387,15 @@ theorem integrable_pair {f : α →ₛ E} {g : α →ₛ F} :
   simpa only [integrable_iff_finMeasSupp] using FinMeasSupp.pair
 #align measure_theory.simple_func.integrable_pair MeasureTheory.SimpleFunc.integrable_pair
 
-theorem memℒp_of_finiteMeasure (f : α →ₛ E) (p : ℝ≥0∞) (μ : Measure α) [FiniteMeasure μ] :
+theorem memℒp_of_isFiniteMeasure (f : α →ₛ E) (p : ℝ≥0∞) (μ : Measure α) [IsFiniteMeasure μ] :
     Memℒp f p μ :=
   let ⟨C, hfC⟩ := f.exists_forall_norm_le
   Memℒp.of_bound f.aestronglyMeasurable C <| eventually_of_forall hfC
-#align measure_theory.simple_func.mem_ℒp_of_is_finite_measure MeasureTheory.SimpleFunc.memℒp_of_finiteMeasure
+#align measure_theory.simple_func.mem_ℒp_of_is_finite_measure MeasureTheory.SimpleFunc.memℒp_of_isFiniteMeasure
 
-theorem integrable_of_finiteMeasure [FiniteMeasure μ] (f : α →ₛ E) : Integrable f μ :=
-  memℒp_one_iff_integrable.mp (f.memℒp_of_finiteMeasure 1 μ)
-#align measure_theory.simple_func.integrable_of_is_finite_measure MeasureTheory.SimpleFunc.integrable_of_finiteMeasure
+theorem integrable_of_isFiniteMeasure [IsFiniteMeasure μ] (f : α →ₛ E) : Integrable f μ :=
+  memℒp_one_iff_integrable.mp (f.memℒp_of_isFiniteMeasure 1 μ)
+#align measure_theory.simple_func.integrable_of_is_finite_measure MeasureTheory.SimpleFunc.integrable_of_isFiniteMeasure
 
 theorem measure_preimage_lt_top_of_integrable (f : α →ₛ E) (hf : Integrable f μ) {x : E}
     (hx : x ≠ 0) : μ (f ⁻¹' {x}) < ∞ :=
feat: port MeasureTheory.Function.SimpleFuncDenseLp (#4521)

Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com>

Dependencies 12 + 933

934 files ported (98.7%)
424649 lines ported (98.7%)
Show graph

The unported dependencies are

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