-- Mathlib/MeasureTheory/Function/ConditionalExpectation/Real.lean
theorem setIntegral_abs_condExp_le {s : Set α} (hs : MeasurableSet[m] s) (f : α → ℝ) :
    ∫ x in s, |(μ[f|m]) x| ∂μ ≤ ∫ x in s, |f x| ∂μ

Proof state:
case neg
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
s : Set α
hs : MeasurableSet s
f : α → ℝ
hnm : m ≤ m0
hfint : ¬Integrable f μ
⊢ ∫ (x : α) in s, |(μ[f|m]) x| ∂μ ≤ ∫ (x : α) in s, |f x| ∂μ

Tactic:
simp only [condExp_of_not_integrable hfint, Pi.zero_apply, abs_zero, integral_const,
  Algebra.id.smul_eq_mul, mul_zero]

Result:
case neg
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
s : Set α
hs : MeasurableSet s
f : α → ℝ
hnm : m ≤ m0
hfint : ¬Integrable f μ
⊢ 0 ≤ ∫ (x : α) in s, |f x| ∂μ

Proof state:
case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
s : Set α
hs : MeasurableSet s
f : α → ℝ
hnm : m ≤ m0
⊢ ∫ (x : α) in s, |(μ[f|m]) x| ∂μ ≤ ∫ (x : α) in s, |f x| ∂μ

case neg
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
s : Set α
hs : MeasurableSet s
f : α → ℝ
hnm : ¬m ≤ m0
⊢ ∫ (x : α) in s, |(μ[f|m]) x| ∂μ ≤ ∫ (x : α) in s, |f x| ∂μ

Tactic:
swap

Result:
case neg
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
s : Set α
hs : MeasurableSet s
f : α → ℝ
hnm : ¬m ≤ m0
⊢ ∫ (x : α) in s, |(μ[f|m]) x| ∂μ ≤ ∫ (x : α) in s, |f x| ∂μ

case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
s : Set α
hs : MeasurableSet s
f : α → ℝ
hnm : m ≤ m0
⊢ ∫ (x : α) in s, |(μ[f|m]) x| ∂μ ≤ ∫ (x : α) in s, |f x| ∂μ

Proof state:
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
s : Set α
hs : MeasurableSet s
f : α → ℝ
⊢ ∫ (x : α) in s, |(μ[f|m]) x| ∂μ ≤ ∫ (x : α) in s, |f x| ∂μ

Tactic:
by_cases hnm : m ≤ m0

Result:
case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
s : Set α
hs : MeasurableSet s
f : α → ℝ
hnm : m ≤ m0
⊢ ∫ (x : α) in s, |(μ[f|m]) x| ∂μ ≤ ∫ (x : α) in s, |f x| ∂μ

case neg
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
s : Set α
hs : MeasurableSet s
f : α → ℝ
hnm : ¬m ≤ m0
⊢ ∫ (x : α) in s, |(μ[f|m]) x| ∂μ ≤ ∫ (x : α) in s, |f x| ∂μ

Proof state:
case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
s : Set α
hs : MeasurableSet s
f : α → ℝ
hnm : m ≤ m0
⊢ ∫ (x : α) in s, |(μ[f|m]) x| ∂μ ≤ ∫ (x : α) in s, |f x| ∂μ

Tactic:
by_cases hfint : Integrable f μ

Result:
case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
s : Set α
hs : MeasurableSet s
f : α → ℝ
hnm : m ≤ m0
hfint : Integrable f μ
⊢ ∫ (x : α) in s, |(μ[f|m]) x| ∂μ ≤ ∫ (x : α) in s, |f x| ∂μ

case neg
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
s : Set α
hs : MeasurableSet s
f : α → ℝ
hnm : m ≤ m0
hfint : ¬Integrable f μ
⊢ ∫ (x : α) in s, |(μ[f|m]) x| ∂μ ≤ ∫ (x : α) in s, |f x| ∂μ

Proof state:
case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
s : Set α
hs : MeasurableSet s
f : α → ℝ
hnm : m ≤ m0
hfint : Integrable f μ
this : ∫ (x : α) in s, |(μ[f|m]) x| ∂μ = ∫ (x : α), |(μ[s.indicator f|m]) x| ∂μ
x : α
⊢ (fun x => |s.indicator f x|) x = s.indicator (fun x => |f x|) x

Tactic:
simp_rw [← Real.norm_eq_abs, norm_indicator_eq_indicator_norm]

Result:
no goals

Proof state:
case neg
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
s : Set α
hs : MeasurableSet s
f : α → ℝ
hnm : m ≤ m0
hfint : ¬Integrable f μ
⊢ 0 ≤ ∫ (x : α) in s, |f x| ∂μ

Tactic:
positivity

Result:
no goals

Proof state:
case neg
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
s : Set α
hs : MeasurableSet s
f : α → ℝ
hnm : ¬m ≤ m0
⊢ 0 ≤ ∫ (x : α) in s, |f x| ∂μ

Tactic:
positivity

Result:
no goals

Proof state:
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
s : Set α
hs : MeasurableSet s
f : α → ℝ
hnm : m ≤ m0
hfint : Integrable f μ
this : (fun x => |(μ[s.indicator f|m]) x|) =ᶠ[ae μ] fun x => |s.indicator (μ[f|m]) x|
x : α
⊢ s.indicator (fun x => |(μ[f|m]) x|) x = |s.indicator (μ[f|m]) x|

