[GOAL]
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α →ₛ ℝ≥0
ε : ℝ≥0∞
ε0 : ε ≠ 0
⊢ ∃ g, (∀ (x : α), ↑f x ≤ g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), ↑(g x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f x) ∂μ + ε
[PROOFSTEP]
induction' f using MeasureTheory.SimpleFunc.induction with c s hs f₁ f₂ _ h₁ h₂ generalizing ε
[GOAL]
case h_ind
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
ε : ℝ≥0∞
ε0 : ε ≠ 0
⊢ ∃ g,
    (∀ (x : α), ↑(piecewise s hs (const α c) (const α 0)) x ≤ g x) ∧
      LowerSemicontinuous g ∧ ∫⁻ (x : α), ↑(g x) ∂μ ≤ ∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ + ε
[PROOFSTEP]
let f := SimpleFunc.piecewise s hs (SimpleFunc.const α c) (SimpleFunc.const α 0)
[GOAL]
case h_ind
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
ε : ℝ≥0∞
ε0 : ε ≠ 0
f : α →ₛ ℝ≥0 := piecewise s hs (const α c) (const α 0)
⊢ ∃ g,
    (∀ (x : α), ↑(piecewise s hs (const α c) (const α 0)) x ≤ g x) ∧
      LowerSemicontinuous g ∧ ∫⁻ (x : α), ↑(g x) ∂μ ≤ ∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ + ε
[PROOFSTEP]
by_cases h : ∫⁻ x, f x ∂μ = ⊤
[GOAL]
case pos
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
ε : ℝ≥0∞
ε0 : ε ≠ 0
f : α →ₛ ℝ≥0 := piecewise s hs (const α c) (const α 0)
h : ∫⁻ (x : α), ↑(↑f x) ∂μ = ⊤
⊢ ∃ g,
    (∀ (x : α), ↑(piecewise s hs (const α c) (const α 0)) x ≤ g x) ∧
      LowerSemicontinuous g ∧ ∫⁻ (x : α), ↑(g x) ∂μ ≤ ∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ + ε
[PROOFSTEP]
refine' ⟨fun _ => c, fun x => _, lowerSemicontinuous_const, by simp only [_root_.top_add, le_top, h]⟩
[GOAL]
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
ε : ℝ≥0∞
ε0 : ε ≠ 0
f : α →ₛ ℝ≥0 := piecewise s hs (const α c) (const α 0)
h : ∫⁻ (x : α), ↑(↑f x) ∂μ = ⊤
⊢ ∫⁻ (x : α), ↑((fun x => c) x) ∂μ ≤ ∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ + ε
[PROOFSTEP]
simp only [_root_.top_add, le_top, h]
[GOAL]
case pos
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
ε : ℝ≥0∞
ε0 : ε ≠ 0
f : α →ₛ ℝ≥0 := piecewise s hs (const α c) (const α 0)
h : ∫⁻ (x : α), ↑(↑f x) ∂μ = ⊤
x : α
⊢ ↑(piecewise s hs (const α c) (const α 0)) x ≤ (fun x => c) x
[PROOFSTEP]
simp only [SimpleFunc.coe_const, SimpleFunc.const_zero, SimpleFunc.coe_zero, Set.piecewise_eq_indicator,
  SimpleFunc.coe_piecewise]
[GOAL]
case pos
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
ε : ℝ≥0∞
ε0 : ε ≠ 0
f : α →ₛ ℝ≥0 := piecewise s hs (const α c) (const α 0)
h : ∫⁻ (x : α), ↑(↑f x) ∂μ = ⊤
x : α
⊢ Set.piecewise s (Function.const α c) 0 x ≤ c
[PROOFSTEP]
exact Set.indicator_le_self _ _ _
[GOAL]
case neg
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
ε : ℝ≥0∞
ε0 : ε ≠ 0
f : α →ₛ ℝ≥0 := piecewise s hs (const α c) (const α 0)
h : ¬∫⁻ (x : α), ↑(↑f x) ∂μ = ⊤
⊢ ∃ g,
    (∀ (x : α), ↑(piecewise s hs (const α c) (const α 0)) x ≤ g x) ∧
      LowerSemicontinuous g ∧ ∫⁻ (x : α), ↑(g x) ∂μ ≤ ∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ + ε
[PROOFSTEP]
by_cases hc : c = 0
[GOAL]
case pos
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
ε : ℝ≥0∞
ε0 : ε ≠ 0
f : α →ₛ ℝ≥0 := piecewise s hs (const α c) (const α 0)
h : ¬∫⁻ (x : α), ↑(↑f x) ∂μ = ⊤
hc : c = 0
⊢ ∃ g,
    (∀ (x : α), ↑(piecewise s hs (const α c) (const α 0)) x ≤ g x) ∧
      LowerSemicontinuous g ∧ ∫⁻ (x : α), ↑(g x) ∂μ ≤ ∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ + ε
[PROOFSTEP]
refine' ⟨fun _ => 0, _, lowerSemicontinuous_const, _⟩
[GOAL]
case pos.refine'_1
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
ε : ℝ≥0∞
ε0 : ε ≠ 0
f : α →ₛ ℝ≥0 := piecewise s hs (const α c) (const α 0)
h : ¬∫⁻ (x : α), ↑(↑f x) ∂μ = ⊤
hc : c = 0
⊢ ∀ (x : α), ↑(piecewise s hs (const α c) (const α 0)) x ≤ (fun x => 0) x
[PROOFSTEP]
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]
[GOAL]
case pos.refine'_1
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
ε : ℝ≥0∞
ε0 : ε ≠ 0
f : α →ₛ ℝ≥0 := piecewise s hs (const α c) (const α 0)
h : ¬∫⁻ (x : α), ↑(↑f x) ∂μ = ⊤
hc : c = 0
⊢ ∀ (x : α), ↑(piecewise s hs (const α c) (const α 0)) x ≤ (fun x => 0) x
[PROOFSTEP]
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]
[GOAL]
case pos.refine'_2
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
ε : ℝ≥0∞
ε0 : ε ≠ 0
f : α →ₛ ℝ≥0 := piecewise s hs (const α c) (const α 0)
h : ¬∫⁻ (x : α), ↑(↑f x) ∂μ = ⊤
hc : c = 0
⊢ ∫⁻ (x : α), ↑((fun x => 0) x) ∂μ ≤ ∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ + ε
[PROOFSTEP]
simp only [lintegral_const, zero_mul, zero_le, ENNReal.coe_zero]
[GOAL]
case neg
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
ε : ℝ≥0∞
ε0 : ε ≠ 0
f : α →ₛ ℝ≥0 := piecewise s hs (const α c) (const α 0)
h : ¬∫⁻ (x : α), ↑(↑f x) ∂μ = ⊤
hc : ¬c = 0
⊢ ∃ g,
    (∀ (x : α), ↑(piecewise s hs (const α c) (const α 0)) x ≤ g x) ∧
      LowerSemicontinuous g ∧ ∫⁻ (x : α), ↑(g x) ∂μ ≤ ∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ + ε
[PROOFSTEP]
have : μ s < μ s + ε / c :=
  by
  have : (0 : ℝ≥0∞) < ε / c := ENNReal.div_pos_iff.2 ⟨ε0, ENNReal.coe_ne_top⟩
  simpa using ENNReal.add_lt_add_left ?aux this
[GOAL]
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
ε : ℝ≥0∞
ε0 : ε ≠ 0
f : α →ₛ ℝ≥0 := piecewise s hs (const α c) (const α 0)
h : ¬∫⁻ (x : α), ↑(↑f x) ∂μ = ⊤
hc : ¬c = 0
⊢ ↑↑μ s < ↑↑μ s + ε / ↑c
[PROOFSTEP]
have : (0 : ℝ≥0∞) < ε / c := ENNReal.div_pos_iff.2 ⟨ε0, ENNReal.coe_ne_top⟩
[GOAL]
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
ε : ℝ≥0∞
ε0 : ε ≠ 0
f : α →ₛ ℝ≥0 := piecewise s hs (const α c) (const α 0)
h : ¬∫⁻ (x : α), ↑(↑f x) ∂μ = ⊤
hc : ¬c = 0
this : 0 < ε / ↑c
⊢ ↑↑μ s < ↑↑μ s + ε / ↑c
[PROOFSTEP]
simpa using ENNReal.add_lt_add_left ?aux this
[GOAL]
case aux
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
ε : ℝ≥0∞
ε0 : ε ≠ 0
f : α →ₛ ℝ≥0 := piecewise s hs (const α c) (const α 0)
h : ¬∫⁻ (x : α), ↑(↑f x) ∂μ = ⊤
hc : ¬c = 0
this : 0 < ε / ↑c
⊢ ↑↑μ s ≠ ⊤
case neg
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
ε : ℝ≥0∞
ε0 : ε ≠ 0
f : α →ₛ ℝ≥0 := piecewise s hs (const α c) (const α 0)
h : ¬∫⁻ (x : α), ↑(↑f x) ∂μ = ⊤
hc : ¬c = 0
this : ↑↑μ s < ↑↑μ s + ε / ↑c
⊢ ∃ g,
    (∀ (x : α), ↑(piecewise s hs (const α c) (const α 0)) x ≤ g x) ∧
      LowerSemicontinuous g ∧ ∫⁻ (x : α), ↑(g x) ∂μ ≤ ∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ + ε
[PROOFSTEP]
case aux =>
  classical simpa [hs, hc, lt_top_iff_ne_top, true_and_iff, SimpleFunc.coe_const, Function.const_apply, lintegral_const,
    ENNReal.coe_indicator, Set.univ_inter, ENNReal.coe_ne_top, MeasurableSet.univ, ENNReal.mul_eq_top,
    SimpleFunc.const_zero, or_false_iff, lintegral_indicator, ENNReal.coe_eq_zero, Ne.def, not_false_iff,
    SimpleFunc.coe_zero, Set.piecewise_eq_indicator, SimpleFunc.coe_piecewise, false_and_iff, restrict_apply] using h
[GOAL]
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
ε : ℝ≥0∞
ε0 : ε ≠ 0
f : α →ₛ ℝ≥0 := piecewise s hs (const α c) (const α 0)
h : ¬∫⁻ (x : α), ↑(↑f x) ∂μ = ⊤
hc : ¬c = 0
this : 0 < ε / ↑c
⊢ ↑↑μ s ≠ ⊤
[PROOFSTEP]
case aux =>
  classical simpa [hs, hc, lt_top_iff_ne_top, true_and_iff, SimpleFunc.coe_const, Function.const_apply, lintegral_const,
    ENNReal.coe_indicator, Set.univ_inter, ENNReal.coe_ne_top, MeasurableSet.univ, ENNReal.mul_eq_top,
    SimpleFunc.const_zero, or_false_iff, lintegral_indicator, ENNReal.coe_eq_zero, Ne.def, not_false_iff,
    SimpleFunc.coe_zero, Set.piecewise_eq_indicator, SimpleFunc.coe_piecewise, false_and_iff, restrict_apply] using h
[GOAL]
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
ε : ℝ≥0∞
ε0 : ε ≠ 0
f : α →ₛ ℝ≥0 := piecewise s hs (const α c) (const α 0)
h : ¬∫⁻ (x : α), ↑(↑f x) ∂μ = ⊤
hc : ¬c = 0
this : 0 < ε / ↑c
⊢ ↑↑μ s ≠ ⊤
[PROOFSTEP]
classical simpa [hs, hc, lt_top_iff_ne_top, true_and_iff, SimpleFunc.coe_const, Function.const_apply, lintegral_const,
  ENNReal.coe_indicator, Set.univ_inter, ENNReal.coe_ne_top, MeasurableSet.univ, ENNReal.mul_eq_top,
  SimpleFunc.const_zero, or_false_iff, lintegral_indicator, ENNReal.coe_eq_zero, Ne.def, not_false_iff,
  SimpleFunc.coe_zero, Set.piecewise_eq_indicator, SimpleFunc.coe_piecewise, false_and_iff, restrict_apply] using h
[GOAL]
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
ε : ℝ≥0∞
ε0 : ε ≠ 0
f : α →ₛ ℝ≥0 := piecewise s hs (const α c) (const α 0)
h : ¬∫⁻ (x : α), ↑(↑f x) ∂μ = ⊤
hc : ¬c = 0
this : 0 < ε / ↑c
⊢ ↑↑μ s ≠ ⊤
[PROOFSTEP]
simpa [hs, hc, lt_top_iff_ne_top, true_and_iff, SimpleFunc.coe_const, Function.const_apply, lintegral_const,
  ENNReal.coe_indicator, Set.univ_inter, ENNReal.coe_ne_top, MeasurableSet.univ, ENNReal.mul_eq_top,
  SimpleFunc.const_zero, or_false_iff, lintegral_indicator, ENNReal.coe_eq_zero, Ne.def, not_false_iff,
  SimpleFunc.coe_zero, Set.piecewise_eq_indicator, SimpleFunc.coe_piecewise, false_and_iff, restrict_apply] using h
[GOAL]
case neg
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
ε : ℝ≥0∞
ε0 : ε ≠ 0
f : α →ₛ ℝ≥0 := piecewise s hs (const α c) (const α 0)
h : ¬∫⁻ (x : α), ↑(↑f x) ∂μ = ⊤
hc : ¬c = 0
this : ↑↑μ s < ↑↑μ s + ε / ↑c
⊢ ∃ g,
    (∀ (x : α), ↑(piecewise s hs (const α c) (const α 0)) x ≤ g x) ∧
      LowerSemicontinuous g ∧ ∫⁻ (x : α), ↑(g x) ∂μ ≤ ∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ + ε
[PROOFSTEP]
obtain ⟨u, su, u_open, μu⟩ : ∃ (u : _), u ⊇ s ∧ IsOpen u ∧ μ u < μ s + ε / c := s.exists_isOpen_lt_of_lt _ this
[GOAL]
case neg.intro.intro.intro
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
ε : ℝ≥0∞
ε0 : ε ≠ 0
f : α →ₛ ℝ≥0 := piecewise s hs (const α c) (const α 0)
h : ¬∫⁻ (x : α), ↑(↑f x) ∂μ = ⊤
hc : ¬c = 0
this : ↑↑μ s < ↑↑μ s + ε / ↑c
u : Set α
su : u ⊇ s
u_open : IsOpen u
μu : ↑↑μ u < ↑↑μ s + ε / ↑c
⊢ ∃ g,
    (∀ (x : α), ↑(piecewise s hs (const α c) (const α 0)) x ≤ g x) ∧
      LowerSemicontinuous g ∧ ∫⁻ (x : α), ↑(g x) ∂μ ≤ ∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ + ε
[PROOFSTEP]
refine' ⟨Set.indicator u fun _ => c, fun x => _, u_open.lowerSemicontinuous_indicator (zero_le _), _⟩
[GOAL]
case neg.intro.intro.intro.refine'_1
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
ε : ℝ≥0∞
ε0 : ε ≠ 0
f : α →ₛ ℝ≥0 := piecewise s hs (const α c) (const α 0)
h : ¬∫⁻ (x : α), ↑(↑f x) ∂μ = ⊤
hc : ¬c = 0
this : ↑↑μ s < ↑↑μ s + ε / ↑c
u : Set α
su : u ⊇ s
u_open : IsOpen u
μu : ↑↑μ u < ↑↑μ s + ε / ↑c
x : α
⊢ ↑(piecewise s hs (const α c) (const α 0)) x ≤ Set.indicator u (fun x => c) x
[PROOFSTEP]
simp only [SimpleFunc.coe_const, SimpleFunc.const_zero, SimpleFunc.coe_zero, Set.piecewise_eq_indicator,
  SimpleFunc.coe_piecewise]
[GOAL]
case neg.intro.intro.intro.refine'_1
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
ε : ℝ≥0∞
ε0 : ε ≠ 0
f : α →ₛ ℝ≥0 := piecewise s hs (const α c) (const α 0)
h : ¬∫⁻ (x : α), ↑(↑f x) ∂μ = ⊤
hc : ¬c = 0
this : ↑↑μ s < ↑↑μ s + ε / ↑c
u : Set α
su : u ⊇ s
u_open : IsOpen u
μu : ↑↑μ u < ↑↑μ s + ε / ↑c
x : α
⊢ Set.piecewise s (Function.const α c) 0 x ≤ Set.indicator u (fun x => c) x
[PROOFSTEP]
exact Set.indicator_le_indicator_of_subset su (fun x => zero_le _) _
[GOAL]
case neg.intro.intro.intro.refine'_2
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
ε : ℝ≥0∞
ε0 : ε ≠ 0
f : α →ₛ ℝ≥0 := piecewise s hs (const α c) (const α 0)
h : ¬∫⁻ (x : α), ↑(↑f x) ∂μ = ⊤
hc : ¬c = 0
this : ↑↑μ s < ↑↑μ s + ε / ↑c
u : Set α
su : u ⊇ s
u_open : IsOpen u
μu : ↑↑μ u < ↑↑μ s + ε / ↑c
⊢ ∫⁻ (x : α), ↑(Set.indicator u (fun x => c) x) ∂μ ≤ ∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ + ε
[PROOFSTEP]
suffices (c : ℝ≥0∞) * μ u ≤ c * μ s + ε by
  classical simpa only [ENNReal.coe_indicator, u_open.measurableSet, lintegral_indicator, lintegral_const,
    MeasurableSet.univ, Measure.restrict_apply, Set.univ_inter, const_zero, coe_piecewise, coe_const, coe_zero,
    Set.piecewise_eq_indicator, Function.const_apply, hs]
[GOAL]
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
ε : ℝ≥0∞
ε0 : ε ≠ 0
f : α →ₛ ℝ≥0 := piecewise s hs (const α c) (const α 0)
h : ¬∫⁻ (x : α), ↑(↑f x) ∂μ = ⊤
hc : ¬c = 0
this✝ : ↑↑μ s < ↑↑μ s + ε / ↑c
u : Set α
su : u ⊇ s
u_open : IsOpen u
μu : ↑↑μ u < ↑↑μ s + ε / ↑c
this : ↑c * ↑↑μ u ≤ ↑c * ↑↑μ s + ε
⊢ ∫⁻ (x : α), ↑(Set.indicator u (fun x => c) x) ∂μ ≤ ∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ + ε
[PROOFSTEP]
classical simpa only [ENNReal.coe_indicator, u_open.measurableSet, lintegral_indicator, lintegral_const,
  MeasurableSet.univ, Measure.restrict_apply, Set.univ_inter, const_zero, coe_piecewise, coe_const, coe_zero,
  Set.piecewise_eq_indicator, Function.const_apply, hs]
[GOAL]
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
ε : ℝ≥0∞
ε0 : ε ≠ 0
f : α →ₛ ℝ≥0 := piecewise s hs (const α c) (const α 0)
h : ¬∫⁻ (x : α), ↑(↑f x) ∂μ = ⊤
hc : ¬c = 0
this✝ : ↑↑μ s < ↑↑μ s + ε / ↑c
u : Set α
su : u ⊇ s
u_open : IsOpen u
μu : ↑↑μ u < ↑↑μ s + ε / ↑c
this : ↑c * ↑↑μ u ≤ ↑c * ↑↑μ s + ε
⊢ ∫⁻ (x : α), ↑(Set.indicator u (fun x => c) x) ∂μ ≤ ∫⁻ (x : α), ↑(↑(piecewise s hs (const α c) (const α 0)) x) ∂μ + ε
[PROOFSTEP]
simpa only [ENNReal.coe_indicator, u_open.measurableSet, lintegral_indicator, lintegral_const, MeasurableSet.univ,
  Measure.restrict_apply, Set.univ_inter, const_zero, coe_piecewise, coe_const, coe_zero, Set.piecewise_eq_indicator,
  Function.const_apply, hs]
