l3lab/ntp-mathlib huggingface dataset:
theorem norm_integral_le_integral_norm (f : α →ₛ E) (hf : Integrable f μ) :
    ‖f.integral μ‖ ≤ (f.map norm).integral μ := by
  refine' (norm_setToSimpleFunc_le_integral_norm _ (fun s _ _ => _) hf).trans (one_mul _).le
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedAddCommGroup F
inst✝⁷ : NormedSpace ℝ F
p : ℝ≥0∞
G : Type u_5
F' : Type u_6
inst✝⁶ : NormedAddCommGroup G
inst✝⁵ : NormedAddCommGroup F'
inst✝⁴ : NormedSpace ℝ F'
m : MeasurableSpace α
μ : Measure α
inst✝³ : NormedField 𝕜
inst✝² : NormedSpace 𝕜 E
inst✝¹ : NormedSpace ℝ E
inst✝ : SMulCommClass ℝ 𝕜 E
f : α →ₛ E
hf : Integrable ↑f
s : Set α
x✝¹ : MeasurableSet s
x✝ : ↑↑μ s < ⊤
⊢ ‖weightedSMul μ s‖ ≤ 1 * ENNReal.toReal (↑↑μ s)

Next tactic:
exact (norm_weightedSMul_le s).trans (one_mul _).symm.le
theorem integral_add_measure {ν} (f : α →ₛ E) (hf : Integrable f (μ + ν)) :
    f.integral (μ + ν) = f.integral μ + f.integral ν := by
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedAddCommGroup F
inst✝⁷ : NormedSpace ℝ F
p : ℝ≥0∞
G : Type u_5
F' : Type u_6
inst✝⁶ : NormedAddCommGroup G
inst✝⁵ : NormedAddCommGroup F'
inst✝⁴ : NormedSpace ℝ F'
m : MeasurableSpace α
μ : Measure α
inst✝³ : NormedField 𝕜
inst✝² : NormedSpace 𝕜 E
inst✝¹ : NormedSpace ℝ E
inst✝ : SMulCommClass ℝ 𝕜 E
ν : Measure α
f : α →ₛ E
hf : Integrable ↑f
⊢ integral (μ + ν) f = integral μ f + integral ν f

Next tactic:
simp_rw [integral_def]
theorem integral_add_measure {ν} (f : α →ₛ E) (hf : Integrable f (μ + ν)) :
    f.integral (μ + ν) = f.integral μ + f.integral ν := by
  simp_rw [integral_def]
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedAddCommGroup F
inst✝⁷ : NormedSpace ℝ F
p : ℝ≥0∞
G : Type u_5
F' : Type u_6
inst✝⁶ : NormedAddCommGroup G
inst✝⁵ : NormedAddCommGroup F'
inst✝⁴ : NormedSpace ℝ F'
m : MeasurableSpace α
μ : Measure α
inst✝³ : NormedField 𝕜
inst✝² : NormedSpace 𝕜 E
inst✝¹ : NormedSpace ℝ E
inst✝ : SMulCommClass ℝ 𝕜 E
ν : Measure α
f : α →ₛ E
hf : Integrable ↑f
⊢ setToSimpleFunc (weightedSMul (μ + ν)) f = setToSimpleFunc (weightedSMul μ) f + setToSimpleFunc (weightedSMul ν) f

Next tactic:
refine' setToSimpleFunc_add_left'
    (weightedSMul μ) (weightedSMul ν) (weightedSMul (μ + ν)) (fun s _ hμνs => _) hf
theorem integral_add_measure {ν} (f : α →ₛ E) (hf : Integrable f (μ + ν)) :
    f.integral (μ + ν) = f.integral μ + f.integral ν := by
  simp_rw [integral_def]
  refine' setToSimpleFunc_add_left'
    (weightedSMul μ) (weightedSMul ν) (weightedSMul (μ + ν)) (fun s _ hμνs => _) hf
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedAddCommGroup F
inst✝⁷ : NormedSpace ℝ F
p : ℝ≥0∞
G : Type u_5
F' : Type u_6
inst✝⁶ : NormedAddCommGroup G
inst✝⁵ : NormedAddCommGroup F'
inst✝⁴ : NormedSpace ℝ F'
m : MeasurableSpace α
μ : Measure α
inst✝³ : NormedField 𝕜
inst✝² : NormedSpace 𝕜 E
inst✝¹ : NormedSpace ℝ E
inst✝ : SMulCommClass ℝ 𝕜 E
ν : Measure α
f : α →ₛ E
hf : Integrable ↑f
s : Set α
x✝ : MeasurableSet s
hμνs : ↑↑(μ + ν) s < ⊤
⊢ weightedSMul (μ + ν) s = weightedSMul μ s + weightedSMul ν s