Tactic:
rw [← Real.norm_eq_abs, norm_indicator_eq_indicator_norm]

Result:
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
s : Set α
hs : MeasurableSet s
f : α → ℝ
hnm : m ≤ m0
hfint : Integrable f μ
this : (fun x => |(μ[s.indicator f|m]) x|) =ᶠ[ae μ] fun x => |s.indicator (μ[f|m]) x|
x : α
⊢ s.indicator (fun x => |(μ[f|m]) x|) x = s.indicator (fun a => ‖(μ[f|m]) a‖) x

Proof state:
case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
s : Set α
hs : MeasurableSet s
f : α → ℝ
hnm : m ≤ m0
hfint : Integrable f μ
⊢ ∫ (x : α) in s, |(μ[f|m]) x| ∂μ ≤ ∫ (x : α) in s, |f x| ∂μ

case neg
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
s : Set α
hs : MeasurableSet s
f : α → ℝ
hnm : m ≤ m0
hfint : ¬Integrable f μ
⊢ ∫ (x : α) in s, |(μ[f|m]) x| ∂μ ≤ ∫ (x : α) in s, |f x| ∂μ

Tactic:
swap

Result:
case neg
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
s : Set α
hs : MeasurableSet s
f : α → ℝ
hnm : m ≤ m0
hfint : ¬Integrable f μ
⊢ ∫ (x : α) in s, |(μ[f|m]) x| ∂μ ≤ ∫ (x : α) in s, |f x| ∂μ

case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
s : Set α
hs : MeasurableSet s
f : α → ℝ
hnm : m ≤ m0
hfint : Integrable f μ
⊢ ∫ (x : α) in s, |(μ[f|m]) x| ∂μ ≤ ∫ (x : α) in s, |f x| ∂μ

Proof state:
case neg
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
s : Set α
hs : MeasurableSet s
f : α → ℝ
hnm : ¬m ≤ m0
⊢ ∫ (x : α) in s, |(μ[f|m]) x| ∂μ ≤ ∫ (x : α) in s, |f x| ∂μ

Tactic:
simp_rw [condExp_of_not_le hnm, Pi.zero_apply, abs_zero, integral_zero]

Result:
case neg
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
s : Set α
hs : MeasurableSet s
f : α → ℝ
hnm : ¬m ≤ m0
⊢ 0 ≤ ∫ (x : α) in s, |f x| ∂μ

Proof state:
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
s : Set α
hs : MeasurableSet s
f : α → ℝ
hnm : m ≤ m0
hfint : Integrable f μ
⊢ ∫ (x : α), s.indicator (fun x => |(μ[f|m]) x|) x ∂μ = ∫ (x : α), |(μ[s.indicator f|m]) x| ∂μ

Tactic:
refine integral_congr_ae ?_

Result:
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
s : Set α
hs : MeasurableSet s
f : α → ℝ
hnm : m ≤ m0
hfint : Integrable f μ
⊢ (s.indicator fun x => |(μ[f|m]) x|) =ᶠ[ae μ] fun x => |(μ[s.indicator f|m]) x|

Proof state:
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
s : Set α
hs : MeasurableSet s
f : α → ℝ
hnm : m ≤ m0
hfint : Integrable f μ
this : (fun x => |(μ[s.indicator f|m]) x|) =ᶠ[ae μ] fun x => |s.indicator (μ[f|m]) x|
x : α
⊢ s.indicator (fun x => |(μ[f|m]) x|) x = s.indicator (fun a => ‖(μ[f|m]) a‖) x

Tactic:
simp only [Real.norm_eq_abs]

Result:
no goals

Proof state:
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
s : Set α
hs : MeasurableSet s
f : α → ℝ
hnm : m ≤ m0
hfint : Integrable f μ
⊢ ∫ (x : α) in s, |(μ[f|m]) x| ∂μ = ∫ (x : α), |(μ[s.indicator f|m]) x| ∂μ

Tactic:
rw [← integral_indicator (hnm _ hs)]

Result:
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
s : Set α
hs : MeasurableSet s
f : α → ℝ
hnm : m ≤ m0
hfint : Integrable f μ
⊢ ∫ (x : α), s.indicator (fun x => |(μ[f|m]) x|) x ∂μ = ∫ (x : α), |(μ[s.indicator f|m]) x| ∂μ

Proof state:
case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
s : Set α
hs : MeasurableSet s
f : α → ℝ
hnm : m ≤ m0
hfint : Integrable f μ
this : ∫ (x : α) in s, |(μ[f|m]) x| ∂μ = ∫ (x : α), |(μ[s.indicator f|m]) x| ∂μ
⊢ ∫ (x : α) in s, |(μ[f|m]) x| ∂μ ≤ ∫ (x : α) in s, |f x| ∂μ

Tactic:
rw [this, ← integral_indicator (hnm _ hs)]

Result:
case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
s : Set α
hs : MeasurableSet s
f : α → ℝ
hnm : m ≤ m0
hfint : Integrable f μ
this : ∫ (x : α) in s, |(μ[f|m]) x| ∂μ = ∫ (x : α), |(μ[s.indicator f|m]) x| ∂μ
⊢ ∫ (x : α), |(μ[s.indicator f|m]) x| ∂μ ≤ ∫ (x : α), s.indicator (fun x => |f x|) x ∂μ