[GOAL]
case neg.intro.intro.intro.refine'_2
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
ε : ℝ≥0∞
ε0 : ε ≠ 0
f : α →ₛ ℝ≥0 := piecewise s hs (const α c) (const α 0)
h : ¬∫⁻ (x : α), ↑(↑f x) ∂μ = ⊤
hc : ¬c = 0
this : ↑↑μ s < ↑↑μ s + ε / ↑c
u : Set α
su : u ⊇ s
u_open : IsOpen u
μu : ↑↑μ u < ↑↑μ s + ε / ↑c
⊢ ↑c * ↑↑μ u ≤ ↑c * ↑↑μ s + ε
[PROOFSTEP]
calc
  (c : ℝ≥0∞) * μ u ≤ c * (μ s + ε / c) := mul_le_mul_left' μu.le _
  _ = c * μ s + ε := by
    simp_rw [mul_add]
    rw [ENNReal.mul_div_cancel' _ ENNReal.coe_ne_top]
    simpa using hc
[GOAL]
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
ε : ℝ≥0∞
ε0 : ε ≠ 0
f : α →ₛ ℝ≥0 := piecewise s hs (const α c) (const α 0)
h : ¬∫⁻ (x : α), ↑(↑f x) ∂μ = ⊤
hc : ¬c = 0
this : ↑↑μ s < ↑↑μ s + ε / ↑c
u : Set α
su : u ⊇ s
u_open : IsOpen u
μu : ↑↑μ u < ↑↑μ s + ε / ↑c
⊢ ↑c * (↑↑μ s + ε / ↑c) = ↑c * ↑↑μ s + ε
[PROOFSTEP]
simp_rw [mul_add]
[GOAL]
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
ε : ℝ≥0∞
ε0 : ε ≠ 0
f : α →ₛ ℝ≥0 := piecewise s hs (const α c) (const α 0)
h : ¬∫⁻ (x : α), ↑(↑f x) ∂μ = ⊤
hc : ¬c = 0
this : ↑↑μ s < ↑↑μ s + ε / ↑c
u : Set α
su : u ⊇ s
u_open : IsOpen u
μu : ↑↑μ u < ↑↑μ s + ε / ↑c
⊢ ↑c * ↑↑μ s + ↑c * (ε / ↑c) = ↑c * ↑↑μ s + ε
[PROOFSTEP]
rw [ENNReal.mul_div_cancel' _ ENNReal.coe_ne_top]
[GOAL]
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
c : ℝ≥0
s : Set α
hs : MeasurableSet s
ε : ℝ≥0∞
ε0 : ε ≠ 0
f : α →ₛ ℝ≥0 := piecewise s hs (const α c) (const α 0)
h : ¬∫⁻ (x : α), ↑(↑f x) ∂μ = ⊤
hc : ¬c = 0
this : ↑↑μ s < ↑↑μ s + ε / ↑c
u : Set α
su : u ⊇ s
u_open : IsOpen u
μu : ↑↑μ u < ↑↑μ s + ε / ↑c
⊢ ↑c ≠ 0
[PROOFSTEP]
simpa using hc
[GOAL]
case h_add
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
f₁ f₂ : α →ₛ ℝ≥0
a✝ : Disjoint (Function.support ↑f₁) (Function.support ↑f₂)
h₁ :
  ∀ {ε : ℝ≥0∞},
    ε ≠ 0 → ∃ g, (∀ (x : α), ↑f₁ x ≤ g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), ↑(g x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₁ x) ∂μ + ε
h₂ :
  ∀ {ε : ℝ≥0∞},
    ε ≠ 0 → ∃ g, (∀ (x : α), ↑f₂ x ≤ g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), ↑(g x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₂ x) ∂μ + ε
ε : ℝ≥0∞
ε0 : ε ≠ 0
⊢ ∃ g,
    (∀ (x : α), ↑(f₁ + f₂) x ≤ g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), ↑(g x) ∂μ ≤ ∫⁻ (x : α), ↑(↑(f₁ + f₂) x) ∂μ + ε
[PROOFSTEP]
rcases h₁ (ENNReal.half_pos ε0).ne' with ⟨g₁, f₁_le_g₁, g₁cont, g₁int⟩
[GOAL]
case h_add.intro.intro.intro
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
f₁ f₂ : α →ₛ ℝ≥0
a✝ : Disjoint (Function.support ↑f₁) (Function.support ↑f₂)
h₁ :
  ∀ {ε : ℝ≥0∞},
    ε ≠ 0 → ∃ g, (∀ (x : α), ↑f₁ x ≤ g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), ↑(g x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₁ x) ∂μ + ε
h₂ :
  ∀ {ε : ℝ≥0∞},
    ε ≠ 0 → ∃ g, (∀ (x : α), ↑f₂ x ≤ g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), ↑(g x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₂ x) ∂μ + ε
ε : ℝ≥0∞
ε0 : ε ≠ 0
g₁ : α → ℝ≥0
f₁_le_g₁ : ∀ (x : α), ↑f₁ x ≤ g₁ x
g₁cont : LowerSemicontinuous g₁
g₁int : ∫⁻ (x : α), ↑(g₁ x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₁ x) ∂μ + ε / 2
⊢ ∃ g,
    (∀ (x : α), ↑(f₁ + f₂) x ≤ g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), ↑(g x) ∂μ ≤ ∫⁻ (x : α), ↑(↑(f₁ + f₂) x) ∂μ + ε
[PROOFSTEP]
rcases h₂ (ENNReal.half_pos ε0).ne' with ⟨g₂, f₂_le_g₂, g₂cont, g₂int⟩
[GOAL]
case h_add.intro.intro.intro.intro.intro.intro
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
f₁ f₂ : α →ₛ ℝ≥0
a✝ : Disjoint (Function.support ↑f₁) (Function.support ↑f₂)
h₁ :
  ∀ {ε : ℝ≥0∞},
    ε ≠ 0 → ∃ g, (∀ (x : α), ↑f₁ x ≤ g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), ↑(g x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₁ x) ∂μ + ε
h₂ :
  ∀ {ε : ℝ≥0∞},
    ε ≠ 0 → ∃ g, (∀ (x : α), ↑f₂ x ≤ g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), ↑(g x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₂ x) ∂μ + ε
ε : ℝ≥0∞
ε0 : ε ≠ 0
g₁ : α → ℝ≥0
f₁_le_g₁ : ∀ (x : α), ↑f₁ x ≤ g₁ x
g₁cont : LowerSemicontinuous g₁
g₁int : ∫⁻ (x : α), ↑(g₁ x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₁ x) ∂μ + ε / 2
g₂ : α → ℝ≥0
f₂_le_g₂ : ∀ (x : α), ↑f₂ x ≤ g₂ x
g₂cont : LowerSemicontinuous g₂
g₂int : ∫⁻ (x : α), ↑(g₂ x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₂ x) ∂μ + ε / 2
⊢ ∃ g,
    (∀ (x : α), ↑(f₁ + f₂) x ≤ g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), ↑(g x) ∂μ ≤ ∫⁻ (x : α), ↑(↑(f₁ + f₂) x) ∂μ + ε
[PROOFSTEP]
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, _⟩
[GOAL]
case h_add.intro.intro.intro.intro.intro.intro
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
f₁ f₂ : α →ₛ ℝ≥0
a✝ : Disjoint (Function.support ↑f₁) (Function.support ↑f₂)
h₁ :
  ∀ {ε : ℝ≥0∞},
    ε ≠ 0 → ∃ g, (∀ (x : α), ↑f₁ x ≤ g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), ↑(g x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₁ x) ∂μ + ε
h₂ :
  ∀ {ε : ℝ≥0∞},
    ε ≠ 0 → ∃ g, (∀ (x : α), ↑f₂ x ≤ g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), ↑(g x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₂ x) ∂μ + ε
ε : ℝ≥0∞
ε0 : ε ≠ 0
g₁ : α → ℝ≥0
f₁_le_g₁ : ∀ (x : α), ↑f₁ x ≤ g₁ x
g₁cont : LowerSemicontinuous g₁
g₁int : ∫⁻ (x : α), ↑(g₁ x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₁ x) ∂μ + ε / 2
g₂ : α → ℝ≥0
f₂_le_g₂ : ∀ (x : α), ↑f₂ x ≤ g₂ x
g₂cont : LowerSemicontinuous g₂
g₂int : ∫⁻ (x : α), ↑(g₂ x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₂ x) ∂μ + ε / 2
⊢ ∫⁻ (x : α), ↑((fun x => g₁ x + g₂ x) x) ∂μ ≤ ∫⁻ (x : α), ↑(↑(f₁ + f₂) x) ∂μ + ε
[PROOFSTEP]
simp only [SimpleFunc.coe_add, ENNReal.coe_add, Pi.add_apply]
[GOAL]
case h_add.intro.intro.intro.intro.intro.intro
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
f₁ f₂ : α →ₛ ℝ≥0
a✝ : Disjoint (Function.support ↑f₁) (Function.support ↑f₂)
h₁ :
  ∀ {ε : ℝ≥0∞},
    ε ≠ 0 → ∃ g, (∀ (x : α), ↑f₁ x ≤ g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), ↑(g x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₁ x) ∂μ + ε
h₂ :
  ∀ {ε : ℝ≥0∞},
    ε ≠ 0 → ∃ g, (∀ (x : α), ↑f₂ x ≤ g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), ↑(g x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₂ x) ∂μ + ε
ε : ℝ≥0∞
ε0 : ε ≠ 0
g₁ : α → ℝ≥0
f₁_le_g₁ : ∀ (x : α), ↑f₁ x ≤ g₁ x
g₁cont : LowerSemicontinuous g₁
g₁int : ∫⁻ (x : α), ↑(g₁ x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₁ x) ∂μ + ε / 2
g₂ : α → ℝ≥0
f₂_le_g₂ : ∀ (x : α), ↑f₂ x ≤ g₂ x
g₂cont : LowerSemicontinuous g₂
g₂int : ∫⁻ (x : α), ↑(g₂ x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₂ x) ∂μ + ε / 2
⊢ ∫⁻ (x : α), ↑(g₁ x) + ↑(g₂ x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₁ x) + ↑(↑f₂ x) ∂μ + ε
[PROOFSTEP]
rw [lintegral_add_left f₁.measurable.coe_nnreal_ennreal, lintegral_add_left g₁cont.measurable.coe_nnreal_ennreal]
[GOAL]
case h_add.intro.intro.intro.intro.intro.intro
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
f₁ f₂ : α →ₛ ℝ≥0
a✝ : Disjoint (Function.support ↑f₁) (Function.support ↑f₂)
h₁ :
  ∀ {ε : ℝ≥0∞},
    ε ≠ 0 → ∃ g, (∀ (x : α), ↑f₁ x ≤ g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), ↑(g x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₁ x) ∂μ + ε
h₂ :
  ∀ {ε : ℝ≥0∞},
    ε ≠ 0 → ∃ g, (∀ (x : α), ↑f₂ x ≤ g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), ↑(g x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₂ x) ∂μ + ε
ε : ℝ≥0∞
ε0 : ε ≠ 0
g₁ : α → ℝ≥0
f₁_le_g₁ : ∀ (x : α), ↑f₁ x ≤ g₁ x
g₁cont : LowerSemicontinuous g₁
g₁int : ∫⁻ (x : α), ↑(g₁ x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₁ x) ∂μ + ε / 2
g₂ : α → ℝ≥0
f₂_le_g₂ : ∀ (x : α), ↑f₂ x ≤ g₂ x
g₂cont : LowerSemicontinuous g₂
g₂int : ∫⁻ (x : α), ↑(g₂ x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₂ x) ∂μ + ε / 2
⊢ ∫⁻ (a : α), ↑(g₁ a) ∂μ + ∫⁻ (a : α), ↑(g₂ a) ∂μ ≤ ∫⁻ (a : α), ↑(↑f₁ a) ∂μ + ∫⁻ (a : α), ↑(↑f₂ a) ∂μ + ε
[PROOFSTEP]
convert add_le_add g₁int g₂int using 1
[GOAL]
case h.e'_4
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
f₁ f₂ : α →ₛ ℝ≥0
a✝ : Disjoint (Function.support ↑f₁) (Function.support ↑f₂)
h₁ :
  ∀ {ε : ℝ≥0∞},
    ε ≠ 0 → ∃ g, (∀ (x : α), ↑f₁ x ≤ g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), ↑(g x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₁ x) ∂μ + ε
h₂ :
  ∀ {ε : ℝ≥0∞},
    ε ≠ 0 → ∃ g, (∀ (x : α), ↑f₂ x ≤ g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), ↑(g x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₂ x) ∂μ + ε
ε : ℝ≥0∞
ε0 : ε ≠ 0
g₁ : α → ℝ≥0
f₁_le_g₁ : ∀ (x : α), ↑f₁ x ≤ g₁ x
g₁cont : LowerSemicontinuous g₁
g₁int : ∫⁻ (x : α), ↑(g₁ x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₁ x) ∂μ + ε / 2
g₂ : α → ℝ≥0
f₂_le_g₂ : ∀ (x : α), ↑f₂ x ≤ g₂ x
g₂cont : LowerSemicontinuous g₂
g₂int : ∫⁻ (x : α), ↑(g₂ x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₂ x) ∂μ + ε / 2
⊢ ∫⁻ (a : α), ↑(↑f₁ a) ∂μ + ∫⁻ (a : α), ↑(↑f₂ a) ∂μ + ε =
    ∫⁻ (x : α), ↑(↑f₁ x) ∂μ + ε / 2 + (∫⁻ (x : α), ↑(↑f₂ x) ∂μ + ε / 2)
[PROOFSTEP]
conv_lhs => rw [← ENNReal.add_halves ε]
[GOAL]
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
f₁ f₂ : α →ₛ ℝ≥0
a✝ : Disjoint (Function.support ↑f₁) (Function.support ↑f₂)
h₁ :
  ∀ {ε : ℝ≥0∞},
    ε ≠ 0 → ∃ g, (∀ (x : α), ↑f₁ x ≤ g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), ↑(g x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₁ x) ∂μ + ε
h₂ :
  ∀ {ε : ℝ≥0∞},
    ε ≠ 0 → ∃ g, (∀ (x : α), ↑f₂ x ≤ g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), ↑(g x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₂ x) ∂μ + ε
ε : ℝ≥0∞
ε0 : ε ≠ 0
g₁ : α → ℝ≥0
f₁_le_g₁ : ∀ (x : α), ↑f₁ x ≤ g₁ x
g₁cont : LowerSemicontinuous g₁
g₁int : ∫⁻ (x : α), ↑(g₁ x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₁ x) ∂μ + ε / 2
g₂ : α → ℝ≥0
f₂_le_g₂ : ∀ (x : α), ↑f₂ x ≤ g₂ x
g₂cont : LowerSemicontinuous g₂
g₂int : ∫⁻ (x : α), ↑(g₂ x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₂ x) ∂μ + ε / 2
| ∫⁻ (a : α), ↑(↑f₁ a) ∂μ + ∫⁻ (a : α), ↑(↑f₂ a) ∂μ + ε
[PROOFSTEP]
rw [← ENNReal.add_halves ε]
[GOAL]
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
f₁ f₂ : α →ₛ ℝ≥0
a✝ : Disjoint (Function.support ↑f₁) (Function.support ↑f₂)
h₁ :
  ∀ {ε : ℝ≥0∞},
    ε ≠ 0 → ∃ g, (∀ (x : α), ↑f₁ x ≤ g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), ↑(g x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₁ x) ∂μ + ε
h₂ :
  ∀ {ε : ℝ≥0∞},
    ε ≠ 0 → ∃ g, (∀ (x : α), ↑f₂ x ≤ g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), ↑(g x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₂ x) ∂μ + ε
ε : ℝ≥0∞
ε0 : ε ≠ 0
g₁ : α → ℝ≥0
f₁_le_g₁ : ∀ (x : α), ↑f₁ x ≤ g₁ x
g₁cont : LowerSemicontinuous g₁
g₁int : ∫⁻ (x : α), ↑(g₁ x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₁ x) ∂μ + ε / 2
g₂ : α → ℝ≥0
f₂_le_g₂ : ∀ (x : α), ↑f₂ x ≤ g₂ x
g₂cont : LowerSemicontinuous g₂
g₂int : ∫⁻ (x : α), ↑(g₂ x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₂ x) ∂μ + ε / 2
| ∫⁻ (a : α), ↑(↑f₁ a) ∂μ + ∫⁻ (a : α), ↑(↑f₂ a) ∂μ + ε
[PROOFSTEP]
rw [← ENNReal.add_halves ε]
[GOAL]
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
f₁ f₂ : α →ₛ ℝ≥0
a✝ : Disjoint (Function.support ↑f₁) (Function.support ↑f₂)
h₁ :
  ∀ {ε : ℝ≥0∞},
    ε ≠ 0 → ∃ g, (∀ (x : α), ↑f₁ x ≤ g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), ↑(g x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₁ x) ∂μ + ε
h₂ :
  ∀ {ε : ℝ≥0∞},
    ε ≠ 0 → ∃ g, (∀ (x : α), ↑f₂ x ≤ g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), ↑(g x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₂ x) ∂μ + ε
ε : ℝ≥0∞
ε0 : ε ≠ 0
g₁ : α → ℝ≥0
f₁_le_g₁ : ∀ (x : α), ↑f₁ x ≤ g₁ x
g₁cont : LowerSemicontinuous g₁
g₁int : ∫⁻ (x : α), ↑(g₁ x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₁ x) ∂μ + ε / 2
g₂ : α → ℝ≥0
f₂_le_g₂ : ∀ (x : α), ↑f₂ x ≤ g₂ x
g₂cont : LowerSemicontinuous g₂
g₂int : ∫⁻ (x : α), ↑(g₂ x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₂ x) ∂μ + ε / 2
| ∫⁻ (a : α), ↑(↑f₁ a) ∂μ + ∫⁻ (a : α), ↑(↑f₂ a) ∂μ + ε
[PROOFSTEP]
rw [← ENNReal.add_halves ε]
[GOAL]
case h.e'_4
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
f₁ f₂ : α →ₛ ℝ≥0
a✝ : Disjoint (Function.support ↑f₁) (Function.support ↑f₂)
h₁ :
  ∀ {ε : ℝ≥0∞},
    ε ≠ 0 → ∃ g, (∀ (x : α), ↑f₁ x ≤ g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), ↑(g x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₁ x) ∂μ + ε
h₂ :
  ∀ {ε : ℝ≥0∞},
    ε ≠ 0 → ∃ g, (∀ (x : α), ↑f₂ x ≤ g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), ↑(g x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₂ x) ∂μ + ε
ε : ℝ≥0∞
ε0 : ε ≠ 0
g₁ : α → ℝ≥0
f₁_le_g₁ : ∀ (x : α), ↑f₁ x ≤ g₁ x
g₁cont : LowerSemicontinuous g₁
g₁int : ∫⁻ (x : α), ↑(g₁ x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₁ x) ∂μ + ε / 2
g₂ : α → ℝ≥0
f₂_le_g₂ : ∀ (x : α), ↑f₂ x ≤ g₂ x
g₂cont : LowerSemicontinuous g₂
g₂int : ∫⁻ (x : α), ↑(g₂ x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₂ x) ∂μ + ε / 2
⊢ ∫⁻ (a : α), ↑(↑f₁ a) ∂μ + ∫⁻ (a : α), ↑(↑f₂ a) ∂μ + (ε / 2 + ε / 2) =
    ∫⁻ (x : α), ↑(↑f₁ x) ∂μ + ε / 2 + (∫⁻ (x : α), ↑(↑f₂ x) ∂μ + ε / 2)
[PROOFSTEP]
abel
[GOAL]
case h.e'_4
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
ε✝ : ℝ≥0∞
ε0✝ : ε✝ ≠ 0
f₁ f₂ : α →ₛ ℝ≥0
a✝ : Disjoint (Function.support ↑f₁) (Function.support ↑f₂)
h₁ :
  ∀ {ε : ℝ≥0∞},
    ε ≠ 0 → ∃ g, (∀ (x : α), ↑f₁ x ≤ g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), ↑(g x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₁ x) ∂μ + ε
h₂ :
  ∀ {ε : ℝ≥0∞},
    ε ≠ 0 → ∃ g, (∀ (x : α), ↑f₂ x ≤ g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), ↑(g x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₂ x) ∂μ + ε
ε : ℝ≥0∞
ε0 : ε ≠ 0
g₁ : α → ℝ≥0
f₁_le_g₁ : ∀ (x : α), ↑f₁ x ≤ g₁ x
g₁cont : LowerSemicontinuous g₁
g₁int : ∫⁻ (x : α), ↑(g₁ x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₁ x) ∂μ + ε / 2
g₂ : α → ℝ≥0
f₂_le_g₂ : ∀ (x : α), ↑f₂ x ≤ g₂ x
g₂cont : LowerSemicontinuous g₂
g₂int : ∫⁻ (x : α), ↑(g₂ x) ∂μ ≤ ∫⁻ (x : α), ↑(↑f₂ x) ∂μ + ε / 2
⊢ ∫⁻ (a : α), ↑(↑f₁ a) ∂μ + ∫⁻ (a : α), ↑(↑f₂ a) ∂μ + (ε / 2 + ε / 2) =
    ∫⁻ (x : α), ↑(↑f₁ x) ∂μ + ε / 2 + (∫⁻ (x : α), ↑(↑f₂ x) ∂μ + ε / 2)
[PROOFSTEP]
abel
[GOAL]
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0∞
hf : Measurable f
ε : ℝ≥0∞
εpos : ε ≠ 0
⊢ ∃ g, (∀ (x : α), f x ≤ g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), f x ∂μ + ε
[PROOFSTEP]
rcases ENNReal.exists_pos_sum_of_countable' εpos ℕ with ⟨δ, δpos, hδ⟩
[GOAL]
case intro.intro
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0∞
hf : Measurable f
ε : ℝ≥0∞
εpos : ε ≠ 0
δ : ℕ → ℝ≥0∞
δpos : ∀ (i : ℕ), 0 < δ i
hδ : ∑' (i : ℕ), δ i < ε
⊢ ∃ g, (∀ (x : α), f x ≤ g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), f x ∂μ + ε
[PROOFSTEP]
have :
  ∀ n,
    ∃ g : α → ℝ≥0,
      (∀ x, SimpleFunc.eapproxDiff f n x ≤ g x) ∧
        LowerSemicontinuous g ∧ (∫⁻ x, g x ∂μ) ≤ (∫⁻ x, SimpleFunc.eapproxDiff f n x ∂μ) + δ n :=
  fun n => SimpleFunc.exists_le_lowerSemicontinuous_lintegral_ge μ (SimpleFunc.eapproxDiff f n) (δpos n).ne'
[GOAL]
case intro.intro
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0∞
hf : Measurable f
ε : ℝ≥0∞
εpos : ε ≠ 0
δ : ℕ → ℝ≥0∞
δpos : ∀ (i : ℕ), 0 < δ i
hδ : ∑' (i : ℕ), δ i < ε
this :
  ∀ (n : ℕ),
    ∃ g,
      (∀ (x : α), ↑(SimpleFunc.eapproxDiff f n) x ≤ g x) ∧
        LowerSemicontinuous g ∧ ∫⁻ (x : α), ↑(g x) ∂μ ≤ ∫⁻ (x : α), ↑(↑(SimpleFunc.eapproxDiff f n) x) ∂μ + δ n
⊢ ∃ g, (∀ (x : α), f x ≤ g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), f x ∂μ + ε
[PROOFSTEP]
choose g f_le_g gcont hg using this
[GOAL]
case intro.intro
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0∞
hf : Measurable f
ε : ℝ≥0∞
εpos : ε ≠ 0
δ : ℕ → ℝ≥0∞
δpos : ∀ (i : ℕ), 0 < δ i
hδ : ∑' (i : ℕ), δ i < ε
g : ℕ → α → ℝ≥0
f_le_g : ∀ (n : ℕ) (x : α), ↑(SimpleFunc.eapproxDiff f n) x ≤ g n x
gcont : ∀ (n : ℕ), LowerSemicontinuous (g n)
hg : ∀ (n : ℕ), ∫⁻ (x : α), ↑(g n x) ∂μ ≤ ∫⁻ (x : α), ↑(↑(SimpleFunc.eapproxDiff f n) x) ∂μ + δ n
⊢ ∃ g, (∀ (x : α), f x ≤ g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), f x ∂μ + ε
[PROOFSTEP]
refine' ⟨fun x => ∑' n, g n x, fun x => _, _, _⟩
[GOAL]
case intro.intro.refine'_1
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0∞
hf : Measurable f
ε : ℝ≥0∞
εpos : ε ≠ 0
δ : ℕ → ℝ≥0∞
δpos : ∀ (i : ℕ), 0 < δ i
hδ : ∑' (i : ℕ), δ i < ε
g : ℕ → α → ℝ≥0
f_le_g : ∀ (n : ℕ) (x : α), ↑(SimpleFunc.eapproxDiff f n) x ≤ g n x
gcont : ∀ (n : ℕ), LowerSemicontinuous (g n)
hg : ∀ (n : ℕ), ∫⁻ (x : α), ↑(g n x) ∂μ ≤ ∫⁻ (x : α), ↑(↑(SimpleFunc.eapproxDiff f n) x) ∂μ + δ n
x : α
⊢ f x ≤ (fun x => ∑' (n : ℕ), ↑(g n x)) x
[PROOFSTEP]
rw [← SimpleFunc.tsum_eapproxDiff f hf]
[GOAL]
case intro.intro.refine'_1
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0∞
hf : Measurable f
ε : ℝ≥0∞
εpos : ε ≠ 0
δ : ℕ → ℝ≥0∞
δpos : ∀ (i : ℕ), 0 < δ i
hδ : ∑' (i : ℕ), δ i < ε
g : ℕ → α → ℝ≥0
f_le_g : ∀ (n : ℕ) (x : α), ↑(SimpleFunc.eapproxDiff f n) x ≤ g n x
gcont : ∀ (n : ℕ), LowerSemicontinuous (g n)
hg : ∀ (n : ℕ), ∫⁻ (x : α), ↑(g n x) ∂μ ≤ ∫⁻ (x : α), ↑(↑(SimpleFunc.eapproxDiff f n) x) ∂μ + δ n
x : α
⊢ ∑' (n : ℕ), ↑(↑(SimpleFunc.eapproxDiff f n) x) ≤ (fun x => ∑' (n : ℕ), ↑(g n x)) x
[PROOFSTEP]
exact ENNReal.tsum_le_tsum fun n => ENNReal.coe_le_coe.2 (f_le_g n x)
[GOAL]
case intro.intro.refine'_2
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0∞
hf : Measurable f
ε : ℝ≥0∞
εpos : ε ≠ 0
δ : ℕ → ℝ≥0∞
δpos : ∀ (i : ℕ), 0 < δ i
hδ : ∑' (i : ℕ), δ i < ε
g : ℕ → α → ℝ≥0
f_le_g : ∀ (n : ℕ) (x : α), ↑(SimpleFunc.eapproxDiff f n) x ≤ g n x
gcont : ∀ (n : ℕ), LowerSemicontinuous (g n)
hg : ∀ (n : ℕ), ∫⁻ (x : α), ↑(g n x) ∂μ ≤ ∫⁻ (x : α), ↑(↑(SimpleFunc.eapproxDiff f n) x) ∂μ + δ n
⊢ LowerSemicontinuous fun x => ∑' (n : ℕ), ↑(g n x)
[PROOFSTEP]
refine' lowerSemicontinuous_tsum fun n => _
[GOAL]
case intro.intro.refine'_2
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0∞
hf : Measurable f
ε : ℝ≥0∞
εpos : ε ≠ 0
δ : ℕ → ℝ≥0∞
δpos : ∀ (i : ℕ), 0 < δ i
hδ : ∑' (i : ℕ), δ i < ε
g : ℕ → α → ℝ≥0
f_le_g : ∀ (n : ℕ) (x : α), ↑(SimpleFunc.eapproxDiff f n) x ≤ g n x
gcont : ∀ (n : ℕ), LowerSemicontinuous (g n)
hg : ∀ (n : ℕ), ∫⁻ (x : α), ↑(g n x) ∂μ ≤ ∫⁻ (x : α), ↑(↑(SimpleFunc.eapproxDiff f n) x) ∂μ + δ n
n : ℕ
⊢ LowerSemicontinuous fun x => ↑(g n x)
[PROOFSTEP]
exact ENNReal.continuous_coe.comp_lowerSemicontinuous (gcont n) fun x y hxy => ENNReal.coe_le_coe.2 hxy
[GOAL]
case intro.intro.refine'_3
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0∞
hf : Measurable f
ε : ℝ≥0∞
εpos : ε ≠ 0
δ : ℕ → ℝ≥0∞
δpos : ∀ (i : ℕ), 0 < δ i
hδ : ∑' (i : ℕ), δ i < ε
g : ℕ → α → ℝ≥0
f_le_g : ∀ (n : ℕ) (x : α), ↑(SimpleFunc.eapproxDiff f n) x ≤ g n x
gcont : ∀ (n : ℕ), LowerSemicontinuous (g n)
hg : ∀ (n : ℕ), ∫⁻ (x : α), ↑(g n x) ∂μ ≤ ∫⁻ (x : α), ↑(↑(SimpleFunc.eapproxDiff f n) x) ∂μ + δ n
⊢ ∫⁻ (x : α), (fun x => ∑' (n : ℕ), ↑(g n x)) x ∂μ ≤ ∫⁻ (x : α), f x ∂μ + ε
[PROOFSTEP]
calc
  ∫⁻ x, ∑' n : ℕ, g n x ∂μ = ∑' n, ∫⁻ x, g n x ∂μ := by
    rw [lintegral_tsum fun n => (gcont n).measurable.coe_nnreal_ennreal.aemeasurable]
  _ ≤ ∑' n, ((∫⁻ x, SimpleFunc.eapproxDiff f n x ∂μ) + δ n) := (ENNReal.tsum_le_tsum hg)
  _ = ∑' n, ∫⁻ x, SimpleFunc.eapproxDiff f n x ∂μ + ∑' n, δ n := ENNReal.tsum_add
  _ ≤ (∫⁻ x : α, f x ∂μ) + ε := by
    refine' add_le_add _ hδ.le
    rw [← lintegral_tsum]
    · simp_rw [SimpleFunc.tsum_eapproxDiff f hf, le_refl]
    · intro n; exact (SimpleFunc.measurable _).coe_nnreal_ennreal.aemeasurable
[GOAL]
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0∞
hf : Measurable f
ε : ℝ≥0∞
εpos : ε ≠ 0
δ : ℕ → ℝ≥0∞
δpos : ∀ (i : ℕ), 0 < δ i
hδ : ∑' (i : ℕ), δ i < ε
g : ℕ → α → ℝ≥0
f_le_g : ∀ (n : ℕ) (x : α), ↑(SimpleFunc.eapproxDiff f n) x ≤ g n x
gcont : ∀ (n : ℕ), LowerSemicontinuous (g n)
hg : ∀ (n : ℕ), ∫⁻ (x : α), ↑(g n x) ∂μ ≤ ∫⁻ (x : α), ↑(↑(SimpleFunc.eapproxDiff f n) x) ∂μ + δ n
⊢ ∫⁻ (x : α), ∑' (n : ℕ), ↑(g n x) ∂μ = ∑' (n : ℕ), ∫⁻ (x : α), ↑(g n x) ∂μ
[PROOFSTEP]
rw [lintegral_tsum fun n => (gcont n).measurable.coe_nnreal_ennreal.aemeasurable]
[GOAL]
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0∞
hf : Measurable f
ε : ℝ≥0∞
εpos : ε ≠ 0
δ : ℕ → ℝ≥0∞
δpos : ∀ (i : ℕ), 0 < δ i
hδ : ∑' (i : ℕ), δ i < ε
g : ℕ → α → ℝ≥0
f_le_g : ∀ (n : ℕ) (x : α), ↑(SimpleFunc.eapproxDiff f n) x ≤ g n x
gcont : ∀ (n : ℕ), LowerSemicontinuous (g n)
hg : ∀ (n : ℕ), ∫⁻ (x : α), ↑(g n x) ∂μ ≤ ∫⁻ (x : α), ↑(↑(SimpleFunc.eapproxDiff f n) x) ∂μ + δ n
⊢ ∑' (n : ℕ), ∫⁻ (x : α), ↑(↑(SimpleFunc.eapproxDiff f n) x) ∂μ + ∑' (n : ℕ), δ n ≤ ∫⁻ (x : α), f x ∂μ + ε
[PROOFSTEP]
refine' add_le_add _ hδ.le
[GOAL]
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0∞
hf : Measurable f
ε : ℝ≥0∞
εpos : ε ≠ 0
δ : ℕ → ℝ≥0∞
δpos : ∀ (i : ℕ), 0 < δ i
hδ : ∑' (i : ℕ), δ i < ε
g : ℕ → α → ℝ≥0
f_le_g : ∀ (n : ℕ) (x : α), ↑(SimpleFunc.eapproxDiff f n) x ≤ g n x
gcont : ∀ (n : ℕ), LowerSemicontinuous (g n)
hg : ∀ (n : ℕ), ∫⁻ (x : α), ↑(g n x) ∂μ ≤ ∫⁻ (x : α), ↑(↑(SimpleFunc.eapproxDiff f n) x) ∂μ + δ n
⊢ ∑' (n : ℕ), ∫⁻ (x : α), ↑(↑(SimpleFunc.eapproxDiff f n) x) ∂μ ≤ ∫⁻ (x : α), f x ∂μ
[PROOFSTEP]
rw [← lintegral_tsum]
[GOAL]
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0∞
hf : Measurable f
ε : ℝ≥0∞
εpos : ε ≠ 0
δ : ℕ → ℝ≥0∞
δpos : ∀ (i : ℕ), 0 < δ i
hδ : ∑' (i : ℕ), δ i < ε
g : ℕ → α → ℝ≥0
f_le_g : ∀ (n : ℕ) (x : α), ↑(SimpleFunc.eapproxDiff f n) x ≤ g n x
gcont : ∀ (n : ℕ), LowerSemicontinuous (g n)
hg : ∀ (n : ℕ), ∫⁻ (x : α), ↑(g n x) ∂μ ≤ ∫⁻ (x : α), ↑(↑(SimpleFunc.eapproxDiff f n) x) ∂μ + δ n
⊢ ∫⁻ (a : α), ∑' (i : ℕ), ↑(↑(SimpleFunc.eapproxDiff f i) a) ∂μ ≤ ∫⁻ (x : α), f x ∂μ
[PROOFSTEP]
simp_rw [SimpleFunc.tsum_eapproxDiff f hf, le_refl]
[GOAL]
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0∞
hf : Measurable f
ε : ℝ≥0∞
εpos : ε ≠ 0
δ : ℕ → ℝ≥0∞
δpos : ∀ (i : ℕ), 0 < δ i
hδ : ∑' (i : ℕ), δ i < ε
g : ℕ → α → ℝ≥0
f_le_g : ∀ (n : ℕ) (x : α), ↑(SimpleFunc.eapproxDiff f n) x ≤ g n x
gcont : ∀ (n : ℕ), LowerSemicontinuous (g n)
hg : ∀ (n : ℕ), ∫⁻ (x : α), ↑(g n x) ∂μ ≤ ∫⁻ (x : α), ↑(↑(SimpleFunc.eapproxDiff f n) x) ∂μ + δ n
⊢ ∀ (i : ℕ), AEMeasurable fun x => ↑(↑(SimpleFunc.eapproxDiff f i) x)
[PROOFSTEP]
intro n
[GOAL]
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0∞
hf : Measurable f
ε : ℝ≥0∞
εpos : ε ≠ 0
δ : ℕ → ℝ≥0∞
δpos : ∀ (i : ℕ), 0 < δ i
hδ : ∑' (i : ℕ), δ i < ε
g : ℕ → α → ℝ≥0
f_le_g : ∀ (n : ℕ) (x : α), ↑(SimpleFunc.eapproxDiff f n) x ≤ g n x
gcont : ∀ (n : ℕ), LowerSemicontinuous (g n)
hg : ∀ (n : ℕ), ∫⁻ (x : α), ↑(g n x) ∂μ ≤ ∫⁻ (x : α), ↑(↑(SimpleFunc.eapproxDiff f n) x) ∂μ + δ n
n : ℕ
⊢ AEMeasurable fun x => ↑(↑(SimpleFunc.eapproxDiff f n) x)
[PROOFSTEP]
exact (SimpleFunc.measurable _).coe_nnreal_ennreal.aemeasurable
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fmeas : Measurable f
ε : ℝ≥0∞
ε0 : ε ≠ 0
⊢ ∃ g, (∀ (x : α), ↑(f x) < g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), ↑(f x) ∂μ + ε
[PROOFSTEP]
have : ε / 2 ≠ 0 := (ENNReal.half_pos ε0).ne'
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fmeas : Measurable f
ε : ℝ≥0∞
ε0 : ε ≠ 0
this : ε / 2 ≠ 0
⊢ ∃ g, (∀ (x : α), ↑(f x) < g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), ↑(f x) ∂μ + ε
[PROOFSTEP]
rcases exists_pos_lintegral_lt_of_sigmaFinite μ this with ⟨w, wpos, wmeas, wint⟩
[GOAL]
case intro.intro.intro
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fmeas : Measurable f
ε : ℝ≥0∞
ε0 : ε ≠ 0
this : ε / 2 ≠ 0
w : α → ℝ≥0
wpos : ∀ (x : α), 0 < w x
wmeas : Measurable w
wint : ∫⁻ (x : α), ↑(w x) ∂μ < ε / 2
⊢ ∃ g, (∀ (x : α), ↑(f x) < g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), ↑(f x) ∂μ + ε
[PROOFSTEP]
let f' x := ((f x + w x : ℝ≥0) : ℝ≥0∞)
[GOAL]
case intro.intro.intro
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fmeas : Measurable f
ε : ℝ≥0∞
ε0 : ε ≠ 0
this : ε / 2 ≠ 0
w : α → ℝ≥0
wpos : ∀ (x : α), 0 < w x
wmeas : Measurable w
wint : ∫⁻ (x : α), ↑(w x) ∂μ < ε / 2
f' : α → ℝ≥0∞ := fun x => ↑(f x + w x)
⊢ ∃ g, (∀ (x : α), ↑(f x) < g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), ↑(f x) ∂μ + ε
[PROOFSTEP]
rcases exists_le_lowerSemicontinuous_lintegral_ge μ f' (fmeas.add wmeas).coe_nnreal_ennreal this with
  ⟨g, le_g, gcont, gint⟩
[GOAL]
case intro.intro.intro.intro.intro.intro
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fmeas : Measurable f
ε : ℝ≥0∞
ε0 : ε ≠ 0
this : ε / 2 ≠ 0
w : α → ℝ≥0
wpos : ∀ (x : α), 0 < w x
wmeas : Measurable w
wint : ∫⁻ (x : α), ↑(w x) ∂μ < ε / 2
f' : α → ℝ≥0∞ := fun x => ↑(f x + w x)
g : α → ℝ≥0∞
le_g : ∀ (x : α), f' x ≤ g x
gcont : LowerSemicontinuous g
gint : ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), f' x ∂μ + ε / 2
⊢ ∃ g, (∀ (x : α), ↑(f x) < g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), ↑(f x) ∂μ + ε
[PROOFSTEP]
refine' ⟨g, fun x => _, gcont, _⟩
[GOAL]
case intro.intro.intro.intro.intro.intro.refine'_1
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fmeas : Measurable f
ε : ℝ≥0∞
ε0 : ε ≠ 0
this : ε / 2 ≠ 0
w : α → ℝ≥0
wpos : ∀ (x : α), 0 < w x
wmeas : Measurable w
wint : ∫⁻ (x : α), ↑(w x) ∂μ < ε / 2
f' : α → ℝ≥0∞ := fun x => ↑(f x + w x)
g : α → ℝ≥0∞
le_g : ∀ (x : α), f' x ≤ g x
gcont : LowerSemicontinuous g
gint : ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), f' x ∂μ + ε / 2
x : α
⊢ ↑(f x) < g x
[PROOFSTEP]
calc
  (f x : ℝ≥0∞) < f' x := by simpa only [← ENNReal.coe_lt_coe, add_zero] using add_lt_add_left (wpos x) (f x)
  _ ≤ g x := le_g x
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fmeas : Measurable f
ε : ℝ≥0∞
ε0 : ε ≠ 0
this : ε / 2 ≠ 0
w : α → ℝ≥0
wpos : ∀ (x : α), 0 < w x
wmeas : Measurable w
wint : ∫⁻ (x : α), ↑(w x) ∂μ < ε / 2
f' : α → ℝ≥0∞ := fun x => ↑(f x + w x)
g : α → ℝ≥0∞
le_g : ∀ (x : α), f' x ≤ g x
gcont : LowerSemicontinuous g
gint : ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), f' x ∂μ + ε / 2
x : α
⊢ ↑(f x) < f' x
[PROOFSTEP]
simpa only [← ENNReal.coe_lt_coe, add_zero] using add_lt_add_left (wpos x) (f x)
[GOAL]
case intro.intro.intro.intro.intro.intro.refine'_2
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fmeas : Measurable f
ε : ℝ≥0∞
ε0 : ε ≠ 0
this : ε / 2 ≠ 0
w : α → ℝ≥0
wpos : ∀ (x : α), 0 < w x
wmeas : Measurable w
wint : ∫⁻ (x : α), ↑(w x) ∂μ < ε / 2
f' : α → ℝ≥0∞ := fun x => ↑(f x + w x)
g : α → ℝ≥0∞
le_g : ∀ (x : α), f' x ≤ g x
gcont : LowerSemicontinuous g
gint : ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), f' x ∂μ + ε / 2
⊢ ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), ↑(f x) ∂μ + ε
[PROOFSTEP]
calc
  (∫⁻ x : α, g x ∂μ) ≤ (∫⁻ x : α, f x + w x ∂μ) + ε / 2 := gint
  _ = ((∫⁻ x : α, f x ∂μ) + ∫⁻ x : α, w x ∂μ) + ε / 2 := by rw [lintegral_add_right _ wmeas.coe_nnreal_ennreal]
  _ ≤ (∫⁻ x : α, f x ∂μ) + ε / 2 + ε / 2 := (add_le_add_right (add_le_add_left wint.le _) _)
  _ = (∫⁻ x : α, f x ∂μ) + ε := by rw [add_assoc, ENNReal.add_halves]
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fmeas : Measurable f
ε : ℝ≥0∞
ε0 : ε ≠ 0
this : ε / 2 ≠ 0
w : α → ℝ≥0
wpos : ∀ (x : α), 0 < w x
wmeas : Measurable w
wint : ∫⁻ (x : α), ↑(w x) ∂μ < ε / 2
f' : α → ℝ≥0∞ := fun x => ↑(f x + w x)
g : α → ℝ≥0∞
le_g : ∀ (x : α), f' x ≤ g x
gcont : LowerSemicontinuous g
gint : ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), f' x ∂μ + ε / 2
⊢ ∫⁻ (x : α), ↑(f x) + ↑(w x) ∂μ + ε / 2 = ∫⁻ (x : α), ↑(f x) ∂μ + ∫⁻ (x : α), ↑(w x) ∂μ + ε / 2
[PROOFSTEP]
rw [lintegral_add_right _ wmeas.coe_nnreal_ennreal]
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fmeas : Measurable f
ε : ℝ≥0∞
ε0 : ε ≠ 0
this : ε / 2 ≠ 0
w : α → ℝ≥0
wpos : ∀ (x : α), 0 < w x
wmeas : Measurable w
wint : ∫⁻ (x : α), ↑(w x) ∂μ < ε / 2
f' : α → ℝ≥0∞ := fun x => ↑(f x + w x)
g : α → ℝ≥0∞
le_g : ∀ (x : α), f' x ≤ g x
gcont : LowerSemicontinuous g
gint : ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), f' x ∂μ + ε / 2
⊢ ∫⁻ (x : α), ↑(f x) ∂μ + ε / 2 + ε / 2 = ∫⁻ (x : α), ↑(f x) ∂μ + ε
[PROOFSTEP]
rw [add_assoc, ENNReal.add_halves]
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fmeas : AEMeasurable f
ε : ℝ≥0∞
ε0 : ε ≠ 0
⊢ ∃ g, (∀ (x : α), ↑(f x) < g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), ↑(f x) ∂μ + ε
[PROOFSTEP]
have : ε / 2 ≠ 0 := (ENNReal.half_pos ε0).ne'
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fmeas : AEMeasurable f
ε : ℝ≥0∞
ε0 : ε ≠ 0
this : ε / 2 ≠ 0
⊢ ∃ g, (∀ (x : α), ↑(f x) < g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), ↑(f x) ∂μ + ε
[PROOFSTEP]
rcases exists_lt_lowerSemicontinuous_lintegral_ge μ (fmeas.mk f) fmeas.measurable_mk this with
  ⟨g0, f_lt_g0, g0_cont, g0_int⟩
