Theorem: MeasureTheory.ae_bdd_condexp_of_ae_bdd
File: Mathlib/MeasureTheory/Function/ConditionalExpectation/Real.lean

Proof steps:
state_before: α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
R : ℝ≥0
f : α → ℝ
hbdd : ∀ᵐ (x : α) ∂μ, |f x| ≤ ↑R
⊢ ∀ᵐ (x : α) ∂μ, |(μ[f|m]) x| ≤ ↑R
state_after: case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
R : ℝ≥0
f : α → ℝ
hbdd : ∀ᵐ (x : α) ∂μ, |f x| ≤ ↑R
hnm : m ≤ m0
⊢ ∀ᵐ (x : α) ∂μ, |(μ[f|m]) x| ≤ ↑R

case neg
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
R : ℝ≥0
f : α → ℝ
hbdd : ∀ᵐ (x : α) ∂μ, |f x| ≤ ↑R
hnm : ¬m ≤ m0
⊢ ∀ᵐ (x : α) ∂μ, |(μ[f|m]) x| ≤ ↑R
tactic: by_cases hnm : m ≤ m0
state_before: case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
R : ℝ≥0
f : α → ℝ
hbdd : ∀ᵐ (x : α) ∂μ, |f x| ≤ ↑R
hnm : m ≤ m0
⊢ ∀ᵐ (x : α) ∂μ, |(μ[f|m]) x| ≤ ↑R

case neg
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
R : ℝ≥0
f : α → ℝ
hbdd : ∀ᵐ (x : α) ∂μ, |f x| ≤ ↑R
hnm : ¬m ≤ m0
⊢ ∀ᵐ (x : α) ∂μ, |(μ[f|m]) x| ≤ ↑R
state_after: case neg
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
R : ℝ≥0
f : α → ℝ
hbdd : ∀ᵐ (x : α) ∂μ, |f x| ≤ ↑R
hnm : ¬m ≤ m0
⊢ ∀ᵐ (x : α) ∂μ, |(μ[f|m]) x| ≤ ↑R

case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
R : ℝ≥0
f : α → ℝ
hbdd : ∀ᵐ (x : α) ∂μ, |f x| ≤ ↑R
hnm : m ≤ m0
⊢ ∀ᵐ (x : α) ∂μ, |(μ[f|m]) x| ≤ ↑R
tactic: swap
state_before: case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
R : ℝ≥0
f : α → ℝ
hbdd : ∀ᵐ (x : α) ∂μ, |f x| ≤ ↑R
hnm : m ≤ m0
⊢ ∀ᵐ (x : α) ∂μ, |(μ[f|m]) x| ≤ ↑R
state_after: case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
R : ℝ≥0
f : α → ℝ
hbdd : ∀ᵐ (x : α) ∂μ, |f x| ≤ ↑R
hnm : m ≤ m0
hfint : Integrable f μ
⊢ ∀ᵐ (x : α) ∂μ, |(μ[f|m]) x| ≤ ↑R

case neg
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
R : ℝ≥0
f : α → ℝ
hbdd : ∀ᵐ (x : α) ∂μ, |f x| ≤ ↑R
hnm : m ≤ m0
hfint : ¬Integrable f μ
⊢ ∀ᵐ (x : α) ∂μ, |(μ[f|m]) x| ≤ ↑R
tactic: by_cases hfint : Integrable f μ
state_before: case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
R : ℝ≥0
f : α → ℝ
hbdd : ∀ᵐ (x : α) ∂μ, |f x| ≤ ↑R
hnm : m ≤ m0
hfint : Integrable f μ
⊢ ∀ᵐ (x : α) ∂μ, |(μ[f|m]) x| ≤ ↑R

case neg
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
R : ℝ≥0
f : α → ℝ
hbdd : ∀ᵐ (x : α) ∂μ, |f x| ≤ ↑R
hnm : m ≤ m0
hfint : ¬Integrable f μ
⊢ ∀ᵐ (x : α) ∂μ, |(μ[f|m]) x| ≤ ↑R
state_after: case neg
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
R : ℝ≥0
f : α → ℝ
hbdd : ∀ᵐ (x : α) ∂μ, |f x| ≤ ↑R
hnm : m ≤ m0
hfint : ¬Integrable f μ
⊢ ∀ᵐ (x : α) ∂μ, |(μ[f|m]) x| ≤ ↑R

