Theorem: MeasureTheory.exists_pos_lintegral_lt_of_sigmaFinite
File: Mathlib/MeasureTheory/Integral/Lebesgue.lean

tactic: set s : ℕ → Set α := disjointed (spanningSets μ)
state_before: α : Type u_1
β : Type ?u.1816357
γ : Type ?u.1816360
δ : Type ?u.1816363
m m0 : MeasurableSpace α
μ : Measure α
inst✝ : SigmaFinite μ
ε : ℝ≥0∞
ε0 : ε ≠ 0
⊢ ∃ g, (∀ (x : α), 0 < g x) ∧ Measurable g ∧ (∫⁻ (x : α), ↑(g x) ∂μ) < ε

tactic: have : ∀ n, μ (s n) < ∞ := fun n =>
  (measure_mono <| disjointed_subset _ _).trans_lt (measure_spanningSets_lt_top μ n)
state_before: α : Type u_1
β : Type ?u.1816357
γ : Type ?u.1816360
δ : Type ?u.1816363
m m0 : MeasurableSpace α
μ : Measure α
inst✝ : SigmaFinite μ
ε : ℝ≥0∞
ε0 : ε ≠ 0
s : ℕ → Set α := disjointed (spanningSets μ)
⊢ ∃ g, (∀ (x : α), 0 < g x) ∧ Measurable g ∧ (∫⁻ (x : α), ↑(g x) ∂μ) < ε