[GOAL]
case intro.intro.intro
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fmeas : AEMeasurable f
ε : ℝ≥0∞
ε0 : ε ≠ 0
this : ε / 2 ≠ 0
g0 : α → ℝ≥0∞
f_lt_g0 : ∀ (x : α), ↑(AEMeasurable.mk f fmeas x) < g0 x
g0_cont : LowerSemicontinuous g0
g0_int : ∫⁻ (x : α), g0 x ∂μ ≤ ∫⁻ (x : α), ↑(AEMeasurable.mk f fmeas x) ∂μ + ε / 2
⊢ ∃ g, (∀ (x : α), ↑(f x) < g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), ↑(f x) ∂μ + ε
[PROOFSTEP]
rcases exists_measurable_superset_of_null fmeas.ae_eq_mk with ⟨s, hs, smeas, μs⟩
[GOAL]
case intro.intro.intro.intro.intro.intro
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fmeas : AEMeasurable f
ε : ℝ≥0∞
ε0 : ε ≠ 0
this : ε / 2 ≠ 0
g0 : α → ℝ≥0∞
f_lt_g0 : ∀ (x : α), ↑(AEMeasurable.mk f fmeas x) < g0 x
g0_cont : LowerSemicontinuous g0
g0_int : ∫⁻ (x : α), g0 x ∂μ ≤ ∫⁻ (x : α), ↑(AEMeasurable.mk f fmeas x) ∂μ + ε / 2
s : Set α
hs : {x | (fun x => f x = AEMeasurable.mk f fmeas x) x}ᶜ ⊆ s
smeas : MeasurableSet s
μs : ↑↑μ s = 0
⊢ ∃ g, (∀ (x : α), ↑(f x) < g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), ↑(f x) ∂μ + ε
[PROOFSTEP]
rcases exists_le_lowerSemicontinuous_lintegral_ge μ (s.indicator fun _x => ∞) (measurable_const.indicator smeas)
    this with
  ⟨g1, le_g1, g1_cont, g1_int⟩
