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

tactic: cases' eq_or_ne (∫⁻ a, f a ∂μ) 0 with h₀ h₀
state_before: α : Type u_1
β : Type ?u.77053
γ : Type ?u.77056
δ : Type ?u.77059
m : MeasurableSpace α
μ ν : Measure α
f : α → ℝ≥0∞
⊢ ∃ g, Measurable g ∧ g ≤ f ∧ (∫⁻ (a : α), f a ∂μ) = ∫⁻ (a : α), g a ∂μ

tactic: rcases exists_seq_strictMono_tendsto' h₀.bot_lt with ⟨L, _, hLf, hL_tendsto⟩
state_before: case inr
α : Type u_1
β : Type ?u.77053
γ : Type ?u.77056
δ : Type ?u.77059
m : MeasurableSpace α
μ ν : Measure α
f : α → ℝ≥0∞
h₀ : (∫⁻ (a : α), f a ∂μ) ≠ 0
⊢ ∃ g, Measurable g ∧ g ≤ f ∧ (∫⁻ (a : α), f a ∂μ) = ∫⁻ (a : α), g a ∂μ

tactic: have : ∀ n, ∃ g : α → ℝ≥0∞, Measurable g ∧ g ≤ f ∧ L n < ∫⁻ a, g a ∂μ := by
  intro n
  simpa only [← iSup_lintegral_measurable_le_eq_lintegral f, lt_iSup_iff, exists_prop] using
    (hLf n).2
state_before: case inr.intro.intro.intro
α : Type u_1
β : Type ?u.77053
γ : Type ?u.77056
δ : Type ?u.77059
m : MeasurableSpace α
μ ν : Measure α
f : α → ℝ≥0∞
h₀ : (∫⁻ (a : α), f a ∂μ) ≠ 0
L : ℕ → ℝ≥0∞
left✝ : StrictMono L
hLf : ∀ (n : ℕ), L n ∈ Ioo ⊥ (∫⁻ (a : α), f a ∂μ)
hL_tendsto : Tendsto L atTop (𝓝 (∫⁻ (a : α), f a ∂μ))
⊢ ∃ g, Measurable g ∧ g ≤ f ∧ (∫⁻ (a : α), f a ∂μ) = ∫⁻ (a : α), g a ∂μ

tactic: choose g hgm hgf hLg using this
state_before: case inr.intro.intro.intro
α : Type u_1
β : Type ?u.77053
γ : Type ?u.77056
δ : Type ?u.77059
m : MeasurableSpace α
μ ν : Measure α
f : α → ℝ≥0∞
h₀ : (∫⁻ (a : α), f a ∂μ) ≠ 0
L : ℕ → ℝ≥0∞
left✝ : StrictMono L
hLf : ∀ (n : ℕ), L n ∈ Ioo ⊥ (∫⁻ (a : α), f a ∂μ)
hL_tendsto : Tendsto L atTop (𝓝 (∫⁻ (a : α), f a ∂μ))
this : ∀ (n : ℕ), ∃ g, Measurable g ∧ g ≤ f ∧ L n < ∫⁻ (a : α), g a ∂μ
⊢ ∃ g, Measurable g ∧ g ≤ f ∧ (∫⁻ (a : α), f a ∂μ) = ∫⁻ (a : α), g a ∂μ

tactic: refine'
  ⟨fun x => ⨆ n, g n x, measurable_iSup hgm, fun x => iSup_le fun n => hgf n x, le_antisymm _ _⟩
state_before: case inr.intro.intro.intro
α : Type u_1
β : Type ?u.77053
γ : Type ?u.77056
δ : Type ?u.77059
m : MeasurableSpace α
μ ν : Measure α
f : α → ℝ≥0∞
h₀ : (∫⁻ (a : α), f a ∂μ) ≠ 0
L : ℕ → ℝ≥0∞
left✝ : StrictMono L
hLf : ∀ (n : ℕ), L n ∈ Ioo ⊥ (∫⁻ (a : α), f a ∂μ)
hL_tendsto : Tendsto L atTop (𝓝 (∫⁻ (a : α), f a ∂μ))
g : ℕ → α → ℝ≥0∞
hgm : ∀ (n : ℕ), Measurable (g n)
hgf : ∀ (n : ℕ), g n ≤ f
hLg : ∀ (n : ℕ), L n < ∫⁻ (a : α), g n a ∂μ
⊢ ∃ g, Measurable g ∧ g ≤ f ∧ (∫⁻ (a : α), f a ∂μ) = ∫⁻ (a : α), g a ∂μ

tactic: exact ⟨0, measurable_zero, zero_le f, h₀.trans lintegral_zero.symm⟩
state_before: case inl
α : Type u_1
β : Type ?u.77053
γ : Type ?u.77056
δ : Type ?u.77059
m : MeasurableSpace α
μ ν : Measure α
f : α → ℝ≥0∞
h₀ : (∫⁻ (a : α), f a ∂μ) = 0
⊢ ∃ g, Measurable g ∧ g ≤ f ∧ (∫⁻ (a : α), f a ∂μ) = ∫⁻ (a : α), g a ∂μ

