-- Mathlib/MeasureTheory/Integral/SetIntegral.lean
theorem tendsto_setIntegral_of_monotone
    {ι : Type*} [Preorder ι] [(atTop : Filter ι).IsCountablyGenerated]
    {s : ι → Set X} (hsm : ∀ i, MeasurableSet (s i)) (h_mono : Monotone s)
    (hfi : IntegrableOn f (⋃ n, s n) μ) :
    Tendsto (fun i => ∫ x in s i, f x ∂μ) atTop (𝓝 (∫ x in ⋃ n, s n, f x ∂μ))

Proof state:
X : Type u_1
E : Type u_3
mX : MeasurableSpace X
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
f : X → E
μ : Measure X
ι : Type u_5
inst✝¹ : Preorder ι
inst✝ : atTop.IsCountablyGenerated
s : ι → Set X
hsm : ∀ (i : ι), MeasurableSet (s i)
h_mono : Monotone s
hfi : IntegrableOn f (⋃ n, s n) μ
⊢ Tendsto (fun i => ∫ (x : X) in s i, f x ∂μ) atTop (𝓝 (∫ (x : X) in ⋃ n, s n, f x ∂μ))

Tactic:
refine .of_neBot_imp fun hne ↦ ?_

Result:
X : Type u_1
E : Type u_3
mX : MeasurableSpace X
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
f : X → E
μ : Measure X
ι : Type u_5
inst✝¹ : Preorder ι
inst✝ : atTop.IsCountablyGenerated
s : ι → Set X
hsm : ∀ (i : ι), MeasurableSet (s i)
h_mono : Monotone s
hfi : IntegrableOn f (⋃ n, s n) μ
hne : atTop.NeBot
⊢ Tendsto (fun i => ∫ (x : X) in s i, f x ∂μ) atTop (𝓝 (∫ (x : X) in ⋃ n, s n, f x ∂μ))

Proof state:
case intro
X : Type u_1
E : Type u_3
mX : MeasurableSpace X
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
f : X → E
μ : Measure X
ι : Type u_5
inst✝¹ : Preorder ι
inst✝ : atTop.IsCountablyGenerated
s : ι → Set X
hsm : ∀ (i : ι), MeasurableSet (s i)
h_mono : Monotone s
hne : atTop.NeBot
this : IsDirected ι fun x1 x2 => x1 ≤ x2
S : Set X := ⋃ i, s i
hfi : IntegrableOn f S μ
hfi' : (μ.withDensity fun x => ↑‖f x‖₊) S < ⊤
hSm : MeasurableSet S
hsub : ∀ {i : ι}, s i ⊆ S
ν : Measure X := μ.withDensity fun x => ‖f x‖ₑ
hν : ν = μ.withDensity fun x => ‖f x‖ₑ
ε : ℝ≥0
ε0 : 0 < ↑ε
⊢ ∀ᶠ (x : ι) in atTop, ∫ (x : X) in s x, f x ∂μ ∈ Metric.closedBall (∫ (x : X) in S, f x ∂μ) ↑ε

Tactic:
have : ∀ᶠ i in atTop, ν (s i) ∈ Icc (ν S - ε) (ν S + ε) :=
  tendsto_measure_iUnion_atTop h_mono (ENNReal.Icc_mem_nhds hfi'.ne (ENNReal.coe_pos.2 ε0).ne')

Result:
case intro
X : Type u_1
E : Type u_3
mX : MeasurableSpace X
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
f : X → E
μ : Measure X
ι : Type u_5
inst✝¹ : Preorder ι
inst✝ : atTop.IsCountablyGenerated
s : ι → Set X
hsm : ∀ (i : ι), MeasurableSet (s i)
h_mono : Monotone s
hne : atTop.NeBot
this✝ : IsDirected ι fun x1 x2 => x1 ≤ x2
S : Set X := ⋃ i, s i
hfi : IntegrableOn f S μ
hfi' : (μ.withDensity fun x => ↑‖f x‖₊) S < ⊤
hSm : MeasurableSet S
hsub : ∀ {i : ι}, s i ⊆ S
ν : Measure X := μ.withDensity fun x => ‖f x‖ₑ
hν : ν = μ.withDensity fun x => ‖f x‖ₑ
ε : ℝ≥0
ε0 : 0 < ↑ε
this : ∀ᶠ (i : ι) in atTop, ν (s i) ∈ Icc (ν S - ↑ε) (ν S + ↑ε)
⊢ ∀ᶠ (x : ι) in atTop, ∫ (x : X) in s x, f x ∂μ ∈ Metric.closedBall (∫ (x : X) in S, f x ∂μ) ↑ε