[GOAL]
case intro.intro.intro.intro.intro.intro.intro.intro.intro
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fmeas : AEMeasurable f
ε : ℝ≥0∞
ε0 : ε ≠ 0
this : ε / 2 ≠ 0
g0 : α → ℝ≥0∞
f_lt_g0 : ∀ (x : α), ↑(AEMeasurable.mk f fmeas x) < g0 x
g0_cont : LowerSemicontinuous g0
g0_int : ∫⁻ (x : α), g0 x ∂μ ≤ ∫⁻ (x : α), ↑(AEMeasurable.mk f fmeas x) ∂μ + ε / 2
s : Set α
hs : {x | (fun x => f x = AEMeasurable.mk f fmeas x) x}ᶜ ⊆ s
smeas : MeasurableSet s
μs : ↑↑μ s = 0
g1 : α → ℝ≥0∞
le_g1 : ∀ (x : α), Set.indicator s (fun _x => ⊤) x ≤ g1 x
g1_cont : LowerSemicontinuous g1
g1_int : ∫⁻ (x : α), g1 x ∂μ ≤ ∫⁻ (x : α), Set.indicator s (fun _x => ⊤) x ∂μ + ε / 2
⊢ ∃ g, (∀ (x : α), ↑(f x) < g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), ↑(f x) ∂μ + ε
[PROOFSTEP]
refine' ⟨fun x => g0 x + g1 x, fun x => _, g0_cont.add g1_cont, _⟩
[GOAL]
case intro.intro.intro.intro.intro.intro.intro.intro.intro.refine'_1
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fmeas : AEMeasurable f
ε : ℝ≥0∞
ε0 : ε ≠ 0
this : ε / 2 ≠ 0
g0 : α → ℝ≥0∞
f_lt_g0 : ∀ (x : α), ↑(AEMeasurable.mk f fmeas x) < g0 x
g0_cont : LowerSemicontinuous g0
g0_int : ∫⁻ (x : α), g0 x ∂μ ≤ ∫⁻ (x : α), ↑(AEMeasurable.mk f fmeas x) ∂μ + ε / 2
s : Set α
hs : {x | (fun x => f x = AEMeasurable.mk f fmeas x) x}ᶜ ⊆ s
smeas : MeasurableSet s
μs : ↑↑μ s = 0
g1 : α → ℝ≥0∞
le_g1 : ∀ (x : α), Set.indicator s (fun _x => ⊤) x ≤ g1 x
g1_cont : LowerSemicontinuous g1
g1_int : ∫⁻ (x : α), g1 x ∂μ ≤ ∫⁻ (x : α), Set.indicator s (fun _x => ⊤) x ∂μ + ε / 2
x : α
⊢ ↑(f x) < (fun x => g0 x + g1 x) x
[PROOFSTEP]
by_cases h : x ∈ s
[GOAL]
case pos
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fmeas : AEMeasurable f
ε : ℝ≥0∞
ε0 : ε ≠ 0
this : ε / 2 ≠ 0
g0 : α → ℝ≥0∞
f_lt_g0 : ∀ (x : α), ↑(AEMeasurable.mk f fmeas x) < g0 x
g0_cont : LowerSemicontinuous g0
g0_int : ∫⁻ (x : α), g0 x ∂μ ≤ ∫⁻ (x : α), ↑(AEMeasurable.mk f fmeas x) ∂μ + ε / 2
s : Set α
hs : {x | (fun x => f x = AEMeasurable.mk f fmeas x) x}ᶜ ⊆ s
smeas : MeasurableSet s
μs : ↑↑μ s = 0
g1 : α → ℝ≥0∞
le_g1 : ∀ (x : α), Set.indicator s (fun _x => ⊤) x ≤ g1 x
g1_cont : LowerSemicontinuous g1
g1_int : ∫⁻ (x : α), g1 x ∂μ ≤ ∫⁻ (x : α), Set.indicator s (fun _x => ⊤) x ∂μ + ε / 2
x : α
h : x ∈ s
⊢ ↑(f x) < (fun x => g0 x + g1 x) x
[PROOFSTEP]
have := le_g1 x
[GOAL]
case pos
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fmeas : AEMeasurable f
ε : ℝ≥0∞
ε0 : ε ≠ 0
this✝ : ε / 2 ≠ 0
g0 : α → ℝ≥0∞
f_lt_g0 : ∀ (x : α), ↑(AEMeasurable.mk f fmeas x) < g0 x
g0_cont : LowerSemicontinuous g0
g0_int : ∫⁻ (x : α), g0 x ∂μ ≤ ∫⁻ (x : α), ↑(AEMeasurable.mk f fmeas x) ∂μ + ε / 2
s : Set α
hs : {x | (fun x => f x = AEMeasurable.mk f fmeas x) x}ᶜ ⊆ s
smeas : MeasurableSet s
μs : ↑↑μ s = 0
g1 : α → ℝ≥0∞
le_g1 : ∀ (x : α), Set.indicator s (fun _x => ⊤) x ≤ g1 x
g1_cont : LowerSemicontinuous g1
g1_int : ∫⁻ (x : α), g1 x ∂μ ≤ ∫⁻ (x : α), Set.indicator s (fun _x => ⊤) x ∂μ + ε / 2
x : α
h : x ∈ s
this : Set.indicator s (fun _x => ⊤) x ≤ g1 x
⊢ ↑(f x) < (fun x => g0 x + g1 x) x
[PROOFSTEP]
simp only [h, Set.indicator_of_mem, top_le_iff] at this
[GOAL]
case pos
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fmeas : AEMeasurable f
ε : ℝ≥0∞
ε0 : ε ≠ 0
this✝ : ε / 2 ≠ 0
g0 : α → ℝ≥0∞
f_lt_g0 : ∀ (x : α), ↑(AEMeasurable.mk f fmeas x) < g0 x
g0_cont : LowerSemicontinuous g0
g0_int : ∫⁻ (x : α), g0 x ∂μ ≤ ∫⁻ (x : α), ↑(AEMeasurable.mk f fmeas x) ∂μ + ε / 2
s : Set α
hs : {x | (fun x => f x = AEMeasurable.mk f fmeas x) x}ᶜ ⊆ s
smeas : MeasurableSet s
μs : ↑↑μ s = 0
g1 : α → ℝ≥0∞
le_g1 : ∀ (x : α), Set.indicator s (fun _x => ⊤) x ≤ g1 x
g1_cont : LowerSemicontinuous g1
g1_int : ∫⁻ (x : α), g1 x ∂μ ≤ ∫⁻ (x : α), Set.indicator s (fun _x => ⊤) x ∂μ + ε / 2
x : α
h : x ∈ s
this : g1 x = ⊤
⊢ ↑(f x) < (fun x => g0 x + g1 x) x
[PROOFSTEP]
simp [this]
[GOAL]
case neg
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fmeas : AEMeasurable f
ε : ℝ≥0∞
ε0 : ε ≠ 0
this : ε / 2 ≠ 0
g0 : α → ℝ≥0∞
f_lt_g0 : ∀ (x : α), ↑(AEMeasurable.mk f fmeas x) < g0 x
g0_cont : LowerSemicontinuous g0
g0_int : ∫⁻ (x : α), g0 x ∂μ ≤ ∫⁻ (x : α), ↑(AEMeasurable.mk f fmeas x) ∂μ + ε / 2
s : Set α
hs : {x | (fun x => f x = AEMeasurable.mk f fmeas x) x}ᶜ ⊆ s
smeas : MeasurableSet s
μs : ↑↑μ s = 0
g1 : α → ℝ≥0∞
le_g1 : ∀ (x : α), Set.indicator s (fun _x => ⊤) x ≤ g1 x
g1_cont : LowerSemicontinuous g1
g1_int : ∫⁻ (x : α), g1 x ∂μ ≤ ∫⁻ (x : α), Set.indicator s (fun _x => ⊤) x ∂μ + ε / 2
x : α
h : ¬x ∈ s
⊢ ↑(f x) < (fun x => g0 x + g1 x) x
[PROOFSTEP]
have : f x = fmeas.mk f x := by rw [Set.compl_subset_comm] at hs ; exact hs h
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fmeas : AEMeasurable f
ε : ℝ≥0∞
ε0 : ε ≠ 0
this : ε / 2 ≠ 0
g0 : α → ℝ≥0∞
f_lt_g0 : ∀ (x : α), ↑(AEMeasurable.mk f fmeas x) < g0 x
g0_cont : LowerSemicontinuous g0
g0_int : ∫⁻ (x : α), g0 x ∂μ ≤ ∫⁻ (x : α), ↑(AEMeasurable.mk f fmeas x) ∂μ + ε / 2
s : Set α
hs : {x | (fun x => f x = AEMeasurable.mk f fmeas x) x}ᶜ ⊆ s
smeas : MeasurableSet s
μs : ↑↑μ s = 0
g1 : α → ℝ≥0∞
le_g1 : ∀ (x : α), Set.indicator s (fun _x => ⊤) x ≤ g1 x
g1_cont : LowerSemicontinuous g1
g1_int : ∫⁻ (x : α), g1 x ∂μ ≤ ∫⁻ (x : α), Set.indicator s (fun _x => ⊤) x ∂μ + ε / 2
x : α
h : ¬x ∈ s
⊢ f x = AEMeasurable.mk f fmeas x
[PROOFSTEP]
rw [Set.compl_subset_comm] at hs
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fmeas : AEMeasurable f
ε : ℝ≥0∞
ε0 : ε ≠ 0
this : ε / 2 ≠ 0
g0 : α → ℝ≥0∞
f_lt_g0 : ∀ (x : α), ↑(AEMeasurable.mk f fmeas x) < g0 x
g0_cont : LowerSemicontinuous g0
g0_int : ∫⁻ (x : α), g0 x ∂μ ≤ ∫⁻ (x : α), ↑(AEMeasurable.mk f fmeas x) ∂μ + ε / 2
s : Set α
hs : sᶜ ⊆ {x | (fun x => f x = AEMeasurable.mk f fmeas x) x}
smeas : MeasurableSet s
μs : ↑↑μ s = 0
g1 : α → ℝ≥0∞
le_g1 : ∀ (x : α), Set.indicator s (fun _x => ⊤) x ≤ g1 x
g1_cont : LowerSemicontinuous g1
g1_int : ∫⁻ (x : α), g1 x ∂μ ≤ ∫⁻ (x : α), Set.indicator s (fun _x => ⊤) x ∂μ + ε / 2
x : α
h : ¬x ∈ s
⊢ f x = AEMeasurable.mk f fmeas x
[PROOFSTEP]
exact hs h
[GOAL]
case neg
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fmeas : AEMeasurable f
ε : ℝ≥0∞
ε0 : ε ≠ 0
this✝ : ε / 2 ≠ 0
g0 : α → ℝ≥0∞
f_lt_g0 : ∀ (x : α), ↑(AEMeasurable.mk f fmeas x) < g0 x
g0_cont : LowerSemicontinuous g0
g0_int : ∫⁻ (x : α), g0 x ∂μ ≤ ∫⁻ (x : α), ↑(AEMeasurable.mk f fmeas x) ∂μ + ε / 2
s : Set α
hs : {x | (fun x => f x = AEMeasurable.mk f fmeas x) x}ᶜ ⊆ s
smeas : MeasurableSet s
μs : ↑↑μ s = 0
g1 : α → ℝ≥0∞
le_g1 : ∀ (x : α), Set.indicator s (fun _x => ⊤) x ≤ g1 x
g1_cont : LowerSemicontinuous g1
g1_int : ∫⁻ (x : α), g1 x ∂μ ≤ ∫⁻ (x : α), Set.indicator s (fun _x => ⊤) x ∂μ + ε / 2
x : α
h : ¬x ∈ s
this : f x = AEMeasurable.mk f fmeas x
⊢ ↑(f x) < (fun x => g0 x + g1 x) x
[PROOFSTEP]
rw [this]
[GOAL]
case neg
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fmeas : AEMeasurable f
ε : ℝ≥0∞
ε0 : ε ≠ 0
this✝ : ε / 2 ≠ 0
g0 : α → ℝ≥0∞
f_lt_g0 : ∀ (x : α), ↑(AEMeasurable.mk f fmeas x) < g0 x
g0_cont : LowerSemicontinuous g0
g0_int : ∫⁻ (x : α), g0 x ∂μ ≤ ∫⁻ (x : α), ↑(AEMeasurable.mk f fmeas x) ∂μ + ε / 2
s : Set α
hs : {x | (fun x => f x = AEMeasurable.mk f fmeas x) x}ᶜ ⊆ s
smeas : MeasurableSet s
μs : ↑↑μ s = 0
g1 : α → ℝ≥0∞
le_g1 : ∀ (x : α), Set.indicator s (fun _x => ⊤) x ≤ g1 x
g1_cont : LowerSemicontinuous g1
g1_int : ∫⁻ (x : α), g1 x ∂μ ≤ ∫⁻ (x : α), Set.indicator s (fun _x => ⊤) x ∂μ + ε / 2
x : α
h : ¬x ∈ s
this : f x = AEMeasurable.mk f fmeas x
⊢ ↑(AEMeasurable.mk f fmeas x) < (fun x => g0 x + g1 x) x
[PROOFSTEP]
exact (f_lt_g0 x).trans_le le_self_add
[GOAL]
case intro.intro.intro.intro.intro.intro.intro.intro.intro.refine'_2
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fmeas : AEMeasurable f
ε : ℝ≥0∞
ε0 : ε ≠ 0
this : ε / 2 ≠ 0
g0 : α → ℝ≥0∞
f_lt_g0 : ∀ (x : α), ↑(AEMeasurable.mk f fmeas x) < g0 x
g0_cont : LowerSemicontinuous g0
g0_int : ∫⁻ (x : α), g0 x ∂μ ≤ ∫⁻ (x : α), ↑(AEMeasurable.mk f fmeas x) ∂μ + ε / 2
s : Set α
hs : {x | (fun x => f x = AEMeasurable.mk f fmeas x) x}ᶜ ⊆ s
smeas : MeasurableSet s
μs : ↑↑μ s = 0
g1 : α → ℝ≥0∞
le_g1 : ∀ (x : α), Set.indicator s (fun _x => ⊤) x ≤ g1 x
g1_cont : LowerSemicontinuous g1
g1_int : ∫⁻ (x : α), g1 x ∂μ ≤ ∫⁻ (x : α), Set.indicator s (fun _x => ⊤) x ∂μ + ε / 2
⊢ ∫⁻ (x : α), (fun x => g0 x + g1 x) x ∂μ ≤ ∫⁻ (x : α), ↑(f x) ∂μ + ε
[PROOFSTEP]
calc
  ∫⁻ x, g0 x + g1 x ∂μ = (∫⁻ x, g0 x ∂μ) + ∫⁻ x, g1 x ∂μ := lintegral_add_left g0_cont.measurable _
  _ ≤ (∫⁻ x, f x ∂μ) + ε / 2 + (0 + ε / 2) := by
    refine' add_le_add _ _
    · convert g0_int using 2
      exact lintegral_congr_ae (fmeas.ae_eq_mk.fun_comp _)
    · convert g1_int
      simp only [smeas, μs, lintegral_const, Set.univ_inter, MeasurableSet.univ, lintegral_indicator, mul_zero,
        restrict_apply]
  _ = (∫⁻ x, f x ∂μ) + ε := by simp only [add_assoc, ENNReal.add_halves, zero_add]
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fmeas : AEMeasurable f
ε : ℝ≥0∞
ε0 : ε ≠ 0
this : ε / 2 ≠ 0
g0 : α → ℝ≥0∞
f_lt_g0 : ∀ (x : α), ↑(AEMeasurable.mk f fmeas x) < g0 x
g0_cont : LowerSemicontinuous g0
g0_int : ∫⁻ (x : α), g0 x ∂μ ≤ ∫⁻ (x : α), ↑(AEMeasurable.mk f fmeas x) ∂μ + ε / 2
s : Set α
hs : {x | (fun x => f x = AEMeasurable.mk f fmeas x) x}ᶜ ⊆ s
smeas : MeasurableSet s
μs : ↑↑μ s = 0
g1 : α → ℝ≥0∞
le_g1 : ∀ (x : α), Set.indicator s (fun _x => ⊤) x ≤ g1 x
g1_cont : LowerSemicontinuous g1
g1_int : ∫⁻ (x : α), g1 x ∂μ ≤ ∫⁻ (x : α), Set.indicator s (fun _x => ⊤) x ∂μ + ε / 2
⊢ ∫⁻ (x : α), g0 x ∂μ + ∫⁻ (x : α), g1 x ∂μ ≤ ∫⁻ (x : α), ↑(f x) ∂μ + ε / 2 + (0 + ε / 2)
[PROOFSTEP]
refine' add_le_add _ _
[GOAL]
case refine'_1
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fmeas : AEMeasurable f
ε : ℝ≥0∞
ε0 : ε ≠ 0
this : ε / 2 ≠ 0
g0 : α → ℝ≥0∞
f_lt_g0 : ∀ (x : α), ↑(AEMeasurable.mk f fmeas x) < g0 x
g0_cont : LowerSemicontinuous g0
g0_int : ∫⁻ (x : α), g0 x ∂μ ≤ ∫⁻ (x : α), ↑(AEMeasurable.mk f fmeas x) ∂μ + ε / 2
s : Set α
hs : {x | (fun x => f x = AEMeasurable.mk f fmeas x) x}ᶜ ⊆ s
smeas : MeasurableSet s
μs : ↑↑μ s = 0
g1 : α → ℝ≥0∞
le_g1 : ∀ (x : α), Set.indicator s (fun _x => ⊤) x ≤ g1 x
g1_cont : LowerSemicontinuous g1
g1_int : ∫⁻ (x : α), g1 x ∂μ ≤ ∫⁻ (x : α), Set.indicator s (fun _x => ⊤) x ∂μ + ε / 2
⊢ ∫⁻ (x : α), g0 x ∂μ ≤ ∫⁻ (x : α), ↑(f x) ∂μ + ε / 2
[PROOFSTEP]
convert g0_int using 2
[GOAL]
case h.e'_4.h.e'_5
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fmeas : AEMeasurable f
ε : ℝ≥0∞
ε0 : ε ≠ 0
this : ε / 2 ≠ 0
g0 : α → ℝ≥0∞
f_lt_g0 : ∀ (x : α), ↑(AEMeasurable.mk f fmeas x) < g0 x
g0_cont : LowerSemicontinuous g0
g0_int : ∫⁻ (x : α), g0 x ∂μ ≤ ∫⁻ (x : α), ↑(AEMeasurable.mk f fmeas x) ∂μ + ε / 2
s : Set α
hs : {x | (fun x => f x = AEMeasurable.mk f fmeas x) x}ᶜ ⊆ s
smeas : MeasurableSet s
μs : ↑↑μ s = 0
g1 : α → ℝ≥0∞
le_g1 : ∀ (x : α), Set.indicator s (fun _x => ⊤) x ≤ g1 x
g1_cont : LowerSemicontinuous g1
g1_int : ∫⁻ (x : α), g1 x ∂μ ≤ ∫⁻ (x : α), Set.indicator s (fun _x => ⊤) x ∂μ + ε / 2
⊢ ∫⁻ (x : α), ↑(f x) ∂μ = ∫⁻ (x : α), ↑(AEMeasurable.mk f fmeas x) ∂μ
[PROOFSTEP]
exact lintegral_congr_ae (fmeas.ae_eq_mk.fun_comp _)
[GOAL]
case refine'_2
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fmeas : AEMeasurable f
ε : ℝ≥0∞
ε0 : ε ≠ 0
this : ε / 2 ≠ 0
g0 : α → ℝ≥0∞
f_lt_g0 : ∀ (x : α), ↑(AEMeasurable.mk f fmeas x) < g0 x
g0_cont : LowerSemicontinuous g0
g0_int : ∫⁻ (x : α), g0 x ∂μ ≤ ∫⁻ (x : α), ↑(AEMeasurable.mk f fmeas x) ∂μ + ε / 2
s : Set α
hs : {x | (fun x => f x = AEMeasurable.mk f fmeas x) x}ᶜ ⊆ s
smeas : MeasurableSet s
μs : ↑↑μ s = 0
g1 : α → ℝ≥0∞
le_g1 : ∀ (x : α), Set.indicator s (fun _x => ⊤) x ≤ g1 x
g1_cont : LowerSemicontinuous g1
g1_int : ∫⁻ (x : α), g1 x ∂μ ≤ ∫⁻ (x : α), Set.indicator s (fun _x => ⊤) x ∂μ + ε / 2
⊢ ∫⁻ (x : α), g1 x ∂μ ≤ 0 + ε / 2
[PROOFSTEP]
convert g1_int
[GOAL]
case h.e'_4.h.e'_5
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fmeas : AEMeasurable f
ε : ℝ≥0∞
ε0 : ε ≠ 0
this : ε / 2 ≠ 0
g0 : α → ℝ≥0∞
f_lt_g0 : ∀ (x : α), ↑(AEMeasurable.mk f fmeas x) < g0 x
g0_cont : LowerSemicontinuous g0
g0_int : ∫⁻ (x : α), g0 x ∂μ ≤ ∫⁻ (x : α), ↑(AEMeasurable.mk f fmeas x) ∂μ + ε / 2
s : Set α
hs : {x | (fun x => f x = AEMeasurable.mk f fmeas x) x}ᶜ ⊆ s
smeas : MeasurableSet s
μs : ↑↑μ s = 0
g1 : α → ℝ≥0∞
le_g1 : ∀ (x : α), Set.indicator s (fun _x => ⊤) x ≤ g1 x
g1_cont : LowerSemicontinuous g1
g1_int : ∫⁻ (x : α), g1 x ∂μ ≤ ∫⁻ (x : α), Set.indicator s (fun _x => ⊤) x ∂μ + ε / 2
⊢ 0 = ∫⁻ (x : α), Set.indicator s (fun _x => ⊤) x ∂μ
[PROOFSTEP]
simp only [smeas, μs, lintegral_const, Set.univ_inter, MeasurableSet.univ, lintegral_indicator, mul_zero,
  restrict_apply]
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fmeas : AEMeasurable f
ε : ℝ≥0∞
ε0 : ε ≠ 0
this : ε / 2 ≠ 0
g0 : α → ℝ≥0∞
f_lt_g0 : ∀ (x : α), ↑(AEMeasurable.mk f fmeas x) < g0 x
g0_cont : LowerSemicontinuous g0
g0_int : ∫⁻ (x : α), g0 x ∂μ ≤ ∫⁻ (x : α), ↑(AEMeasurable.mk f fmeas x) ∂μ + ε / 2
s : Set α
hs : {x | (fun x => f x = AEMeasurable.mk f fmeas x) x}ᶜ ⊆ s
smeas : MeasurableSet s
μs : ↑↑μ s = 0
g1 : α → ℝ≥0∞
le_g1 : ∀ (x : α), Set.indicator s (fun _x => ⊤) x ≤ g1 x
g1_cont : LowerSemicontinuous g1
g1_int : ∫⁻ (x : α), g1 x ∂μ ≤ ∫⁻ (x : α), Set.indicator s (fun _x => ⊤) x ∂μ + ε / 2
⊢ ∫⁻ (x : α), ↑(f x) ∂μ + ε / 2 + (0 + ε / 2) = ∫⁻ (x : α), ↑(f x) ∂μ + ε
[PROOFSTEP]
simp only [add_assoc, ENNReal.add_halves, zero_add]
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
ε : ℝ
εpos : 0 < ε
⊢ ∃ g,
    (∀ (x : α), ↑(f x) < g x) ∧
      LowerSemicontinuous g ∧
        (∀ᵐ (x : α) ∂μ, g x < ⊤) ∧
          (Integrable fun x => ENNReal.toReal (g x)) ∧ ∫ (x : α), ENNReal.toReal (g x) ∂μ < ∫ (x : α), ↑(f x) ∂μ + ε
[PROOFSTEP]
have fmeas : AEMeasurable f μ :=
  by
  convert fint.aestronglyMeasurable.real_toNNReal.aemeasurable
  simp only [Real.toNNReal_coe]
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
ε : ℝ
εpos : 0 < ε
⊢ AEMeasurable f
[PROOFSTEP]
convert fint.aestronglyMeasurable.real_toNNReal.aemeasurable
[GOAL]
case h.e'_5.h
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
ε : ℝ
εpos : 0 < ε
x✝ : α
⊢ f x✝ = Real.toNNReal ↑(f x✝)
[PROOFSTEP]
simp only [Real.toNNReal_coe]
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
ε : ℝ
εpos : 0 < ε
fmeas : AEMeasurable f
⊢ ∃ g,
    (∀ (x : α), ↑(f x) < g x) ∧
      LowerSemicontinuous g ∧
        (∀ᵐ (x : α) ∂μ, g x < ⊤) ∧
          (Integrable fun x => ENNReal.toReal (g x)) ∧ ∫ (x : α), ENNReal.toReal (g x) ∂μ < ∫ (x : α), ↑(f x) ∂μ + ε
[PROOFSTEP]
lift ε to ℝ≥0 using εpos.le
[GOAL]
case intro
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
fmeas : AEMeasurable f
ε : ℝ≥0
εpos : 0 < ↑ε
⊢ ∃ g,
    (∀ (x : α), ↑(f x) < g x) ∧
      LowerSemicontinuous g ∧
        (∀ᵐ (x : α) ∂μ, g x < ⊤) ∧
          (Integrable fun x => ENNReal.toReal (g x)) ∧ ∫ (x : α), ENNReal.toReal (g x) ∂μ < ∫ (x : α), ↑(f x) ∂μ + ↑ε
[PROOFSTEP]
obtain ⟨δ, δpos, hδε⟩ : ∃ δ : ℝ≥0, 0 < δ ∧ δ < ε
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
fmeas : AEMeasurable f
ε : ℝ≥0
εpos : 0 < ↑ε
⊢ ∃ δ, 0 < δ ∧ δ < ε
case intro.intro.intro
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
fmeas : AEMeasurable f
ε : ℝ≥0
εpos : 0 < ↑ε
δ : ℝ≥0
δpos : 0 < δ
hδε : δ < ε
⊢ ∃ g,
    (∀ (x : α), ↑(f x) < g x) ∧
      LowerSemicontinuous g ∧
        (∀ᵐ (x : α) ∂μ, g x < ⊤) ∧
          (Integrable fun x => ENNReal.toReal (g x)) ∧ ∫ (x : α), ENNReal.toReal (g x) ∂μ < ∫ (x : α), ↑(f x) ∂μ + ↑ε
[PROOFSTEP]
exact exists_between εpos
[GOAL]
case intro.intro.intro
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
fmeas : AEMeasurable f
ε : ℝ≥0
εpos : 0 < ↑ε
δ : ℝ≥0
δpos : 0 < δ
hδε : δ < ε
⊢ ∃ g,
    (∀ (x : α), ↑(f x) < g x) ∧
      LowerSemicontinuous g ∧
        (∀ᵐ (x : α) ∂μ, g x < ⊤) ∧
          (Integrable fun x => ENNReal.toReal (g x)) ∧ ∫ (x : α), ENNReal.toReal (g x) ∂μ < ∫ (x : α), ↑(f x) ∂μ + ↑ε
[PROOFSTEP]
have int_f_ne_top : (∫⁻ a : α, f a ∂μ) ≠ ∞ := (hasFiniteIntegral_iff_ofNNReal.1 fint.hasFiniteIntegral).ne
[GOAL]
case intro.intro.intro
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
fmeas : AEMeasurable f
ε : ℝ≥0
εpos : 0 < ↑ε
δ : ℝ≥0
δpos : 0 < δ
hδε : δ < ε
int_f_ne_top : ∫⁻ (a : α), ↑(f a) ∂μ ≠ ⊤
⊢ ∃ g,
    (∀ (x : α), ↑(f x) < g x) ∧
      LowerSemicontinuous g ∧
        (∀ᵐ (x : α) ∂μ, g x < ⊤) ∧
          (Integrable fun x => ENNReal.toReal (g x)) ∧ ∫ (x : α), ENNReal.toReal (g x) ∂μ < ∫ (x : α), ↑(f x) ∂μ + ↑ε
[PROOFSTEP]
rcases exists_lt_lowerSemicontinuous_lintegral_ge_of_aemeasurable μ f fmeas (ENNReal.coe_ne_zero.2 δpos.ne') with
  ⟨g, f_lt_g, gcont, gint⟩
[GOAL]
case intro.intro.intro.intro.intro.intro
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
fmeas : AEMeasurable f
ε : ℝ≥0
εpos : 0 < ↑ε
δ : ℝ≥0
δpos : 0 < δ
hδε : δ < ε
int_f_ne_top : ∫⁻ (a : α), ↑(f a) ∂μ ≠ ⊤
g : α → ℝ≥0∞
f_lt_g : ∀ (x : α), ↑(f x) < g x
gcont : LowerSemicontinuous g
gint : ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), ↑(f x) ∂μ + ↑δ
⊢ ∃ g,
    (∀ (x : α), ↑(f x) < g x) ∧
      LowerSemicontinuous g ∧
        (∀ᵐ (x : α) ∂μ, g x < ⊤) ∧
          (Integrable fun x => ENNReal.toReal (g x)) ∧ ∫ (x : α), ENNReal.toReal (g x) ∂μ < ∫ (x : α), ↑(f x) ∂μ + ↑ε
[PROOFSTEP]
have gint_ne : (∫⁻ x : α, g x ∂μ) ≠ ∞ := ne_top_of_le_ne_top (by simpa) gint
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
fmeas : AEMeasurable f
ε : ℝ≥0
εpos : 0 < ↑ε
δ : ℝ≥0
δpos : 0 < δ
hδε : δ < ε
int_f_ne_top : ∫⁻ (a : α), ↑(f a) ∂μ ≠ ⊤
g : α → ℝ≥0∞
f_lt_g : ∀ (x : α), ↑(f x) < g x
gcont : LowerSemicontinuous g
gint : ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), ↑(f x) ∂μ + ↑δ
⊢ ∫⁻ (x : α), ↑(f x) ∂μ + ↑δ ≠ ⊤
[PROOFSTEP]
simpa
[GOAL]
case intro.intro.intro.intro.intro.intro
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
fmeas : AEMeasurable f
ε : ℝ≥0
εpos : 0 < ↑ε
δ : ℝ≥0
δpos : 0 < δ
hδε : δ < ε
int_f_ne_top : ∫⁻ (a : α), ↑(f a) ∂μ ≠ ⊤
g : α → ℝ≥0∞
f_lt_g : ∀ (x : α), ↑(f x) < g x
gcont : LowerSemicontinuous g
gint : ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), ↑(f x) ∂μ + ↑δ
gint_ne : ∫⁻ (x : α), g x ∂μ ≠ ⊤
⊢ ∃ g,
    (∀ (x : α), ↑(f x) < g x) ∧
      LowerSemicontinuous g ∧
        (∀ᵐ (x : α) ∂μ, g x < ⊤) ∧
          (Integrable fun x => ENNReal.toReal (g x)) ∧ ∫ (x : α), ENNReal.toReal (g x) ∂μ < ∫ (x : α), ↑(f x) ∂μ + ↑ε
[PROOFSTEP]
have g_lt_top : ∀ᵐ x : α ∂μ, g x < ∞ := ae_lt_top gcont.measurable gint_ne
[GOAL]
case intro.intro.intro.intro.intro.intro
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
fmeas : AEMeasurable f
ε : ℝ≥0
εpos : 0 < ↑ε
δ : ℝ≥0
δpos : 0 < δ
hδε : δ < ε
int_f_ne_top : ∫⁻ (a : α), ↑(f a) ∂μ ≠ ⊤
g : α → ℝ≥0∞
f_lt_g : ∀ (x : α), ↑(f x) < g x
gcont : LowerSemicontinuous g
gint : ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), ↑(f x) ∂μ + ↑δ
gint_ne : ∫⁻ (x : α), g x ∂μ ≠ ⊤
g_lt_top : ∀ᵐ (x : α) ∂μ, g x < ⊤
⊢ ∃ g,
    (∀ (x : α), ↑(f x) < g x) ∧
      LowerSemicontinuous g ∧
        (∀ᵐ (x : α) ∂μ, g x < ⊤) ∧
          (Integrable fun x => ENNReal.toReal (g x)) ∧ ∫ (x : α), ENNReal.toReal (g x) ∂μ < ∫ (x : α), ↑(f x) ∂μ + ↑ε
