Theorem: MeasureTheory.SimpleFunc.exists_upperSemicontinuous_le_lintegral_le
File: Mathlib/MeasureTheory/Integral/VitaliCaratheodory.lean

tactic: induction' f using MeasureTheory.SimpleFunc.induction with c s hs f₁ f₂ _ h₁ h₂ generalizing ε
state_before: α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α →ₛ ℝ≥0
int_f : (∫⁻ (x : α), ↑(↑f x) ∂μ) ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
⊢ ∃ g, (∀ (x : α), g x ≤ ↑f x) ∧ UpperSemicontinuous g ∧ (∫⁻ (x : α), ↑(↑f x) ∂μ) ≤ (∫⁻ (x : α), ↑(g x) ∂μ) + ε

tactic: by_cases hc : c = 0
state_before: case h_ind
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α →ₛ ℝ≥0
int_f✝ : (∫⁻ (x : α), ↑(↑f x) ∂μ) ≠ ⊤
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
int_f : (∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ) ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
⊢ ∃ g,
    (∀ (x : α), g x ≤ ↑(piecewise s hs (const α c) (const α 0)) x) ∧
      UpperSemicontinuous g ∧
        (∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ) ≤ (∫⁻ (x : α), ↑(g x) ∂μ) + ε

tactic: have μs_lt_top : μ s < ∞ := by
  classical
  simpa only [hs, hc, lt_top_iff_ne_top, true_and_iff, SimpleFunc.coe_const, or_false_iff,
    lintegral_const, ENNReal.coe_indicator, Set.univ_inter, ENNReal.coe_ne_top,
    Measure.restrict_apply MeasurableSet.univ, ENNReal.mul_eq_top, SimpleFunc.const_zero,
    Function.const_apply, lintegral_indicator, ENNReal.coe_eq_zero, Ne.def, not_false_iff,
    SimpleFunc.coe_zero, Set.piecewise_eq_indicator, SimpleFunc.coe_piecewise,
    false_and_iff] using int_f
state_before: case neg
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α →ₛ ℝ≥0
int_f✝ : (∫⁻ (x : α), ↑(↑f x) ∂μ) ≠ ⊤
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
int_f : (∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ) ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
hc : ¬c = 0
⊢ ∃ g,
    (∀ (x : α), g x ≤ ↑(piecewise s hs (const α c) (const α 0)) x) ∧
      UpperSemicontinuous g ∧
        (∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ) ≤ (∫⁻ (x : α), ↑(g x) ∂μ) + ε

tactic: have : (0 : ℝ≥0∞) < ε / c := ENNReal.div_pos_iff.2 ⟨ε0, ENNReal.coe_ne_top⟩
state_before: case neg
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α →ₛ ℝ≥0
int_f✝ : (∫⁻ (x : α), ↑(↑f x) ∂μ) ≠ ⊤
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
int_f : (∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ) ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
hc : ¬c = 0
μs_lt_top : ↑↑μ s < ⊤
⊢ ∃ g,
    (∀ (x : α), g x ≤ ↑(piecewise s hs (const α c) (const α 0)) x) ∧
      UpperSemicontinuous g ∧
        (∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ) ≤ (∫⁻ (x : α), ↑(g x) ∂μ) + ε

tactic: obtain ⟨F, Fs, F_closed, μF⟩ : ∃ (F : _), F ⊆ s ∧ IsClosed F ∧ μ s < μ F + ε / c :=
  hs.exists_isClosed_lt_add μs_lt_top.ne this.ne'
state_before: case neg
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α →ₛ ℝ≥0
int_f✝ : (∫⁻ (x : α), ↑(↑f x) ∂μ) ≠ ⊤
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
int_f : (∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ) ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
hc : ¬c = 0
μs_lt_top : ↑↑μ s < ⊤
this : 0 < ε / ↑c
⊢ ∃ g,
    (∀ (x : α), g x ≤ ↑(piecewise s hs (const α c) (const α 0)) x) ∧
      UpperSemicontinuous g ∧
        (∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ) ≤ (∫⁻ (x : α), ↑(g x) ∂μ) + ε

tactic: refine'
  ⟨Set.indicator F fun _ => c, fun x => _, F_closed.upperSemicontinuous_indicator (zero_le _),
    _⟩
state_before: case neg.intro.intro.intro
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α →ₛ ℝ≥0
int_f✝ : (∫⁻ (x : α), ↑(↑f x) ∂μ) ≠ ⊤
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
int_f : (∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ) ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
hc : ¬c = 0
μs_lt_top : ↑↑μ s < ⊤
this : 0 < ε / ↑c
F : Set α
Fs : F ⊆ s
F_closed : IsClosed F
μF : ↑↑μ s < ↑↑μ F + ε / ↑c
⊢ ∃ g,
    (∀ (x : α), g x ≤ ↑(piecewise s hs (const α c) (const α 0)) x) ∧
      UpperSemicontinuous g ∧
        (∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ) ≤ (∫⁻ (x : α), ↑(g x) ∂μ) + ε

tactic: refine' ⟨fun _ => 0, _, upperSemicontinuous_const, _⟩
state_before: case pos
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α →ₛ ℝ≥0
int_f✝ : (∫⁻ (x : α), ↑(↑f x) ∂μ) ≠ ⊤
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
int_f : (∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ) ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
hc : c = 0
⊢ ∃ g,
    (∀ (x : α), g x ≤ ↑(piecewise s hs (const α c) (const α 0)) x) ∧
      UpperSemicontinuous g ∧
        (∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ) ≤ (∫⁻ (x : α), ↑(g x) ∂μ) + ε

