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

Proof steps:
state_before: α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
⊢ eLpNorm (μ[f|m]) 1 μ ≤ eLpNorm f 1 μ
state_after: case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Integrable f μ
⊢ eLpNorm (μ[f|m]) 1 μ ≤ eLpNorm f 1 μ

case neg
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : ¬Integrable f μ
⊢ eLpNorm (μ[f|m]) 1 μ ≤ eLpNorm f 1 μ
tactic: by_cases hf : Integrable f μ
state_before: case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Integrable f μ
⊢ eLpNorm (μ[f|m]) 1 μ ≤ eLpNorm f 1 μ

case neg
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : ¬Integrable f μ
⊢ eLpNorm (μ[f|m]) 1 μ ≤ eLpNorm f 1 μ
state_after: case neg
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : ¬Integrable f μ
⊢ eLpNorm (μ[f|m]) 1 μ ≤ eLpNorm f 1 μ

case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Integrable f μ
⊢ eLpNorm (μ[f|m]) 1 μ ≤ eLpNorm f 1 μ
tactic: swap
state_before: case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Integrable f μ
⊢ eLpNorm (μ[f|m]) 1 μ ≤ eLpNorm f 1 μ
state_after: case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Integrable f μ
hm : m ≤ m0
⊢ eLpNorm (μ[f|m]) 1 μ ≤ eLpNorm f 1 μ

case neg
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Integrable f μ
hm : ¬m ≤ m0
⊢ eLpNorm (μ[f|m]) 1 μ ≤ eLpNorm f 1 μ
tactic: by_cases hm : m ≤ m0
state_before: case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Integrable f μ
hm : m ≤ m0
⊢ eLpNorm (μ[f|m]) 1 μ ≤ eLpNorm f 1 μ

case neg
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Integrable f μ
hm : ¬m ≤ m0
⊢ eLpNorm (μ[f|m]) 1 μ ≤ eLpNorm f 1 μ
state_after: case neg
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Integrable f μ
hm : ¬m ≤ m0
⊢ eLpNorm (μ[f|m]) 1 μ ≤ eLpNorm f 1 μ

case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Integrable f μ
hm : m ≤ m0
⊢ eLpNorm (μ[f|m]) 1 μ ≤ eLpNorm f 1 μ
tactic: swap
state_before: case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Integrable f μ
hm : m ≤ m0
⊢ eLpNorm (μ[f|m]) 1 μ ≤ eLpNorm f 1 μ
state_after: case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Integrable f μ
hm : m ≤ m0
hsig : SigmaFinite (μ.trim hm)
⊢ eLpNorm (μ[f|m]) 1 μ ≤ eLpNorm f 1 μ

case neg
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Integrable f μ
hm : m ≤ m0
hsig : ¬SigmaFinite (μ.trim hm)
⊢ eLpNorm (μ[f|m]) 1 μ ≤ eLpNorm f 1 μ
tactic: by_cases hsig : SigmaFinite (μ.trim hm)
state_before: case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Integrable f μ
hm : m ≤ m0
hsig : SigmaFinite (μ.trim hm)
⊢ eLpNorm (μ[f|m]) 1 μ ≤ eLpNorm f 1 μ

case neg
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Integrable f μ
hm : m ≤ m0
hsig : ¬SigmaFinite (μ.trim hm)
⊢ eLpNorm (μ[f|m]) 1 μ ≤ eLpNorm f 1 μ
state_after: case neg
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Integrable f μ
hm : m ≤ m0
hsig : ¬SigmaFinite (μ.trim hm)
⊢ eLpNorm (μ[f|m]) 1 μ ≤ eLpNorm f 1 μ

case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Integrable f μ
hm : m ≤ m0
hsig : SigmaFinite (μ.trim hm)
⊢ eLpNorm (μ[f|m]) 1 μ ≤ eLpNorm f 1 μ
tactic: swap
state_before: case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Integrable f μ
hm : m ≤ m0
hsig : SigmaFinite (μ.trim hm)
⊢ eLpNorm (μ[f|m]) 1 μ ≤ eLpNorm f 1 μ
state_after: no goals
tactic: calc
    eLpNorm (μ[f|m]) 1 μ ≤ eLpNorm (μ[(|f|)|m]) 1 μ := by
      refine eLpNorm_mono_ae ?_
      filter_upwards [condexp_mono hf hf.abs
        (ae_of_all μ (fun x => le_abs_self (f x) : ∀ x, f x ≤ |f x|)),
        EventuallyLE.trans (condexp_neg f).symm.le
          (condexp_mono hf.neg hf.abs
          (ae_of_all μ (fun x => neg_le_abs (f x) : ∀ x, -f x ≤ |f x|)))] with x hx₁ hx₂
      exact abs_le_abs hx₁ hx₂
    _ = eLpNorm f 1 μ := by
      rw [eLpNorm_one_eq_lintegral_nnnorm, eLpNorm_one_eq_lintegral_nnnorm, ←
        ENNReal.toReal_eq_toReal (ne_of_lt integrable_condexp.2) (ne_of_lt hf.2), ←
        integral_norm_eq_lintegral_nnnorm
          (stronglyMeasurable_condexp.mono hm).aestronglyMeasurable,
        ← integral_norm_eq_lintegral_nnnorm hf.1]
      simp_rw [Real.norm_eq_abs]
      rw (config := {occs := .pos [2]}) [← integral_condexp hm]
      refine integral_congr_ae ?_
      have : 0 ≤ᵐ[μ] μ[(|f|)|m] := by
        rw [← condexp_zero]
        exact condexp_mono (integrable_zero _ _ _) hf.abs
          (ae_of_all μ (fun x => abs_nonneg (f x) : ∀ x, 0 ≤ |f x|))
      filter_upwards [this] with x hx
      exact abs_eq_self.2 hx