[PROOFSTEP]
have Ig : (∫⁻ a : α, ENNReal.ofReal (g a).toReal ∂μ) = ∫⁻ a : α, g a ∂μ :=
  by
  apply lintegral_congr_ae
  filter_upwards [g_lt_top] with _ hx
  simp only [hx.ne, ENNReal.ofReal_toReal, Ne.def, not_false_iff]
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
fmeas : AEMeasurable f
ε : ℝ≥0
εpos : 0 < ↑ε
δ : ℝ≥0
δpos : 0 < δ
hδε : δ < ε
int_f_ne_top : ∫⁻ (a : α), ↑(f a) ∂μ ≠ ⊤
g : α → ℝ≥0∞
f_lt_g : ∀ (x : α), ↑(f x) < g x
gcont : LowerSemicontinuous g
gint : ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), ↑(f x) ∂μ + ↑δ
gint_ne : ∫⁻ (x : α), g x ∂μ ≠ ⊤
g_lt_top : ∀ᵐ (x : α) ∂μ, g x < ⊤
⊢ ∫⁻ (a : α), ENNReal.ofReal (ENNReal.toReal (g a)) ∂μ = ∫⁻ (a : α), g a ∂μ
[PROOFSTEP]
apply lintegral_congr_ae
[GOAL]
case h
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
fmeas : AEMeasurable f
ε : ℝ≥0
εpos : 0 < ↑ε
δ : ℝ≥0
δpos : 0 < δ
hδε : δ < ε
int_f_ne_top : ∫⁻ (a : α), ↑(f a) ∂μ ≠ ⊤
g : α → ℝ≥0∞
f_lt_g : ∀ (x : α), ↑(f x) < g x
gcont : LowerSemicontinuous g
gint : ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), ↑(f x) ∂μ + ↑δ
gint_ne : ∫⁻ (x : α), g x ∂μ ≠ ⊤
g_lt_top : ∀ᵐ (x : α) ∂μ, g x < ⊤
⊢ (fun a => ENNReal.ofReal (ENNReal.toReal (g a))) =ᶠ[ae μ] fun a => g a
[PROOFSTEP]
filter_upwards [g_lt_top] with _ hx
[GOAL]
case h
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
fmeas : AEMeasurable f
ε : ℝ≥0
εpos : 0 < ↑ε
δ : ℝ≥0
δpos : 0 < δ
hδε : δ < ε
int_f_ne_top : ∫⁻ (a : α), ↑(f a) ∂μ ≠ ⊤
g : α → ℝ≥0∞
f_lt_g : ∀ (x : α), ↑(f x) < g x
gcont : LowerSemicontinuous g
gint : ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), ↑(f x) ∂μ + ↑δ
gint_ne : ∫⁻ (x : α), g x ∂μ ≠ ⊤
g_lt_top : ∀ᵐ (x : α) ∂μ, g x < ⊤
a✝ : α
hx : g a✝ < ⊤
⊢ ENNReal.ofReal (ENNReal.toReal (g a✝)) = g a✝
[PROOFSTEP]
simp only [hx.ne, ENNReal.ofReal_toReal, Ne.def, not_false_iff]
[GOAL]
case intro.intro.intro.intro.intro.intro
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
fmeas : AEMeasurable f
ε : ℝ≥0
εpos : 0 < ↑ε
δ : ℝ≥0
δpos : 0 < δ
hδε : δ < ε
int_f_ne_top : ∫⁻ (a : α), ↑(f a) ∂μ ≠ ⊤
g : α → ℝ≥0∞
f_lt_g : ∀ (x : α), ↑(f x) < g x
gcont : LowerSemicontinuous g
gint : ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), ↑(f x) ∂μ + ↑δ
gint_ne : ∫⁻ (x : α), g x ∂μ ≠ ⊤
g_lt_top : ∀ᵐ (x : α) ∂μ, g x < ⊤
Ig : ∫⁻ (a : α), ENNReal.ofReal (ENNReal.toReal (g a)) ∂μ = ∫⁻ (a : α), g a ∂μ
⊢ ∃ g,
    (∀ (x : α), ↑(f x) < g x) ∧
      LowerSemicontinuous g ∧
        (∀ᵐ (x : α) ∂μ, g x < ⊤) ∧
          (Integrable fun x => ENNReal.toReal (g x)) ∧ ∫ (x : α), ENNReal.toReal (g x) ∂μ < ∫ (x : α), ↑(f x) ∂μ + ↑ε
[PROOFSTEP]
refine' ⟨g, f_lt_g, gcont, g_lt_top, _, _⟩
[GOAL]
case intro.intro.intro.intro.intro.intro.refine'_1
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
fmeas : AEMeasurable f
ε : ℝ≥0
εpos : 0 < ↑ε
δ : ℝ≥0
δpos : 0 < δ
hδε : δ < ε
int_f_ne_top : ∫⁻ (a : α), ↑(f a) ∂μ ≠ ⊤
g : α → ℝ≥0∞
f_lt_g : ∀ (x : α), ↑(f x) < g x
gcont : LowerSemicontinuous g
gint : ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), ↑(f x) ∂μ + ↑δ
gint_ne : ∫⁻ (x : α), g x ∂μ ≠ ⊤
g_lt_top : ∀ᵐ (x : α) ∂μ, g x < ⊤
Ig : ∫⁻ (a : α), ENNReal.ofReal (ENNReal.toReal (g a)) ∂μ = ∫⁻ (a : α), g a ∂μ
⊢ Integrable fun x => ENNReal.toReal (g x)
[PROOFSTEP]
refine' ⟨gcont.measurable.ennreal_toReal.aemeasurable.aestronglyMeasurable, _⟩
[GOAL]
case intro.intro.intro.intro.intro.intro.refine'_1
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
fmeas : AEMeasurable f
ε : ℝ≥0
εpos : 0 < ↑ε
δ : ℝ≥0
δpos : 0 < δ
hδε : δ < ε
int_f_ne_top : ∫⁻ (a : α), ↑(f a) ∂μ ≠ ⊤
g : α → ℝ≥0∞
f_lt_g : ∀ (x : α), ↑(f x) < g x
gcont : LowerSemicontinuous g
gint : ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), ↑(f x) ∂μ + ↑δ
gint_ne : ∫⁻ (x : α), g x ∂μ ≠ ⊤
g_lt_top : ∀ᵐ (x : α) ∂μ, g x < ⊤
Ig : ∫⁻ (a : α), ENNReal.ofReal (ENNReal.toReal (g a)) ∂μ = ∫⁻ (a : α), g a ∂μ
⊢ HasFiniteIntegral fun x => ENNReal.toReal (g x)
[PROOFSTEP]
simp only [hasFiniteIntegral_iff_norm, Real.norm_eq_abs, abs_of_nonneg ENNReal.toReal_nonneg]
[GOAL]
case intro.intro.intro.intro.intro.intro.refine'_1
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
fmeas : AEMeasurable f
ε : ℝ≥0
εpos : 0 < ↑ε
δ : ℝ≥0
δpos : 0 < δ
hδε : δ < ε
int_f_ne_top : ∫⁻ (a : α), ↑(f a) ∂μ ≠ ⊤
g : α → ℝ≥0∞
f_lt_g : ∀ (x : α), ↑(f x) < g x
gcont : LowerSemicontinuous g
gint : ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), ↑(f x) ∂μ + ↑δ
gint_ne : ∫⁻ (x : α), g x ∂μ ≠ ⊤
g_lt_top : ∀ᵐ (x : α) ∂μ, g x < ⊤
Ig : ∫⁻ (a : α), ENNReal.ofReal (ENNReal.toReal (g a)) ∂μ = ∫⁻ (a : α), g a ∂μ
⊢ ∫⁻ (a : α), ENNReal.ofReal (ENNReal.toReal (g a)) ∂μ < ⊤
[PROOFSTEP]
convert gint_ne.lt_top using 1
[GOAL]
case intro.intro.intro.intro.intro.intro.refine'_2
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
fmeas : AEMeasurable f
ε : ℝ≥0
εpos : 0 < ↑ε
δ : ℝ≥0
δpos : 0 < δ
hδε : δ < ε
int_f_ne_top : ∫⁻ (a : α), ↑(f a) ∂μ ≠ ⊤
g : α → ℝ≥0∞
f_lt_g : ∀ (x : α), ↑(f x) < g x
gcont : LowerSemicontinuous g
gint : ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), ↑(f x) ∂μ + ↑δ
gint_ne : ∫⁻ (x : α), g x ∂μ ≠ ⊤
g_lt_top : ∀ᵐ (x : α) ∂μ, g x < ⊤
Ig : ∫⁻ (a : α), ENNReal.ofReal (ENNReal.toReal (g a)) ∂μ = ∫⁻ (a : α), g a ∂μ
⊢ ∫ (x : α), ENNReal.toReal (g x) ∂μ < ∫ (x : α), ↑(f x) ∂μ + ↑ε
[PROOFSTEP]
rw [integral_eq_lintegral_of_nonneg_ae, integral_eq_lintegral_of_nonneg_ae]
[GOAL]
case intro.intro.intro.intro.intro.intro.refine'_2
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
fmeas : AEMeasurable f
ε : ℝ≥0
εpos : 0 < ↑ε
δ : ℝ≥0
δpos : 0 < δ
hδε : δ < ε
int_f_ne_top : ∫⁻ (a : α), ↑(f a) ∂μ ≠ ⊤
g : α → ℝ≥0∞
f_lt_g : ∀ (x : α), ↑(f x) < g x
gcont : LowerSemicontinuous g
gint : ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), ↑(f x) ∂μ + ↑δ
gint_ne : ∫⁻ (x : α), g x ∂μ ≠ ⊤
g_lt_top : ∀ᵐ (x : α) ∂μ, g x < ⊤
Ig : ∫⁻ (a : α), ENNReal.ofReal (ENNReal.toReal (g a)) ∂μ = ∫⁻ (a : α), g a ∂μ
⊢ ENNReal.toReal (∫⁻ (a : α), ENNReal.ofReal (ENNReal.toReal (g a)) ∂μ) <
    ENNReal.toReal (∫⁻ (a : α), ENNReal.ofReal ↑(f a) ∂μ) + ↑ε
[PROOFSTEP]
calc
  ENNReal.toReal (∫⁻ a : α, ENNReal.ofReal (g a).toReal ∂μ) = ENNReal.toReal (∫⁻ a : α, g a ∂μ) := by congr 1
  _ ≤ ENNReal.toReal ((∫⁻ a : α, f a ∂μ) + δ) :=
    by
    apply ENNReal.toReal_mono _ gint
    simpa using int_f_ne_top
  _ = ENNReal.toReal (∫⁻ a : α, f a ∂μ) + δ := by
    rw [ENNReal.toReal_add int_f_ne_top ENNReal.coe_ne_top, ENNReal.coe_toReal]
  _ < ENNReal.toReal (∫⁻ a : α, f a ∂μ) + ε := (add_lt_add_left hδε _)
  _ = (∫⁻ a : α, ENNReal.ofReal ↑(f a) ∂μ).toReal + ε := by simp
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
fmeas : AEMeasurable f
ε : ℝ≥0
εpos : 0 < ↑ε
δ : ℝ≥0
δpos : 0 < δ
hδε : δ < ε
int_f_ne_top : ∫⁻ (a : α), ↑(f a) ∂μ ≠ ⊤
g : α → ℝ≥0∞
f_lt_g : ∀ (x : α), ↑(f x) < g x
gcont : LowerSemicontinuous g
gint : ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), ↑(f x) ∂μ + ↑δ
gint_ne : ∫⁻ (x : α), g x ∂μ ≠ ⊤
g_lt_top : ∀ᵐ (x : α) ∂μ, g x < ⊤
Ig : ∫⁻ (a : α), ENNReal.ofReal (ENNReal.toReal (g a)) ∂μ = ∫⁻ (a : α), g a ∂μ
⊢ ENNReal.toReal (∫⁻ (a : α), ENNReal.ofReal (ENNReal.toReal (g a)) ∂μ) = ENNReal.toReal (∫⁻ (a : α), g a ∂μ)
[PROOFSTEP]
congr 1
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
fmeas : AEMeasurable f
ε : ℝ≥0
εpos : 0 < ↑ε
δ : ℝ≥0
δpos : 0 < δ
hδε : δ < ε
int_f_ne_top : ∫⁻ (a : α), ↑(f a) ∂μ ≠ ⊤
g : α → ℝ≥0∞
f_lt_g : ∀ (x : α), ↑(f x) < g x
gcont : LowerSemicontinuous g
gint : ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), ↑(f x) ∂μ + ↑δ
gint_ne : ∫⁻ (x : α), g x ∂μ ≠ ⊤
g_lt_top : ∀ᵐ (x : α) ∂μ, g x < ⊤
Ig : ∫⁻ (a : α), ENNReal.ofReal (ENNReal.toReal (g a)) ∂μ = ∫⁻ (a : α), g a ∂μ
⊢ ENNReal.toReal (∫⁻ (a : α), g a ∂μ) ≤ ENNReal.toReal (∫⁻ (a : α), ↑(f a) ∂μ + ↑δ)
[PROOFSTEP]
apply ENNReal.toReal_mono _ gint
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
fmeas : AEMeasurable f
ε : ℝ≥0
εpos : 0 < ↑ε
δ : ℝ≥0
δpos : 0 < δ
hδε : δ < ε
int_f_ne_top : ∫⁻ (a : α), ↑(f a) ∂μ ≠ ⊤
g : α → ℝ≥0∞
f_lt_g : ∀ (x : α), ↑(f x) < g x
gcont : LowerSemicontinuous g
gint : ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), ↑(f x) ∂μ + ↑δ
gint_ne : ∫⁻ (x : α), g x ∂μ ≠ ⊤
g_lt_top : ∀ᵐ (x : α) ∂μ, g x < ⊤
Ig : ∫⁻ (a : α), ENNReal.ofReal (ENNReal.toReal (g a)) ∂μ = ∫⁻ (a : α), g a ∂μ
⊢ ∫⁻ (x : α), ↑(f x) ∂μ + ↑δ ≠ ⊤
[PROOFSTEP]
simpa using int_f_ne_top
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
fmeas : AEMeasurable f
ε : ℝ≥0
εpos : 0 < ↑ε
δ : ℝ≥0
δpos : 0 < δ
hδε : δ < ε
int_f_ne_top : ∫⁻ (a : α), ↑(f a) ∂μ ≠ ⊤
g : α → ℝ≥0∞
f_lt_g : ∀ (x : α), ↑(f x) < g x
gcont : LowerSemicontinuous g
gint : ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), ↑(f x) ∂μ + ↑δ
gint_ne : ∫⁻ (x : α), g x ∂μ ≠ ⊤
g_lt_top : ∀ᵐ (x : α) ∂μ, g x < ⊤
Ig : ∫⁻ (a : α), ENNReal.ofReal (ENNReal.toReal (g a)) ∂μ = ∫⁻ (a : α), g a ∂μ
⊢ ENNReal.toReal (∫⁻ (a : α), ↑(f a) ∂μ + ↑δ) = ENNReal.toReal (∫⁻ (a : α), ↑(f a) ∂μ) + ↑δ
[PROOFSTEP]
rw [ENNReal.toReal_add int_f_ne_top ENNReal.coe_ne_top, ENNReal.coe_toReal]
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
fmeas : AEMeasurable f
ε : ℝ≥0
εpos : 0 < ↑ε
δ : ℝ≥0
δpos : 0 < δ
hδε : δ < ε
int_f_ne_top : ∫⁻ (a : α), ↑(f a) ∂μ ≠ ⊤
g : α → ℝ≥0∞
f_lt_g : ∀ (x : α), ↑(f x) < g x
gcont : LowerSemicontinuous g
gint : ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), ↑(f x) ∂μ + ↑δ
gint_ne : ∫⁻ (x : α), g x ∂μ ≠ ⊤
g_lt_top : ∀ᵐ (x : α) ∂μ, g x < ⊤
Ig : ∫⁻ (a : α), ENNReal.ofReal (ENNReal.toReal (g a)) ∂μ = ∫⁻ (a : α), g a ∂μ
⊢ ENNReal.toReal (∫⁻ (a : α), ↑(f a) ∂μ) + ↑ε = ENNReal.toReal (∫⁻ (a : α), ENNReal.ofReal ↑(f a) ∂μ) + ↑ε
[PROOFSTEP]
simp
[GOAL]
case intro.intro.intro.intro.intro.intro.refine'_2.hf
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
fmeas : AEMeasurable f
ε : ℝ≥0
εpos : 0 < ↑ε
δ : ℝ≥0
δpos : 0 < δ
hδε : δ < ε
int_f_ne_top : ∫⁻ (a : α), ↑(f a) ∂μ ≠ ⊤
g : α → ℝ≥0∞
f_lt_g : ∀ (x : α), ↑(f x) < g x
gcont : LowerSemicontinuous g
gint : ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), ↑(f x) ∂μ + ↑δ
gint_ne : ∫⁻ (x : α), g x ∂μ ≠ ⊤
g_lt_top : ∀ᵐ (x : α) ∂μ, g x < ⊤
Ig : ∫⁻ (a : α), ENNReal.ofReal (ENNReal.toReal (g a)) ∂μ = ∫⁻ (a : α), g a ∂μ
⊢ 0 ≤ᶠ[ae μ] fun x => ↑(f x)
[PROOFSTEP]
apply Filter.eventually_of_forall fun x => _
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
fmeas : AEMeasurable f
ε : ℝ≥0
εpos : 0 < ↑ε
δ : ℝ≥0
δpos : 0 < δ
hδε : δ < ε
int_f_ne_top : ∫⁻ (a : α), ↑(f a) ∂μ ≠ ⊤
g : α → ℝ≥0∞
f_lt_g : ∀ (x : α), ↑(f x) < g x
gcont : LowerSemicontinuous g
gint : ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), ↑(f x) ∂μ + ↑δ
gint_ne : ∫⁻ (x : α), g x ∂μ ≠ ⊤
g_lt_top : ∀ᵐ (x : α) ∂μ, g x < ⊤
Ig : ∫⁻ (a : α), ENNReal.ofReal (ENNReal.toReal (g a)) ∂μ = ∫⁻ (a : α), g a ∂μ
⊢ ∀ (x : α), OfNat.ofNat 0 x ≤ (fun x => ↑(f x)) x
[PROOFSTEP]
simp
[GOAL]
case intro.intro.intro.intro.intro.intro.refine'_2.hfm
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
fmeas : AEMeasurable f
ε : ℝ≥0
εpos : 0 < ↑ε
δ : ℝ≥0
δpos : 0 < δ
hδε : δ < ε
int_f_ne_top : ∫⁻ (a : α), ↑(f a) ∂μ ≠ ⊤
g : α → ℝ≥0∞
f_lt_g : ∀ (x : α), ↑(f x) < g x
gcont : LowerSemicontinuous g
gint : ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), ↑(f x) ∂μ + ↑δ
gint_ne : ∫⁻ (x : α), g x ∂μ ≠ ⊤
g_lt_top : ∀ᵐ (x : α) ∂μ, g x < ⊤
Ig : ∫⁻ (a : α), ENNReal.ofReal (ENNReal.toReal (g a)) ∂μ = ∫⁻ (a : α), g a ∂μ
⊢ AEStronglyMeasurable (fun x => ↑(f x)) μ
[PROOFSTEP]
exact fmeas.coe_nnreal_real.aestronglyMeasurable
[GOAL]
case intro.intro.intro.intro.intro.intro.refine'_2.hf
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
fmeas : AEMeasurable f
ε : ℝ≥0
εpos : 0 < ↑ε
δ : ℝ≥0
δpos : 0 < δ
hδε : δ < ε
int_f_ne_top : ∫⁻ (a : α), ↑(f a) ∂μ ≠ ⊤
g : α → ℝ≥0∞
f_lt_g : ∀ (x : α), ↑(f x) < g x
gcont : LowerSemicontinuous g
gint : ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), ↑(f x) ∂μ + ↑δ
gint_ne : ∫⁻ (x : α), g x ∂μ ≠ ⊤
g_lt_top : ∀ᵐ (x : α) ∂μ, g x < ⊤
Ig : ∫⁻ (a : α), ENNReal.ofReal (ENNReal.toReal (g a)) ∂μ = ∫⁻ (a : α), g a ∂μ
⊢ 0 ≤ᶠ[ae μ] fun x => ENNReal.toReal (g x)
[PROOFSTEP]
apply Filter.eventually_of_forall fun x => _
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
fmeas : AEMeasurable f
ε : ℝ≥0
εpos : 0 < ↑ε
δ : ℝ≥0
δpos : 0 < δ
hδε : δ < ε
int_f_ne_top : ∫⁻ (a : α), ↑(f a) ∂μ ≠ ⊤
g : α → ℝ≥0∞
f_lt_g : ∀ (x : α), ↑(f x) < g x
gcont : LowerSemicontinuous g
gint : ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), ↑(f x) ∂μ + ↑δ
gint_ne : ∫⁻ (x : α), g x ∂μ ≠ ⊤
g_lt_top : ∀ᵐ (x : α) ∂μ, g x < ⊤
Ig : ∫⁻ (a : α), ENNReal.ofReal (ENNReal.toReal (g a)) ∂μ = ∫⁻ (a : α), g a ∂μ
⊢ ∀ (x : α), OfNat.ofNat 0 x ≤ (fun x => ENNReal.toReal (g x)) x
[PROOFSTEP]
simp
[GOAL]
case intro.intro.intro.intro.intro.intro.refine'_2.hfm
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
fmeas : AEMeasurable f
ε : ℝ≥0
εpos : 0 < ↑ε
δ : ℝ≥0
δpos : 0 < δ
hδε : δ < ε
int_f_ne_top : ∫⁻ (a : α), ↑(f a) ∂μ ≠ ⊤
g : α → ℝ≥0∞
f_lt_g : ∀ (x : α), ↑(f x) < g x
gcont : LowerSemicontinuous g
gint : ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), ↑(f x) ∂μ + ↑δ
gint_ne : ∫⁻ (x : α), g x ∂μ ≠ ⊤
g_lt_top : ∀ᵐ (x : α) ∂μ, g x < ⊤
Ig : ∫⁻ (a : α), ENNReal.ofReal (ENNReal.toReal (g a)) ∂μ = ∫⁻ (a : α), g a ∂μ
⊢ AEStronglyMeasurable (fun x => ENNReal.toReal (g x)) μ
[PROOFSTEP]
apply gcont.measurable.ennreal_toReal.aemeasurable.aestronglyMeasurable
[GOAL]
α : 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) ∂μ + ε
[PROOFSTEP]
induction' f using MeasureTheory.SimpleFunc.induction with c s hs f₁ f₂ _ h₁ h₂ generalizing ε
[GOAL]
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) ∂μ + ε
[PROOFSTEP]
by_cases hc : c = 0
[GOAL]
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) ∂μ + ε
[PROOFSTEP]
refine' ⟨fun _ => 0, _, upperSemicontinuous_const, _⟩
[GOAL]
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
[PROOFSTEP]
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]
[GOAL]
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
[PROOFSTEP]
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]
[GOAL]
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) ∂μ + ε
[PROOFSTEP]
classical simp only [hc, Set.indicator_zero', lintegral_const, 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]
[GOAL]
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) ∂μ + ε
[PROOFSTEP]
simp only [hc, Set.indicator_zero', lintegral_const, 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]
[GOAL]
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) ∂μ + ε
[PROOFSTEP]
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
[GOAL]
α : 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 < ⊤
[PROOFSTEP]
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
[GOAL]
α : 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 < ⊤
[PROOFSTEP]
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
[GOAL]
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) ∂μ + ε
[PROOFSTEP]
have : (0 : ℝ≥0∞) < ε / c := ENNReal.div_pos_iff.2 ⟨ε0, ENNReal.coe_ne_top⟩
[GOAL]
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) ∂μ + ε
[PROOFSTEP]
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'
[GOAL]
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) ∂μ + ε
[PROOFSTEP]
refine' ⟨Set.indicator F fun _ => c, fun x => _, F_closed.upperSemicontinuous_indicator (zero_le _), _⟩
[GOAL]
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
[PROOFSTEP]
simp only [SimpleFunc.coe_const, SimpleFunc.const_zero, SimpleFunc.coe_zero, Set.piecewise_eq_indicator,
  SimpleFunc.coe_piecewise]