tactic: classical
simp only [hc, Set.indicator_zero', Pi.zero_apply, SimpleFunc.const_zero, imp_true_iff,
  eq_self_iff_true, SimpleFunc.coe_zero, Set.piecewise_eq_indicator,
  SimpleFunc.coe_piecewise, le_zero_iff]
state_before: case pos.refine'_1
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α →ₛ ℝ≥0
int_f✝ : (∫⁻ (x : α), ↑(↑f x) ∂μ) ≠ ⊤
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
int_f : (∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ) ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
hc : c = 0
⊢ ∀ (x : α), (fun x => 0) x ≤ ↑(piecewise s hs (const α c) (const α 0)) x

tactic: simp only [hc, Set.indicator_zero', Pi.zero_apply, SimpleFunc.const_zero, imp_true_iff,
  eq_self_iff_true, SimpleFunc.coe_zero, Set.piecewise_eq_indicator,
  SimpleFunc.coe_piecewise, le_zero_iff]
state_before: case pos.refine'_1
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α →ₛ ℝ≥0
int_f✝ : (∫⁻ (x : α), ↑(↑f x) ∂μ) ≠ ⊤
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
int_f : (∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ) ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
hc : c = 0
⊢ ∀ (x : α), (fun x => 0) x ≤ ↑(piecewise s hs (const α c) (const α 0)) x

tactic: classical
simp only [hc, Set.indicator_zero', lintegral_const, MulZeroClass.zero_mul, Pi.zero_apply,
  SimpleFunc.const_zero, zero_add, zero_le', SimpleFunc.coe_zero,
  Set.piecewise_eq_indicator, ENNReal.coe_zero, SimpleFunc.coe_piecewise, zero_le]
state_before: case pos.refine'_2
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α →ₛ ℝ≥0
int_f✝ : (∫⁻ (x : α), ↑(↑f x) ∂μ) ≠ ⊤
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
int_f : (∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ) ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
hc : c = 0
⊢ (∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ) ≤ (∫⁻ (x : α), ↑((fun x => 0) x) ∂μ) + ε

tactic: simp only [hc, Set.indicator_zero', lintegral_const, MulZeroClass.zero_mul, Pi.zero_apply,
  SimpleFunc.const_zero, zero_add, zero_le', SimpleFunc.coe_zero,
  Set.piecewise_eq_indicator, ENNReal.coe_zero, SimpleFunc.coe_piecewise, zero_le]
state_before: case pos.refine'_2
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α →ₛ ℝ≥0
int_f✝ : (∫⁻ (x : α), ↑(↑f x) ∂μ) ≠ ⊤
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
int_f : (∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ) ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
hc : c = 0
⊢ (∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ) ≤ (∫⁻ (x : α), ↑((fun x => 0) x) ∂μ) + ε

tactic: classical
simpa only [hs, hc, lt_top_iff_ne_top, true_and_iff, SimpleFunc.coe_const, or_false_iff,
  lintegral_const, ENNReal.coe_indicator, Set.univ_inter, ENNReal.coe_ne_top,
  Measure.restrict_apply MeasurableSet.univ, ENNReal.mul_eq_top, SimpleFunc.const_zero,
  Function.const_apply, lintegral_indicator, ENNReal.coe_eq_zero, Ne.def, not_false_iff,
  SimpleFunc.coe_zero, Set.piecewise_eq_indicator, SimpleFunc.coe_piecewise,
  false_and_iff] using int_f
state_before: α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α →ₛ ℝ≥0
int_f✝ : (∫⁻ (x : α), ↑(↑f x) ∂μ) ≠ ⊤
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
int_f : (∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ) ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
hc : ¬c = 0
⊢ ↑↑μ s < ⊤

tactic: simpa only [hs, hc, lt_top_iff_ne_top, true_and_iff, SimpleFunc.coe_const, or_false_iff,
  lintegral_const, ENNReal.coe_indicator, Set.univ_inter, ENNReal.coe_ne_top,
  Measure.restrict_apply MeasurableSet.univ, ENNReal.mul_eq_top, SimpleFunc.const_zero,
  Function.const_apply, lintegral_indicator, ENNReal.coe_eq_zero, Ne.def, not_false_iff,
  SimpleFunc.coe_zero, Set.piecewise_eq_indicator, SimpleFunc.coe_piecewise,
  false_and_iff] using int_f
state_before: α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α →ₛ ℝ≥0
int_f✝ : (∫⁻ (x : α), ↑(↑f x) ∂μ) ≠ ⊤
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
int_f : (∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ) ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
hc : ¬c = 0
⊢ ↑↑μ s < ⊤

tactic: simp only [SimpleFunc.coe_const, SimpleFunc.const_zero, SimpleFunc.coe_zero,
  Set.piecewise_eq_indicator, SimpleFunc.coe_piecewise]
state_before: case neg.intro.intro.intro.refine'_1
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α →ₛ ℝ≥0
int_f✝ : (∫⁻ (x : α), ↑(↑f x) ∂μ) ≠ ⊤
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
int_f : (∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ) ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
hc : ¬c = 0
μs_lt_top : ↑↑μ s < ⊤
this : 0 < ε / ↑c
F : Set α
Fs : F ⊆ s
F_closed : IsClosed F
μF : ↑↑μ s < ↑↑μ F + ε / ↑c
x : α
⊢ Set.indicator F (fun x => c) x ≤ ↑(piecewise s hs (const α c) (const α 0)) x