Proof state:
case h
X : Type u_1
E : Type u_3
mX : MeasurableSpace X
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
f : X → E
μ : Measure X
ι : Type u_5
inst✝¹ : Preorder ι
inst✝ : atTop.IsCountablyGenerated
s : ι → Set X
hsm : ∀ (i : ι), MeasurableSet (s i)
h_mono : Monotone s
hne : atTop.NeBot
this✝ : IsDirected ι fun x1 x2 => x1 ≤ x2
S : Set X := ⋃ i, s i
hfi : IntegrableOn f S μ
hfi' : (μ.withDensity fun x => ↑‖f x‖₊) S < ⊤
hSm : MeasurableSet S
hsub : ∀ {i : ι}, s i ⊆ S
ν : Measure X := μ.withDensity fun x => ‖f x‖ₑ
hν : ν = μ.withDensity fun x => ‖f x‖ₑ
ε : ℝ≥0
ε0 : 0 < ↑ε
this : ∀ᶠ (i : ι) in atTop, ν (s i) ∈ Icc (ν S - ↑ε) (ν S + ↑ε)
i : ι
hi : ν (s i) ∈ Icc (ν S - ↑ε) (ν S + ↑ε)
⊢ ∫⁻ (a : X) in S \ s i, ‖f a‖ₑ ∂μ ≤ ↑ε

Tactic:
rw [← withDensity_apply _ (hSm.diff (hsm _)), ← hν, measure_diff hsub (hsm _).nullMeasurableSet]

Result:
case h
X : Type u_1
E : Type u_3
mX : MeasurableSpace X
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
f : X → E
μ : Measure X
ι : Type u_5
inst✝¹ : Preorder ι
inst✝ : atTop.IsCountablyGenerated
s : ι → Set X
hsm : ∀ (i : ι), MeasurableSet (s i)
h_mono : Monotone s
hne : atTop.NeBot
this✝ : IsDirected ι fun x1 x2 => x1 ≤ x2
S : Set X := ⋃ i, s i
hfi : IntegrableOn f S μ
hfi' : (μ.withDensity fun x => ↑‖f x‖₊) S < ⊤
hSm : MeasurableSet S
hsub : ∀ {i : ι}, s i ⊆ S
ν : Measure X := μ.withDensity fun x => ‖f x‖ₑ
hν : ν = μ.withDensity fun x => ‖f x‖ₑ
ε : ℝ≥0
ε0 : 0 < ↑ε
this : ∀ᶠ (i : ι) in atTop, ν (s i) ∈ Icc (ν S - ↑ε) (ν S + ↑ε)
i : ι
hi : ν (s i) ∈ Icc (ν S - ↑ε) (ν S + ↑ε)
⊢ ν S - ν (s i) ≤ ↑ε

case h
X : Type u_1
E : Type u_3
mX : MeasurableSpace X
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
f : X → E
μ : Measure X
ι : Type u_5
inst✝¹ : Preorder ι
inst✝ : atTop.IsCountablyGenerated
s : ι → Set X
hsm : ∀ (i : ι), MeasurableSet (s i)
h_mono : Monotone s
hne : atTop.NeBot
this✝ : IsDirected ι fun x1 x2 => x1 ≤ x2
S : Set X := ⋃ i, s i
hfi : IntegrableOn f S μ
hfi' : (μ.withDensity fun x => ↑‖f x‖₊) S < ⊤
hSm : MeasurableSet S
hsub : ∀ {i : ι}, s i ⊆ S
ν : Measure X := μ.withDensity fun x => ‖f x‖ₑ
hν : ν = μ.withDensity fun x => ‖f x‖ₑ
ε : ℝ≥0
ε0 : 0 < ↑ε
this : ∀ᶠ (i : ι) in atTop, ν (s i) ∈ Icc (ν S - ↑ε) (ν S + ↑ε)
i : ι
hi : ν (s i) ∈ Icc (ν S - ↑ε) (ν S + ↑ε)
⊢ ν (s i) ≠ ⊤