[GOAL]
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
[PROOFSTEP]
exact Set.indicator_le_indicator_of_subset Fs (fun x => zero_le _) _
[GOAL]
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) ∂μ + ε
[PROOFSTEP]
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]
[GOAL]
α : 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) ∂μ + ε
[PROOFSTEP]
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]
[GOAL]
α : 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) ∂μ + ε
[PROOFSTEP]
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]
[GOAL]
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 + ε
[PROOFSTEP]
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
[GOAL]
α : 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 + ε
[PROOFSTEP]
simp_rw [mul_add]
[GOAL]
α : 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 + ε
[PROOFSTEP]
rw [ENNReal.mul_div_cancel' _ ENNReal.coe_ne_top]
[GOAL]
α : 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
[PROOFSTEP]
simpa using hc
[GOAL]
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) ∂μ + ε
[PROOFSTEP]
have A : ((∫⁻ x : α, f₁ x ∂μ) + ∫⁻ x : α, f₂ x ∂μ) ≠ ⊤ := by rwa [← lintegral_add_left f₁.measurable.coe_nnreal_ennreal]
[GOAL]
α : 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) ∂μ ≠ ⊤
[PROOFSTEP]
rwa [← lintegral_add_left f₁.measurable.coe_nnreal_ennreal]
[GOAL]
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) ∂μ + ε
[PROOFSTEP]
rcases h₁ (ENNReal.add_ne_top.1 A).1 (ENNReal.half_pos ε0).ne' with ⟨g₁, f₁_le_g₁, g₁cont, g₁int⟩
[GOAL]
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) ∂μ + ε
[PROOFSTEP]
rcases h₂ (ENNReal.add_ne_top.1 A).2 (ENNReal.half_pos ε0).ne' with ⟨g₂, f₂_le_g₂, g₂cont, g₂int⟩
[GOAL]
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) ∂μ + ε
[PROOFSTEP]
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, _⟩
[GOAL]
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) ∂μ + ε
[PROOFSTEP]
simp only [SimpleFunc.coe_add, ENNReal.coe_add, Pi.add_apply]
[GOAL]
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) ∂μ + ε
[PROOFSTEP]
rw [lintegral_add_left f₁.measurable.coe_nnreal_ennreal, lintegral_add_left g₁cont.measurable.coe_nnreal_ennreal]
[GOAL]
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) ∂μ + ε
[PROOFSTEP]
convert add_le_add g₁int g₂int using 1
[GOAL]
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)
[PROOFSTEP]
conv_lhs => rw [← ENNReal.add_halves ε]
[GOAL]
α : 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) ∂μ + ε
[PROOFSTEP]
rw [← ENNReal.add_halves ε]
[GOAL]
α : 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) ∂μ + ε
[PROOFSTEP]
rw [← ENNReal.add_halves ε]
[GOAL]
α : 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) ∂μ + ε
[PROOFSTEP]
rw [← ENNReal.add_halves ε]
[GOAL]
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)
[PROOFSTEP]
abel
[GOAL]
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)
[PROOFSTEP]
abel
[GOAL]
α : 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) ∂μ + ε
[PROOFSTEP]
obtain ⟨fs, fs_le_f, int_fs⟩ : ∃ fs : α →ₛ ℝ≥0, (∀ x, fs x ≤ f x) ∧ (∫⁻ x, f x ∂μ) ≤ (∫⁻ x, fs x ∂μ) + ε / 2 := by
  -- Porting note: need to name identifier (not `this`), because `conv_rhs at this` errors
  have aux := ENNReal.lt_add_right int_f (ENNReal.half_pos ε0).ne'
  conv_rhs at aux => rw [lintegral_eq_nnreal (fun x => (f x : ℝ≥0∞)) μ]
  erw [ENNReal.biSup_add] at aux  <;> [skip; exact ⟨0, fun x => by simp⟩]
  simp only [lt_iSup_iff] at aux
  rcases aux with ⟨fs, fs_le_f, int_fs⟩
  refine' ⟨fs, fun x => by simpa only [ENNReal.coe_le_coe] using fs_le_f x, _⟩
  convert int_fs.le
  rw [← SimpleFunc.lintegral_eq_lintegral]
  rfl
[GOAL]
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
int_f : ∫⁻ (x : α), ↑(f x) ∂μ ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
⊢ ∃ fs, (∀ (x : α), ↑fs x ≤ f x) ∧ ∫⁻ (x : α), ↑(f x) ∂μ ≤ ∫⁻ (x : α), ↑(↑fs x) ∂μ + ε / 2
[PROOFSTEP]
have aux := ENNReal.lt_add_right int_f (ENNReal.half_pos ε0).ne'
[GOAL]
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
int_f : ∫⁻ (x : α), ↑(f x) ∂μ ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
aux : ∫⁻ (x : α), ↑(f x) ∂μ < ∫⁻ (x : α), ↑(f x) ∂μ + ε / 2
⊢ ∃ fs, (∀ (x : α), ↑fs x ≤ f x) ∧ ∫⁻ (x : α), ↑(f x) ∂μ ≤ ∫⁻ (x : α), ↑(↑fs x) ∂μ + ε / 2
[PROOFSTEP]
conv_rhs at aux => rw [lintegral_eq_nnreal (fun x => (f x : ℝ≥0∞)) μ]
[GOAL]
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
int_f : ∫⁻ (x : α), ↑(f x) ∂μ ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
aux : ∫⁻ (x : α), ↑(f x) ∂μ < ∫⁻ (x : α), ↑(f x) ∂μ + ε / 2
| ∫⁻ (x : α), ↑(f x) ∂μ + ε / 2
[PROOFSTEP]
rw [lintegral_eq_nnreal (fun x => (f x : ℝ≥0∞)) μ]
[GOAL]
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
int_f : ∫⁻ (x : α), ↑(f x) ∂μ ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
aux : ∫⁻ (x : α), ↑(f x) ∂μ < ∫⁻ (x : α), ↑(f x) ∂μ + ε / 2
| ∫⁻ (x : α), ↑(f x) ∂μ + ε / 2
[PROOFSTEP]
rw [lintegral_eq_nnreal (fun x => (f x : ℝ≥0∞)) μ]
[GOAL]
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
int_f : ∫⁻ (x : α), ↑(f x) ∂μ ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
aux : ∫⁻ (x : α), ↑(f x) ∂μ < ∫⁻ (x : α), ↑(f x) ∂μ + ε / 2
| ∫⁻ (x : α), ↑(f x) ∂μ + ε / 2
[PROOFSTEP]
rw [lintegral_eq_nnreal (fun x => (f x : ℝ≥0∞)) μ]
[GOAL]
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
int_f : ∫⁻ (x : α), ↑(f x) ∂μ ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
aux :
  ∫⁻ (x : α), ↑(f x) ∂μ <
    (⨆ (φ : α →ₛ ℝ≥0) (_ : ∀ (x : α), ↑(↑φ x) ≤ ↑(f x)), SimpleFunc.lintegral (SimpleFunc.map ENNReal.some φ) μ) + ε / 2
⊢ ∃ fs, (∀ (x : α), ↑fs x ≤ f x) ∧ ∫⁻ (x : α), ↑(f x) ∂μ ≤ ∫⁻ (x : α), ↑(↑fs x) ∂μ + ε / 2
[PROOFSTEP]
erw [ENNReal.biSup_add] at aux  <;> [skip; exact ⟨0, fun x => by simp⟩]
[GOAL]
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
int_f : ∫⁻ (x : α), ↑(f x) ∂μ ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
aux :
  ∫⁻ (x : α), ↑(f x) ∂μ <
    (⨆ (φ : α →ₛ ℝ≥0) (_ : ∀ (x : α), ↑(↑φ x) ≤ ↑(f x)), SimpleFunc.lintegral (SimpleFunc.map ENNReal.some φ) μ) + ε / 2
⊢ ∃ fs, (∀ (x : α), ↑fs x ≤ f x) ∧ ∫⁻ (x : α), ↑(f x) ∂μ ≤ ∫⁻ (x : α), ↑(↑fs x) ∂μ + ε / 2
[PROOFSTEP]
erw [ENNReal.biSup_add] at aux
[GOAL]
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
int_f : ∫⁻ (x : α), ↑(f x) ∂μ ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
aux :
  ∫⁻ (x : α), ↑(f x) ∂μ <
    ⨆ (i : α →ₛ ℝ≥0) (_ : i ∈ fun φ => ∀ (x : α), ↑(↑φ x) ≤ ↑(f x)),
      SimpleFunc.lintegral (SimpleFunc.map ENNReal.some i) μ + ε / 2
⊢ ∃ fs, (∀ (x : α), ↑fs x ≤ f x) ∧ ∫⁻ (x : α), ↑(f x) ∂μ ≤ ∫⁻ (x : α), ↑(↑fs x) ∂μ + ε / 2
[PROOFSTEP]
skip
[GOAL]
case hs
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
int_f : ∫⁻ (x : α), ↑(f x) ∂μ ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
aux :
  ∫⁻ (x : α), ↑(f x) ∂μ <
    (⨆ (φ : α →ₛ ℝ≥0) (_ : ∀ (x : α), ↑(↑φ x) ≤ ↑(f x)), SimpleFunc.lintegral (SimpleFunc.map ENNReal.some φ) μ) + ε / 2
⊢ Set.Nonempty fun φ => ∀ (x : α), ↑(↑φ x) ≤ ↑(f x)
[PROOFSTEP]
exact ⟨0, fun x => by simp⟩
[GOAL]
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
int_f : ∫⁻ (x : α), ↑(f x) ∂μ ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
aux :
  ∫⁻ (x : α), ↑(f x) ∂μ <
    (⨆ (φ : α →ₛ ℝ≥0) (_ : ∀ (x : α), ↑(↑φ x) ≤ ↑(f x)), SimpleFunc.lintegral (SimpleFunc.map ENNReal.some φ) μ) + ε / 2
x : α
⊢ ↑(↑0 x) ≤ ↑(f x)
[PROOFSTEP]
simp
[GOAL]
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
int_f : ∫⁻ (x : α), ↑(f x) ∂μ ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
aux :
  ∫⁻ (x : α), ↑(f x) ∂μ <
    ⨆ (i : α →ₛ ℝ≥0) (_ : i ∈ fun φ => ∀ (x : α), ↑(↑φ x) ≤ ↑(f x)),
      SimpleFunc.lintegral (SimpleFunc.map ENNReal.some i) μ + ε / 2
⊢ ∃ fs, (∀ (x : α), ↑fs x ≤ f x) ∧ ∫⁻ (x : α), ↑(f x) ∂μ ≤ ∫⁻ (x : α), ↑(↑fs x) ∂μ + ε / 2
[PROOFSTEP]
simp only [lt_iSup_iff] at aux
[GOAL]
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
int_f : ∫⁻ (x : α), ↑(f x) ∂μ ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
aux : ∃ i i_1, ∫⁻ (x : α), ↑(f x) ∂μ < SimpleFunc.lintegral (SimpleFunc.map ENNReal.some i) μ + ε / 2
⊢ ∃ fs, (∀ (x : α), ↑fs x ≤ f x) ∧ ∫⁻ (x : α), ↑(f x) ∂μ ≤ ∫⁻ (x : α), ↑(↑fs x) ∂μ + ε / 2
[PROOFSTEP]
rcases aux with ⟨fs, fs_le_f, int_fs⟩
[GOAL]
case intro.intro
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
int_f : ∫⁻ (x : α), ↑(f x) ∂μ ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
fs : α →ₛ ℝ≥0
fs_le_f : fs ∈ fun φ => ∀ (x : α), ↑(↑φ x) ≤ ↑(f x)
int_fs : ∫⁻ (x : α), ↑(f x) ∂μ < SimpleFunc.lintegral (SimpleFunc.map ENNReal.some fs) μ + ε / 2
⊢ ∃ fs, (∀ (x : α), ↑fs x ≤ f x) ∧ ∫⁻ (x : α), ↑(f x) ∂μ ≤ ∫⁻ (x : α), ↑(↑fs x) ∂μ + ε / 2
[PROOFSTEP]
refine' ⟨fs, fun x => by simpa only [ENNReal.coe_le_coe] using fs_le_f x, _⟩
[GOAL]
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
int_f : ∫⁻ (x : α), ↑(f x) ∂μ ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
fs : α →ₛ ℝ≥0
fs_le_f : fs ∈ fun φ => ∀ (x : α), ↑(↑φ x) ≤ ↑(f x)
int_fs : ∫⁻ (x : α), ↑(f x) ∂μ < SimpleFunc.lintegral (SimpleFunc.map ENNReal.some fs) μ + ε / 2
x : α
⊢ ↑fs x ≤ f x
[PROOFSTEP]
simpa only [ENNReal.coe_le_coe] using fs_le_f x
[GOAL]
case intro.intro
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
int_f : ∫⁻ (x : α), ↑(f x) ∂μ ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
fs : α →ₛ ℝ≥0
fs_le_f : fs ∈ fun φ => ∀ (x : α), ↑(↑φ x) ≤ ↑(f x)
int_fs : ∫⁻ (x : α), ↑(f x) ∂μ < SimpleFunc.lintegral (SimpleFunc.map ENNReal.some fs) μ + ε / 2
⊢ ∫⁻ (x : α), ↑(f x) ∂μ ≤ ∫⁻ (x : α), ↑(↑fs x) ∂μ + ε / 2
[PROOFSTEP]
convert int_fs.le
[GOAL]
case h.e'_4.h.e'_5
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
int_f : ∫⁻ (x : α), ↑(f x) ∂μ ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
fs : α →ₛ ℝ≥0
fs_le_f : fs ∈ fun φ => ∀ (x : α), ↑(↑φ x) ≤ ↑(f x)
int_fs : ∫⁻ (x : α), ↑(f x) ∂μ < SimpleFunc.lintegral (SimpleFunc.map ENNReal.some fs) μ + ε / 2
⊢ ∫⁻ (x : α), ↑(↑fs x) ∂μ = SimpleFunc.lintegral (SimpleFunc.map ENNReal.some fs) μ
[PROOFSTEP]
rw [← SimpleFunc.lintegral_eq_lintegral]
[GOAL]
case h.e'_4.h.e'_5
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
int_f : ∫⁻ (x : α), ↑(f x) ∂μ ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
fs : α →ₛ ℝ≥0
fs_le_f : fs ∈ fun φ => ∀ (x : α), ↑(↑φ x) ≤ ↑(f x)
int_fs : ∫⁻ (x : α), ↑(f x) ∂μ < SimpleFunc.lintegral (SimpleFunc.map ENNReal.some fs) μ + ε / 2
⊢ ∫⁻ (x : α), ↑(↑fs x) ∂μ = ∫⁻ (a : α), ↑(SimpleFunc.map ENNReal.some fs) a ∂μ
[PROOFSTEP]
rfl
[GOAL]
case intro.intro
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
int_f : ∫⁻ (x : α), ↑(f x) ∂μ ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
fs : α →ₛ ℝ≥0
fs_le_f : ∀ (x : α), ↑fs x ≤ f x
int_fs : ∫⁻ (x : α), ↑(f x) ∂μ ≤ ∫⁻ (x : α), ↑(↑fs x) ∂μ + ε / 2
⊢ ∃ g, (∀ (x : α), g x ≤ f x) ∧ UpperSemicontinuous g ∧ ∫⁻ (x : α), ↑(f x) ∂μ ≤ ∫⁻ (x : α), ↑(g x) ∂μ + ε
[PROOFSTEP]
have int_fs_lt_top : (∫⁻ x, fs x ∂μ) ≠ ∞ :=
  by
  refine' ne_top_of_le_ne_top int_f (lintegral_mono fun x => _)
  simpa only [ENNReal.coe_le_coe] using fs_le_f x
[GOAL]
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
int_f : ∫⁻ (x : α), ↑(f x) ∂μ ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
fs : α →ₛ ℝ≥0
fs_le_f : ∀ (x : α), ↑fs x ≤ f x
int_fs : ∫⁻ (x : α), ↑(f x) ∂μ ≤ ∫⁻ (x : α), ↑(↑fs x) ∂μ + ε / 2
⊢ ∫⁻ (x : α), ↑(↑fs x) ∂μ ≠ ⊤
[PROOFSTEP]
refine' ne_top_of_le_ne_top int_f (lintegral_mono fun x => _)
[GOAL]
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
int_f : ∫⁻ (x : α), ↑(f x) ∂μ ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
fs : α →ₛ ℝ≥0
fs_le_f : ∀ (x : α), ↑fs x ≤ f x
int_fs : ∫⁻ (x : α), ↑(f x) ∂μ ≤ ∫⁻ (x : α), ↑(↑fs x) ∂μ + ε / 2
x : α
⊢ ↑(↑fs x) ≤ ↑(f x)
[PROOFSTEP]
simpa only [ENNReal.coe_le_coe] using fs_le_f x
[GOAL]
case intro.intro
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
int_f : ∫⁻ (x : α), ↑(f x) ∂μ ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
fs : α →ₛ ℝ≥0
fs_le_f : ∀ (x : α), ↑fs x ≤ f x
int_fs : ∫⁻ (x : α), ↑(f x) ∂μ ≤ ∫⁻ (x : α), ↑(↑fs x) ∂μ + ε / 2
int_fs_lt_top : ∫⁻ (x : α), ↑(↑fs x) ∂μ ≠ ⊤
⊢ ∃ g, (∀ (x : α), g x ≤ f x) ∧ UpperSemicontinuous g ∧ ∫⁻ (x : α), ↑(f x) ∂μ ≤ ∫⁻ (x : α), ↑(g x) ∂μ + ε
[PROOFSTEP]
obtain ⟨g, g_le_fs, gcont, gint⟩ :
  ∃ g : α → ℝ≥0, (∀ x, g x ≤ fs x) ∧ UpperSemicontinuous g ∧ (∫⁻ x, fs x ∂μ) ≤ (∫⁻ x, g x ∂μ) + ε / 2 :=
  fs.exists_upperSemicontinuous_le_lintegral_le int_fs_lt_top (ENNReal.half_pos ε0).ne'
[GOAL]
case 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
fs : α →ₛ ℝ≥0
fs_le_f : ∀ (x : α), ↑fs x ≤ f x
int_fs : ∫⁻ (x : α), ↑(f x) ∂μ ≤ ∫⁻ (x : α), ↑(↑fs x) ∂μ + ε / 2
int_fs_lt_top : ∫⁻ (x : α), ↑(↑fs x) ∂μ ≠ ⊤
g : α → ℝ≥0
g_le_fs : ∀ (x : α), g x ≤ ↑fs x
gcont : UpperSemicontinuous g
gint : ∫⁻ (x : α), ↑(↑fs x) ∂μ ≤ ∫⁻ (x : α), ↑(g x) ∂μ + ε / 2
⊢ ∃ g, (∀ (x : α), g x ≤ f x) ∧ UpperSemicontinuous g ∧ ∫⁻ (x : α), ↑(f x) ∂μ ≤ ∫⁻ (x : α), ↑(g x) ∂μ + ε
[PROOFSTEP]
refine' ⟨g, fun x => (g_le_fs x).trans (fs_le_f x), gcont, _⟩
[GOAL]
case 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
fs : α →ₛ ℝ≥0
fs_le_f : ∀ (x : α), ↑fs x ≤ f x
int_fs : ∫⁻ (x : α), ↑(f x) ∂μ ≤ ∫⁻ (x : α), ↑(↑fs x) ∂μ + ε / 2
int_fs_lt_top : ∫⁻ (x : α), ↑(↑fs x) ∂μ ≠ ⊤
g : α → ℝ≥0
g_le_fs : ∀ (x : α), g x ≤ ↑fs x
gcont : UpperSemicontinuous g
gint : ∫⁻ (x : α), ↑(↑fs x) ∂μ ≤ ∫⁻ (x : α), ↑(g x) ∂μ + ε / 2
⊢ ∫⁻ (x : α), ↑(f x) ∂μ ≤ ∫⁻ (x : α), ↑(g x) ∂μ + ε
[PROOFSTEP]
calc
  (∫⁻ x, f x ∂μ) ≤ (∫⁻ x, fs x ∂μ) + ε / 2 := int_fs
  _ ≤ (∫⁻ x, g x ∂μ) + ε / 2 + ε / 2 := (add_le_add gint le_rfl)
  _ = (∫⁻ x, g x ∂μ) + ε := by rw [add_assoc, ENNReal.add_halves]
[GOAL]
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
int_f : ∫⁻ (x : α), ↑(f x) ∂μ ≠ ⊤
ε : ℝ≥0∞
ε0 : ε ≠ 0
fs : α →ₛ ℝ≥0
fs_le_f : ∀ (x : α), ↑fs x ≤ f x
int_fs : ∫⁻ (x : α), ↑(f x) ∂μ ≤ ∫⁻ (x : α), ↑(↑fs x) ∂μ + ε / 2
int_fs_lt_top : ∫⁻ (x : α), ↑(↑fs x) ∂μ ≠ ⊤
g : α → ℝ≥0
g_le_fs : ∀ (x : α), g x ≤ ↑fs x
gcont : UpperSemicontinuous g
gint : ∫⁻ (x : α), ↑(↑fs x) ∂μ ≤ ∫⁻ (x : α), ↑(g x) ∂μ + ε / 2
⊢ ∫⁻ (x : α), ↑(g x) ∂μ + ε / 2 + ε / 2 = ∫⁻ (x : α), ↑(g x) ∂μ + ε
[PROOFSTEP]
rw [add_assoc, ENNReal.add_halves]
[GOAL]
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
ε : ℝ
εpos : 0 < ε
⊢ ∃ g,
    (∀ (x : α), g x ≤ f x) ∧
      UpperSemicontinuous g ∧ (Integrable fun x => ↑(g x)) ∧ ∫ (x : α), ↑(f x) ∂μ - ε ≤ ∫ (x : α), ↑(g x) ∂μ
[PROOFSTEP]
lift ε to ℝ≥0 using εpos.le
[GOAL]
case intro
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
ε : ℝ≥0
εpos : 0 < ↑ε
⊢ ∃ g,
    (∀ (x : α), g x ≤ f x) ∧
      UpperSemicontinuous g ∧ (Integrable fun x => ↑(g x)) ∧ ∫ (x : α), ↑(f x) ∂μ - ↑ε ≤ ∫ (x : α), ↑(g x) ∂μ
[PROOFSTEP]
rw [NNReal.coe_pos, ← ENNReal.coe_pos] at εpos
[GOAL]
case intro
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
ε : ℝ≥0
εpos : 0 < ↑ε
⊢ ∃ g,
    (∀ (x : α), g x ≤ f x) ∧
      UpperSemicontinuous g ∧ (Integrable fun x => ↑(g x)) ∧ ∫ (x : α), ↑(f x) ∂μ - ↑ε ≤ ∫ (x : α), ↑(g x) ∂μ
[PROOFSTEP]
have If : (∫⁻ x, f x ∂μ) < ∞ := hasFiniteIntegral_iff_ofNNReal.1 fint.hasFiniteIntegral
[GOAL]
case intro
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
ε : ℝ≥0
εpos : 0 < ↑ε
If : ∫⁻ (x : α), ↑(f x) ∂μ < ⊤
⊢ ∃ g,
    (∀ (x : α), g x ≤ f x) ∧
      UpperSemicontinuous g ∧ (Integrable fun x => ↑(g x)) ∧ ∫ (x : α), ↑(f x) ∂μ - ↑ε ≤ ∫ (x : α), ↑(g x) ∂μ
[PROOFSTEP]
rcases exists_upperSemicontinuous_le_lintegral_le f If.ne εpos.ne' with ⟨g, gf, gcont, gint⟩
[GOAL]
case intro.intro.intro.intro
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
ε : ℝ≥0
εpos : 0 < ↑ε
If : ∫⁻ (x : α), ↑(f x) ∂μ < ⊤
g : α → ℝ≥0
gf : ∀ (x : α), g x ≤ f x
gcont : UpperSemicontinuous g
gint : ∫⁻ (x : α), ↑(f x) ∂μ ≤ ∫⁻ (x : α), ↑(g x) ∂μ + ↑ε
⊢ ∃ g,
    (∀ (x : α), g x ≤ f x) ∧
      UpperSemicontinuous g ∧ (Integrable fun x => ↑(g x)) ∧ ∫ (x : α), ↑(f x) ∂μ - ↑ε ≤ ∫ (x : α), ↑(g x) ∂μ
[PROOFSTEP]
have Ig : (∫⁻ x, g x ∂μ) < ∞ := by
  refine' lt_of_le_of_lt (lintegral_mono fun x => _) If
  simpa using gf x