tactic: intro n
state_before: α : Type u_1
β : Type ?u.77053
γ : Type ?u.77056
δ : Type ?u.77059
m : MeasurableSpace α
μ ν : Measure α
f : α → ℝ≥0∞
h₀ : (∫⁻ (a : α), f a ∂μ) ≠ 0
L : ℕ → ℝ≥0∞
left✝ : StrictMono L
hLf : ∀ (n : ℕ), L n ∈ Ioo ⊥ (∫⁻ (a : α), f a ∂μ)
hL_tendsto : Tendsto L atTop (𝓝 (∫⁻ (a : α), f a ∂μ))
⊢ ∀ (n : ℕ), ∃ g, Measurable g ∧ g ≤ f ∧ L n < ∫⁻ (a : α), g a ∂μ

tactic: simpa only [← iSup_lintegral_measurable_le_eq_lintegral f, lt_iSup_iff, exists_prop] using
  (hLf n).2
state_before: α : Type u_1
β : Type ?u.77053
γ : Type ?u.77056
δ : Type ?u.77059
m : MeasurableSpace α
μ ν : Measure α
f : α → ℝ≥0∞
h₀ : (∫⁻ (a : α), f a ∂μ) ≠ 0
L : ℕ → ℝ≥0∞
left✝ : StrictMono L
hLf : ∀ (n : ℕ), L n ∈ Ioo ⊥ (∫⁻ (a : α), f a ∂μ)
hL_tendsto : Tendsto L atTop (𝓝 (∫⁻ (a : α), f a ∂μ))
n : ℕ
⊢ ∃ g, Measurable g ∧ g ≤ f ∧ L n < ∫⁻ (a : α), g a ∂μ

tactic: refine' le_of_tendsto' hL_tendsto fun n => (hLg n).le.trans <| lintegral_mono fun x => _
state_before: case inr.intro.intro.intro.refine'_1
α : Type u_1
β : Type ?u.77053
γ : Type ?u.77056
δ : Type ?u.77059
m : MeasurableSpace α
μ ν : Measure α
f : α → ℝ≥0∞
h₀ : (∫⁻ (a : α), f a ∂μ) ≠ 0
L : ℕ → ℝ≥0∞
left✝ : StrictMono L
hLf : ∀ (n : ℕ), L n ∈ Ioo ⊥ (∫⁻ (a : α), f a ∂μ)
hL_tendsto : Tendsto L atTop (𝓝 (∫⁻ (a : α), f a ∂μ))
g : ℕ → α → ℝ≥0∞
hgm : ∀ (n : ℕ), Measurable (g n)
hgf : ∀ (n : ℕ), g n ≤ f
hLg : ∀ (n : ℕ), L n < ∫⁻ (a : α), g n a ∂μ
⊢ (∫⁻ (a : α), f a ∂μ) ≤ ∫⁻ (a : α), (fun x => ⨆ (n : ℕ), g n x) a ∂μ

tactic: exact le_iSup (fun n => g n x) n
state_before: case inr.intro.intro.intro.refine'_1
α : Type u_1
β : Type ?u.77053
γ : Type ?u.77056
δ : Type ?u.77059
m : MeasurableSpace α
μ ν : Measure α
f : α → ℝ≥0∞
h₀ : (∫⁻ (a : α), f a ∂μ) ≠ 0
L : ℕ → ℝ≥0∞
left✝ : StrictMono L
hLf : ∀ (n : ℕ), L n ∈ Ioo ⊥ (∫⁻ (a : α), f a ∂μ)
hL_tendsto : Tendsto L atTop (𝓝 (∫⁻ (a : α), f a ∂μ))
g : ℕ → α → ℝ≥0∞
hgm : ∀ (n : ℕ), Measurable (g n)
hgf : ∀ (n : ℕ), g n ≤ f
hLg : ∀ (n : ℕ), L n < ∫⁻ (a : α), g n a ∂μ
n : ℕ
x : α
⊢ g n x ≤ (fun x => ⨆ (n : ℕ), g n x) x

tactic: exact lintegral_mono fun x => iSup_le fun n => hgf n x
state_before: case inr.intro.intro.intro.refine'_2
α : Type u_1
β : Type ?u.77053
γ : Type ?u.77056
δ : Type ?u.77059
m : MeasurableSpace α
μ ν : Measure α
f : α → ℝ≥0∞
h₀ : (∫⁻ (a : α), f a ∂μ) ≠ 0
L : ℕ → ℝ≥0∞
left✝ : StrictMono L
hLf : ∀ (n : ℕ), L n ∈ Ioo ⊥ (∫⁻ (a : α), f a ∂μ)
hL_tendsto : Tendsto L atTop (𝓝 (∫⁻ (a : α), f a ∂μ))
g : ℕ → α → ℝ≥0∞
hgm : ∀ (n : ℕ), Measurable (g n)
hgf : ∀ (n : ℕ), g n ≤ f
hLg : ∀ (n : ℕ), L n < ∫⁻ (a : α), g n a ∂μ
⊢ (∫⁻ (a : α), (fun x => ⨆ (n : ℕ), g n x) a ∂μ) ≤ ∫⁻ (a : α), f a ∂μ