Theorem: MeasureTheory.Lp.simpleFunc.exists_simpleFunc_nonneg_ae_eq
File: Mathlib/MeasureTheory/Function/SimpleFuncDenseLp.lean

tactic: rw [← Lp.simpleFunc.coeFn_nonneg] at hf
state_before: α : Type u_1
β : Type ?u.2426547
ι : Type ?u.2426550
E : Type ?u.2426553
F : Type ?u.2426556
𝕜 : Type ?u.2426559
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
p : ℝ≥0∞
μ : Measure α
G : Type u_2
inst✝ : NormedLatticeAddCommGroup G
f : { x // x ∈ simpleFunc G p μ }
hf : 0 ≤ f
⊢ ∃ f', 0 ≤ f' ∧ ↑↑↑f =ᵐ[μ] ↑f'

tactic: have hf_ae : 0 ≤ᵐ[μ] simpleFunc.toSimpleFunc f := by
  filter_upwards [toSimpleFunc_eq_toFun f, hf] with _ h1 _; rwa [h1]
state_before: α : Type u_1
β : Type ?u.2426547
ι : Type ?u.2426550
E : Type ?u.2426553
F : Type ?u.2426556
𝕜 : Type ?u.2426559
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
p : ℝ≥0∞
μ : Measure α
G : Type u_2
inst✝ : NormedLatticeAddCommGroup G
f : { x // x ∈ simpleFunc G p μ }
hf : 0 ≤ᵐ[μ] ↑↑↑f
⊢ ∃ f', 0 ≤ f' ∧ ↑↑↑f =ᵐ[μ] ↑f'

tactic: let s := toMeasurable μ { x | ¬0 ≤ simpleFunc.toSimpleFunc f x }ᶜ
state_before: α : Type u_1
β : Type ?u.2426547
ι : Type ?u.2426550
E : Type ?u.2426553
F : Type ?u.2426556
𝕜 : Type ?u.2426559
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
p : ℝ≥0∞
μ : Measure α
G : Type u_2
inst✝ : NormedLatticeAddCommGroup G
f : { x // x ∈ simpleFunc G p μ }
hf : 0 ≤ᵐ[μ] ↑↑↑f
hf_ae : 0 ≤ᵐ[μ] ↑(toSimpleFunc f)
⊢ ∃ f', 0 ≤ f' ∧ ↑↑↑f =ᵐ[μ] ↑f'

tactic: have hs_zero : μ (sᶜ) = 0 := by
  rw [compl_compl, measure_toMeasurable]; rwa [EventuallyLE, ae_iff] at hf_ae
state_before: α : Type u_1
β : Type ?u.2426547
ι : Type ?u.2426550
E : Type ?u.2426553
F : Type ?u.2426556
𝕜 : Type ?u.2426559
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
p : ℝ≥0∞
μ : Measure α
G : Type u_2
inst✝ : NormedLatticeAddCommGroup G
f : { x // x ∈ simpleFunc G p μ }
hf : 0 ≤ᵐ[μ] ↑↑↑f
hf_ae : 0 ≤ᵐ[μ] ↑(toSimpleFunc f)
s : Set α := toMeasurable μ {x | ¬0 ≤ ↑(toSimpleFunc f) x}ᶜ
⊢ ∃ f', 0 ≤ f' ∧ ↑↑↑f =ᵐ[μ] ↑f'

tactic: 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'
state_before: α : Type u_1
β : Type ?u.2426547
ι : Type ?u.2426550
E : Type ?u.2426553
F : Type ?u.2426556
𝕜 : Type ?u.2426559
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
p : ℝ≥0∞
μ : Measure α
G : Type u_2
inst✝ : NormedLatticeAddCommGroup G
f : { x // x ∈ simpleFunc G p μ }
hf : 0 ≤ᵐ[μ] ↑↑↑f
hf_ae : 0 ≤ᵐ[μ] ↑(toSimpleFunc f)
s : Set α := toMeasurable μ {x | ¬0 ≤ ↑(toSimpleFunc f) x}ᶜ
hs_zero : ↑↑μ (sᶜ) = 0
⊢ ∃ f', 0 ≤ f' ∧ ↑↑↑f =ᵐ[μ] ↑f'

tactic: let f' :=
  SimpleFunc.piecewise s (measurableSet_toMeasurable μ _).compl (simpleFunc.toSimpleFunc f)
    (SimpleFunc.const α (0 : G))
state_before: α : Type u_1
β : Type ?u.2426547
ι : Type ?u.2426550
E : Type ?u.2426553
F : Type ?u.2426556
𝕜 : Type ?u.2426559
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
p : ℝ≥0∞
μ : Measure α
G : Type u_2
inst✝ : NormedLatticeAddCommGroup G
f : { x // x ∈ simpleFunc G p μ }
hf : 0 ≤ᵐ[μ] ↑↑↑f
hf_ae : 0 ≤ᵐ[μ] ↑(toSimpleFunc f)
s : Set α := toMeasurable μ {x | ¬0 ≤ ↑(toSimpleFunc f) x}ᶜ
hs_zero : ↑↑μ (sᶜ) = 0
hfs_nonneg : ∀ (x : α), x ∈ s → 0 ≤ ↑(toSimpleFunc f) x
⊢ ∃ f', 0 ≤ f' ∧ ↑↑↑f =ᵐ[μ] ↑f'

tactic: refine' ⟨f', fun x => _, _⟩
state_before: α : Type u_1
β : Type ?u.2426547
ι : Type ?u.2426550
E : Type ?u.2426553
F : Type ?u.2426556
𝕜 : Type ?u.2426559
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
p : ℝ≥0∞
μ : Measure α
G : Type u_2
inst✝ : NormedLatticeAddCommGroup G
f : { x // x ∈ simpleFunc G p μ }
hf : 0 ≤ᵐ[μ] ↑↑↑f
hf_ae : 0 ≤ᵐ[μ] ↑(toSimpleFunc f)
s : Set α := toMeasurable μ {x | ¬0 ≤ ↑(toSimpleFunc f) x}ᶜ
hs_zero : ↑↑μ (sᶜ) = 0
hfs_nonneg : ∀ (x : α), x ∈ s → 0 ≤ ↑(toSimpleFunc f) x
f' : α →ₛ G :=
  SimpleFunc.piecewise s (_ : MeasurableSet (toMeasurable μ {x | ¬0 ≤ ↑(toSimpleFunc f) x}ᶜ)) (toSimpleFunc f)
    (SimpleFunc.const α 0)
⊢ ∃ f', 0 ≤ f' ∧ ↑↑↑f =ᵐ[μ] ↑f'

tactic: filter_upwards [toSimpleFunc_eq_toFun f, hf] with _ h1 _
state_before: α : Type u_1
β : Type ?u.2426547
ι : Type ?u.2426550
E : Type ?u.2426553
F : Type ?u.2426556
𝕜 : Type ?u.2426559
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
p : ℝ≥0∞
μ : Measure α
G : Type u_2
inst✝ : NormedLatticeAddCommGroup G
f : { x // x ∈ simpleFunc G p μ }
hf : 0 ≤ᵐ[μ] ↑↑↑f
⊢ 0 ≤ᵐ[μ] ↑(toSimpleFunc f)

tactic: rwa [h1]
state_before: case h
α : Type u_1
β : Type ?u.2426547
ι : Type ?u.2426550
E : Type ?u.2426553
F : Type ?u.2426556
𝕜 : Type ?u.2426559
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
p : ℝ≥0∞
μ : Measure α
G : Type u_2
inst✝ : NormedLatticeAddCommGroup G
f : { x // x ∈ simpleFunc G p μ }
hf : 0 ≤ᵐ[μ] ↑↑↑f
a✝¹ : α
h1 : ↑(toSimpleFunc f) a✝¹ = ↑↑↑f a✝¹
a✝ : OfNat.ofNat 0 a✝¹ ≤ ↑↑↑f a✝¹
⊢ OfNat.ofNat 0 a✝¹ ≤ ↑(toSimpleFunc f) a✝¹

tactic: rw [compl_compl, measure_toMeasurable]
state_before: α : Type u_1
β : Type ?u.2426547
ι : Type ?u.2426550
E : Type ?u.2426553
F : Type ?u.2426556
𝕜 : Type ?u.2426559
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
p : ℝ≥0∞
μ : Measure α
G : Type u_2
inst✝ : NormedLatticeAddCommGroup G
f : { x // x ∈ simpleFunc G p μ }
hf : 0 ≤ᵐ[μ] ↑↑↑f
hf_ae : 0 ≤ᵐ[μ] ↑(toSimpleFunc f)
s : Set α := toMeasurable μ {x | ¬0 ≤ ↑(toSimpleFunc f) x}ᶜ
⊢ ↑↑μ (sᶜ) = 0

tactic: rwa [EventuallyLE, ae_iff] at hf_ae
state_before: α : Type u_1
β : Type ?u.2426547
ι : Type ?u.2426550
E : Type ?u.2426553
F : Type ?u.2426556
𝕜 : Type ?u.2426559
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
p : ℝ≥0∞
μ : Measure α
G : Type u_2
inst✝ : NormedLatticeAddCommGroup G
f : { x // x ∈ simpleFunc G p μ }
hf : 0 ≤ᵐ[μ] ↑↑↑f
hf_ae : 0 ≤ᵐ[μ] ↑(toSimpleFunc f)
s : Set α := toMeasurable μ {x | ¬0 ≤ ↑(toSimpleFunc f) x}ᶜ
⊢ ↑↑μ {x | ¬0 ≤ ↑(toSimpleFunc f) x} = 0

tactic: intro x hxs
state_before: α : Type u_1
β : Type ?u.2426547
ι : Type ?u.2426550
E : Type ?u.2426553
F : Type ?u.2426556
𝕜 : Type ?u.2426559
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
p : ℝ≥0∞
μ : Measure α
G : Type u_2
inst✝ : NormedLatticeAddCommGroup G
f : { x // x ∈ simpleFunc G p μ }
hf : 0 ≤ᵐ[μ] ↑↑↑f
hf_ae : 0 ≤ᵐ[μ] ↑(toSimpleFunc f)
s : Set α := toMeasurable μ {x | ¬0 ≤ ↑(toSimpleFunc f) x}ᶜ
hs_zero : ↑↑μ (sᶜ) = 0
⊢ ∀ (x : α), x ∈ s → 0 ≤ ↑(toSimpleFunc f) x

tactic: rw [mem_compl_iff] at hxs
state_before: α : Type u_1
β : Type ?u.2426547
ι : Type ?u.2426550
E : Type ?u.2426553
F : Type ?u.2426556
𝕜 : Type ?u.2426559
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
p : ℝ≥0∞
μ : Measure α
G : Type u_2
inst✝ : NormedLatticeAddCommGroup G
f : { x // x ∈ simpleFunc G p μ }
hf : 0 ≤ᵐ[μ] ↑↑↑f
hf_ae : 0 ≤ᵐ[μ] ↑(toSimpleFunc f)
s : Set α := toMeasurable μ {x | ¬0 ≤ ↑(toSimpleFunc f) x}ᶜ
hs_zero : ↑↑μ (sᶜ) = 0
x : α
hxs : x ∈ s
⊢ 0 ≤ ↑(toSimpleFunc f) x

tactic: have hx' : x ∉ { a : α | ¬0 ≤ simpleFunc.toSimpleFunc f a } := fun h =>
  hxs (subset_toMeasurable μ _ h)
state_before: α : Type u_1
β : Type ?u.2426547
ι : Type ?u.2426550
E : Type ?u.2426553
F : Type ?u.2426556
𝕜 : Type ?u.2426559
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
p : ℝ≥0∞
μ : Measure α
G : Type u_2
inst✝ : NormedLatticeAddCommGroup G
f : { x // x ∈ simpleFunc G p μ }
hf : 0 ≤ᵐ[μ] ↑↑↑f
hf_ae : 0 ≤ᵐ[μ] ↑(toSimpleFunc f)
s : Set α := toMeasurable μ {x | ¬0 ≤ ↑(toSimpleFunc f) x}ᶜ
hs_zero : ↑↑μ (sᶜ) = 0
x : α
hxs : ¬x ∈ toMeasurable μ {x | ¬0 ≤ ↑(toSimpleFunc f) x}
⊢ 0 ≤ ↑(toSimpleFunc f) x

tactic: rwa [Set.nmem_setOf_iff, Classical.not_not] at hx'
state_before: α : Type u_1
β : Type ?u.2426547
ι : Type ?u.2426550
E : Type ?u.2426553
F : Type ?u.2426556
𝕜 : Type ?u.2426559
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
p : ℝ≥0∞
μ : Measure α
G : Type u_2
inst✝ : NormedLatticeAddCommGroup G
f : { x // x ∈ simpleFunc G p μ }
hf : 0 ≤ᵐ[μ] ↑↑↑f
hf_ae : 0 ≤ᵐ[μ] ↑(toSimpleFunc f)
s : Set α := toMeasurable μ {x | ¬0 ≤ ↑(toSimpleFunc f) x}ᶜ
hs_zero : ↑↑μ (sᶜ) = 0
x : α
hxs : ¬x ∈ toMeasurable μ {x | ¬0 ≤ ↑(toSimpleFunc f) x}
hx' : ¬x ∈ {a | ¬0 ≤ ↑(toSimpleFunc f) a}
⊢ 0 ≤ ↑(toSimpleFunc f) x

tactic: rw [SimpleFunc.piecewise_apply]
state_before: case refine'_1
α : Type u_1
β : Type ?u.2426547
ι : Type ?u.2426550
E : Type ?u.2426553
F : Type ?u.2426556
𝕜 : Type ?u.2426559
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
p : ℝ≥0∞
μ : Measure α
G : Type u_2
inst✝ : NormedLatticeAddCommGroup G
f : { x // x ∈ simpleFunc G p μ }
hf : 0 ≤ᵐ[μ] ↑↑↑f
hf_ae : 0 ≤ᵐ[μ] ↑(toSimpleFunc f)
s : Set α := toMeasurable μ {x | ¬0 ≤ ↑(toSimpleFunc f) x}ᶜ
hs_zero : ↑↑μ (sᶜ) = 0
hfs_nonneg : ∀ (x : α), x ∈ s → 0 ≤ ↑(toSimpleFunc f) x
f' : α →ₛ G :=
  SimpleFunc.piecewise s (_ : MeasurableSet (toMeasurable μ {x | ¬0 ≤ ↑(toSimpleFunc f) x}ᶜ)) (toSimpleFunc f)
    (SimpleFunc.const α 0)
x : α
⊢ ↑0 x ≤ ↑f' x

tactic: by_cases hxs : x ∈ s
state_before: case refine'_1
α : Type u_1
β : Type ?u.2426547
ι : Type ?u.2426550
E : Type ?u.2426553
F : Type ?u.2426556
𝕜 : Type ?u.2426559
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
p : ℝ≥0∞
μ : Measure α
G : Type u_2
inst✝ : NormedLatticeAddCommGroup G
f : { x // x ∈ simpleFunc G p μ }
hf : 0 ≤ᵐ[μ] ↑↑↑f
hf_ae : 0 ≤ᵐ[μ] ↑(toSimpleFunc f)
s : Set α := toMeasurable μ {x | ¬0 ≤ ↑(toSimpleFunc f) x}ᶜ
hs_zero : ↑↑μ (sᶜ) = 0
hfs_nonneg : ∀ (x : α), x ∈ s → 0 ≤ ↑(toSimpleFunc f) x
f' : α →ₛ G :=
  SimpleFunc.piecewise s (_ : MeasurableSet (toMeasurable μ {x | ¬0 ≤ ↑(toSimpleFunc f) x}ᶜ)) (toSimpleFunc f)
    (SimpleFunc.const α 0)
x : α
⊢ ↑0 x ≤ if x ∈ s then ↑(toSimpleFunc f) x else ↑(SimpleFunc.const α 0) x

tactic: simp only [hxs, hfs_nonneg x hxs, if_true, Pi.zero_apply, SimpleFunc.coe_zero]
state_before: case pos
α : Type u_1
β : Type ?u.2426547
ι : Type ?u.2426550
E : Type ?u.2426553
F : Type ?u.2426556
𝕜 : Type ?u.2426559
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
p : ℝ≥0∞
μ : Measure α
G : Type u_2
inst✝ : NormedLatticeAddCommGroup G
f : { x // x ∈ simpleFunc G p μ }
hf : 0 ≤ᵐ[μ] ↑↑↑f
hf_ae : 0 ≤ᵐ[μ] ↑(toSimpleFunc f)
s : Set α := toMeasurable μ {x | ¬0 ≤ ↑(toSimpleFunc f) x}ᶜ
hs_zero : ↑↑μ (sᶜ) = 0
hfs_nonneg : ∀ (x : α), x ∈ s → 0 ≤ ↑(toSimpleFunc f) x
f' : α →ₛ G :=
  SimpleFunc.piecewise s (_ : MeasurableSet (toMeasurable μ {x | ¬0 ≤ ↑(toSimpleFunc f) x}ᶜ)) (toSimpleFunc f)
    (SimpleFunc.const α 0)
x : α
hxs : x ∈ s
⊢ ↑0 x ≤ if x ∈ s then ↑(toSimpleFunc f) x else ↑(SimpleFunc.const α 0) x

tactic: simp only [hxs, SimpleFunc.const_zero, if_false]
state_before: case neg
α : Type u_1
β : Type ?u.2426547
ι : Type ?u.2426550
E : Type ?u.2426553
F : Type ?u.2426556
𝕜 : Type ?u.2426559
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
p : ℝ≥0∞
μ : Measure α
G : Type u_2
inst✝ : NormedLatticeAddCommGroup G
f : { x // x ∈ simpleFunc G p μ }
hf : 0 ≤ᵐ[μ] ↑↑↑f
hf_ae : 0 ≤ᵐ[μ] ↑(toSimpleFunc f)
s : Set α := toMeasurable μ {x | ¬0 ≤ ↑(toSimpleFunc f) x}ᶜ
hs_zero : ↑↑μ (sᶜ) = 0
hfs_nonneg : ∀ (x : α), x ∈ s → 0 ≤ ↑(toSimpleFunc f) x
f' : α →ₛ G :=
  SimpleFunc.piecewise s (_ : MeasurableSet (toMeasurable μ {x | ¬0 ≤ ↑(toSimpleFunc f) x}ᶜ)) (toSimpleFunc f)
    (SimpleFunc.const α 0)
x : α
hxs : ¬x ∈ s
⊢ ↑0 x ≤ if x ∈ s then ↑(toSimpleFunc f) x else ↑(SimpleFunc.const α 0) x

tactic: rfl
state_before: case neg
α : Type u_1
β : Type ?u.2426547
ι : Type ?u.2426550
E : Type ?u.2426553
F : Type ?u.2426556
𝕜 : Type ?u.2426559
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
p : ℝ≥0∞
μ : Measure α
G : Type u_2
inst✝ : NormedLatticeAddCommGroup G
f : { x // x ∈ simpleFunc G p μ }
hf : 0 ≤ᵐ[μ] ↑↑↑f
hf_ae : 0 ≤ᵐ[μ] ↑(toSimpleFunc f)
s : Set α := toMeasurable μ {x | ¬0 ≤ ↑(toSimpleFunc f) x}ᶜ
hs_zero : ↑↑μ (sᶜ) = 0
hfs_nonneg : ∀ (x : α), x ∈ s → 0 ≤ ↑(toSimpleFunc f) x
f' : α →ₛ G :=
  SimpleFunc.piecewise s (_ : MeasurableSet (toMeasurable μ {x | ¬0 ≤ ↑(toSimpleFunc f) x}ᶜ)) (toSimpleFunc f)
    (SimpleFunc.const α 0)
x : α
hxs : ¬x ∈ s
⊢ ↑0 x ≤ ↑0 x

tactic: rw [SimpleFunc.coe_piecewise]
state_before: case refine'_2
α : Type u_1
β : Type ?u.2426547
ι : Type ?u.2426550
E : Type ?u.2426553
F : Type ?u.2426556
𝕜 : Type ?u.2426559
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
p : ℝ≥0∞
μ : Measure α
G : Type u_2
inst✝ : NormedLatticeAddCommGroup G
f : { x // x ∈ simpleFunc G p μ }
hf : 0 ≤ᵐ[μ] ↑↑↑f
hf_ae : 0 ≤ᵐ[μ] ↑(toSimpleFunc f)
s : Set α := toMeasurable μ {x | ¬0 ≤ ↑(toSimpleFunc f) x}ᶜ
hs_zero : ↑↑μ (sᶜ) = 0
hfs_nonneg : ∀ (x : α), x ∈ s → 0 ≤ ↑(toSimpleFunc f) x
f' : α →ₛ G :=
  SimpleFunc.piecewise s (_ : MeasurableSet (toMeasurable μ {x | ¬0 ≤ ↑(toSimpleFunc f) x}ᶜ)) (toSimpleFunc f)
    (SimpleFunc.const α 0)
⊢ ↑↑↑f =ᵐ[μ] ↑f'

tactic: 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
state_before: case refine'_2
α : Type u_1
β : Type ?u.2426547
ι : Type ?u.2426550
E : Type ?u.2426553
F : Type ?u.2426556
𝕜 : Type ?u.2426559
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
p : ℝ≥0∞
μ : Measure α
G : Type u_2
inst✝ : NormedLatticeAddCommGroup G
f : { x // x ∈ simpleFunc G p μ }
hf : 0 ≤ᵐ[μ] ↑↑↑f
hf_ae : 0 ≤ᵐ[μ] ↑(toSimpleFunc f)
s : Set α := toMeasurable μ {x | ¬0 ≤ ↑(toSimpleFunc f) x}ᶜ
hs_zero : ↑↑μ (sᶜ) = 0
hfs_nonneg : ∀ (x : α), x ∈ s → 0 ≤ ↑(toSimpleFunc f) x
f' : α →ₛ G :=
  SimpleFunc.piecewise s (_ : MeasurableSet (toMeasurable μ {x | ¬0 ≤ ↑(toSimpleFunc f) x}ᶜ)) (toSimpleFunc f)
    (SimpleFunc.const α 0)
⊢ ↑↑↑f =ᵐ[μ] Set.piecewise s ↑(toSimpleFunc f) ↑(SimpleFunc.const α 0)

tactic: refine' EventuallyEq.trans (toSimpleFunc_eq_toFun f).symm _
state_before: case refine'_2
α : Type u_1
β : Type ?u.2426547
ι : Type ?u.2426550
E : Type ?u.2426553
F : Type ?u.2426556
𝕜 : Type ?u.2426559
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
p : ℝ≥0∞
μ : Measure α
G : Type u_2
inst✝ : NormedLatticeAddCommGroup G
f : { x // x ∈ simpleFunc G p μ }
hf : 0 ≤ᵐ[μ] ↑↑↑f
hf_ae : 0 ≤ᵐ[μ] ↑(toSimpleFunc f)
s : Set α := toMeasurable μ {x | ¬0 ≤ ↑(toSimpleFunc f) x}ᶜ
hs_zero : ↑↑μ (sᶜ) = 0
hfs_nonneg : ∀ (x : α), x ∈ s → 0 ≤ ↑(toSimpleFunc f) x
f' : α →ₛ G :=
  SimpleFunc.piecewise s (_ : MeasurableSet (toMeasurable μ {x | ¬0 ≤ ↑(toSimpleFunc f) x}ᶜ)) (toSimpleFunc f)
    (SimpleFunc.const α 0)
this : s =ᵐ[μ] Set.univ
⊢ ↑↑↑f =ᵐ[μ] Set.piecewise s ↑(toSimpleFunc f) ↑(SimpleFunc.const α 0)

tactic: refine' EventuallyEq.trans _ (piecewise_ae_eq_of_ae_eq_set this.symm)
state_before: case refine'_2
α : Type u_1
β : Type ?u.2426547
ι : Type ?u.2426550
E : Type ?u.2426553
F : Type ?u.2426556
𝕜 : Type ?u.2426559
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
p : ℝ≥0∞
μ : Measure α
G : Type u_2
inst✝ : NormedLatticeAddCommGroup G
f : { x // x ∈ simpleFunc G p μ }
hf : 0 ≤ᵐ[μ] ↑↑↑f
hf_ae : 0 ≤ᵐ[μ] ↑(toSimpleFunc f)
s : Set α := toMeasurable μ {x | ¬0 ≤ ↑(toSimpleFunc f) x}ᶜ
hs_zero : ↑↑μ (sᶜ) = 0
hfs_nonneg : ∀ (x : α), x ∈ s → 0 ≤ ↑(toSimpleFunc f) x
f' : α →ₛ G :=
  SimpleFunc.piecewise s (_ : MeasurableSet (toMeasurable μ {x | ¬0 ≤ ↑(toSimpleFunc f) x}ᶜ)) (toSimpleFunc f)
    (SimpleFunc.const α 0)
this : s =ᵐ[μ] Set.univ
⊢ ↑(toSimpleFunc f) =ᵐ[μ] Set.piecewise s ↑(toSimpleFunc f) ↑(SimpleFunc.const α 0)

tactic: simp only [SimpleFunc.const_zero, indicator_univ, piecewise_eq_indicator, SimpleFunc.coe_zero]
state_before: case refine'_2
α : Type u_1
β : Type ?u.2426547
ι : Type ?u.2426550
E : Type ?u.2426553
F : Type ?u.2426556
𝕜 : Type ?u.2426559
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
p : ℝ≥0∞
μ : Measure α
G : Type u_2
inst✝ : NormedLatticeAddCommGroup G
f : { x // x ∈ simpleFunc G p μ }
hf : 0 ≤ᵐ[μ] ↑↑↑f
hf_ae : 0 ≤ᵐ[μ] ↑(toSimpleFunc f)
s : Set α := toMeasurable μ {x | ¬0 ≤ ↑(toSimpleFunc f) x}ᶜ
hs_zero : ↑↑μ (sᶜ) = 0
hfs_nonneg : ∀ (x : α), x ∈ s → 0 ≤ ↑(toSimpleFunc f) x
f' : α →ₛ G :=
  SimpleFunc.piecewise s (_ : MeasurableSet (toMeasurable μ {x | ¬0 ≤ ↑(toSimpleFunc f) x}ᶜ)) (toSimpleFunc f)
    (SimpleFunc.const α 0)
this✝ : s =ᵐ[μ] Set.univ
this : DecidablePred fun x => x ∈ Set.univ := fun x => Classical.propDecidable ((fun x => x ∈ Set.univ) x)
⊢ ↑(toSimpleFunc f) =ᵐ[μ] Set.piecewise Set.univ ↑(toSimpleFunc f) ↑(SimpleFunc.const α 0)

tactic: rfl
state_before: case refine'_2
α : Type u_1
β : Type ?u.2426547
ι : Type ?u.2426550
E : Type ?u.2426553
F : Type ?u.2426556
𝕜 : Type ?u.2426559
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
p : ℝ≥0∞
μ : Measure α
G : Type u_2
inst✝ : NormedLatticeAddCommGroup G
f : { x // x ∈ simpleFunc G p μ }
hf : 0 ≤ᵐ[μ] ↑↑↑f
hf_ae : 0 ≤ᵐ[μ] ↑(toSimpleFunc f)
s : Set α := toMeasurable μ {x | ¬0 ≤ ↑(toSimpleFunc f) x}ᶜ
hs_zero : ↑↑μ (sᶜ) = 0
hfs_nonneg : ∀ (x : α), x ∈ s → 0 ≤ ↑(toSimpleFunc f) x
f' : α →ₛ G :=
  SimpleFunc.piecewise s (_ : MeasurableSet (toMeasurable μ {x | ¬0 ≤ ↑(toSimpleFunc f) x}ᶜ)) (toSimpleFunc f)
    (SimpleFunc.const α 0)
this✝ : s =ᵐ[μ] Set.univ
this : DecidablePred fun x => x ∈ Set.univ := fun x => Classical.propDecidable ((fun x => x ∈ Set.univ) x)
⊢ ↑(toSimpleFunc f) =ᵐ[μ] ↑(toSimpleFunc f)

tactic: rw [ae_eq_set]
state_before: α : Type u_1
β : Type ?u.2426547
ι : Type ?u.2426550
E : Type ?u.2426553
F : Type ?u.2426556
𝕜 : Type ?u.2426559
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
p : ℝ≥0∞
μ : Measure α
G : Type u_2
inst✝ : NormedLatticeAddCommGroup G
f : { x // x ∈ simpleFunc G p μ }
hf : 0 ≤ᵐ[μ] ↑↑↑f
hf_ae : 0 ≤ᵐ[μ] ↑(toSimpleFunc f)
s : Set α := toMeasurable μ {x | ¬0 ≤ ↑(toSimpleFunc f) x}ᶜ
hs_zero : ↑↑μ (sᶜ) = 0
hfs_nonneg : ∀ (x : α), x ∈ s → 0 ≤ ↑(toSimpleFunc f) x
f' : α →ₛ G :=
  SimpleFunc.piecewise s (_ : MeasurableSet (toMeasurable μ {x | ¬0 ≤ ↑(toSimpleFunc f) x}ᶜ)) (toSimpleFunc f)
    (SimpleFunc.const α 0)
⊢ s =ᵐ[μ] Set.univ

tactic: simp only [true_and_iff, measure_empty, eq_self_iff_true, diff_univ, ← compl_eq_univ_diff]
state_before: α : Type u_1
β : Type ?u.2426547
ι : Type ?u.2426550
E : Type ?u.2426553
F : Type ?u.2426556
𝕜 : Type ?u.2426559
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
p : ℝ≥0∞
μ : Measure α
G : Type u_2
inst✝ : NormedLatticeAddCommGroup G
f : { x // x ∈ simpleFunc G p μ }
hf : 0 ≤ᵐ[μ] ↑↑↑f
hf_ae : 0 ≤ᵐ[μ] ↑(toSimpleFunc f)
s : Set α := toMeasurable μ {x | ¬0 ≤ ↑(toSimpleFunc f) x}ᶜ
hs_zero : ↑↑μ (sᶜ) = 0
hfs_nonneg : ∀ (x : α), x ∈ s → 0 ≤ ↑(toSimpleFunc f) x
f' : α →ₛ G :=
  SimpleFunc.piecewise s (_ : MeasurableSet (toMeasurable μ {x | ¬0 ≤ ↑(toSimpleFunc f) x}ᶜ)) (toSimpleFunc f)
    (SimpleFunc.const α 0)
⊢ ↑↑μ (s \ Set.univ) = 0 ∧ ↑↑μ (Set.univ \ s) = 0

tactic: exact hs_zero
state_before: α : Type u_1
β : Type ?u.2426547
ι : Type ?u.2426550
E : Type ?u.2426553
F : Type ?u.2426556
𝕜 : Type ?u.2426559
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedAddCommGroup F
p : ℝ≥0∞
μ : Measure α
G : Type u_2
inst✝ : NormedLatticeAddCommGroup G
f : { x // x ∈ simpleFunc G p μ }
hf : 0 ≤ᵐ[μ] ↑↑↑f
hf_ae : 0 ≤ᵐ[μ] ↑(toSimpleFunc f)
s : Set α := toMeasurable μ {x | ¬0 ≤ ↑(toSimpleFunc f) x}ᶜ
hs_zero : ↑↑μ (sᶜ) = 0
hfs_nonneg : ∀ (x : α), x ∈ s → 0 ≤ ↑(toSimpleFunc f) x
f' : α →ₛ G :=
  SimpleFunc.piecewise s (_ : MeasurableSet (toMeasurable μ {x | ¬0 ≤ ↑(toSimpleFunc f) x}ᶜ)) (toSimpleFunc f)
    (SimpleFunc.const α 0)
⊢ ↑↑μ (toMeasurable μ {x | ¬0 ≤ ↑(toSimpleFunc f) x}ᶜᶜ) = 0