[GOAL]
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
ε : ℝ≥0
εpos : 0 < ↑ε
If : ∫⁻ (x : α), ↑(f x) ∂μ < ⊤
g : α → ℝ≥0
gf : ∀ (x : α), g x ≤ f x
gcont : UpperSemicontinuous g
gint : ∫⁻ (x : α), ↑(f x) ∂μ ≤ ∫⁻ (x : α), ↑(g x) ∂μ + ↑ε
⊢ ∫⁻ (x : α), ↑(g x) ∂μ < ⊤
[PROOFSTEP]
refine' lt_of_le_of_lt (lintegral_mono fun x => _) If
[GOAL]
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
ε : ℝ≥0
εpos : 0 < ↑ε
If : ∫⁻ (x : α), ↑(f x) ∂μ < ⊤
g : α → ℝ≥0
gf : ∀ (x : α), g x ≤ f x
gcont : UpperSemicontinuous g
gint : ∫⁻ (x : α), ↑(f x) ∂μ ≤ ∫⁻ (x : α), ↑(g x) ∂μ + ↑ε
x : α
⊢ ↑(g x) ≤ ↑(f x)
[PROOFSTEP]
simpa using gf x
[GOAL]
case intro.intro.intro.intro
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
ε : ℝ≥0
εpos : 0 < ↑ε
If : ∫⁻ (x : α), ↑(f x) ∂μ < ⊤
g : α → ℝ≥0
gf : ∀ (x : α), g x ≤ f x
gcont : UpperSemicontinuous g
gint : ∫⁻ (x : α), ↑(f x) ∂μ ≤ ∫⁻ (x : α), ↑(g x) ∂μ + ↑ε
Ig : ∫⁻ (x : α), ↑(g x) ∂μ < ⊤
⊢ ∃ g,
    (∀ (x : α), g x ≤ f x) ∧
      UpperSemicontinuous g ∧ (Integrable fun x => ↑(g x)) ∧ ∫ (x : α), ↑(f x) ∂μ - ↑ε ≤ ∫ (x : α), ↑(g x) ∂μ
[PROOFSTEP]
refine' ⟨g, gf, gcont, _, _⟩
[GOAL]
case intro.intro.intro.intro.refine'_1
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
ε : ℝ≥0
εpos : 0 < ↑ε
If : ∫⁻ (x : α), ↑(f x) ∂μ < ⊤
g : α → ℝ≥0
gf : ∀ (x : α), g x ≤ f x
gcont : UpperSemicontinuous g
gint : ∫⁻ (x : α), ↑(f x) ∂μ ≤ ∫⁻ (x : α), ↑(g x) ∂μ + ↑ε
Ig : ∫⁻ (x : α), ↑(g x) ∂μ < ⊤
⊢ Integrable fun x => ↑(g x)
[PROOFSTEP]
refine' Integrable.mono fint gcont.measurable.coe_nnreal_real.aemeasurable.aestronglyMeasurable _
[GOAL]
case intro.intro.intro.intro.refine'_1
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
ε : ℝ≥0
εpos : 0 < ↑ε
If : ∫⁻ (x : α), ↑(f x) ∂μ < ⊤
g : α → ℝ≥0
gf : ∀ (x : α), g x ≤ f x
gcont : UpperSemicontinuous g
gint : ∫⁻ (x : α), ↑(f x) ∂μ ≤ ∫⁻ (x : α), ↑(g x) ∂μ + ↑ε
Ig : ∫⁻ (x : α), ↑(g x) ∂μ < ⊤
⊢ ∀ᵐ (a : α) ∂μ, ‖↑(g a)‖ ≤ ‖↑(f a)‖
[PROOFSTEP]
exact Filter.eventually_of_forall fun x => by simp [gf x]
[GOAL]
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
ε : ℝ≥0
εpos : 0 < ↑ε
If : ∫⁻ (x : α), ↑(f x) ∂μ < ⊤
g : α → ℝ≥0
gf : ∀ (x : α), g x ≤ f x
gcont : UpperSemicontinuous g
gint : ∫⁻ (x : α), ↑(f x) ∂μ ≤ ∫⁻ (x : α), ↑(g x) ∂μ + ↑ε
Ig : ∫⁻ (x : α), ↑(g x) ∂μ < ⊤
x : α
⊢ ‖↑(g x)‖ ≤ ‖↑(f x)‖
[PROOFSTEP]
simp [gf x]
[GOAL]
case intro.intro.intro.intro.refine'_2
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
ε : ℝ≥0
εpos : 0 < ↑ε
If : ∫⁻ (x : α), ↑(f x) ∂μ < ⊤
g : α → ℝ≥0
gf : ∀ (x : α), g x ≤ f x
gcont : UpperSemicontinuous g
gint : ∫⁻ (x : α), ↑(f x) ∂μ ≤ ∫⁻ (x : α), ↑(g x) ∂μ + ↑ε
Ig : ∫⁻ (x : α), ↑(g x) ∂μ < ⊤
⊢ ∫ (x : α), ↑(f x) ∂μ - ↑ε ≤ ∫ (x : α), ↑(g x) ∂μ
[PROOFSTEP]
rw [integral_eq_lintegral_of_nonneg_ae, integral_eq_lintegral_of_nonneg_ae]
[GOAL]
case intro.intro.intro.intro.refine'_2
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
ε : ℝ≥0
εpos : 0 < ↑ε
If : ∫⁻ (x : α), ↑(f x) ∂μ < ⊤
g : α → ℝ≥0
gf : ∀ (x : α), g x ≤ f x
gcont : UpperSemicontinuous g
gint : ∫⁻ (x : α), ↑(f x) ∂μ ≤ ∫⁻ (x : α), ↑(g x) ∂μ + ↑ε
Ig : ∫⁻ (x : α), ↑(g x) ∂μ < ⊤
⊢ ENNReal.toReal (∫⁻ (a : α), ENNReal.ofReal ↑(f a) ∂μ) - ↑ε ≤ ENNReal.toReal (∫⁻ (a : α), ENNReal.ofReal ↑(g a) ∂μ)
[PROOFSTEP]
rw [sub_le_iff_le_add]
[GOAL]
case intro.intro.intro.intro.refine'_2
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
ε : ℝ≥0
εpos : 0 < ↑ε
If : ∫⁻ (x : α), ↑(f x) ∂μ < ⊤
g : α → ℝ≥0
gf : ∀ (x : α), g x ≤ f x
gcont : UpperSemicontinuous g
gint : ∫⁻ (x : α), ↑(f x) ∂μ ≤ ∫⁻ (x : α), ↑(g x) ∂μ + ↑ε
Ig : ∫⁻ (x : α), ↑(g x) ∂μ < ⊤
⊢ ENNReal.toReal (∫⁻ (a : α), ENNReal.ofReal ↑(f a) ∂μ) ≤ ENNReal.toReal (∫⁻ (a : α), ENNReal.ofReal ↑(g a) ∂μ) + ↑ε
[PROOFSTEP]
convert ENNReal.toReal_mono _ gint
[GOAL]
case h.e'_3.h.e'_1.h.e'_4.h
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
ε : ℝ≥0
εpos : 0 < ↑ε
If : ∫⁻ (x : α), ↑(f x) ∂μ < ⊤
g : α → ℝ≥0
gf : ∀ (x : α), g x ≤ f x
gcont : UpperSemicontinuous g
gint : ∫⁻ (x : α), ↑(f x) ∂μ ≤ ∫⁻ (x : α), ↑(g x) ∂μ + ↑ε
Ig : ∫⁻ (x : α), ↑(g x) ∂μ < ⊤
x✝ : α
⊢ ENNReal.ofReal ↑(f x✝) = ↑(f x✝)
[PROOFSTEP]
simp
[GOAL]
case h.e'_4
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
ε : ℝ≥0
εpos : 0 < ↑ε
If : ∫⁻ (x : α), ↑(f x) ∂μ < ⊤
g : α → ℝ≥0
gf : ∀ (x : α), g x ≤ f x
gcont : UpperSemicontinuous g
gint : ∫⁻ (x : α), ↑(f x) ∂μ ≤ ∫⁻ (x : α), ↑(g x) ∂μ + ↑ε
Ig : ∫⁻ (x : α), ↑(g x) ∂μ < ⊤
⊢ ENNReal.toReal (∫⁻ (a : α), ENNReal.ofReal ↑(g a) ∂μ) + ↑ε = ENNReal.toReal (∫⁻ (x : α), ↑(g x) ∂μ + ↑ε)
[PROOFSTEP]
rw [ENNReal.toReal_add Ig.ne ENNReal.coe_ne_top]
[GOAL]
case h.e'_4
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
ε : ℝ≥0
εpos : 0 < ↑ε
If : ∫⁻ (x : α), ↑(f x) ∂μ < ⊤
g : α → ℝ≥0
gf : ∀ (x : α), g x ≤ f x
gcont : UpperSemicontinuous g
gint : ∫⁻ (x : α), ↑(f x) ∂μ ≤ ∫⁻ (x : α), ↑(g x) ∂μ + ↑ε
Ig : ∫⁻ (x : α), ↑(g x) ∂μ < ⊤
⊢ ENNReal.toReal (∫⁻ (a : α), ENNReal.ofReal ↑(g a) ∂μ) + ↑ε =
    ENNReal.toReal (∫⁻ (x : α), ↑(g x) ∂μ) + ENNReal.toReal ↑ε
[PROOFSTEP]
simp
[GOAL]
case intro.intro.intro.intro.refine'_2
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
ε : ℝ≥0
εpos : 0 < ↑ε
If : ∫⁻ (x : α), ↑(f x) ∂μ < ⊤
g : α → ℝ≥0
gf : ∀ (x : α), g x ≤ f x
gcont : UpperSemicontinuous g
gint : ∫⁻ (x : α), ↑(f x) ∂μ ≤ ∫⁻ (x : α), ↑(g x) ∂μ + ↑ε
Ig : ∫⁻ (x : α), ↑(g x) ∂μ < ⊤
⊢ ∫⁻ (x : α), ↑(g x) ∂μ + ↑ε ≠ ⊤
[PROOFSTEP]
simpa using Ig.ne
[GOAL]
case intro.intro.intro.intro.refine'_2.hf
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
ε : ℝ≥0
εpos : 0 < ↑ε
If : ∫⁻ (x : α), ↑(f x) ∂μ < ⊤
g : α → ℝ≥0
gf : ∀ (x : α), g x ≤ f x
gcont : UpperSemicontinuous g
gint : ∫⁻ (x : α), ↑(f x) ∂μ ≤ ∫⁻ (x : α), ↑(g x) ∂μ + ↑ε
Ig : ∫⁻ (x : α), ↑(g x) ∂μ < ⊤
⊢ 0 ≤ᶠ[ae μ] fun x => ↑(g x)
[PROOFSTEP]
apply Filter.eventually_of_forall
[GOAL]
case intro.intro.intro.intro.refine'_2.hf.hp
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
ε : ℝ≥0
εpos : 0 < ↑ε
If : ∫⁻ (x : α), ↑(f x) ∂μ < ⊤
g : α → ℝ≥0
gf : ∀ (x : α), g x ≤ f x
gcont : UpperSemicontinuous g
gint : ∫⁻ (x : α), ↑(f x) ∂μ ≤ ∫⁻ (x : α), ↑(g x) ∂μ + ↑ε
Ig : ∫⁻ (x : α), ↑(g x) ∂μ < ⊤
⊢ ∀ (x : α), OfNat.ofNat 0 x ≤ (fun x => ↑(g x)) x
[PROOFSTEP]
simp
[GOAL]
case intro.intro.intro.intro.refine'_2.hfm
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
ε : ℝ≥0
εpos : 0 < ↑ε
If : ∫⁻ (x : α), ↑(f x) ∂μ < ⊤
g : α → ℝ≥0
gf : ∀ (x : α), g x ≤ f x
gcont : UpperSemicontinuous g
gint : ∫⁻ (x : α), ↑(f x) ∂μ ≤ ∫⁻ (x : α), ↑(g x) ∂μ + ↑ε
Ig : ∫⁻ (x : α), ↑(g x) ∂μ < ⊤
⊢ AEStronglyMeasurable (fun x => ↑(g x)) μ
[PROOFSTEP]
exact gcont.measurable.coe_nnreal_real.aemeasurable.aestronglyMeasurable
[GOAL]
case intro.intro.intro.intro.refine'_2.hf
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
ε : ℝ≥0
εpos : 0 < ↑ε
If : ∫⁻ (x : α), ↑(f x) ∂μ < ⊤
g : α → ℝ≥0
gf : ∀ (x : α), g x ≤ f x
gcont : UpperSemicontinuous g
gint : ∫⁻ (x : α), ↑(f x) ∂μ ≤ ∫⁻ (x : α), ↑(g x) ∂μ + ↑ε
Ig : ∫⁻ (x : α), ↑(g x) ∂μ < ⊤
⊢ 0 ≤ᶠ[ae μ] fun x => ↑(f x)
[PROOFSTEP]
apply Filter.eventually_of_forall
[GOAL]
case intro.intro.intro.intro.refine'_2.hf.hp
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
ε : ℝ≥0
εpos : 0 < ↑ε
If : ∫⁻ (x : α), ↑(f x) ∂μ < ⊤
g : α → ℝ≥0
gf : ∀ (x : α), g x ≤ f x
gcont : UpperSemicontinuous g
gint : ∫⁻ (x : α), ↑(f x) ∂μ ≤ ∫⁻ (x : α), ↑(g x) ∂μ + ↑ε
Ig : ∫⁻ (x : α), ↑(g x) ∂μ < ⊤
⊢ ∀ (x : α), OfNat.ofNat 0 x ≤ (fun x => ↑(f x)) x
[PROOFSTEP]
simp
[GOAL]
case intro.intro.intro.intro.refine'_2.hfm
α : Type u_1
inst✝³ : TopologicalSpace α
inst✝² : MeasurableSpace α
inst✝¹ : BorelSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
f : α → ℝ≥0
fint : Integrable fun x => ↑(f x)
ε : ℝ≥0
εpos : 0 < ↑ε
If : ∫⁻ (x : α), ↑(f x) ∂μ < ⊤
g : α → ℝ≥0
gf : ∀ (x : α), g x ≤ f x
gcont : UpperSemicontinuous g
gint : ∫⁻ (x : α), ↑(f x) ∂μ ≤ ∫⁻ (x : α), ↑(g x) ∂μ + ↑ε
Ig : ∫⁻ (x : α), ↑(g x) ∂μ < ⊤
⊢ AEStronglyMeasurable (fun x => ↑(f x)) μ
[PROOFSTEP]
exact fint.aestronglyMeasurable
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
⊢ ∃ g,
    (∀ (x : α), ↑(f x) < g x) ∧
      LowerSemicontinuous g ∧
        (Integrable fun x => EReal.toReal (g x)) ∧
          (∀ᵐ (x : α) ∂μ, g x < ⊤) ∧ ∫ (x : α), EReal.toReal (g x) ∂μ < ∫ (x : α), f x ∂μ + ε
[PROOFSTEP]
let δ : ℝ≥0 := ⟨ε / 2, (half_pos εpos).le⟩
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
⊢ ∃ g,
    (∀ (x : α), ↑(f x) < g x) ∧
      LowerSemicontinuous g ∧
        (Integrable fun x => EReal.toReal (g x)) ∧
          (∀ᵐ (x : α) ∂μ, g x < ⊤) ∧ ∫ (x : α), EReal.toReal (g x) ∂μ < ∫ (x : α), f x ∂μ + ε
[PROOFSTEP]
have δpos : 0 < δ := half_pos εpos
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
⊢ ∃ g,
    (∀ (x : α), ↑(f x) < g x) ∧
      LowerSemicontinuous g ∧
        (Integrable fun x => EReal.toReal (g x)) ∧
          (∀ᵐ (x : α) ∂μ, g x < ⊤) ∧ ∫ (x : α), EReal.toReal (g x) ∂μ < ∫ (x : α), f x ∂μ + ε
[PROOFSTEP]
let fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
⊢ ∃ g,
    (∀ (x : α), ↑(f x) < g x) ∧
      LowerSemicontinuous g ∧
        (Integrable fun x => EReal.toReal (g x)) ∧
          (∀ᵐ (x : α) ∂μ, g x < ⊤) ∧ ∫ (x : α), EReal.toReal (g x) ∂μ < ∫ (x : α), f x ∂μ + ε
[PROOFSTEP]
have int_fp : Integrable (fun x => (fp x : ℝ)) μ := hf.real_toNNReal
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
⊢ ∃ g,
    (∀ (x : α), ↑(f x) < g x) ∧
      LowerSemicontinuous g ∧
        (Integrable fun x => EReal.toReal (g x)) ∧
          (∀ᵐ (x : α) ∂μ, g x < ⊤) ∧ ∫ (x : α), EReal.toReal (g x) ∂μ < ∫ (x : α), f x ∂μ + ε
[PROOFSTEP]
rcases exists_lt_lowerSemicontinuous_integral_gt_nnreal fp int_fp δpos with
  ⟨gp, fp_lt_gp, gpcont, gp_lt_top, gp_integrable, gpint⟩
[GOAL]
case intro.intro.intro.intro.intro
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
⊢ ∃ g,
    (∀ (x : α), ↑(f x) < g x) ∧
      LowerSemicontinuous g ∧
        (Integrable fun x => EReal.toReal (g x)) ∧
          (∀ᵐ (x : α) ∂μ, g x < ⊤) ∧ ∫ (x : α), EReal.toReal (g x) ∂μ < ∫ (x : α), f x ∂μ + ε
[PROOFSTEP]
let fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
[GOAL]
case intro.intro.intro.intro.intro
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
⊢ ∃ g,
    (∀ (x : α), ↑(f x) < g x) ∧
      LowerSemicontinuous g ∧
        (Integrable fun x => EReal.toReal (g x)) ∧
          (∀ᵐ (x : α) ∂μ, g x < ⊤) ∧ ∫ (x : α), EReal.toReal (g x) ∂μ < ∫ (x : α), f x ∂μ + ε
[PROOFSTEP]
have int_fm : Integrable (fun x => (fm x : ℝ)) μ := hf.neg.real_toNNReal
[GOAL]
case intro.intro.intro.intro.intro
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
⊢ ∃ g,
    (∀ (x : α), ↑(f x) < g x) ∧
      LowerSemicontinuous g ∧
        (Integrable fun x => EReal.toReal (g x)) ∧
          (∀ᵐ (x : α) ∂μ, g x < ⊤) ∧ ∫ (x : α), EReal.toReal (g x) ∂μ < ∫ (x : α), f x ∂μ + ε
[PROOFSTEP]
rcases exists_upperSemicontinuous_le_integral_le fm int_fm δpos with ⟨gm, gm_le_fm, gmcont, gm_integrable, gmint⟩
[GOAL]
case intro.intro.intro.intro.intro.intro.intro.intro.intro
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
⊢ ∃ g,
    (∀ (x : α), ↑(f x) < g x) ∧
      LowerSemicontinuous g ∧
        (Integrable fun x => EReal.toReal (g x)) ∧
          (∀ᵐ (x : α) ∂μ, g x < ⊤) ∧ ∫ (x : α), EReal.toReal (g x) ∂μ < ∫ (x : α), f x ∂μ + ε
[PROOFSTEP]
let g : α → EReal := fun x => (gp x : EReal) - gm x
[GOAL]
case intro.intro.intro.intro.intro.intro.intro.intro.intro
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
⊢ ∃ g,
    (∀ (x : α), ↑(f x) < g x) ∧
      LowerSemicontinuous g ∧
        (Integrable fun x => EReal.toReal (g x)) ∧
          (∀ᵐ (x : α) ∂μ, g x < ⊤) ∧ ∫ (x : α), EReal.toReal (g x) ∂μ < ∫ (x : α), f x ∂μ + ε
[PROOFSTEP]
have ae_g : ∀ᵐ x ∂μ, (g x).toReal = (gp x : EReal).toReal - (gm x : EReal).toReal :=
  by
  filter_upwards [gp_lt_top] with _ hx
  rw [EReal.toReal_sub] <;> simp [hx.ne]
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
⊢ ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
[PROOFSTEP]
filter_upwards [gp_lt_top] with _ hx
[GOAL]
case h
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
a✝ : α
hx : gp a✝ < ⊤
⊢ EReal.toReal (↑(gp a✝) - ↑↑(gm a✝)) = EReal.toReal ↑(gp a✝) - EReal.toReal ↑↑(gm a✝)
[PROOFSTEP]
rw [EReal.toReal_sub]
[GOAL]
case h.hx
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
a✝ : α
hx : gp a✝ < ⊤
⊢ ↑(gp a✝) ≠ ⊤
[PROOFSTEP]
simp [hx.ne]
[GOAL]
case h.h'x
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
a✝ : α
hx : gp a✝ < ⊤
⊢ ↑(gp a✝) ≠ ⊥
[PROOFSTEP]
simp [hx.ne]
[GOAL]
case h.hy
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
a✝ : α
hx : gp a✝ < ⊤
⊢ ↑↑(gm a✝) ≠ ⊤
[PROOFSTEP]
simp [hx.ne]
[GOAL]
case h.h'y
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
a✝ : α
hx : gp a✝ < ⊤
⊢ ↑↑(gm a✝) ≠ ⊥
[PROOFSTEP]
simp [hx.ne]
[GOAL]
case intro.intro.intro.intro.intro.intro.intro.intro.intro
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ ∃ g,
    (∀ (x : α), ↑(f x) < g x) ∧
      LowerSemicontinuous g ∧
        (Integrable fun x => EReal.toReal (g x)) ∧
          (∀ᵐ (x : α) ∂μ, g x < ⊤) ∧ ∫ (x : α), EReal.toReal (g x) ∂μ < ∫ (x : α), f x ∂μ + ε