tactic: exact Set.indicator_le_indicator_of_subset Fs (fun x => zero_le _) _
state_before: case neg.intro.intro.intro.refine'_1
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α →ₛ ℝ≥0
int_f✝ : (∫⁻ (x : α), ↑(↑f x) ∂μ) ≠ ⊤
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
int_f : (∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ) ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
hc : ¬c = 0
μs_lt_top : ↑↑μ s < ⊤
this : 0 < ε / ↑c
F : Set α
Fs : F ⊆ s
F_closed : IsClosed F
μF : ↑↑μ s < ↑↑μ F + ε / ↑c
x : α
⊢ Set.indicator F (fun x => c) x ≤ Set.piecewise s (Function.const α c) 0 x

tactic: suffices (c : ℝ≥0∞) * μ s ≤ c * μ F + ε by
  classical
  simpa only [hs, F_closed.measurableSet, SimpleFunc.coe_const, Function.const_apply,
    lintegral_const, ENNReal.coe_indicator, Set.univ_inter, MeasurableSet.univ,
    SimpleFunc.const_zero, lintegral_indicator, SimpleFunc.coe_zero,
    Set.piecewise_eq_indicator, SimpleFunc.coe_piecewise, Measure.restrict_apply]
state_before: case neg.intro.intro.intro.refine'_2
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α →ₛ ℝ≥0
int_f✝ : (∫⁻ (x : α), ↑(↑f x) ∂μ) ≠ ⊤
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
int_f : (∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ) ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
hc : ¬c = 0
μs_lt_top : ↑↑μ s < ⊤
this : 0 < ε / ↑c
F : Set α
Fs : F ⊆ s
F_closed : IsClosed F
μF : ↑↑μ s < ↑↑μ F + ε / ↑c
⊢ (∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ) ≤
    (∫⁻ (x : α), ↑(Set.indicator F (fun x => c) x) ∂μ) + ε

