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

tactic: by_cases hnm : m ≤ m0
state_before: α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
s : Set α
hs : MeasurableSet s
f : α → ℝ
⊢ ∫ (x : α) in s, |(μ[f|m]) x| ∂μ ≤ ∫ (x : α) in s, |f x| ∂μ
state_after: 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
state_before: 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| ∂μ
state_after: 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| ∂μ

tactic: by_cases hfint : Integrable f μ
state_before: 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| ∂μ
state_after: 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
state_before: 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| ∂μ
state_after: 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| ∂μ

tactic: have : ∫ x in s, |(μ[f|m]) x| ∂μ = ∫ x, |(μ[s.indicator f|m]) x| ∂μ := by
  rw [← integral_indicator (hnm _ hs)]
  refine integral_congr_ae ?_
  have : (fun x => |(μ[s.indicator f|m]) x|) =ᵐ[μ] fun x => |s.indicator (μ[f|m]) x| :=
    (condexp_indicator hfint hs).fun_comp abs
  refine EventuallyEq.trans (eventually_of_forall fun x => ?_) this.symm
  rw [← Real.norm_eq_abs, norm_indicator_eq_indicator_norm]
  simp only [Real.norm_eq_abs]
state_before: 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| ∂μ
state_after: 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)]
state_before: 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| ∂μ
state_after: 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 ∂μ

tactic: refine (integral_abs_condexp_le _).trans
  (le_of_eq <| integral_congr_ae <| eventually_of_forall fun x => ?_)
state_before: 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 ∂μ
state_after: 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]
state_before: 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
state_after: no goals

tactic: simp_rw [condexp_of_not_le hnm, Pi.zero_apply, abs_zero, integral_zero]
state_before: 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| ∂μ
state_after: 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
state_before: case neg
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
s : Set α
hs : MeasurableSet s
f : α → ℝ
hnm : ¬m ≤ m0
⊢ 0 ≤ ∫ (x : α) in s, |f x| ∂μ
state_after: no goals

tactic: simp only [condexp_undef hfint, Pi.zero_apply, abs_zero, integral_const, Algebra.id.smul_eq_mul,
  mul_zero]
state_before: 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| ∂μ
state_after: 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
state_before: 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| ∂μ
state_after: no goals

tactic: rw [← integral_indicator (hnm _ hs)]
state_before: α : 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| ∂μ
state_after: α : 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 ?_
state_before: α : 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| ∂μ
state_after: α : 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|

tactic: have : (fun x => |(μ[s.indicator f|m]) x|) =ᵐ[μ] fun x => |s.indicator (μ[f|m]) x| :=
  (condexp_indicator hfint hs).fun_comp abs
state_before: α : 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|
state_after: α : 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|
⊢ (s.indicator fun x => |(μ[f|m]) x|) =ᶠ[ae μ] fun x => |(μ[s.indicator f|m]) x|

tactic: refine EventuallyEq.trans (eventually_of_forall fun x => ?_) this.symm
state_before: α : 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|
⊢ (s.indicator fun x => |(μ[f|m]) x|) =ᶠ[ae μ] fun x => |(μ[s.indicator f|m]) x|
state_after: α : 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]
state_before: α : 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|
state_after: α : 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]
state_before: α : 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
state_after: no goals