case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
R : ℝ≥0
f : α → ℝ
hbdd : ∀ᵐ (x : α) ∂μ, |f x| ≤ ↑R
hnm : m ≤ m0
hfint : Integrable f μ
⊢ ∀ᵐ (x : α) ∂μ, |(μ[f|m]) x| ≤ ↑R
tactic: swap
state_before: case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
R : ℝ≥0
f : α → ℝ
hbdd : ∀ᵐ (x : α) ∂μ, |f x| ≤ ↑R
hnm : m ≤ m0
hfint : Integrable f μ
⊢ ∀ᵐ (x : α) ∂μ, |(μ[f|m]) x| ≤ ↑R
state_after: case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
R : ℝ≥0
f : α → ℝ
hbdd : ∀ᵐ (x : α) ∂μ, |f x| ≤ ↑R
hnm : m ≤ m0
hfint : Integrable f μ
h : ¬∀ᵐ (x : α) ∂μ, |(μ[f|m]) x| ≤ ↑R
⊢ False
tactic: by_contra h
state_before: case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
R : ℝ≥0
f : α → ℝ
hbdd : ∀ᵐ (x : α) ∂μ, |f x| ≤ ↑R
hnm : m ≤ m0
hfint : Integrable f μ
h : ¬∀ᵐ (x : α) ∂μ, |(μ[f|m]) x| ≤ ↑R
⊢ False
state_after: case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
R : ℝ≥0
f : α → ℝ
hbdd : ∀ᵐ (x : α) ∂μ, |f x| ≤ ↑R
hnm : m ≤ m0
hfint : Integrable f μ
h : μ {x | (fun x => |(μ[f|m]) x| ≤ ↑R) x}ᶜ ≠ 0
⊢ False
tactic: change μ _ ≠ 0 at h
state_before: case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
R : ℝ≥0
f : α → ℝ
hbdd : ∀ᵐ (x : α) ∂μ, |f x| ≤ ↑R
hnm : m ≤ m0
hfint : Integrable f μ
h : μ {x | (fun x => |(μ[f|m]) x| ≤ ↑R) x}ᶜ ≠ 0
⊢ False
state_after: case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
R : ℝ≥0
f : α → ℝ
hbdd : ∀ᵐ (x : α) ∂μ, |f x| ≤ ↑R
hnm : m ≤ m0
hfint : Integrable f μ
h : 0 < μ {x | ↑R < |(μ[f|m]) x|}
⊢ False
tactic: simp only [← zero_lt_iff, Set.compl_def, Set.mem_setOf_eq, not_le] at h
state_before: case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
R : ℝ≥0
f : α → ℝ
hbdd : ∀ᵐ (x : α) ∂μ, |f x| ≤ ↑R
hnm : m ≤ m0
hfint : Integrable f μ
h : 0 < μ {x | ↑R < |(μ[f|m]) x|}
⊢ False
state_after: case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
R : ℝ≥0
f : α → ℝ
hbdd : ∀ᵐ (x : α) ∂μ, |f x| ≤ ↑R
hnm : m ≤ m0
hfint : Integrable f μ
h : 0 < μ {x | ↑R < |(μ[f|m]) x|}
⊢ (μ {x | ↑R < |(μ[f|m]) x|}).toReal * ↑R < (μ {x | ↑R < |(μ[f|m]) x|}).toReal * ↑R
tactic: suffices (μ {x | ↑R < |(μ[f|m]) x|}).toReal * ↑R < (μ {x | ↑R < |(μ[f|m]) x|}).toReal * ↑R by
    exact this.ne rfl
state_before: case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
R : ℝ≥0
f : α → ℝ
hbdd : ∀ᵐ (x : α) ∂μ, |f x| ≤ ↑R
hnm : m ≤ m0
hfint : Integrable f μ
h : 0 < μ {x | ↑R < |(μ[f|m]) x|}
⊢ (μ {x | ↑R < |(μ[f|m]) x|}).toReal * ↑R < (μ {x | ↑R < |(μ[f|m]) x|}).toReal * ↑R
state_after: case pos.refine_1
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
R : ℝ≥0
f : α → ℝ
hbdd : ∀ᵐ (x : α) ∂μ, |f x| ≤ ↑R
hnm : m ≤ m0
hfint : Integrable f μ
h : 0 < μ {x | ↑R < |(μ[f|m]) x|}
⊢ IntegrableOn (fun x => |(μ[f|m]) x|) {x | ↑R < |(μ[f|m]) x|} μ