[PROOFSTEP]
refine' ⟨g, ?lt, ?lsc, ?int, ?aelt, ?intlt⟩
[GOAL]
case lt
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ ∀ (x : α), ↑(f x) < g x
case lsc
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ LowerSemicontinuous g
case int
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ Integrable fun x => EReal.toReal (g x)
case aelt
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ ∀ᵐ (x : α) ∂μ, g x < ⊤
case intlt
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ ∫ (x : α), EReal.toReal (g x) ∂μ < ∫ (x : α), f x ∂μ + ε
[PROOFSTEP]
case int =>
  show Integrable (fun x => EReal.toReal (g x)) μ
  rw [integrable_congr ae_g]
  convert gp_integrable.sub gm_integrable
  simp
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ Integrable fun x => EReal.toReal (g x)
[PROOFSTEP]
case int =>
  show Integrable (fun x => EReal.toReal (g x)) μ
  rw [integrable_congr ae_g]
  convert gp_integrable.sub gm_integrable
  simp
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ Integrable fun x => EReal.toReal (g x)
[PROOFSTEP]
show Integrable (fun x => EReal.toReal (g x)) μ
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ Integrable fun x => EReal.toReal (g x)
[PROOFSTEP]
rw [integrable_congr ae_g]
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ Integrable fun x => EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
[PROOFSTEP]
convert gp_integrable.sub gm_integrable
[GOAL]
case h.e'_5.h
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
x✝ : α
⊢ EReal.toReal ↑(gp x✝) - EReal.toReal ↑↑(gm x✝) = ((fun x => ENNReal.toReal (gp x)) - fun x => ↑(gm x)) x✝
[PROOFSTEP]
simp
[GOAL]
case lt
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ ∀ (x : α), ↑(f x) < g x
case lsc
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ LowerSemicontinuous g
case aelt
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ ∀ᵐ (x : α) ∂μ, g x < ⊤
case intlt
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ ∫ (x : α), EReal.toReal (g x) ∂μ < ∫ (x : α), f x ∂μ + ε
[PROOFSTEP]
case intlt => show (∫ x : α, (g x).toReal ∂μ) < (∫ x : α, f x ∂μ) + ε;
  exact
    calc
      (∫ x : α, (g x).toReal ∂μ) = ∫ x : α, EReal.toReal (gp x) - EReal.toReal (gm x) ∂μ := integral_congr_ae ae_g
      _ = (∫ x : α, EReal.toReal (gp x) ∂μ) - ∫ x : α, ↑(gm x) ∂μ :=
        by
        simp only [EReal.toReal_coe_ennreal, ENNReal.coe_toReal]
        exact integral_sub gp_integrable gm_integrable
      _ < (∫ x : α, ↑(fp x) ∂μ) + ↑δ - ∫ x : α, ↑(gm x) ∂μ :=
        by
        apply sub_lt_sub_right
        convert gpint
        simp only [EReal.toReal_coe_ennreal]
      _ ≤ (∫ x : α, ↑(fp x) ∂μ) + ↑δ - ((∫ x : α, ↑(fm x) ∂μ) - δ) := (sub_le_sub_left gmint _)
      _ = (∫ x : α, f x ∂μ) + 2 * δ := by simp_rw [integral_eq_integral_pos_part_sub_integral_neg_part hf]; ring
      _ = (∫ x : α, f x ∂μ) + ε := by congr 1; field_simp [mul_comm]
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ ∫ (x : α), EReal.toReal (g x) ∂μ < ∫ (x : α), f x ∂μ + ε
[PROOFSTEP]
case intlt => show (∫ x : α, (g x).toReal ∂μ) < (∫ x : α, f x ∂μ) + ε;
  exact
    calc
      (∫ x : α, (g x).toReal ∂μ) = ∫ x : α, EReal.toReal (gp x) - EReal.toReal (gm x) ∂μ := integral_congr_ae ae_g
      _ = (∫ x : α, EReal.toReal (gp x) ∂μ) - ∫ x : α, ↑(gm x) ∂μ :=
        by
        simp only [EReal.toReal_coe_ennreal, ENNReal.coe_toReal]
        exact integral_sub gp_integrable gm_integrable
      _ < (∫ x : α, ↑(fp x) ∂μ) + ↑δ - ∫ x : α, ↑(gm x) ∂μ :=
        by
        apply sub_lt_sub_right
        convert gpint
        simp only [EReal.toReal_coe_ennreal]
      _ ≤ (∫ x : α, ↑(fp x) ∂μ) + ↑δ - ((∫ x : α, ↑(fm x) ∂μ) - δ) := (sub_le_sub_left gmint _)
      _ = (∫ x : α, f x ∂μ) + 2 * δ := by simp_rw [integral_eq_integral_pos_part_sub_integral_neg_part hf]; ring
      _ = (∫ x : α, f x ∂μ) + ε := by congr 1; field_simp [mul_comm]
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ ∫ (x : α), EReal.toReal (g x) ∂μ < ∫ (x : α), f x ∂μ + ε
[PROOFSTEP]
show (∫ x : α, (g x).toReal ∂μ) < (∫ x : α, f x ∂μ) + ε
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ ∫ (x : α), EReal.toReal (g x) ∂μ < ∫ (x : α), f x ∂μ + ε
[PROOFSTEP]
exact
  calc
    (∫ x : α, (g x).toReal ∂μ) = ∫ x : α, EReal.toReal (gp x) - EReal.toReal (gm x) ∂μ := integral_congr_ae ae_g
    _ = (∫ x : α, EReal.toReal (gp x) ∂μ) - ∫ x : α, ↑(gm x) ∂μ :=
      by
      simp only [EReal.toReal_coe_ennreal, ENNReal.coe_toReal]
      exact integral_sub gp_integrable gm_integrable
    _ < (∫ x : α, ↑(fp x) ∂μ) + ↑δ - ∫ x : α, ↑(gm x) ∂μ :=
      by
      apply sub_lt_sub_right
      convert gpint
      simp only [EReal.toReal_coe_ennreal]
    _ ≤ (∫ x : α, ↑(fp x) ∂μ) + ↑δ - ((∫ x : α, ↑(fm x) ∂μ) - δ) := (sub_le_sub_left gmint _)
    _ = (∫ x : α, f x ∂μ) + 2 * δ := by simp_rw [integral_eq_integral_pos_part_sub_integral_neg_part hf]; ring
    _ = (∫ x : α, f x ∂μ) + ε := by congr 1; field_simp [mul_comm]
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ ∫ (x : α), EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x) ∂μ =
    ∫ (x : α), EReal.toReal ↑(gp x) ∂μ - ∫ (x : α), ↑(gm x) ∂μ
[PROOFSTEP]
simp only [EReal.toReal_coe_ennreal, ENNReal.coe_toReal]
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ ∫ (x : α), ENNReal.toReal (gp x) - ↑(gm x) ∂μ = ∫ (x : α), ENNReal.toReal (gp x) ∂μ - ∫ (x : α), ↑(gm x) ∂μ
[PROOFSTEP]
exact integral_sub gp_integrable gm_integrable
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ ∫ (x : α), EReal.toReal ↑(gp x) ∂μ - ∫ (x : α), ↑(gm x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + ↑δ - ∫ (x : α), ↑(gm x) ∂μ
[PROOFSTEP]
apply sub_lt_sub_right
[GOAL]
case h
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ ∫ (x : α), EReal.toReal ↑(gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + ↑δ
[PROOFSTEP]
convert gpint
[GOAL]
case h.e'_3.h.e'_7.h
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
x✝ : α
⊢ EReal.toReal ↑(gp x✝) = ENNReal.toReal (gp x✝)
[PROOFSTEP]
simp only [EReal.toReal_coe_ennreal]
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ ∫ (x : α), ↑(fp x) ∂μ + ↑δ - (∫ (x : α), ↑(fm x) ∂μ - ↑δ) = ∫ (x : α), f x ∂μ + 2 * ↑δ
[PROOFSTEP]
simp_rw [integral_eq_integral_pos_part_sub_integral_neg_part hf]
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ ∫ (x : α), ↑(Real.toNNReal (f x)) ∂μ + ↑{ val := ε / 2, property := (_ : 0 ≤ ε / 2) } -
      (∫ (x : α), ↑(Real.toNNReal (-f x)) ∂μ - ↑{ val := ε / 2, property := (_ : 0 ≤ ε / 2) }) =
    ∫ (x : α), ↑(Real.toNNReal (f x)) ∂μ - ∫ (x : α), ↑(Real.toNNReal (-f x)) ∂μ +
      2 * ↑{ val := ε / 2, property := (_ : 0 ≤ ε / 2) }
[PROOFSTEP]
ring
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ ∫ (x : α), f x ∂μ + 2 * ↑δ = ∫ (x : α), f x ∂μ + ε
[PROOFSTEP]
congr 1
[GOAL]
case e_a
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ 2 * ↑δ = ε
[PROOFSTEP]
field_simp [mul_comm]
[GOAL]
case lt
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ ∀ (x : α), ↑(f x) < g x
case lsc
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ LowerSemicontinuous g
case aelt
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ ∀ᵐ (x : α) ∂μ, g x < ⊤
[PROOFSTEP]
case aelt =>
  show ∀ᵐ x : α ∂μ, g x < ⊤
  filter_upwards [gp_lt_top] with ?_ hx
  simp only [sub_eq_add_neg, Ne.def, (EReal.add_lt_top _ _).ne, lt_top_iff_ne_top, lt_top_iff_ne_top.1 hx,
    EReal.coe_ennreal_eq_top_iff, not_false_iff, EReal.neg_eq_top_iff, EReal.coe_ennreal_ne_bot]
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ ∀ᵐ (x : α) ∂μ, g x < ⊤
[PROOFSTEP]
case aelt =>
  show ∀ᵐ x : α ∂μ, g x < ⊤
  filter_upwards [gp_lt_top] with ?_ hx
  simp only [sub_eq_add_neg, Ne.def, (EReal.add_lt_top _ _).ne, lt_top_iff_ne_top, lt_top_iff_ne_top.1 hx,
    EReal.coe_ennreal_eq_top_iff, not_false_iff, EReal.neg_eq_top_iff, EReal.coe_ennreal_ne_bot]
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ ∀ᵐ (x : α) ∂μ, g x < ⊤
[PROOFSTEP]
show ∀ᵐ x : α ∂μ, g x < ⊤
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ ∀ᵐ (x : α) ∂μ, g x < ⊤
[PROOFSTEP]
filter_upwards [gp_lt_top] with ?_ hx
[GOAL]
case h
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
x✝ : α
hx : gp x✝ < ⊤
⊢ ↑(gp x✝) - ↑↑(gm x✝) < ⊤
[PROOFSTEP]
simp only [sub_eq_add_neg, Ne.def, (EReal.add_lt_top _ _).ne, lt_top_iff_ne_top, lt_top_iff_ne_top.1 hx,
  EReal.coe_ennreal_eq_top_iff, not_false_iff, EReal.neg_eq_top_iff, EReal.coe_ennreal_ne_bot]
[GOAL]
case lt
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ ∀ (x : α), ↑(f x) < g x
case lsc
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ LowerSemicontinuous g
[PROOFSTEP]
case lt =>
  show ∀ x, (f x : EReal) < g x
  intro x
  rw [EReal.coe_real_ereal_eq_coe_toNNReal_sub_coe_toNNReal (f x)]
  refine' EReal.sub_lt_sub_of_lt_of_le _ _ _ _
  · simp only [EReal.coe_ennreal_lt_coe_ennreal_iff]; exact fp_lt_gp x
  · simp only [ENNReal.coe_le_coe, EReal.coe_ennreal_le_coe_ennreal_iff]
    exact gm_le_fm x
  · simp only [EReal.coe_ennreal_ne_bot, Ne.def, not_false_iff]
  · simp only [EReal.coe_nnreal_ne_top, Ne.def, not_false_iff]
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ ∀ (x : α), ↑(f x) < g x
[PROOFSTEP]
case lt =>
  show ∀ x, (f x : EReal) < g x
  intro x
  rw [EReal.coe_real_ereal_eq_coe_toNNReal_sub_coe_toNNReal (f x)]
  refine' EReal.sub_lt_sub_of_lt_of_le _ _ _ _
  · simp only [EReal.coe_ennreal_lt_coe_ennreal_iff]; exact fp_lt_gp x
  · simp only [ENNReal.coe_le_coe, EReal.coe_ennreal_le_coe_ennreal_iff]
    exact gm_le_fm x
  · simp only [EReal.coe_ennreal_ne_bot, Ne.def, not_false_iff]
  · simp only [EReal.coe_nnreal_ne_top, Ne.def, not_false_iff]
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ ∀ (x : α), ↑(f x) < g x
[PROOFSTEP]
show ∀ x, (f x : EReal) < g x
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ ∀ (x : α), ↑(f x) < g x
[PROOFSTEP]
intro x
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
x : α
⊢ ↑(f x) < g x
[PROOFSTEP]
rw [EReal.coe_real_ereal_eq_coe_toNNReal_sub_coe_toNNReal (f x)]
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
x : α
⊢ ↑↑(Real.toNNReal (f x)) - ↑↑(Real.toNNReal (-f x)) < g x
[PROOFSTEP]
refine' EReal.sub_lt_sub_of_lt_of_le _ _ _ _
[GOAL]
case refine'_1
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
x : α
⊢ ↑↑(Real.toNNReal (f x)) < ↑(gp x)
[PROOFSTEP]
simp only [EReal.coe_ennreal_lt_coe_ennreal_iff]
[GOAL]
case refine'_1
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
x : α
⊢ ↑(Real.toNNReal (f x)) < gp x
[PROOFSTEP]
exact fp_lt_gp x
[GOAL]
case refine'_2
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
x : α
⊢ ↑↑(gm x) ≤ ↑↑(Real.toNNReal (-f x))
[PROOFSTEP]
simp only [ENNReal.coe_le_coe, EReal.coe_ennreal_le_coe_ennreal_iff]
[GOAL]
case refine'_2
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
x : α
⊢ gm x ≤ Real.toNNReal (-f x)
[PROOFSTEP]
exact gm_le_fm x
[GOAL]
case refine'_3
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
x : α
⊢ ↑↑(gm x) ≠ ⊥
[PROOFSTEP]
simp only [EReal.coe_ennreal_ne_bot, Ne.def, not_false_iff]
[GOAL]
case refine'_4
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
x : α
⊢ ↑↑(Real.toNNReal (-f x)) ≠ ⊤
[PROOFSTEP]
simp only [EReal.coe_nnreal_ne_top, Ne.def, not_false_iff]
[GOAL]
case lsc
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ LowerSemicontinuous g
[PROOFSTEP]
case lsc =>
  show LowerSemicontinuous g
  apply LowerSemicontinuous.add'
  ·
    exact
      continuous_coe_ennreal_ereal.comp_lowerSemicontinuous gpcont fun x y hxy =>
        EReal.coe_ennreal_le_coe_ennreal_iff.2 hxy
  · apply continuous_neg.comp_upperSemicontinuous_antitone _ fun x y hxy => EReal.neg_le_neg_iff.2 hxy
    dsimp
    apply
      continuous_coe_ennreal_ereal.comp_upperSemicontinuous _ fun x y hxy => EReal.coe_ennreal_le_coe_ennreal_iff.2 hxy
    exact ENNReal.continuous_coe.comp_upperSemicontinuous gmcont fun x y hxy => ENNReal.coe_le_coe.2 hxy
  · intro x
    exact EReal.continuousAt_add (by simp) (by simp)
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ LowerSemicontinuous g
[PROOFSTEP]
case lsc =>
  show LowerSemicontinuous g
  apply LowerSemicontinuous.add'
  ·
    exact
      continuous_coe_ennreal_ereal.comp_lowerSemicontinuous gpcont fun x y hxy =>
        EReal.coe_ennreal_le_coe_ennreal_iff.2 hxy
  · apply continuous_neg.comp_upperSemicontinuous_antitone _ fun x y hxy => EReal.neg_le_neg_iff.2 hxy
    dsimp
    apply
      continuous_coe_ennreal_ereal.comp_upperSemicontinuous _ fun x y hxy => EReal.coe_ennreal_le_coe_ennreal_iff.2 hxy
    exact ENNReal.continuous_coe.comp_upperSemicontinuous gmcont fun x y hxy => ENNReal.coe_le_coe.2 hxy
  · intro x
    exact EReal.continuousAt_add (by simp) (by simp)
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ LowerSemicontinuous g
[PROOFSTEP]
show LowerSemicontinuous g
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ LowerSemicontinuous g
[PROOFSTEP]
apply LowerSemicontinuous.add'
[GOAL]
case hf
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ LowerSemicontinuous fun z => ↑(gp z)
[PROOFSTEP]
exact
  continuous_coe_ennreal_ereal.comp_lowerSemicontinuous gpcont fun x y hxy => EReal.coe_ennreal_le_coe_ennreal_iff.2 hxy
[GOAL]
case hg
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ LowerSemicontinuous fun z => -↑↑(gm z)
[PROOFSTEP]
apply continuous_neg.comp_upperSemicontinuous_antitone _ fun x y hxy => EReal.neg_le_neg_iff.2 hxy
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ UpperSemicontinuous fun z => ↑↑(gm z)
[PROOFSTEP]
dsimp
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ UpperSemicontinuous fun z => ↑↑(gm z)
[PROOFSTEP]
apply continuous_coe_ennreal_ereal.comp_upperSemicontinuous _ fun x y hxy => EReal.coe_ennreal_le_coe_ennreal_iff.2 hxy
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ UpperSemicontinuous fun z => ↑(gm z)
[PROOFSTEP]
exact ENNReal.continuous_coe.comp_upperSemicontinuous gmcont fun x y hxy => ENNReal.coe_le_coe.2 hxy
[GOAL]
case hcont
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
⊢ ∀ (x : α), ContinuousAt (fun p => p.fst + p.snd) (↑(gp x), -↑↑(gm x))
[PROOFSTEP]
intro x
[GOAL]
case hcont
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
x : α
⊢ ContinuousAt (fun p => p.fst + p.snd) (↑(gp x), -↑↑(gm x))
[PROOFSTEP]
exact EReal.continuousAt_add (by simp) (by simp)
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
x : α
⊢ (↑(gp x), -↑↑(gm x)).fst ≠ ⊤ ∨ (↑(gp x), -↑↑(gm x)).snd ≠ ⊥
[PROOFSTEP]
simp
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
δ : ℝ≥0 := { val := ε / 2, property := (_ : 0 ≤ ε / 2) }
δpos : 0 < δ
fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
int_fp : Integrable fun x => ↑(fp x)
gp : α → ℝ≥0∞
fp_lt_gp : ∀ (x : α), ↑(fp x) < gp x
gpcont : LowerSemicontinuous gp
gp_lt_top : ∀ᵐ (x : α) ∂μ, gp x < ⊤
gp_integrable : Integrable fun x => ENNReal.toReal (gp x)
gpint : ∫ (x : α), ENNReal.toReal (gp x) ∂μ < ∫ (x : α), ↑(fp x) ∂μ + (fun a => ↑a) δ
fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
int_fm : Integrable fun x => ↑(fm x)
gm : α → ℝ≥0
gm_le_fm : ∀ (x : α), gm x ≤ fm x
gmcont : UpperSemicontinuous gm
gm_integrable : Integrable fun x => ↑(gm x)
gmint : ∫ (x : α), ↑(fm x) ∂μ - (fun a => ↑a) δ ≤ ∫ (x : α), ↑(gm x) ∂μ
g : α → EReal := fun x => ↑(gp x) - ↑↑(gm x)
ae_g : ∀ᵐ (x : α) ∂μ, EReal.toReal (g x) = EReal.toReal ↑(gp x) - EReal.toReal ↑↑(gm x)
x : α
⊢ (↑(gp x), -↑↑(gm x)).fst ≠ ⊥ ∨ (↑(gp x), -↑↑(gm x)).snd ≠ ⊤
[PROOFSTEP]
simp
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
⊢ ∃ g,
    (∀ (x : α), g x < ↑(f x)) ∧
      UpperSemicontinuous g ∧
        (Integrable fun x => EReal.toReal (g x)) ∧
          (∀ᵐ (x : α) ∂μ, ⊥ < g x) ∧ ∫ (x : α), f x ∂μ < ∫ (x : α), EReal.toReal (g x) ∂μ + ε
[PROOFSTEP]
rcases exists_lt_lowerSemicontinuous_integral_lt (fun x => -f x) hf.neg εpos with
  ⟨g, g_lt_f, gcont, g_integrable, g_lt_top, gint⟩
[GOAL]
case intro.intro.intro.intro.intro
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
g : α → EReal
g_lt_f : ∀ (x : α), ↑(-f x) < g x
gcont : LowerSemicontinuous g
g_integrable : Integrable fun x => EReal.toReal (g x)
g_lt_top : ∀ᵐ (x : α) ∂μ, g x < ⊤
gint : ∫ (x : α), EReal.toReal (g x) ∂μ < ∫ (x : α), -f x ∂μ + ε
⊢ ∃ g,
    (∀ (x : α), g x < ↑(f x)) ∧
      UpperSemicontinuous g ∧
        (Integrable fun x => EReal.toReal (g x)) ∧
          (∀ᵐ (x : α) ∂μ, ⊥ < g x) ∧ ∫ (x : α), f x ∂μ < ∫ (x : α), EReal.toReal (g x) ∂μ + ε
[PROOFSTEP]
refine' ⟨fun x => -g x, _, _, _, _, _⟩
[GOAL]
case intro.intro.intro.intro.intro.refine'_1
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
g : α → EReal
g_lt_f : ∀ (x : α), ↑(-f x) < g x
gcont : LowerSemicontinuous g
g_integrable : Integrable fun x => EReal.toReal (g x)
g_lt_top : ∀ᵐ (x : α) ∂μ, g x < ⊤
gint : ∫ (x : α), EReal.toReal (g x) ∂μ < ∫ (x : α), -f x ∂μ + ε
⊢ ∀ (x : α), (fun x => -g x) x < ↑(f x)
[PROOFSTEP]
exact fun x => EReal.neg_lt_iff_neg_lt.1 (by simpa only [EReal.coe_neg] using g_lt_f x)
[GOAL]
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
g : α → EReal
g_lt_f : ∀ (x : α), ↑(-f x) < g x
gcont : LowerSemicontinuous g
g_integrable : Integrable fun x => EReal.toReal (g x)
g_lt_top : ∀ᵐ (x : α) ∂μ, g x < ⊤
gint : ∫ (x : α), EReal.toReal (g x) ∂μ < ∫ (x : α), -f x ∂μ + ε
x : α
⊢ -↑(f x) < g x
[PROOFSTEP]
simpa only [EReal.coe_neg] using g_lt_f x
[GOAL]
case intro.intro.intro.intro.intro.refine'_2
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
g : α → EReal
g_lt_f : ∀ (x : α), ↑(-f x) < g x
gcont : LowerSemicontinuous g
g_integrable : Integrable fun x => EReal.toReal (g x)
g_lt_top : ∀ᵐ (x : α) ∂μ, g x < ⊤
gint : ∫ (x : α), EReal.toReal (g x) ∂μ < ∫ (x : α), -f x ∂μ + ε
⊢ UpperSemicontinuous fun x => -g x
[PROOFSTEP]
exact continuous_neg.comp_lowerSemicontinuous_antitone gcont fun x y hxy => EReal.neg_le_neg_iff.2 hxy
[GOAL]
case intro.intro.intro.intro.intro.refine'_3
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
g : α → EReal
g_lt_f : ∀ (x : α), ↑(-f x) < g x
gcont : LowerSemicontinuous g
g_integrable : Integrable fun x => EReal.toReal (g x)
g_lt_top : ∀ᵐ (x : α) ∂μ, g x < ⊤
gint : ∫ (x : α), EReal.toReal (g x) ∂μ < ∫ (x : α), -f x ∂μ + ε
⊢ Integrable fun x => EReal.toReal ((fun x => -g x) x)
[PROOFSTEP]
convert g_integrable.neg
[GOAL]
case h.e'_5.h
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
g : α → EReal
g_lt_f : ∀ (x : α), ↑(-f x) < g x
gcont : LowerSemicontinuous g
g_integrable : Integrable fun x => EReal.toReal (g x)
g_lt_top : ∀ᵐ (x : α) ∂μ, g x < ⊤
gint : ∫ (x : α), EReal.toReal (g x) ∂μ < ∫ (x : α), -f x ∂μ + ε
x✝ : α
⊢ EReal.toReal ((fun x => -g x) x✝) = (-fun x => EReal.toReal (g x)) x✝
[PROOFSTEP]
simp
[GOAL]
case intro.intro.intro.intro.intro.refine'_4
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
g : α → EReal
g_lt_f : ∀ (x : α), ↑(-f x) < g x
gcont : LowerSemicontinuous g
g_integrable : Integrable fun x => EReal.toReal (g x)
g_lt_top : ∀ᵐ (x : α) ∂μ, g x < ⊤
gint : ∫ (x : α), EReal.toReal (g x) ∂μ < ∫ (x : α), -f x ∂μ + ε
⊢ ∀ᵐ (x : α) ∂μ, ⊥ < (fun x => -g x) x
[PROOFSTEP]
simpa [bot_lt_iff_ne_bot, lt_top_iff_ne_top] using g_lt_top
[GOAL]
case intro.intro.intro.intro.intro.refine'_5
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
g : α → EReal
g_lt_f : ∀ (x : α), ↑(-f x) < g x
gcont : LowerSemicontinuous g
g_integrable : Integrable fun x => EReal.toReal (g x)
g_lt_top : ∀ᵐ (x : α) ∂μ, g x < ⊤
gint : ∫ (x : α), EReal.toReal (g x) ∂μ < ∫ (x : α), -f x ∂μ + ε
⊢ ∫ (x : α), f x ∂μ < ∫ (x : α), EReal.toReal ((fun x => -g x) x) ∂μ + ε
[PROOFSTEP]
simp_rw [integral_neg, lt_neg_add_iff_add_lt] at gint
[GOAL]
case intro.intro.intro.intro.intro.refine'_5
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
g : α → EReal
g_lt_f : ∀ (x : α), ↑(-f x) < g x
gcont : LowerSemicontinuous g
g_integrable : Integrable fun x => EReal.toReal (g x)
g_lt_top : ∀ᵐ (x : α) ∂μ, g x < ⊤
gint : ∫ (a : α), f a ∂μ + ∫ (x : α), EReal.toReal (g x) ∂μ < ε
⊢ ∫ (x : α), f x ∂μ < ∫ (x : α), EReal.toReal ((fun x => -g x) x) ∂μ + ε
[PROOFSTEP]
rw [add_comm] at gint
[GOAL]
case intro.intro.intro.intro.intro.refine'_5
α : Type u_1
inst✝⁴ : TopologicalSpace α
inst✝³ : MeasurableSpace α
inst✝² : BorelSpace α
μ : Measure α
inst✝¹ : WeaklyRegular μ
inst✝ : SigmaFinite μ
f : α → ℝ
hf : Integrable f
ε : ℝ
εpos : 0 < ε
g : α → EReal
g_lt_f : ∀ (x : α), ↑(-f x) < g x
gcont : LowerSemicontinuous g
g_integrable : Integrable fun x => EReal.toReal (g x)
g_lt_top : ∀ᵐ (x : α) ∂μ, g x < ⊤
gint : ∫ (x : α), EReal.toReal (g x) ∂μ + ∫ (a : α), f a ∂μ < ε
⊢ ∫ (x : α), f x ∂μ < ∫ (x : α), EReal.toReal ((fun x => -g x) x) ∂μ + ε
[PROOFSTEP]
simpa [integral_neg] using gint