Theorem: MeasureTheory.exists_lt_lowerSemicontinuous_integral_lt
File: Mathlib/MeasureTheory/Integral/VitaliCaratheodory.lean

tactic: let δ : ℝ≥0 := ⟨ε / 2, (half_pos εpos).le⟩
state_before: α : 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 ∂μ) + ε

tactic: have δpos : 0 < δ := half_pos εpos
state_before: α : 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 ∂μ) + ε

tactic: let fp : α → ℝ≥0 := fun x => Real.toNNReal (f x)
state_before: α : 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 ∂μ) + ε

tactic: have int_fp : Integrable (fun x => (fp x : ℝ)) μ := hf.real_toNNReal
state_before: α : 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 ∂μ) + ε

tactic: rcases exists_lt_lowerSemicontinuous_integral_gt_nnreal fp int_fp δpos with
  ⟨gp, fp_lt_gp, gpcont, gp_lt_top, gp_integrable, gpint⟩
state_before: α : 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 ∂μ) + ε

tactic: let fm : α → ℝ≥0 := fun x => Real.toNNReal (-f x)
state_before: 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 ∂μ) + ε

tactic: have int_fm : Integrable (fun x => (fm x : ℝ)) μ := hf.neg.real_toNNReal
state_before: 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 ∂μ) + ε

tactic: rcases exists_upperSemicontinuous_le_integral_le fm int_fm δpos with
  ⟨gm, gm_le_fm, gmcont, gm_integrable, gmint⟩
state_before: 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 ∂μ) + ε

tactic: let g : α → EReal := fun x => (gp x : EReal) - gm x
state_before: 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 ∂μ) + ε

tactic: 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]
state_before: 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 ∂μ) + ε

tactic: refine' ⟨g, ?lt, ?lsc, ?int, ?aelt, ?intlt⟩
state_before: 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 ∂μ) + ε

tactic: case int =>
  show Integrable (fun x => EReal.toReal (g x)) μ
  rw [integrable_congr ae_g]
  convert gp_integrable.sub gm_integrable
  simp
state_before: 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 ∂μ) + ε

tactic: 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]
state_before: 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 ∂μ) + ε

tactic: 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]
state_before: 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 < ⊤

tactic: filter_upwards [gp_lt_top] with _ hx
state_before: α : 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)

tactic: rw [EReal.toReal_sub] <;> simp [hx.ne]
state_before: 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✝)

tactic: show Integrable (fun x => EReal.toReal (g x)) μ
state_before: α : 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)

tactic: rw [integrable_congr ae_g]
state_before: α : 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)

tactic: convert gp_integrable.sub gm_integrable
state_before: α : 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)

tactic: simp
state_before: 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✝

tactic: show (∫ x : α, (g x).toReal ∂μ) < (∫ x : α, f x ∂μ) + ε
state_before: α : 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 ∂μ) + ε

tactic: 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]
state_before: α : 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 ∂μ) + ε

tactic: simp only [EReal.toReal_coe_ennreal, ENNReal.coe_toReal]
state_before: α : 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) ∂μ

tactic: exact integral_sub gp_integrable gm_integrable
state_before: α : 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) ∂μ

tactic: apply sub_lt_sub_right
state_before: α : 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) ∂μ

tactic: convert gpint
state_before: 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) ∂μ) + ↑δ

tactic: simp only [EReal.toReal_coe_ennreal]
state_before: case h.e'_3.h.e'_8.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✝)

tactic: simp_rw [integral_eq_integral_pos_part_sub_integral_neg_part hf]
state_before: α : 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 * ↑δ

tactic: ring
state_before: α : 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) }

tactic: congr 1
state_before: α : 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 ∂μ) + ε

tactic: field_simp [mul_comm]
state_before: 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 * ↑δ = ε

tactic: show ∀ᵐ x : α ∂μ, g x < ⊤
state_before: α : 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 < ⊤

tactic: filter_upwards [gp_lt_top] with ?_ hx
state_before: α : 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 < ⊤

tactic: 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]
state_before: 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✝) < ⊤

tactic: show ∀ x, (f x : EReal) < g x
state_before: α : 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

tactic: intro x
state_before: α : 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

tactic: rw [EReal.coe_real_ereal_eq_coe_toNNReal_sub_coe_toNNReal (f x)]
state_before: α : 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

tactic: refine' EReal.sub_lt_sub_of_lt_of_le _ _ _ _
state_before: α : 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

tactic: simp only [EReal.coe_ennreal_lt_coe_ennreal_iff]
state_before: 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)

tactic: exact fp_lt_gp x
state_before: 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

tactic: simp only [ENNReal.coe_le_coe, EReal.coe_ennreal_le_coe_ennreal_iff]
state_before: 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))

tactic: exact gm_le_fm x
state_before: 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)

tactic: simp only [EReal.coe_ennreal_ne_bot, Ne.def, not_false_iff]
state_before: 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) ≠ ⊥

tactic: simp only [EReal.coe_nnreal_ne_top, Ne.def, not_false_iff]
state_before: 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)) ≠ ⊤

tactic: show LowerSemicontinuous g
state_before: α : 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

tactic: apply LowerSemicontinuous.add'
state_before: α : 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

tactic: exact continuous_coe_ennreal_ereal.comp_lowerSemicontinuous gpcont fun x y hxy =>
    EReal.coe_ennreal_le_coe_ennreal_iff.2 hxy
state_before: 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)

tactic: apply continuous_neg.comp_upperSemicontinuous_antitone _ fun x y hxy =>
    EReal.neg_le_neg_iff.2 hxy
state_before: 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)

tactic: dsimp
state_before: α : 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)

tactic: apply continuous_coe_ennreal_ereal.comp_upperSemicontinuous _ fun x y hxy =>
    EReal.coe_ennreal_le_coe_ennreal_iff.2 hxy
state_before: α : 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)

tactic: exact ENNReal.continuous_coe.comp_upperSemicontinuous gmcont fun x y hxy =>
    ENNReal.coe_le_coe.2 hxy
state_before: α : 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)

tactic: intro x
state_before: 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))

tactic: exact EReal.continuousAt_add (by simp) (by simp)
state_before: 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))

tactic: simp
state_before: α : 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 ≠ ⊥

tactic: simp
state_before: α : 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 ≠ ⊤