case pos.refine_2
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
R : ℝ≥0
f : α → ℝ
hbdd : ∀ᵐ (x : α) ∂μ, |f x| ≤ ↑R
hnm : m ≤ m0
hfint : Integrable f μ
h : 0 < μ {x | ↑R < |(μ[f|m]) x|}
⊢ ∫ (x : α) in {x | ↑R < |(μ[f|m]) x|}, |(μ[f|m]) x| ∂μ ≤ (μ {x | ↑R < |(μ[f|m]) x|}).toReal * ↑R
tactic: refine lt_of_lt_of_le (setIntegral_gt_gt R.coe_nonneg ?_ h.ne') ?_
state_before: case pos.refine_2
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
R : ℝ≥0
f : α → ℝ
hbdd : ∀ᵐ (x : α) ∂μ, |f x| ≤ ↑R
hnm : m ≤ m0
hfint : Integrable f μ
h : 0 < μ {x | ↑R < |(μ[f|m]) x|}
⊢ ∫ (x : α) in {x | ↑R < |(μ[f|m]) x|}, |(μ[f|m]) x| ∂μ ≤ (μ {x | ↑R < |(μ[f|m]) x|}).toReal * ↑R
state_after: case pos.refine_2.refine_1
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
R : ℝ≥0
f : α → ℝ
hbdd : ∀ᵐ (x : α) ∂μ, |f x| ≤ ↑R
hnm : m ≤ m0
hfint : Integrable f μ
h : 0 < μ {x | ↑R < |(μ[f|m]) x|}
⊢ MeasurableSet {x | ↑R < |(μ[f|m]) x|}

case pos.refine_2.refine_2
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
R : ℝ≥0
f : α → ℝ
hbdd : ∀ᵐ (x : α) ∂μ, |f x| ≤ ↑R
hnm : m ≤ m0
hfint : Integrable f μ
h : 0 < μ {x | ↑R < |(μ[f|m]) x|}
⊢ ∫ (x : α) in {x | ↑R < |(μ[f|m]) x|}, |f x| ∂μ ≤ (μ {x | ↑R < |(μ[f|m]) x|}).toReal * ↑R
tactic: refine (setIntegral_abs_condexp_le ?_ _).trans ?_
state_before: case pos.refine_2.refine_2
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
R : ℝ≥0
f : α → ℝ
hbdd : ∀ᵐ (x : α) ∂μ, |f x| ≤ ↑R
hnm : m ≤ m0
hfint : Integrable f μ
h : 0 < μ {x | ↑R < |(μ[f|m]) x|}
⊢ ∫ (x : α) in {x | ↑R < |(μ[f|m]) x|}, |f x| ∂μ ≤ (μ {x | ↑R < |(μ[f|m]) x|}).toReal * ↑R
state_after: case pos.refine_2.refine_2
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
R : ℝ≥0
f : α → ℝ
hbdd : ∀ᵐ (x : α) ∂μ, |f x| ≤ ↑R
hnm : m ≤ m0
hfint : Integrable f μ
h : 0 < μ {x | ↑R < |(μ[f|m]) x|}
⊢ ∫ (x : α) in {x | ↑R < |(μ[f|m]) x|}, |f x| ∂μ ≤ ∫ (x : α) in {x | ↑R < |(μ[f|m]) x|}, ↑R ∂μ
tactic: simp only [← smul_eq_mul, ← setIntegral_const, NNReal.val_eq_coe, RCLike.ofReal_real_eq_id,
    _root_.id]
state_before: case pos.refine_2.refine_2
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
R : ℝ≥0
f : α → ℝ
hbdd : ∀ᵐ (x : α) ∂μ, |f x| ≤ ↑R
hnm : m ≤ m0
hfint : Integrable f μ
h : 0 < μ {x | ↑R < |(μ[f|m]) x|}
⊢ ∫ (x : α) in {x | ↑R < |(μ[f|m]) x|}, |f x| ∂μ ≤ ∫ (x : α) in {x | ↑R < |(μ[f|m]) x|}, ↑R ∂μ
state_after: case pos.refine_2.refine_2
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
R : ℝ≥0
f : α → ℝ
hbdd : ∀ᵐ (x : α) ∂μ, |f x| ≤ ↑R
hnm : m ≤ m0
hfint : Integrable f μ
h : 0 < μ {x | ↑R < |(μ[f|m]) x|}
⊢ IntegrableOn (fun x => ↑R) {x | ↑R < |(μ[f|m]) x|} μ
tactic: refine setIntegral_mono_ae hfint.abs.integrableOn ?_ hbdd
state_before: case pos.refine_2.refine_2
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
R : ℝ≥0
f : α → ℝ
hbdd : ∀ᵐ (x : α) ∂μ, |f x| ≤ ↑R
hnm : m ≤ m0
hfint : Integrable f μ
h : 0 < μ {x | ↑R < |(μ[f|m]) x|}
⊢ IntegrableOn (fun x => ↑R) {x | ↑R < |(μ[f|m]) x|} μ
state_after: case pos.refine_2.refine_2
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
R : ℝ≥0
f : α → ℝ
hbdd : ∀ᵐ (x : α) ∂μ, |f x| ≤ ↑R
hnm : m ≤ m0
hfint : Integrable f μ
h : 0 < μ {x | ↑R < |(μ[f|m]) x|}
⊢ ∫⁻ (a : α) in {x | ↑R < |(μ[f|m]) x|}, ↑‖(fun x => ↑R) a‖₊ ∂μ ≤
    ∫⁻ (a : α) in {x | ↑R < |(μ[f|m]) x|}, ↑‖(μ[f|m]) a‖₊ ∂μ
tactic: refine ⟨aestronglyMeasurable_const, lt_of_le_of_lt ?_
    (integrable_condexp.integrableOn : IntegrableOn (μ[f|m]) {x | ↑R < |(μ[f|m]) x|} μ).2⟩
state_before: case pos.refine_2.refine_2
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
R : ℝ≥0
f : α → ℝ
hbdd : ∀ᵐ (x : α) ∂μ, |f x| ≤ ↑R
hnm : m ≤ m0
hfint : Integrable f μ
h : 0 < μ {x | ↑R < |(μ[f|m]) x|}
⊢ ∫⁻ (a : α) in {x | ↑R < |(μ[f|m]) x|}, ↑‖(fun x => ↑R) a‖₊ ∂μ ≤
    ∫⁻ (a : α) in {x | ↑R < |(μ[f|m]) x|}, ↑‖(μ[f|m]) a‖₊ ∂μ
state_after: case pos.refine_2.refine_2
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
R : ℝ≥0
f : α → ℝ
hbdd : ∀ᵐ (x : α) ∂μ, |f x| ≤ ↑R
hnm : m ≤ m0
hfint : Integrable f μ
h : 0 < μ {x | ↑R < |(μ[f|m]) x|}
x : α
hx : x ∈ {x | ↑R < |(μ[f|m]) x|}
⊢ ↑‖(fun x => ↑R) x‖₊ ≤ ↑‖(μ[f|m]) x‖₊
tactic: refine setLIntegral_mono
    (stronglyMeasurable_condexp.mono hnm).measurable.nnnorm.coe_nnreal_ennreal fun x hx => ?_
state_before: case pos.refine_2.refine_2
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
R : ℝ≥0
f : α → ℝ
hbdd : ∀ᵐ (x : α) ∂μ, |f x| ≤ ↑R
hnm : m ≤ m0
hfint : Integrable f μ
h : 0 < μ {x | ↑R < |(μ[f|m]) x|}
x : α
hx : x ∈ {x | ↑R < |(μ[f|m]) x|}
⊢ ↑‖(fun x => ↑R) x‖₊ ≤ ↑‖(μ[f|m]) x‖₊
state_after: case pos.refine_2.refine_2
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
R : ℝ≥0
f : α → ℝ
hbdd : ∀ᵐ (x : α) ∂μ, |f x| ≤ ↑R
hnm : m ≤ m0
hfint : Integrable f μ
h : 0 < μ {x | ↑R < |(μ[f|m]) x|}
x : α
hx : x ∈ {x | ↑R < |(μ[f|m]) x|}
⊢ ⟨↑R, ⋯⟩ ≤ ‖(μ[f|m]) x‖₊
tactic: rw [ENNReal.coe_le_coe, Real.nnnorm_of_nonneg R.coe_nonneg]
state_before: case pos.refine_2.refine_2
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
R : ℝ≥0
f : α → ℝ
hbdd : ∀ᵐ (x : α) ∂μ, |f x| ≤ ↑R
hnm : m ≤ m0
hfint : Integrable f μ
h : 0 < μ {x | ↑R < |(μ[f|m]) x|}
x : α
hx : x ∈ {x | ↑R < |(μ[f|m]) x|}
⊢ ⟨↑R, ⋯⟩ ≤ ‖(μ[f|m]) x‖₊
state_after: no goals
tactic: exact Subtype.mk_le_mk.2 (le_of_lt hx)