Next tactic:
rw [lt_top_iff_ne_top, Measure.coe_add, Pi.add_apply, ENNReal.add_ne_top] at hμνs
theorem integral_add_measure {ν} (f : α →ₛ E) (hf : Integrable f (μ + ν)) :
    f.integral (μ + ν) = f.integral μ + f.integral ν := by
  simp_rw [integral_def]
  refine' setToSimpleFunc_add_left'
    (weightedSMul μ) (weightedSMul ν) (weightedSMul (μ + ν)) (fun s _ hμνs => _) hf
  rw [lt_top_iff_ne_top, Measure.coe_add, Pi.add_apply, ENNReal.add_ne_top] at hμνs
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedAddCommGroup F
inst✝⁷ : NormedSpace ℝ F
p : ℝ≥0∞
G : Type u_5
F' : Type u_6
inst✝⁶ : NormedAddCommGroup G
inst✝⁵ : NormedAddCommGroup F'
inst✝⁴ : NormedSpace ℝ F'
m : MeasurableSpace α
μ : Measure α
inst✝³ : NormedField 𝕜
inst✝² : NormedSpace 𝕜 E
inst✝¹ : NormedSpace ℝ E
inst✝ : SMulCommClass ℝ 𝕜 E
ν : Measure α
f : α →ₛ E
hf : Integrable ↑f
s : Set α
x✝ : MeasurableSet s
hμνs : ↑↑μ s ≠ ⊤ ∧ ↑↑ν s ≠ ⊤
⊢ weightedSMul (μ + ν) s = weightedSMul μ s + weightedSMul ν s

Next tactic:
rw [weightedSMul_add_measure _ _ hμνs.1 hμνs.2]
theorem norm_eq_integral (f : α →₁ₛ[μ] E) : ‖f‖ = ((toSimpleFunc f).map norm).integral μ := by
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedAddCommGroup F
m : MeasurableSpace α
μ : Measure α
f : ↥(simpleFunc E 1 μ)
⊢ ‖f‖ = SimpleFunc.integral μ (SimpleFunc.map norm (toSimpleFunc f))