tactic: calc
  (c : ℝ≥0∞) * μ s ≤ c * (μ F + ε / c) := mul_le_mul_left' μF.le _
  _ = c * μ F + ε := by
    simp_rw [mul_add]
    rw [ENNReal.mul_div_cancel' _ ENNReal.coe_ne_top]
    simpa using hc
state_before: case neg.intro.intro.intro.refine'_2
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α →ₛ ℝ≥0
int_f✝ : (∫⁻ (x : α), ↑(↑f x) ∂μ) ≠ ⊤
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
int_f : (∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ) ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
hc : ¬c = 0
μs_lt_top : ↑↑μ s < ⊤
this : 0 < ε / ↑c
F : Set α
Fs : F ⊆ s
F_closed : IsClosed F
μF : ↑↑μ s < ↑↑μ F + ε / ↑c
⊢ ↑c * ↑↑μ s ≤ ↑c * ↑↑μ F + ε

tactic: classical
simpa only [hs, F_closed.measurableSet, SimpleFunc.coe_const, Function.const_apply,
  lintegral_const, ENNReal.coe_indicator, Set.univ_inter, MeasurableSet.univ,
  SimpleFunc.const_zero, lintegral_indicator, SimpleFunc.coe_zero,
  Set.piecewise_eq_indicator, SimpleFunc.coe_piecewise, Measure.restrict_apply]
state_before: α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α →ₛ ℝ≥0
int_f✝ : (∫⁻ (x : α), ↑(↑f x) ∂μ) ≠ ⊤
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
int_f : (∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ) ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
hc : ¬c = 0
μs_lt_top : ↑↑μ s < ⊤
this✝ : 0 < ε / ↑c
F : Set α
Fs : F ⊆ s
F_closed : IsClosed F
μF : ↑↑μ s < ↑↑μ F + ε / ↑c
this : ↑c * ↑↑μ s ≤ ↑c * ↑↑μ F + ε
⊢ (∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ) ≤
    (∫⁻ (x : α), ↑(Set.indicator F (fun x => c) x) ∂μ) + ε

tactic: simpa only [hs, F_closed.measurableSet, SimpleFunc.coe_const, Function.const_apply,
  lintegral_const, ENNReal.coe_indicator, Set.univ_inter, MeasurableSet.univ,
  SimpleFunc.const_zero, lintegral_indicator, SimpleFunc.coe_zero,
  Set.piecewise_eq_indicator, SimpleFunc.coe_piecewise, Measure.restrict_apply]
state_before: α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α →ₛ ℝ≥0
int_f✝ : (∫⁻ (x : α), ↑(↑f x) ∂μ) ≠ ⊤
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
int_f : (∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ) ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
hc : ¬c = 0
μs_lt_top : ↑↑μ s < ⊤
this✝ : 0 < ε / ↑c
F : Set α
Fs : F ⊆ s
F_closed : IsClosed F
μF : ↑↑μ s < ↑↑μ F + ε / ↑c
this : ↑c * ↑↑μ s ≤ ↑c * ↑↑μ F + ε
⊢ (∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ) ≤
    (∫⁻ (x : α), ↑(Set.indicator F (fun x => c) x) ∂μ) + ε

tactic: simp_rw [mul_add]
state_before: α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α →ₛ ℝ≥0
int_f✝ : (∫⁻ (x : α), ↑(↑f x) ∂μ) ≠ ⊤
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
int_f : (∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ) ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
hc : ¬c = 0
μs_lt_top : ↑↑μ s < ⊤
this : 0 < ε / ↑c
F : Set α
Fs : F ⊆ s
F_closed : IsClosed F
μF : ↑↑μ s < ↑↑μ F + ε / ↑c
⊢ ↑c * (↑↑μ F + ε / ↑c) = ↑c * ↑↑μ F + ε

tactic: rw [ENNReal.mul_div_cancel' _ ENNReal.coe_ne_top]
state_before: α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α →ₛ ℝ≥0
int_f✝ : (∫⁻ (x : α), ↑(↑f x) ∂μ) ≠ ⊤
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
int_f : (∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ) ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
hc : ¬c = 0
μs_lt_top : ↑↑μ s < ⊤
this : 0 < ε / ↑c
F : Set α
Fs : F ⊆ s
F_closed : IsClosed F
μF : ↑↑μ s < ↑↑μ F + ε / ↑c
⊢ ↑c * ↑↑μ F + ↑c * (ε / ↑c) = ↑c * ↑↑μ F + ε

tactic: simpa using hc
state_before: α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α →ₛ ℝ≥0
int_f✝ : (∫⁻ (x : α), ↑(↑f x) ∂μ) ≠ ⊤
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
int_f : (∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ) ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
hc : ¬c = 0
μs_lt_top : ↑↑μ s < ⊤
this : 0 < ε / ↑c
F : Set α
Fs : F ⊆ s
F_closed : IsClosed F
μF : ↑↑μ s < ↑↑μ F + ε / ↑c
⊢ ↑c ≠ 0

tactic: have A : ((∫⁻ x : α, f₁ x ∂μ) + ∫⁻ x : α, f₂ x ∂μ) ≠ ⊤ := by
  rwa [← lintegral_add_left f₁.measurable.coe_nnreal_ennreal]
state_before: case h_add
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α →ₛ ℝ≥0
int_f✝ : (∫⁻ (x : α), ↑(↑f x) ∂μ) ≠ ⊤
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
f₁ f₂ : α →ₛ ℝ≥0
a✝ : Disjoint (Function.support ↑f₁) (Function.support ↑f₂)
h₁ :
  (∫⁻ (x : α), ↑(↑f₁ x) ∂μ) ≠ ⊤ →
    ∀ {ε : ℝ≥0∞},
      ε ≠ 0 →
        ∃ g, (∀ (x : α), g x ≤ ↑f₁ x) ∧ UpperSemicontinuous g ∧ (∫⁻ (x : α), ↑(↑f₁ x) ∂μ) ≤ (∫⁻ (x : α), ↑(g x) ∂μ) + ε
h₂ :
  (∫⁻ (x : α), ↑(↑f₂ x) ∂μ) ≠ ⊤ →
    ∀ {ε : ℝ≥0∞},
      ε ≠ 0 →
        ∃ g, (∀ (x : α), g x ≤ ↑f₂ x) ∧ UpperSemicontinuous g ∧ (∫⁻ (x : α), ↑(↑f₂ x) ∂μ) ≤ (∫⁻ (x : α), ↑(g x) ∂μ) + ε
int_f : (∫⁻ (x : α), ↑(↑(f₁ + f₂) x) ∂μ) ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
⊢ ∃ g,
    (∀ (x : α), g x ≤ ↑(f₁ + f₂) x) ∧
      UpperSemicontinuous g ∧ (∫⁻ (x : α), ↑(↑(f₁ + f₂) x) ∂μ) ≤ (∫⁻ (x : α), ↑(g x) ∂μ) + ε

tactic: rcases h₁ (ENNReal.add_ne_top.1 A).1 (ENNReal.half_pos ε0).ne' with
  ⟨g₁, f₁_le_g₁, g₁cont, g₁int⟩
state_before: case h_add
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α →ₛ ℝ≥0
int_f✝ : (∫⁻ (x : α), ↑(↑f x) ∂μ) ≠ ⊤
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
f₁ f₂ : α →ₛ ℝ≥0
a✝ : Disjoint (Function.support ↑f₁) (Function.support ↑f₂)
h₁ :
  (∫⁻ (x : α), ↑(↑f₁ x) ∂μ) ≠ ⊤ →
    ∀ {ε : ℝ≥0∞},
      ε ≠ 0 →
        ∃ g, (∀ (x : α), g x ≤ ↑f₁ x) ∧ UpperSemicontinuous g ∧ (∫⁻ (x : α), ↑(↑f₁ x) ∂μ) ≤ (∫⁻ (x : α), ↑(g x) ∂μ) + ε
h₂ :
  (∫⁻ (x : α), ↑(↑f₂ x) ∂μ) ≠ ⊤ →
    ∀ {ε : ℝ≥0∞},
      ε ≠ 0 →
        ∃ g, (∀ (x : α), g x ≤ ↑f₂ x) ∧ UpperSemicontinuous g ∧ (∫⁻ (x : α), ↑(↑f₂ x) ∂μ) ≤ (∫⁻ (x : α), ↑(g x) ∂μ) + ε
int_f : (∫⁻ (x : α), ↑(↑(f₁ + f₂) x) ∂μ) ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
A : ((∫⁻ (x : α), ↑(↑f₁ x) ∂μ) + ∫⁻ (x : α), ↑(↑f₂ x) ∂μ) ≠ ⊤
⊢ ∃ g,
    (∀ (x : α), g x ≤ ↑(f₁ + f₂) x) ∧
      UpperSemicontinuous g ∧ (∫⁻ (x : α), ↑(↑(f₁ + f₂) x) ∂μ) ≤ (∫⁻ (x : α), ↑(g x) ∂μ) + ε

tactic: rcases h₂ (ENNReal.add_ne_top.1 A).2 (ENNReal.half_pos ε0).ne' with
  ⟨g₂, f₂_le_g₂, g₂cont, g₂int⟩
state_before: case h_add.intro.intro.intro
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α →ₛ ℝ≥0
int_f✝ : (∫⁻ (x : α), ↑(↑f x) ∂μ) ≠ ⊤
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
f₁ f₂ : α →ₛ ℝ≥0
a✝ : Disjoint (Function.support ↑f₁) (Function.support ↑f₂)
h₁ :
  (∫⁻ (x : α), ↑(↑f₁ x) ∂μ) ≠ ⊤ →
    ∀ {ε : ℝ≥0∞},
      ε ≠ 0 →
        ∃ g, (∀ (x : α), g x ≤ ↑f₁ x) ∧ UpperSemicontinuous g ∧ (∫⁻ (x : α), ↑(↑f₁ x) ∂μ) ≤ (∫⁻ (x : α), ↑(g x) ∂μ) + ε
h₂ :
  (∫⁻ (x : α), ↑(↑f₂ x) ∂μ) ≠ ⊤ →
    ∀ {ε : ℝ≥0∞},
      ε ≠ 0 →
        ∃ g, (∀ (x : α), g x ≤ ↑f₂ x) ∧ UpperSemicontinuous g ∧ (∫⁻ (x : α), ↑(↑f₂ x) ∂μ) ≤ (∫⁻ (x : α), ↑(g x) ∂μ) + ε
int_f : (∫⁻ (x : α), ↑(↑(f₁ + f₂) x) ∂μ) ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
A : ((∫⁻ (x : α), ↑(↑f₁ x) ∂μ) + ∫⁻ (x : α), ↑(↑f₂ x) ∂μ) ≠ ⊤
g₁ : α → ℝ≥0
f₁_le_g₁ : ∀ (x : α), g₁ x ≤ ↑f₁ x
g₁cont : UpperSemicontinuous g₁
g₁int : (∫⁻ (x : α), ↑(↑f₁ x) ∂μ) ≤ (∫⁻ (x : α), ↑(g₁ x) ∂μ) + ε / 2
⊢ ∃ g,
    (∀ (x : α), g x ≤ ↑(f₁ + f₂) x) ∧
      UpperSemicontinuous g ∧ (∫⁻ (x : α), ↑(↑(f₁ + f₂) x) ∂μ) ≤ (∫⁻ (x : α), ↑(g x) ∂μ) + ε

tactic: refine'
  ⟨fun x => g₁ x + g₂ x, fun x => add_le_add (f₁_le_g₁ x) (f₂_le_g₂ x), g₁cont.add g₂cont, _⟩
state_before: case h_add.intro.intro.intro.intro.intro.intro
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α →ₛ ℝ≥0
int_f✝ : (∫⁻ (x : α), ↑(↑f x) ∂μ) ≠ ⊤
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
f₁ f₂ : α →ₛ ℝ≥0
a✝ : Disjoint (Function.support ↑f₁) (Function.support ↑f₂)
h₁ :
  (∫⁻ (x : α), ↑(↑f₁ x) ∂μ) ≠ ⊤ →
    ∀ {ε : ℝ≥0∞},
      ε ≠ 0 →
        ∃ g, (∀ (x : α), g x ≤ ↑f₁ x) ∧ UpperSemicontinuous g ∧ (∫⁻ (x : α), ↑(↑f₁ x) ∂μ) ≤ (∫⁻ (x : α), ↑(g x) ∂μ) + ε
h₂ :
  (∫⁻ (x : α), ↑(↑f₂ x) ∂μ) ≠ ⊤ →
    ∀ {ε : ℝ≥0∞},
      ε ≠ 0 →
        ∃ g, (∀ (x : α), g x ≤ ↑f₂ x) ∧ UpperSemicontinuous g ∧ (∫⁻ (x : α), ↑(↑f₂ x) ∂μ) ≤ (∫⁻ (x : α), ↑(g x) ∂μ) + ε
int_f : (∫⁻ (x : α), ↑(↑(f₁ + f₂) x) ∂μ) ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
A : ((∫⁻ (x : α), ↑(↑f₁ x) ∂μ) + ∫⁻ (x : α), ↑(↑f₂ x) ∂μ) ≠ ⊤
g₁ : α → ℝ≥0
f₁_le_g₁ : ∀ (x : α), g₁ x ≤ ↑f₁ x
g₁cont : UpperSemicontinuous g₁
g₁int : (∫⁻ (x : α), ↑(↑f₁ x) ∂μ) ≤ (∫⁻ (x : α), ↑(g₁ x) ∂μ) + ε / 2
g₂ : α → ℝ≥0
f₂_le_g₂ : ∀ (x : α), g₂ x ≤ ↑f₂ x
g₂cont : UpperSemicontinuous g₂
g₂int : (∫⁻ (x : α), ↑(↑f₂ x) ∂μ) ≤ (∫⁻ (x : α), ↑(g₂ x) ∂μ) + ε / 2
⊢ ∃ g,
    (∀ (x : α), g x ≤ ↑(f₁ + f₂) x) ∧
      UpperSemicontinuous g ∧ (∫⁻ (x : α), ↑(↑(f₁ + f₂) x) ∂μ) ≤ (∫⁻ (x : α), ↑(g x) ∂μ) + ε

tactic: simp only [SimpleFunc.coe_add, ENNReal.coe_add, Pi.add_apply]
state_before: case h_add.intro.intro.intro.intro.intro.intro
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α →ₛ ℝ≥0
int_f✝ : (∫⁻ (x : α), ↑(↑f x) ∂μ) ≠ ⊤
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
f₁ f₂ : α →ₛ ℝ≥0
a✝ : Disjoint (Function.support ↑f₁) (Function.support ↑f₂)
h₁ :
  (∫⁻ (x : α), ↑(↑f₁ x) ∂μ) ≠ ⊤ →
    ∀ {ε : ℝ≥0∞},
      ε ≠ 0 →
        ∃ g, (∀ (x : α), g x ≤ ↑f₁ x) ∧ UpperSemicontinuous g ∧ (∫⁻ (x : α), ↑(↑f₁ x) ∂μ) ≤ (∫⁻ (x : α), ↑(g x) ∂μ) + ε
h₂ :
  (∫⁻ (x : α), ↑(↑f₂ x) ∂μ) ≠ ⊤ →
    ∀ {ε : ℝ≥0∞},
      ε ≠ 0 →
        ∃ g, (∀ (x : α), g x ≤ ↑f₂ x) ∧ UpperSemicontinuous g ∧ (∫⁻ (x : α), ↑(↑f₂ x) ∂μ) ≤ (∫⁻ (x : α), ↑(g x) ∂μ) + ε
int_f : (∫⁻ (x : α), ↑(↑(f₁ + f₂) x) ∂μ) ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
A : ((∫⁻ (x : α), ↑(↑f₁ x) ∂μ) + ∫⁻ (x : α), ↑(↑f₂ x) ∂μ) ≠ ⊤
g₁ : α → ℝ≥0
f₁_le_g₁ : ∀ (x : α), g₁ x ≤ ↑f₁ x
g₁cont : UpperSemicontinuous g₁
g₁int : (∫⁻ (x : α), ↑(↑f₁ x) ∂μ) ≤ (∫⁻ (x : α), ↑(g₁ x) ∂μ) + ε / 2
g₂ : α → ℝ≥0
f₂_le_g₂ : ∀ (x : α), g₂ x ≤ ↑f₂ x
g₂cont : UpperSemicontinuous g₂
g₂int : (∫⁻ (x : α), ↑(↑f₂ x) ∂μ) ≤ (∫⁻ (x : α), ↑(g₂ x) ∂μ) + ε / 2
⊢ (∫⁻ (x : α), ↑(↑(f₁ + f₂) x) ∂μ) ≤ (∫⁻ (x : α), ↑((fun x => g₁ x + g₂ x) x) ∂μ) + ε

tactic: rw [lintegral_add_left f₁.measurable.coe_nnreal_ennreal,
  lintegral_add_left g₁cont.measurable.coe_nnreal_ennreal]
state_before: case h_add.intro.intro.intro.intro.intro.intro
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α →ₛ ℝ≥0
int_f✝ : (∫⁻ (x : α), ↑(↑f x) ∂μ) ≠ ⊤
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
f₁ f₂ : α →ₛ ℝ≥0
a✝ : Disjoint (Function.support ↑f₁) (Function.support ↑f₂)
h₁ :
  (∫⁻ (x : α), ↑(↑f₁ x) ∂μ) ≠ ⊤ →
    ∀ {ε : ℝ≥0∞},
      ε ≠ 0 →
        ∃ g, (∀ (x : α), g x ≤ ↑f₁ x) ∧ UpperSemicontinuous g ∧ (∫⁻ (x : α), ↑(↑f₁ x) ∂μ) ≤ (∫⁻ (x : α), ↑(g x) ∂μ) + ε
h₂ :
  (∫⁻ (x : α), ↑(↑f₂ x) ∂μ) ≠ ⊤ →
    ∀ {ε : ℝ≥0∞},
      ε ≠ 0 →
        ∃ g, (∀ (x : α), g x ≤ ↑f₂ x) ∧ UpperSemicontinuous g ∧ (∫⁻ (x : α), ↑(↑f₂ x) ∂μ) ≤ (∫⁻ (x : α), ↑(g x) ∂μ) + ε
int_f : (∫⁻ (x : α), ↑(↑(f₁ + f₂) x) ∂μ) ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
A : ((∫⁻ (x : α), ↑(↑f₁ x) ∂μ) + ∫⁻ (x : α), ↑(↑f₂ x) ∂μ) ≠ ⊤
g₁ : α → ℝ≥0
f₁_le_g₁ : ∀ (x : α), g₁ x ≤ ↑f₁ x
g₁cont : UpperSemicontinuous g₁
g₁int : (∫⁻ (x : α), ↑(↑f₁ x) ∂μ) ≤ (∫⁻ (x : α), ↑(g₁ x) ∂μ) + ε / 2
g₂ : α → ℝ≥0
f₂_le_g₂ : ∀ (x : α), g₂ x ≤ ↑f₂ x
g₂cont : UpperSemicontinuous g₂
g₂int : (∫⁻ (x : α), ↑(↑f₂ x) ∂μ) ≤ (∫⁻ (x : α), ↑(g₂ x) ∂μ) + ε / 2
⊢ (∫⁻ (x : α), ↑(↑f₁ x) + ↑(↑f₂ x) ∂μ) ≤ (∫⁻ (x : α), ↑(g₁ x) + ↑(g₂ x) ∂μ) + ε

tactic: convert add_le_add g₁int g₂int using 1
state_before: case h_add.intro.intro.intro.intro.intro.intro
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α →ₛ ℝ≥0
int_f✝ : (∫⁻ (x : α), ↑(↑f x) ∂μ) ≠ ⊤
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
f₁ f₂ : α →ₛ ℝ≥0
a✝ : Disjoint (Function.support ↑f₁) (Function.support ↑f₂)
h₁ :
  (∫⁻ (x : α), ↑(↑f₁ x) ∂μ) ≠ ⊤ →
    ∀ {ε : ℝ≥0∞},
      ε ≠ 0 →
        ∃ g, (∀ (x : α), g x ≤ ↑f₁ x) ∧ UpperSemicontinuous g ∧ (∫⁻ (x : α), ↑(↑f₁ x) ∂μ) ≤ (∫⁻ (x : α), ↑(g x) ∂μ) + ε
h₂ :
  (∫⁻ (x : α), ↑(↑f₂ x) ∂μ) ≠ ⊤ →
    ∀ {ε : ℝ≥0∞},
      ε ≠ 0 →
        ∃ g, (∀ (x : α), g x ≤ ↑f₂ x) ∧ UpperSemicontinuous g ∧ (∫⁻ (x : α), ↑(↑f₂ x) ∂μ) ≤ (∫⁻ (x : α), ↑(g x) ∂μ) + ε
int_f : (∫⁻ (x : α), ↑(↑(f₁ + f₂) x) ∂μ) ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
A : ((∫⁻ (x : α), ↑(↑f₁ x) ∂μ) + ∫⁻ (x : α), ↑(↑f₂ x) ∂μ) ≠ ⊤
g₁ : α → ℝ≥0
f₁_le_g₁ : ∀ (x : α), g₁ x ≤ ↑f₁ x
g₁cont : UpperSemicontinuous g₁
g₁int : (∫⁻ (x : α), ↑(↑f₁ x) ∂μ) ≤ (∫⁻ (x : α), ↑(g₁ x) ∂μ) + ε / 2
g₂ : α → ℝ≥0
f₂_le_g₂ : ∀ (x : α), g₂ x ≤ ↑f₂ x
g₂cont : UpperSemicontinuous g₂
g₂int : (∫⁻ (x : α), ↑(↑f₂ x) ∂μ) ≤ (∫⁻ (x : α), ↑(g₂ x) ∂μ) + ε / 2
⊢ ((∫⁻ (a : α), ↑(↑f₁ a) ∂μ) + ∫⁻ (a : α), ↑(↑f₂ a) ∂μ) ≤ ((∫⁻ (a : α), ↑(g₁ a) ∂μ) + ∫⁻ (a : α), ↑(g₂ a) ∂μ) + ε

tactic: simp only
state_before: case h.e'_4
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α →ₛ ℝ≥0
int_f✝ : (∫⁻ (x : α), ↑(↑f x) ∂μ) ≠ ⊤
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
f₁ f₂ : α →ₛ ℝ≥0
a✝ : Disjoint (Function.support ↑f₁) (Function.support ↑f₂)
h₁ :
  (∫⁻ (x : α), ↑(↑f₁ x) ∂μ) ≠ ⊤ →
    ∀ {ε : ℝ≥0∞},
      ε ≠ 0 →
        ∃ g, (∀ (x : α), g x ≤ ↑f₁ x) ∧ UpperSemicontinuous g ∧ (∫⁻ (x : α), ↑(↑f₁ x) ∂μ) ≤ (∫⁻ (x : α), ↑(g x) ∂μ) + ε
h₂ :
  (∫⁻ (x : α), ↑(↑f₂ x) ∂μ) ≠ ⊤ →
    ∀ {ε : ℝ≥0∞},
      ε ≠ 0 →
        ∃ g, (∀ (x : α), g x ≤ ↑f₂ x) ∧ UpperSemicontinuous g ∧ (∫⁻ (x : α), ↑(↑f₂ x) ∂μ) ≤ (∫⁻ (x : α), ↑(g x) ∂μ) + ε
int_f : (∫⁻ (x : α), ↑(↑(f₁ + f₂) x) ∂μ) ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
A : ((∫⁻ (x : α), ↑(↑f₁ x) ∂μ) + ∫⁻ (x : α), ↑(↑f₂ x) ∂μ) ≠ ⊤
g₁ : α → ℝ≥0
f₁_le_g₁ : ∀ (x : α), g₁ x ≤ ↑f₁ x
g₁cont : UpperSemicontinuous g₁
g₁int : (∫⁻ (x : α), ↑(↑f₁ x) ∂μ) ≤ (∫⁻ (x : α), ↑(g₁ x) ∂μ) + ε / 2
g₂ : α → ℝ≥0
f₂_le_g₂ : ∀ (x : α), g₂ x ≤ ↑f₂ x
g₂cont : UpperSemicontinuous g₂
g₂int : (∫⁻ (x : α), ↑(↑f₂ x) ∂μ) ≤ (∫⁻ (x : α), ↑(g₂ x) ∂μ) + ε / 2
⊢ ((∫⁻ (a : α), ↑(g₁ a) ∂μ) + ∫⁻ (a : α), ↑(g₂ a) ∂μ) + ε =
    (∫⁻ (x : α), ↑(g₁ x) ∂μ) + ε / 2 + ((∫⁻ (x : α), ↑(g₂ x) ∂μ) + ε / 2)

tactic: conv_lhs => rw [← ENNReal.add_halves ε]
state_before: case h.e'_4
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α →ₛ ℝ≥0
int_f✝ : (∫⁻ (x : α), ↑(↑f x) ∂μ) ≠ ⊤
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
f₁ f₂ : α →ₛ ℝ≥0
a✝ : Disjoint (Function.support ↑f₁) (Function.support ↑f₂)
h₁ :
  (∫⁻ (x : α), ↑(↑f₁ x) ∂μ) ≠ ⊤ →
    ∀ {ε : ℝ≥0∞},
      ε ≠ 0 →
        ∃ g, (∀ (x : α), g x ≤ ↑f₁ x) ∧ UpperSemicontinuous g ∧ (∫⁻ (x : α), ↑(↑f₁ x) ∂μ) ≤ (∫⁻ (x : α), ↑(g x) ∂μ) + ε
h₂ :
  (∫⁻ (x : α), ↑(↑f₂ x) ∂μ) ≠ ⊤ →
    ∀ {ε : ℝ≥0∞},
      ε ≠ 0 →
        ∃ g, (∀ (x : α), g x ≤ ↑f₂ x) ∧ UpperSemicontinuous g ∧ (∫⁻ (x : α), ↑(↑f₂ x) ∂μ) ≤ (∫⁻ (x : α), ↑(g x) ∂μ) + ε
int_f : (∫⁻ (x : α), ↑(↑(f₁ + f₂) x) ∂μ) ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
A : ((∫⁻ (x : α), ↑(↑f₁ x) ∂μ) + ∫⁻ (x : α), ↑(↑f₂ x) ∂μ) ≠ ⊤
g₁ : α → ℝ≥0
f₁_le_g₁ : ∀ (x : α), g₁ x ≤ ↑f₁ x
g₁cont : UpperSemicontinuous g₁
g₁int : (∫⁻ (x : α), ↑(↑f₁ x) ∂μ) ≤ (∫⁻ (x : α), ↑(g₁ x) ∂μ) + ε / 2
g₂ : α → ℝ≥0
f₂_le_g₂ : ∀ (x : α), g₂ x ≤ ↑f₂ x
g₂cont : UpperSemicontinuous g₂
g₂int : (∫⁻ (x : α), ↑(↑f₂ x) ∂μ) ≤ (∫⁻ (x : α), ↑(g₂ x) ∂μ) + ε / 2
⊢ ((∫⁻ (a : α), ↑(g₁ a) ∂μ) + ∫⁻ (a : α), ↑(g₂ a) ∂μ) + ε =
    (∫⁻ (x : α), ↑(g₁ x) ∂μ) + ε / 2 + ((∫⁻ (x : α), ↑(g₂ x) ∂μ) + ε / 2)

tactic: abel
state_before: case h.e'_4
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α →ₛ ℝ≥0
int_f✝ : (∫⁻ (x : α), ↑(↑f x) ∂μ) ≠ ⊤
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
f₁ f₂ : α →ₛ ℝ≥0
a✝ : Disjoint (Function.support ↑f₁) (Function.support ↑f₂)
h₁ :
  (∫⁻ (x : α), ↑(↑f₁ x) ∂μ) ≠ ⊤ →
    ∀ {ε : ℝ≥0∞},
      ε ≠ 0 →
        ∃ g, (∀ (x : α), g x ≤ ↑f₁ x) ∧ UpperSemicontinuous g ∧ (∫⁻ (x : α), ↑(↑f₁ x) ∂μ) ≤ (∫⁻ (x : α), ↑(g x) ∂μ) + ε
h₂ :
  (∫⁻ (x : α), ↑(↑f₂ x) ∂μ) ≠ ⊤ →
    ∀ {ε : ℝ≥0∞},
      ε ≠ 0 →
        ∃ g, (∀ (x : α), g x ≤ ↑f₂ x) ∧ UpperSemicontinuous g ∧ (∫⁻ (x : α), ↑(↑f₂ x) ∂μ) ≤ (∫⁻ (x : α), ↑(g x) ∂μ) + ε
int_f : (∫⁻ (x : α), ↑(↑(f₁ + f₂) x) ∂μ) ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
A : ((∫⁻ (x : α), ↑(↑f₁ x) ∂μ) + ∫⁻ (x : α), ↑(↑f₂ x) ∂μ) ≠ ⊤
g₁ : α → ℝ≥0
f₁_le_g₁ : ∀ (x : α), g₁ x ≤ ↑f₁ x
g₁cont : UpperSemicontinuous g₁
g₁int : (∫⁻ (x : α), ↑(↑f₁ x) ∂μ) ≤ (∫⁻ (x : α), ↑(g₁ x) ∂μ) + ε / 2
g₂ : α → ℝ≥0
f₂_le_g₂ : ∀ (x : α), g₂ x ≤ ↑f₂ x
g₂cont : UpperSemicontinuous g₂
g₂int : (∫⁻ (x : α), ↑(↑f₂ x) ∂μ) ≤ (∫⁻ (x : α), ↑(g₂ x) ∂μ) + ε / 2
⊢ ((∫⁻ (a : α), ↑(g₁ a) ∂μ) + ∫⁻ (a : α), ↑(g₂ a) ∂μ) + (ε / 2 + ε / 2) =
    (∫⁻ (x : α), ↑(g₁ x) ∂μ) + ε / 2 + ((∫⁻ (x : α), ↑(g₂ x) ∂μ) + ε / 2)

tactic: rwa [← lintegral_add_left f₁.measurable.coe_nnreal_ennreal]
state_before: α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α →ₛ ℝ≥0
int_f✝ : (∫⁻ (x : α), ↑(↑f x) ∂μ) ≠ ⊤
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
f₁ f₂ : α →ₛ ℝ≥0
a✝ : Disjoint (Function.support ↑f₁) (Function.support ↑f₂)
h₁ :
  (∫⁻ (x : α), ↑(↑f₁ x) ∂μ) ≠ ⊤ →
    ∀ {ε : ℝ≥0∞},
      ε ≠ 0 →
        ∃ g, (∀ (x : α), g x ≤ ↑f₁ x) ∧ UpperSemicontinuous g ∧ (∫⁻ (x : α), ↑(↑f₁ x) ∂μ) ≤ (∫⁻ (x : α), ↑(g x) ∂μ) + ε
h₂ :
  (∫⁻ (x : α), ↑(↑f₂ x) ∂μ) ≠ ⊤ →
    ∀ {ε : ℝ≥0∞},
      ε ≠ 0 →
        ∃ g, (∀ (x : α), g x ≤ ↑f₂ x) ∧ UpperSemicontinuous g ∧ (∫⁻ (x : α), ↑(↑f₂ x) ∂μ) ≤ (∫⁻ (x : α), ↑(g x) ∂μ) + ε
int_f : (∫⁻ (x : α), ↑(↑(f₁ + f₂) x) ∂μ) ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
⊢ ((∫⁻ (x : α), ↑(↑f₁ x) ∂μ) + ∫⁻ (x : α), ↑(↑f₂ x) ∂μ) ≠ ⊤