tactic: obtain ⟨δ, δpos, δsum⟩ : ∃ δ : ℕ → ℝ≥0, (∀ i, 0 < δ i) ∧ (∑' i, μ (s i) * δ i) < ε
state_before: α : Type u_1
β : Type ?u.1816357
γ : Type ?u.1816360
δ : Type ?u.1816363
m m0 : MeasurableSpace α
μ : Measure α
inst✝ : SigmaFinite μ
ε : ℝ≥0∞
ε0 : ε ≠ 0
s : ℕ → Set α := disjointed (spanningSets μ)
this : ∀ (n : ℕ), ↑↑μ (s n) < ⊤
⊢ ∃ g, (∀ (x : α), 0 < g x) ∧ Measurable g ∧ (∫⁻ (x : α), ↑(g x) ∂μ) < ε

tactic: exact ENNReal.exists_pos_tsum_mul_lt_of_countable ε0 _ fun n => (this n).ne
state_before: α : Type u_1
β : Type ?u.1816357
γ : Type ?u.1816360
δ : Type ?u.1816363
m m0 : MeasurableSpace α
μ : Measure α
inst✝ : SigmaFinite μ
ε : ℝ≥0∞
ε0 : ε ≠ 0
s : ℕ → Set α := disjointed (spanningSets μ)
this : ∀ (n : ℕ), ↑↑μ (s n) < ⊤
⊢ ∃ δ, (∀ (i : ℕ), 0 < δ i) ∧ (∑' (i : ℕ), ↑↑μ (s i) * ↑(δ i)) < ε

case intro.intro
α : Type u_1
β : Type ?u.1816357
γ : Type ?u.1816360
δ✝ : Type ?u.1816363
m m0 : MeasurableSpace α
μ : Measure α
inst✝ : SigmaFinite μ
ε : ℝ≥0∞
ε0 : ε ≠ 0
s : ℕ → Set α := disjointed (spanningSets μ)
this : ∀ (n : ℕ), ↑↑μ (s n) < ⊤
δ : ℕ → ℝ≥0
δpos : ∀ (i : ℕ), 0 < δ i
δsum : (∑' (i : ℕ), ↑↑μ (s i) * ↑(δ i)) < ε
⊢ ∃ g, (∀ (x : α), 0 < g x) ∧ Measurable g ∧ (∫⁻ (x : α), ↑(g x) ∂μ) < ε

tactic: set N : α → ℕ := spanningSetsIndex μ
state_before: case intro.intro
α : Type u_1
β : Type ?u.1816357
γ : Type ?u.1816360
δ✝ : Type ?u.1816363
m m0 : MeasurableSpace α
μ : Measure α
inst✝ : SigmaFinite μ
ε : ℝ≥0∞
ε0 : ε ≠ 0
s : ℕ → Set α := disjointed (spanningSets μ)
this : ∀ (n : ℕ), ↑↑μ (s n) < ⊤
δ : ℕ → ℝ≥0
δpos : ∀ (i : ℕ), 0 < δ i
δsum : (∑' (i : ℕ), ↑↑μ (s i) * ↑(δ i)) < ε
⊢ ∃ g, (∀ (x : α), 0 < g x) ∧ Measurable g ∧ (∫⁻ (x : α), ↑(g x) ∂μ) < ε

tactic: have hN_meas : Measurable N := measurable_spanningSetsIndex μ
state_before: case intro.intro
α : Type u_1
β : Type ?u.1816357
γ : Type ?u.1816360
δ✝ : Type ?u.1816363
m m0 : MeasurableSpace α
μ : Measure α
inst✝ : SigmaFinite μ
ε : ℝ≥0∞
ε0 : ε ≠ 0
s : ℕ → Set α := disjointed (spanningSets μ)
this : ∀ (n : ℕ), ↑↑μ (s n) < ⊤
δ : ℕ → ℝ≥0
δpos : ∀ (i : ℕ), 0 < δ i
δsum : (∑' (i : ℕ), ↑↑μ (s i) * ↑(δ i)) < ε
N : α → ℕ := spanningSetsIndex μ
⊢ ∃ g, (∀ (x : α), 0 < g x) ∧ Measurable g ∧ (∫⁻ (x : α), ↑(g x) ∂μ) < ε

tactic: have hNs : ∀ n, N ⁻¹' {n} = s n := preimage_spanningSetsIndex_singleton μ
state_before: case intro.intro
α : Type u_1
β : Type ?u.1816357
γ : Type ?u.1816360
δ✝ : Type ?u.1816363
m m0 : MeasurableSpace α
μ : Measure α
inst✝ : SigmaFinite μ
ε : ℝ≥0∞
ε0 : ε ≠ 0
s : ℕ → Set α := disjointed (spanningSets μ)
this : ∀ (n : ℕ), ↑↑μ (s n) < ⊤
δ : ℕ → ℝ≥0
δpos : ∀ (i : ℕ), 0 < δ i
δsum : (∑' (i : ℕ), ↑↑μ (s i) * ↑(δ i)) < ε
N : α → ℕ := spanningSetsIndex μ
hN_meas : Measurable N
⊢ ∃ g, (∀ (x : α), 0 < g x) ∧ Measurable g ∧ (∫⁻ (x : α), ↑(g x) ∂μ) < ε

tactic: refine' ⟨δ ∘ N, fun x => δpos _, measurable_from_nat.comp hN_meas, _⟩
state_before: case intro.intro
α : Type u_1
β : Type ?u.1816357
γ : Type ?u.1816360
δ✝ : Type ?u.1816363
m m0 : MeasurableSpace α
μ : Measure α
inst✝ : SigmaFinite μ
ε : ℝ≥0∞
ε0 : ε ≠ 0
s : ℕ → Set α := disjointed (spanningSets μ)
this : ∀ (n : ℕ), ↑↑μ (s n) < ⊤
δ : ℕ → ℝ≥0
δpos : ∀ (i : ℕ), 0 < δ i
δsum : (∑' (i : ℕ), ↑↑μ (s i) * ↑(δ i)) < ε
N : α → ℕ := spanningSetsIndex μ
hN_meas : Measurable N
hNs : ∀ (n : ℕ), N ⁻¹' {n} = s n
⊢ ∃ g, (∀ (x : α), 0 < g x) ∧ Measurable g ∧ (∫⁻ (x : α), ↑(g x) ∂μ) < ε

tactic: erw [lintegral_comp measurable_from_nat.coe_nnreal_ennreal hN_meas]
state_before: case intro.intro
α : Type u_1
β : Type ?u.1816357
γ : Type ?u.1816360
δ✝ : Type ?u.1816363
m m0 : MeasurableSpace α
μ : Measure α
inst✝ : SigmaFinite μ
ε : ℝ≥0∞
ε0 : ε ≠ 0
s : ℕ → Set α := disjointed (spanningSets μ)
this : ∀ (n : ℕ), ↑↑μ (s n) < ⊤
δ : ℕ → ℝ≥0
δpos : ∀ (i : ℕ), 0 < δ i
δsum : (∑' (i : ℕ), ↑↑μ (s i) * ↑(δ i)) < ε
N : α → ℕ := spanningSetsIndex μ
hN_meas : Measurable N
hNs : ∀ (n : ℕ), N ⁻¹' {n} = s n
⊢ (∫⁻ (x : α), ↑((δ ∘ N) x) ∂μ) < ε

tactic: simpa [hNs, lintegral_countable', measurable_spanningSetsIndex, mul_comm] using δsum
state_before: case intro.intro
α : Type u_1
β : Type ?u.1816357
γ : Type ?u.1816360
δ✝ : Type ?u.1816363
m m0 : MeasurableSpace α
μ : Measure α
inst✝ : SigmaFinite μ
ε : ℝ≥0∞
ε0 : ε ≠ 0
s : ℕ → Set α := disjointed (spanningSets μ)
this : ∀ (n : ℕ), ↑↑μ (s n) < ⊤
δ : ℕ → ℝ≥0
δpos : ∀ (i : ℕ), 0 < δ i
δsum : (∑' (i : ℕ), ↑↑μ (s i) * ↑(δ i)) < ε
N : α → ℕ := spanningSetsIndex μ
hN_meas : Measurable N
hNs : ∀ (n : ℕ), N ⁻¹' {n} = s n
⊢ (∫⁻ (a : ℕ), ↑(δ a) ∂Measure.map N μ) < ε