Next tactic:
rw [norm_eq_sum_mul f, (toSimpleFunc f).map_integral norm (SimpleFunc.integrable f) norm_zero]
theorem norm_eq_integral (f : α →₁ₛ[μ] E) : ‖f‖ = ((toSimpleFunc f).map norm).integral μ := by
  rw [norm_eq_sum_mul f, (toSimpleFunc f).map_integral norm (SimpleFunc.integrable f) norm_zero]
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedAddCommGroup F
m : MeasurableSpace α
μ : Measure α
f : ↥(simpleFunc E 1 μ)
⊢ ∑ x in SimpleFunc.range (toSimpleFunc f), ENNReal.toReal (↑↑μ (↑(toSimpleFunc f) ⁻¹' {x})) * ‖x‖ =
    ∑ x in SimpleFunc.range (toSimpleFunc f), ENNReal.toReal (↑↑μ (↑(toSimpleFunc f) ⁻¹' {x})) • ‖x‖

Next tactic:
simp_rw [smul_eq_mul]
/-- Positive part of a simple function in L1 space.  -/
nonrec def posPart (f : α →₁ₛ[μ] ℝ) : α →₁ₛ[μ] ℝ :=
  ⟨Lp.posPart (f : α →₁[μ] ℝ), by
    

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedAddCommGroup F
m : MeasurableSpace α
μ : Measure α
f : ↥(simpleFunc ℝ 1 μ)
⊢ Lp.posPart ↑f ∈ simpleFunc ℝ 1 μ

Next tactic:
rcases f with ⟨f, s, hsf⟩
/-- Positive part of a simple function in L1 space.  -/
nonrec def posPart (f : α →₁ₛ[μ] ℝ) : α →₁ₛ[μ] ℝ :=
  ⟨Lp.posPart (f : α →₁[μ] ℝ), by
    rcases f with ⟨f, s, hsf⟩
    

Proof state:
case mk.intro
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedAddCommGroup F
m : MeasurableSpace α
μ : Measure α
f : ↥(Lp ℝ 1)
s : α →ₛ ℝ
hsf : AEEqFun.mk ↑s (_ : AEStronglyMeasurable (↑s) μ) = ↑f
⊢ Lp.posPart ↑{ val := f, property := (_ : ∃ s, AEEqFun.mk ↑s (_ : AEStronglyMeasurable (↑s) μ) = ↑f) } ∈
    simpleFunc ℝ 1 μ

Next tactic:
use s.posPart
/-- Positive part of a simple function in L1 space.  -/
nonrec def posPart (f : α →₁ₛ[μ] ℝ) : α →₁ₛ[μ] ℝ :=
  ⟨Lp.posPart (f : α →₁[μ] ℝ), by
    rcases f with ⟨f, s, hsf⟩
    use s.posPart
    

Proof state:
case h
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedAddCommGroup F
m : MeasurableSpace α
μ : Measure α
f : ↥(Lp ℝ 1)
s : α →ₛ ℝ
hsf : AEEqFun.mk ↑s (_ : AEStronglyMeasurable (↑s) μ) = ↑f
⊢ AEEqFun.mk ↑(MeasureTheory.SimpleFunc.posPart s)
      (_ : AEStronglyMeasurable (↑(MeasureTheory.SimpleFunc.posPart s)) μ) =
    ↑(Lp.posPart ↑{ val := f, property := (_ : ∃ s, AEEqFun.mk ↑s (_ : AEStronglyMeasurable (↑s) μ) = ↑f) })

Next tactic:
simp only [Subtype.coe_mk, Lp.coe_posPart, ← hsf, AEEqFun.posPart_mk,
      SimpleFunc.coe_map, mk_eq_mk]
/-- Positive part of a simple function in L1 space.  -/
nonrec def posPart (f : α →₁ₛ[μ] ℝ) : α →₁ₛ[μ] ℝ :=
  ⟨Lp.posPart (f : α →₁[μ] ℝ), by
    rcases f with ⟨f, s, hsf⟩
    use s.posPart
    simp only [Subtype.coe_mk, Lp.coe_posPart, ← hsf, AEEqFun.posPart_mk,
      SimpleFunc.coe_map, mk_eq_mk]
    -- Porting note: added
    

Proof state:
case h
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedAddCommGroup F
m : MeasurableSpace α
μ : Measure α
f : ↥(Lp ℝ 1)
s : α →ₛ ℝ
hsf : AEEqFun.mk ↑s (_ : AEStronglyMeasurable (↑s) μ) = ↑f
⊢ ↑(MeasureTheory.SimpleFunc.posPart s) =ᵐ[μ] fun x => max (↑s x) 0

Next tactic:
simp [SimpleFunc.posPart, Function.comp, EventuallyEq.rfl]
nonrec theorem integral_eq_lintegral {f : α →₁ₛ[μ] ℝ} (h_pos : 0 ≤ᵐ[μ] toSimpleFunc f) :
    integral f = ENNReal.toReal (∫⁻ a, ENNReal.ofReal ((toSimpleFunc f) a) ∂μ) := by
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedAddCommGroup F
m : MeasurableSpace α
μ : Measure α
inst✝⁵ : NormedField 𝕜
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedSpace ℝ E
inst✝² : SMulCommClass ℝ 𝕜 E
F' : Type u_5
inst✝¹ : NormedAddCommGroup F'
inst✝ : NormedSpace ℝ F'
f : ↥(simpleFunc ℝ 1 μ)
h_pos : 0 ≤ᵐ[μ] ↑(toSimpleFunc f)
⊢ integral f = ENNReal.toReal (∫⁻ (a : α), ENNReal.ofReal (↑(toSimpleFunc f) a) ∂μ)

Next tactic:
rw [integral, SimpleFunc.integral_eq_lintegral (SimpleFunc.integrable f) h_pos]
theorem norm_integral_le_norm (f : α →₁ₛ[μ] E) : ‖integral f‖ ≤ ‖f‖ := by
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedAddCommGroup F
m : MeasurableSpace α
μ : Measure α
inst✝⁵ : NormedField 𝕜
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedSpace ℝ E
inst✝² : SMulCommClass ℝ 𝕜 E
F' : Type u_5
inst✝¹ : NormedAddCommGroup F'
inst✝ : NormedSpace ℝ F'
f : ↥(simpleFunc E 1 μ)
⊢ ‖integral f‖ ≤ ‖f‖

Next tactic:
rw [integral, norm_eq_integral]
theorem norm_integral_le_norm (f : α →₁ₛ[μ] E) : ‖integral f‖ ≤ ‖f‖ := by
  rw [integral, norm_eq_integral]
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedAddCommGroup F
m : MeasurableSpace α
μ : Measure α
inst✝⁵ : NormedField 𝕜
inst✝⁴ : NormedSpace 𝕜 E
inst✝³ : NormedSpace ℝ E
inst✝² : SMulCommClass ℝ 𝕜 E
F' : Type u_5
inst✝¹ : NormedAddCommGroup F'
inst✝ : NormedSpace ℝ F'
f : ↥(simpleFunc E 1 μ)
⊢ ‖MeasureTheory.SimpleFunc.integral μ (toSimpleFunc f)‖ ≤
    MeasureTheory.SimpleFunc.integral μ (SimpleFunc.map norm (toSimpleFunc f))

Next tactic:
exact (toSimpleFunc f).norm_integral_le_integral_norm (SimpleFunc.integrable f)
/-- The Bochner integral over simple functions in L1 space as a continuous linear map. -/
def integralCLM' : (α →₁ₛ[μ] E) →L[𝕜] E :=
  LinearMap.mkContinuous ⟨⟨integral, integral_add⟩, integral_smul⟩ 1 fun f =>
    le_trans (norm_integral_le_norm _) <| by 

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹⁰ : NormedAddCommGroup E
inst✝⁹ : NormedAddCommGroup F
m : MeasurableSpace α
μ : Measure α
inst✝⁸ : NormedField 𝕜
inst✝⁷ : NormedSpace 𝕜 E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : SMulCommClass ℝ 𝕜 E
F' : Type u_5
inst✝⁴ : NormedAddCommGroup F'
inst✝³ : NormedSpace ℝ F'
E' : Type u_6
inst✝² : NormedAddCommGroup E'
inst✝¹ : NormedSpace ℝ E'
inst✝ : NormedSpace 𝕜 E'
f : ↥(simpleFunc E 1 μ)
⊢ ‖f‖ ≤ 1 * ‖f‖

Next tactic:
rw [one_mul]
theorem norm_Integral_le_one : ‖Integral‖ ≤ 1 :=
  -- Porting note: Old proof was `LinearMap.mkContinuous_norm_le _ zero_le_one _`
  LinearMap.mkContinuous_norm_le _ zero_le_one (fun f => by
    

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹⁰ : NormedAddCommGroup E
inst✝⁹ : NormedAddCommGroup F
m : MeasurableSpace α
μ : Measure α
inst✝⁸ : NormedField 𝕜
inst✝⁷ : NormedSpace 𝕜 E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : SMulCommClass ℝ 𝕜 E
F' : Type u_5
inst✝⁴ : NormedAddCommGroup F'
inst✝³ : NormedSpace ℝ F'
E' : Type u_6
inst✝² : NormedAddCommGroup E'
inst✝¹ : NormedSpace ℝ E'
inst✝ : NormedSpace 𝕜 E'
f : ↥(simpleFunc E 1 μ)
⊢ ‖{
          toAddHom :=
            { toFun := integral,
              map_add' := (_ : ∀ (f g : ↥(simpleFunc E 1 μ)), integral (f + g) = integral f + integral g) },
          map_smul' := (_ : ∀ (c : ℝ) (f : ↥(simpleFunc E 1 μ)), integral (c • f) = c • integral f) }
        f‖ ≤
    1 * ‖f‖

Next tactic:
rw [one_mul]
theorem norm_Integral_le_one : ‖Integral‖ ≤ 1 :=
  -- Porting note: Old proof was `LinearMap.mkContinuous_norm_le _ zero_le_one _`
  LinearMap.mkContinuous_norm_le _ zero_le_one (fun f => by
    rw [one_mul]
    

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹⁰ : NormedAddCommGroup E
inst✝⁹ : NormedAddCommGroup F
m : MeasurableSpace α
μ : Measure α
inst✝⁸ : NormedField 𝕜
inst✝⁷ : NormedSpace 𝕜 E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : SMulCommClass ℝ 𝕜 E
F' : Type u_5
inst✝⁴ : NormedAddCommGroup F'
inst✝³ : NormedSpace ℝ F'
E' : Type u_6
inst✝² : NormedAddCommGroup E'
inst✝¹ : NormedSpace ℝ E'
inst✝ : NormedSpace 𝕜 E'
f : ↥(simpleFunc E 1 μ)
⊢ ‖{
          toAddHom :=
            { toFun := integral,
              map_add' := (_ : ∀ (f g : ↥(simpleFunc E 1 μ)), integral (f + g) = integral f + integral g) },
          map_smul' := (_ : ∀ (c : ℝ) (f : ↥(simpleFunc E 1 μ)), integral (c • f) = c • integral f) }
        f‖ ≤
    ‖f‖

Next tactic:
exact norm_integral_le_norm f
theorem posPart_toSimpleFunc (f : α →₁ₛ[μ] ℝ) :
    toSimpleFunc (posPart f) =ᵐ[μ] (toSimpleFunc f).posPart := by
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹⁰ : NormedAddCommGroup E
inst✝⁹ : NormedAddCommGroup F
m : MeasurableSpace α
μ : Measure α
inst✝⁸ : NormedField 𝕜
inst✝⁷ : NormedSpace 𝕜 E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : SMulCommClass ℝ 𝕜 E
F' : Type u_5
inst✝⁴ : NormedAddCommGroup F'
inst✝³ : NormedSpace ℝ F'
E' : Type u_6
inst✝² : NormedAddCommGroup E'
inst✝¹ : NormedSpace ℝ E'
inst✝ : NormedSpace 𝕜 E'
f : ↥(simpleFunc ℝ 1 μ)
⊢ ↑(toSimpleFunc (posPart f)) =ᵐ[μ] ↑(MeasureTheory.SimpleFunc.posPart (toSimpleFunc f))

Next tactic:
have eq : ∀ a, (toSimpleFunc f).posPart a = max ((toSimpleFunc f) a) 0 := fun a => rfl
theorem posPart_toSimpleFunc (f : α →₁ₛ[μ] ℝ) :
    toSimpleFunc (posPart f) =ᵐ[μ] (toSimpleFunc f).posPart := by
  have eq : ∀ a, (toSimpleFunc f).posPart a = max ((toSimpleFunc f) a) 0 := fun a => rfl
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹⁰ : NormedAddCommGroup E
inst✝⁹ : NormedAddCommGroup F
m : MeasurableSpace α
μ : Measure α
inst✝⁸ : NormedField 𝕜
inst✝⁷ : NormedSpace 𝕜 E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : SMulCommClass ℝ 𝕜 E
F' : Type u_5
inst✝⁴ : NormedAddCommGroup F'
inst✝³ : NormedSpace ℝ F'
E' : Type u_6
inst✝² : NormedAddCommGroup E'
inst✝¹ : NormedSpace ℝ E'
inst✝ : NormedSpace 𝕜 E'
f : ↥(simpleFunc ℝ 1 μ)
eq : ∀ (a : α), ↑(MeasureTheory.SimpleFunc.posPart (toSimpleFunc f)) a = max (↑(toSimpleFunc f) a) 0
⊢ ↑(toSimpleFunc (posPart f)) =ᵐ[μ] ↑(MeasureTheory.SimpleFunc.posPart (toSimpleFunc f))

Next tactic:
have ae_eq : ∀ᵐ a ∂μ, toSimpleFunc (posPart f) a = max ((toSimpleFunc f) a) 0 := by
    filter_upwards [toSimpleFunc_eq_toFun (posPart f), Lp.coeFn_posPart (f : α →₁[μ] ℝ),
      toSimpleFunc_eq_toFun f] with _ _ h₂ h₃
    convert h₂ using 1
    -- Porting note: added
    rw [h₃]
theorem posPart_toSimpleFunc (f : α →₁ₛ[μ] ℝ) :
    toSimpleFunc (posPart f) =ᵐ[μ] (toSimpleFunc f).posPart := by
  have eq : ∀ a, (toSimpleFunc f).posPart a = max ((toSimpleFunc f) a) 0 := fun a => rfl
  have ae_eq : ∀ᵐ a ∂μ, toSimpleFunc (posPart f) a = max ((toSimpleFunc f) a) 0 := by
    

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹⁰ : NormedAddCommGroup E
inst✝⁹ : NormedAddCommGroup F
m : MeasurableSpace α
μ : Measure α
inst✝⁸ : NormedField 𝕜
inst✝⁷ : NormedSpace 𝕜 E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : SMulCommClass ℝ 𝕜 E
F' : Type u_5
inst✝⁴ : NormedAddCommGroup F'
inst✝³ : NormedSpace ℝ F'
E' : Type u_6
inst✝² : NormedAddCommGroup E'
inst✝¹ : NormedSpace ℝ E'
inst✝ : NormedSpace 𝕜 E'
f : ↥(simpleFunc ℝ 1 μ)
eq : ∀ (a : α), ↑(MeasureTheory.SimpleFunc.posPart (toSimpleFunc f)) a = max (↑(toSimpleFunc f) a) 0
⊢ ∀ᵐ (a : α) ∂μ, ↑(toSimpleFunc (posPart f)) a = max (↑(toSimpleFunc f) a) 0

Next tactic:
filter_upwards [toSimpleFunc_eq_toFun (posPart f), Lp.coeFn_posPart (f : α →₁[μ] ℝ),
      toSimpleFunc_eq_toFun f] with _ _ h₂ h₃
theorem posPart_toSimpleFunc (f : α →₁ₛ[μ] ℝ) :
    toSimpleFunc (posPart f) =ᵐ[μ] (toSimpleFunc f).posPart := by
  have eq : ∀ a, (toSimpleFunc f).posPart a = max ((toSimpleFunc f) a) 0 := fun a => rfl
  have ae_eq : ∀ᵐ a ∂μ, toSimpleFunc (posPart f) a = max ((toSimpleFunc f) a) 0 := by
    filter_upwards [toSimpleFunc_eq_toFun (posPart f), Lp.coeFn_posPart (f : α →₁[μ] ℝ),
      toSimpleFunc_eq_toFun f] with _ _ h₂ h₃
    

Proof state:
case h
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹⁰ : NormedAddCommGroup E
inst✝⁹ : NormedAddCommGroup F
m : MeasurableSpace α
μ : Measure α
inst✝⁸ : NormedField 𝕜
inst✝⁷ : NormedSpace 𝕜 E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : SMulCommClass ℝ 𝕜 E
F' : Type u_5
inst✝⁴ : NormedAddCommGroup F'
inst✝³ : NormedSpace ℝ F'
E' : Type u_6
inst✝² : NormedAddCommGroup E'
inst✝¹ : NormedSpace ℝ E'
inst✝ : NormedSpace 𝕜 E'
f : ↥(simpleFunc ℝ 1 μ)
eq : ∀ (a : α), ↑(MeasureTheory.SimpleFunc.posPart (toSimpleFunc f)) a = max (↑(toSimpleFunc f) a) 0
a✝¹ : α
a✝ : ↑(toSimpleFunc (posPart f)) a✝¹ = ↑↑↑(posPart f) a✝¹
h₂ : ↑↑(Lp.posPart ↑f) a✝¹ = max (↑↑↑f a✝¹) 0
h₃ : ↑(toSimpleFunc f) a✝¹ = ↑↑↑f a✝¹
⊢ ↑(toSimpleFunc (posPart f)) a✝¹ = max (↑(toSimpleFunc f) a✝¹) 0

Next tactic:
convert h₂ using 1
theorem posPart_toSimpleFunc (f : α →₁ₛ[μ] ℝ) :
    toSimpleFunc (posPart f) =ᵐ[μ] (toSimpleFunc f).posPart := by
  have eq : ∀ a, (toSimpleFunc f).posPart a = max ((toSimpleFunc f) a) 0 := fun a => rfl
  have ae_eq : ∀ᵐ a ∂μ, toSimpleFunc (posPart f) a = max ((toSimpleFunc f) a) 0 := by
    filter_upwards [toSimpleFunc_eq_toFun (posPart f), Lp.coeFn_posPart (f : α →₁[μ] ℝ),
      toSimpleFunc_eq_toFun f] with _ _ h₂ h₃
    convert h₂ using 1
    -- Porting note: added
    

Proof state:
case h.e'_3
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹⁰ : NormedAddCommGroup E
inst✝⁹ : NormedAddCommGroup F
m : MeasurableSpace α
μ : Measure α
inst✝⁸ : NormedField 𝕜
inst✝⁷ : NormedSpace 𝕜 E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : SMulCommClass ℝ 𝕜 E
F' : Type u_5
inst✝⁴ : NormedAddCommGroup F'
inst✝³ : NormedSpace ℝ F'
E' : Type u_6
inst✝² : NormedAddCommGroup E'
inst✝¹ : NormedSpace ℝ E'
inst✝ : NormedSpace 𝕜 E'
f : ↥(simpleFunc ℝ 1 μ)
eq : ∀ (a : α), ↑(MeasureTheory.SimpleFunc.posPart (toSimpleFunc f)) a = max (↑(toSimpleFunc f) a) 0
a✝¹ : α
a✝ : ↑(toSimpleFunc (posPart f)) a✝¹ = ↑↑↑(posPart f) a✝¹
h₂ : ↑↑(Lp.posPart ↑f) a✝¹ = max (↑↑↑f a✝¹) 0
h₃ : ↑(toSimpleFunc f) a✝¹ = ↑↑↑f a✝¹
⊢ max (↑(toSimpleFunc f) a✝¹) 0 = max (↑↑↑f a✝¹) 0

Next tactic:
rw [h₃]
theorem posPart_toSimpleFunc (f : α →₁ₛ[μ] ℝ) :
    toSimpleFunc (posPart f) =ᵐ[μ] (toSimpleFunc f).posPart := by
  have eq : ∀ a, (toSimpleFunc f).posPart a = max ((toSimpleFunc f) a) 0 := fun a => rfl
  have ae_eq : ∀ᵐ a ∂μ, toSimpleFunc (posPart f) a = max ((toSimpleFunc f) a) 0 := by
    filter_upwards [toSimpleFunc_eq_toFun (posPart f), Lp.coeFn_posPart (f : α →₁[μ] ℝ),
      toSimpleFunc_eq_toFun f] with _ _ h₂ h₃
    convert h₂ using 1
    -- Porting note: added
    rw [h₃]
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹⁰ : NormedAddCommGroup E
inst✝⁹ : NormedAddCommGroup F
m : MeasurableSpace α
μ : Measure α
inst✝⁸ : NormedField 𝕜
inst✝⁷ : NormedSpace 𝕜 E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : SMulCommClass ℝ 𝕜 E
F' : Type u_5
inst✝⁴ : NormedAddCommGroup F'
inst✝³ : NormedSpace ℝ F'
E' : Type u_6
inst✝² : NormedAddCommGroup E'
inst✝¹ : NormedSpace ℝ E'
inst✝ : NormedSpace 𝕜 E'
f : ↥(simpleFunc ℝ 1 μ)
eq : ∀ (a : α), ↑(MeasureTheory.SimpleFunc.posPart (toSimpleFunc f)) a = max (↑(toSimpleFunc f) a) 0
ae_eq : ∀ᵐ (a : α) ∂μ, ↑(toSimpleFunc (posPart f)) a = max (↑(toSimpleFunc f) a) 0
⊢ ↑(toSimpleFunc (posPart f)) =ᵐ[μ] ↑(MeasureTheory.SimpleFunc.posPart (toSimpleFunc f))

Next tactic:
refine' ae_eq.mono fun a h => _
theorem posPart_toSimpleFunc (f : α →₁ₛ[μ] ℝ) :
    toSimpleFunc (posPart f) =ᵐ[μ] (toSimpleFunc f).posPart := by
  have eq : ∀ a, (toSimpleFunc f).posPart a = max ((toSimpleFunc f) a) 0 := fun a => rfl
  have ae_eq : ∀ᵐ a ∂μ, toSimpleFunc (posPart f) a = max ((toSimpleFunc f) a) 0 := by
    filter_upwards [toSimpleFunc_eq_toFun (posPart f), Lp.coeFn_posPart (f : α →₁[μ] ℝ),
      toSimpleFunc_eq_toFun f] with _ _ h₂ h₃
    convert h₂ using 1
    -- Porting note: added
    rw [h₃]
  refine' ae_eq.mono fun a h => _
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹⁰ : NormedAddCommGroup E
inst✝⁹ : NormedAddCommGroup F
m : MeasurableSpace α
μ : Measure α
inst✝⁸ : NormedField 𝕜
inst✝⁷ : NormedSpace 𝕜 E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : SMulCommClass ℝ 𝕜 E
F' : Type u_5
inst✝⁴ : NormedAddCommGroup F'
inst✝³ : NormedSpace ℝ F'
E' : Type u_6
inst✝² : NormedAddCommGroup E'
inst✝¹ : NormedSpace ℝ E'
inst✝ : NormedSpace 𝕜 E'
f : ↥(simpleFunc ℝ 1 μ)
eq : ∀ (a : α), ↑(MeasureTheory.SimpleFunc.posPart (toSimpleFunc f)) a = max (↑(toSimpleFunc f) a) 0
ae_eq : ∀ᵐ (a : α) ∂μ, ↑(toSimpleFunc (posPart f)) a = max (↑(toSimpleFunc f) a) 0
a : α
h : ↑(toSimpleFunc (posPart f)) a = max (↑(toSimpleFunc f) a) 0
⊢ ↑(toSimpleFunc (posPart f)) a = ↑(MeasureTheory.SimpleFunc.posPart (toSimpleFunc f)) a

Next tactic:
rw [h, eq]
theorem negPart_toSimpleFunc (f : α →₁ₛ[μ] ℝ) :
    toSimpleFunc (negPart f) =ᵐ[μ] (toSimpleFunc f).negPart := by
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹⁰ : NormedAddCommGroup E
inst✝⁹ : NormedAddCommGroup F
m : MeasurableSpace α
μ : Measure α
inst✝⁸ : NormedField 𝕜
inst✝⁷ : NormedSpace 𝕜 E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : SMulCommClass ℝ 𝕜 E
F' : Type u_5
inst✝⁴ : NormedAddCommGroup F'
inst✝³ : NormedSpace ℝ F'
E' : Type u_6
inst✝² : NormedAddCommGroup E'
inst✝¹ : NormedSpace ℝ E'
inst✝ : NormedSpace 𝕜 E'
f : ↥(simpleFunc ℝ 1 μ)
⊢ ↑(toSimpleFunc (negPart f)) =ᵐ[μ] ↑(MeasureTheory.SimpleFunc.negPart (toSimpleFunc f))

Next tactic:
rw [SimpleFunc.negPart, MeasureTheory.SimpleFunc.negPart]
theorem negPart_toSimpleFunc (f : α →₁ₛ[μ] ℝ) :
    toSimpleFunc (negPart f) =ᵐ[μ] (toSimpleFunc f).negPart := by
  rw [SimpleFunc.negPart, MeasureTheory.SimpleFunc.negPart]
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹⁰ : NormedAddCommGroup E
inst✝⁹ : NormedAddCommGroup F
m : MeasurableSpace α
μ : Measure α
inst✝⁸ : NormedField 𝕜
inst✝⁷ : NormedSpace 𝕜 E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : SMulCommClass ℝ 𝕜 E
F' : Type u_5
inst✝⁴ : NormedAddCommGroup F'
inst✝³ : NormedSpace ℝ F'
E' : Type u_6
inst✝² : NormedAddCommGroup E'
inst✝¹ : NormedSpace ℝ E'
inst✝ : NormedSpace 𝕜 E'
f : ↥(simpleFunc ℝ 1 μ)
⊢ ↑(toSimpleFunc (posPart (-f))) =ᵐ[μ] ↑(MeasureTheory.SimpleFunc.posPart (-toSimpleFunc f))

Next tactic:
filter_upwards [posPart_toSimpleFunc (-f), neg_toSimpleFunc f]
theorem negPart_toSimpleFunc (f : α →₁ₛ[μ] ℝ) :
    toSimpleFunc (negPart f) =ᵐ[μ] (toSimpleFunc f).negPart := by
  rw [SimpleFunc.negPart, MeasureTheory.SimpleFunc.negPart]
  filter_upwards [posPart_toSimpleFunc (-f), neg_toSimpleFunc f]
  

Proof state:
case h
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹⁰ : NormedAddCommGroup E
inst✝⁹ : NormedAddCommGroup F
m : MeasurableSpace α
μ : Measure α
inst✝⁸ : NormedField 𝕜
inst✝⁷ : NormedSpace 𝕜 E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : SMulCommClass ℝ 𝕜 E
F' : Type u_5
inst✝⁴ : NormedAddCommGroup F'
inst✝³ : NormedSpace ℝ F'
E' : Type u_6
inst✝² : NormedAddCommGroup E'
inst✝¹ : NormedSpace ℝ E'
inst✝ : NormedSpace 𝕜 E'
f : ↥(simpleFunc ℝ 1 μ)
⊢ ∀ (a : α),
    ↑(toSimpleFunc (posPart (-f))) a = ↑(MeasureTheory.SimpleFunc.posPart (toSimpleFunc (-f))) a →
      ↑(toSimpleFunc (-f)) a = (-↑(toSimpleFunc f)) a →
        ↑(toSimpleFunc (posPart (-f))) a = ↑(MeasureTheory.SimpleFunc.posPart (-toSimpleFunc f)) a

Next tactic:
intro a h₁ h₂
theorem negPart_toSimpleFunc (f : α →₁ₛ[μ] ℝ) :
    toSimpleFunc (negPart f) =ᵐ[μ] (toSimpleFunc f).negPart := by
  rw [SimpleFunc.negPart, MeasureTheory.SimpleFunc.negPart]
  filter_upwards [posPart_toSimpleFunc (-f), neg_toSimpleFunc f]
  intro a h₁ h₂
  

Proof state:
case h
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹⁰ : NormedAddCommGroup E
inst✝⁹ : NormedAddCommGroup F
m : MeasurableSpace α
μ : Measure α
inst✝⁸ : NormedField 𝕜
inst✝⁷ : NormedSpace 𝕜 E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : SMulCommClass ℝ 𝕜 E
F' : Type u_5
inst✝⁴ : NormedAddCommGroup F'
inst✝³ : NormedSpace ℝ F'
E' : Type u_6
inst✝² : NormedAddCommGroup E'
inst✝¹ : NormedSpace ℝ E'
inst✝ : NormedSpace 𝕜 E'
f : ↥(simpleFunc ℝ 1 μ)
a : α
h₁ : ↑(toSimpleFunc (posPart (-f))) a = ↑(MeasureTheory.SimpleFunc.posPart (toSimpleFunc (-f))) a
h₂ : ↑(toSimpleFunc (-f)) a = (-↑(toSimpleFunc f)) a
⊢ ↑(toSimpleFunc (posPart (-f))) a = ↑(MeasureTheory.SimpleFunc.posPart (-toSimpleFunc f)) a

Next tactic:
rw [h₁]