Proof state:
case h
X : Type u_1
E : Type u_3
mX : MeasurableSpace X
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
f : X → E
μ : Measure X
ι : Type u_5
inst✝¹ : Preorder ι
inst✝ : atTop.IsCountablyGenerated
s : ι → Set X
hsm : ∀ (i : ι), MeasurableSet (s i)
h_mono : Monotone s
hne : atTop.NeBot
this✝ : IsDirected ι fun x1 x2 => x1 ≤ x2
S : Set X := ⋃ i, s i
hfi : IntegrableOn f S μ
hfi' : (μ.withDensity fun x => ↑‖f x‖₊) S < ⊤
hSm : MeasurableSet S
hsub : ∀ {i : ι}, s i ⊆ S
ν : Measure X := μ.withDensity fun x => ‖f x‖ₑ
hν : ν = μ.withDensity fun x => ‖f x‖ₑ
ε : ℝ≥0
ε0 : 0 < ↑ε
this : ∀ᶠ (i : ι) in atTop, ν (s i) ∈ Icc (ν S - ↑ε) (ν S + ↑ε)
i : ι
hi : ν (s i) ∈ Icc (ν S - ↑ε) (ν S + ↑ε)
⊢ ↑‖∫ (x : X) in S \ s i, f x ∂μ‖₊ ≤ ↑ε

Tactic:
refine (enorm_integral_le_lintegral_enorm _).trans ?_

Result:
case h
X : Type u_1
E : Type u_3
mX : MeasurableSpace X
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
f : X → E
μ : Measure X
ι : Type u_5
inst✝¹ : Preorder ι
inst✝ : atTop.IsCountablyGenerated
s : ι → Set X
hsm : ∀ (i : ι), MeasurableSet (s i)
h_mono : Monotone s
hne : atTop.NeBot
this✝ : IsDirected ι fun x1 x2 => x1 ≤ x2
S : Set X := ⋃ i, s i
hfi : IntegrableOn f S μ
hfi' : (μ.withDensity fun x => ↑‖f x‖₊) S < ⊤
hSm : MeasurableSet S
hsub : ∀ {i : ι}, s i ⊆ S
ν : Measure X := μ.withDensity fun x => ‖f x‖ₑ
hν : ν = μ.withDensity fun x => ‖f x‖ₑ
ε : ℝ≥0
ε0 : 0 < ↑ε
this : ∀ᶠ (i : ι) in atTop, ν (s i) ∈ Icc (ν S - ↑ε) (ν S + ↑ε)
i : ι
hi : ν (s i) ∈ Icc (ν S - ↑ε) (ν S + ↑ε)
⊢ ∫⁻ (a : X) in S \ s i, ‖f a‖ₑ ∂μ ≤ ↑ε

Proof state:
X : Type u_1
E : Type u_3
mX : MeasurableSpace X
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
f : X → E
μ : Measure X
ι : Type u_5
inst✝¹ : Preorder ι
inst✝ : atTop.IsCountablyGenerated
s : ι → Set X
hsm : ∀ (i : ι), MeasurableSet (s i)
h_mono : Monotone s
hfi : IntegrableOn f (⋃ n, s n) μ
hne : atTop.NeBot
⊢ Tendsto (fun i => ∫ (x : X) in s i, f x ∂μ) atTop (𝓝 (∫ (x : X) in ⋃ n, s n, f x ∂μ))

Tactic:
have := (atTop_neBot_iff.mp hne).2

Result:
X : Type u_1
E : Type u_3
mX : MeasurableSpace X
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
f : X → E
μ : Measure X
ι : Type u_5
inst✝¹ : Preorder ι
inst✝ : atTop.IsCountablyGenerated
s : ι → Set X
hsm : ∀ (i : ι), MeasurableSet (s i)
h_mono : Monotone s
hfi : IntegrableOn f (⋃ n, s n) μ
hne : atTop.NeBot
this : IsDirected ι fun x1 x2 => x1 ≤ x2
⊢ Tendsto (fun i => ∫ (x : X) in s i, f x ∂μ) atTop (𝓝 (∫ (x : X) in ⋃ n, s n, f x ∂μ))