l3lab/ntp-mathlib huggingface dataset:
theorem rnDeriv_ae_eq_condexp {hm : m ≤ m0} [hμm : SigmaFinite (μ.trim hm)] {f : α → ℝ}
    (hf : Integrable f μ) :
    SignedMeasure.rnDeriv ((μ.withDensityᵥ f).trim hm) (μ.trim hm) =ᵐ[μ] μ[f|m] := by
  refine' ae_eq_condexp_of_forall_set_integral_eq hm hf _ _ _
  · exact fun _ _ _ => (integrable_of_integrable_trim hm
      (SignedMeasure.integrable_rnDeriv ((μ.withDensityᵥ f).trim hm) (μ.trim hm))).integrableOn
  · intro s hs _
    

Proof state:
case refine'_2
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
hμm : SigmaFinite (Measure.trim μ hm)
f : α → ℝ
hf : Integrable f
s : Set α
hs : MeasurableSet s
a✝ : ↑↑μ s < ⊤
⊢ ∫ (x : α) in s, SignedMeasure.rnDeriv (VectorMeasure.trim (Measure.withDensityᵥ μ f) hm) (Measure.trim μ hm) x ∂μ =
    ∫ (x : α) in s, f x ∂μ

Next tactic:
conv_rhs => rw [← hf.withDensityᵥ_trim_eq_integral hm hs,
      ← SignedMeasure.withDensityᵥ_rnDeriv_eq ((μ.withDensityᵥ f).trim hm) (μ.trim hm)
        (hf.withDensityᵥ_trim_absolutelyContinuous hm)]
theorem rnDeriv_ae_eq_condexp {hm : m ≤ m0} [hμm : SigmaFinite (μ.trim hm)] {f : α → ℝ}
    (hf : Integrable f μ) :
    SignedMeasure.rnDeriv ((μ.withDensityᵥ f).trim hm) (μ.trim hm) =ᵐ[μ] μ[f|m] := by
  refine' ae_eq_condexp_of_forall_set_integral_eq hm hf _ _ _
  · exact fun _ _ _ => (integrable_of_integrable_trim hm
      (SignedMeasure.integrable_rnDeriv ((μ.withDensityᵥ f).trim hm) (μ.trim hm))).integrableOn
  · intro s hs _
    conv_rhs => 

Proof state:
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
hμm : SigmaFinite (Measure.trim μ hm)
f : α → ℝ
hf : Integrable f
s : Set α
hs : MeasurableSet s
a✝ : ↑↑μ s < ⊤
| ∫ (x : α) in s, f x ∂μ

Next tactic:
rw [← hf.withDensityᵥ_trim_eq_integral hm hs,
      ← SignedMeasure.withDensityᵥ_rnDeriv_eq ((μ.withDensityᵥ f).trim hm) (μ.trim hm)
        (hf.withDensityᵥ_trim_absolutelyContinuous hm)]
theorem rnDeriv_ae_eq_condexp {hm : m ≤ m0} [hμm : SigmaFinite (μ.trim hm)] {f : α → ℝ}
    (hf : Integrable f μ) :
    SignedMeasure.rnDeriv ((μ.withDensityᵥ f).trim hm) (μ.trim hm) =ᵐ[μ] μ[f|m] := by
  refine' ae_eq_condexp_of_forall_set_integral_eq hm hf _ _ _
  · exact fun _ _ _ => (integrable_of_integrable_trim hm
      (SignedMeasure.integrable_rnDeriv ((μ.withDensityᵥ f).trim hm) (μ.trim hm))).integrableOn
  · intro s hs _
    conv_rhs => rw [← hf.withDensityᵥ_trim_eq_integral hm hs,
      ← SignedMeasure.withDensityᵥ_rnDeriv_eq ((μ.withDensityᵥ f).trim hm) (μ.trim hm)
        (hf.withDensityᵥ_trim_absolutelyContinuous hm)]
    

Proof state:
case refine'_2
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
hμm : SigmaFinite (Measure.trim μ hm)
f : α → ℝ
hf : Integrable f
s : Set α
hs : MeasurableSet s
a✝ : ↑↑μ s < ⊤
⊢ ∫ (x : α) in s, SignedMeasure.rnDeriv (VectorMeasure.trim (Measure.withDensityᵥ μ f) hm) (Measure.trim μ hm) x ∂μ =
    ↑(Measure.withDensityᵥ (Measure.trim μ hm)
          (SignedMeasure.rnDeriv (VectorMeasure.trim (Measure.withDensityᵥ μ f) hm) (Measure.trim μ hm)))
      s

Next tactic:
rw [withDensityᵥ_apply
      (SignedMeasure.integrable_rnDeriv ((μ.withDensityᵥ f).trim hm) (μ.trim hm)) hs,
      ← set_integral_trim hm _ hs]
theorem rnDeriv_ae_eq_condexp {hm : m ≤ m0} [hμm : SigmaFinite (μ.trim hm)] {f : α → ℝ}
    (hf : Integrable f μ) :
    SignedMeasure.rnDeriv ((μ.withDensityᵥ f).trim hm) (μ.trim hm) =ᵐ[μ] μ[f|m] := by
  refine' ae_eq_condexp_of_forall_set_integral_eq hm hf _ _ _
  · exact fun _ _ _ => (integrable_of_integrable_trim hm
      (SignedMeasure.integrable_rnDeriv ((μ.withDensityᵥ f).trim hm) (μ.trim hm))).integrableOn
  · intro s hs _
    conv_rhs => rw [← hf.withDensityᵥ_trim_eq_integral hm hs,
      ← SignedMeasure.withDensityᵥ_rnDeriv_eq ((μ.withDensityᵥ f).trim hm) (μ.trim hm)
        (hf.withDensityᵥ_trim_absolutelyContinuous hm)]
    rw [withDensityᵥ_apply
      (SignedMeasure.integrable_rnDeriv ((μ.withDensityᵥ f).trim hm) (μ.trim hm)) hs,
      ← set_integral_trim hm _ hs]
    

Proof state:
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
hμm : SigmaFinite (Measure.trim μ hm)
f : α → ℝ
hf : Integrable f
s : Set α
hs : MeasurableSet s
a✝ : ↑↑μ s < ⊤
⊢ StronglyMeasurable fun x =>
    SignedMeasure.rnDeriv (VectorMeasure.trim (Measure.withDensityᵥ μ f) hm) (Measure.trim μ hm) x

Next tactic:
exact (SignedMeasure.measurable_rnDeriv _ _).stronglyMeasurable
theorem rnDeriv_ae_eq_condexp {hm : m ≤ m0} [hμm : SigmaFinite (μ.trim hm)] {f : α → ℝ}
    (hf : Integrable f μ) :
    SignedMeasure.rnDeriv ((μ.withDensityᵥ f).trim hm) (μ.trim hm) =ᵐ[μ] μ[f|m] := by
  refine' ae_eq_condexp_of_forall_set_integral_eq hm hf _ _ _
  · exact fun _ _ _ => (integrable_of_integrable_trim hm
      (SignedMeasure.integrable_rnDeriv ((μ.withDensityᵥ f).trim hm) (μ.trim hm))).integrableOn
  · intro s hs _
    conv_rhs => rw [← hf.withDensityᵥ_trim_eq_integral hm hs,
      ← SignedMeasure.withDensityᵥ_rnDeriv_eq ((μ.withDensityᵥ f).trim hm) (μ.trim hm)
        (hf.withDensityᵥ_trim_absolutelyContinuous hm)]
    rw [withDensityᵥ_apply
      (SignedMeasure.integrable_rnDeriv ((μ.withDensityᵥ f).trim hm) (μ.trim hm)) hs,
      ← set_integral_trim hm _ hs]
    exact (SignedMeasure.measurable_rnDeriv _ _).stronglyMeasurable
  · 

Proof state:
case refine'_3
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
hμm : SigmaFinite (Measure.trim μ hm)
f : α → ℝ
hf : Integrable f
⊢ AEStronglyMeasurable' m (SignedMeasure.rnDeriv (VectorMeasure.trim (Measure.withDensityᵥ μ f) hm) (Measure.trim μ hm))
    μ

Next tactic:
exact StronglyMeasurable.aeStronglyMeasurable'
      (SignedMeasure.measurable_rnDeriv _ _).stronglyMeasurable
theorem snorm_one_condexp_le_snorm (f : α → ℝ) : snorm (μ[f|m]) 1 μ ≤ snorm f 1 μ := by
  

Proof state:
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
⊢ snorm (μ[f|m]) 1 μ ≤ snorm f 1 μ

Next tactic:
by_cases hf : Integrable f μ
theorem snorm_one_condexp_le_snorm (f : α → ℝ) : snorm (μ[f|m]) 1 μ ≤ snorm f 1 μ := by
  by_cases hf : Integrable f μ
  

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

Next tactic:
swap
theorem snorm_one_condexp_le_snorm (f : α → ℝ) : snorm (μ[f|m]) 1 μ ≤ snorm f 1 μ := by
  by_cases hf : Integrable f μ
  swap; · 

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

Next tactic:
rw [condexp_undef hf, snorm_zero]
theorem snorm_one_condexp_le_snorm (f : α → ℝ) : snorm (μ[f|m]) 1 μ ≤ snorm f 1 μ := by
  by_cases hf : Integrable f μ
  swap; · rw [condexp_undef hf, snorm_zero]; 

Proof state:
case neg
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : ¬Integrable f
⊢ 0 ≤ snorm f 1 μ

Next tactic:
exact zero_le _
theorem snorm_one_condexp_le_snorm (f : α → ℝ) : snorm (μ[f|m]) 1 μ ≤ snorm f 1 μ := by
  by_cases hf : Integrable f μ
  swap; · rw [condexp_undef hf, snorm_zero]; exact zero_le _
  

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

Next tactic:
by_cases hm : m ≤ m0
theorem snorm_one_condexp_le_snorm (f : α → ℝ) : snorm (μ[f|m]) 1 μ ≤ snorm f 1 μ := by
  by_cases hf : Integrable f μ
  swap; · rw [condexp_undef hf, snorm_zero]; exact zero_le _
  by_cases hm : m ≤ m0
  

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

Next tactic:
swap
theorem snorm_one_condexp_le_snorm (f : α → ℝ) : snorm (μ[f|m]) 1 μ ≤ snorm f 1 μ := by
  by_cases hf : Integrable f μ
  swap; · rw [condexp_undef hf, snorm_zero]; exact zero_le _
  by_cases hm : m ≤ m0
  swap; · 

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

Next tactic:
rw [condexp_of_not_le hm, snorm_zero]
theorem snorm_one_condexp_le_snorm (f : α → ℝ) : snorm (μ[f|m]) 1 μ ≤ snorm f 1 μ := by
  by_cases hf : Integrable f μ
  swap; · rw [condexp_undef hf, snorm_zero]; exact zero_le _
  by_cases hm : m ≤ m0
  swap; · rw [condexp_of_not_le hm, snorm_zero]; 

Proof state:
case neg
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Integrable f
hm : ¬m ≤ m0
⊢ 0 ≤ snorm f 1 μ

Next tactic:
exact zero_le _
theorem snorm_one_condexp_le_snorm (f : α → ℝ) : snorm (μ[f|m]) 1 μ ≤ snorm f 1 μ := by
  by_cases hf : Integrable f μ
  swap; · rw [condexp_undef hf, snorm_zero]; exact zero_le _
  by_cases hm : m ≤ m0
  swap; · rw [condexp_of_not_le hm, snorm_zero]; exact zero_le _
  

Proof state:
case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Integrable f
hm : m ≤ m0
⊢ snorm (μ[f|m]) 1 μ ≤ snorm f 1 μ

Next tactic:
by_cases hsig : SigmaFinite (μ.trim hm)
theorem snorm_one_condexp_le_snorm (f : α → ℝ) : snorm (μ[f|m]) 1 μ ≤ snorm f 1 μ := by
  by_cases hf : Integrable f μ
  swap; · rw [condexp_undef hf, snorm_zero]; exact zero_le _
  by_cases hm : m ≤ m0
  swap; · rw [condexp_of_not_le hm, snorm_zero]; exact zero_le _
  by_cases hsig : SigmaFinite (μ.trim hm)
  

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

Next tactic:
swap
theorem snorm_one_condexp_le_snorm (f : α → ℝ) : snorm (μ[f|m]) 1 μ ≤ snorm f 1 μ := by
  by_cases hf : Integrable f μ
  swap; · rw [condexp_undef hf, snorm_zero]; exact zero_le _
  by_cases hm : m ≤ m0
  swap; · rw [condexp_of_not_le hm, snorm_zero]; exact zero_le _
  by_cases hsig : SigmaFinite (μ.trim hm)
  swap; · 

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

Next tactic:
rw [condexp_of_not_sigmaFinite hm hsig, snorm_zero]
theorem snorm_one_condexp_le_snorm (f : α → ℝ) : snorm (μ[f|m]) 1 μ ≤ snorm f 1 μ := by
  by_cases hf : Integrable f μ
  swap; · rw [condexp_undef hf, snorm_zero]; exact zero_le _
  by_cases hm : m ≤ m0
  swap; · rw [condexp_of_not_le hm, snorm_zero]; exact zero_le _
  by_cases hsig : SigmaFinite (μ.trim hm)
  swap; · rw [condexp_of_not_sigmaFinite hm hsig, snorm_zero]; 

Proof state:
case neg
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Integrable f
hm : m ≤ m0
hsig : ¬SigmaFinite (Measure.trim μ hm)
⊢ 0 ≤ snorm f 1 μ

Next tactic:
exact zero_le _
theorem snorm_one_condexp_le_snorm (f : α → ℝ) : snorm (μ[f|m]) 1 μ ≤ snorm f 1 μ := by
  by_cases hf : Integrable f μ
  swap; · rw [condexp_undef hf, snorm_zero]; exact zero_le _
  by_cases hm : m ≤ m0
  swap; · rw [condexp_of_not_le hm, snorm_zero]; exact zero_le _
  by_cases hsig : SigmaFinite (μ.trim hm)
  swap; · rw [condexp_of_not_sigmaFinite hm hsig, snorm_zero]; exact zero_le _
  

Proof state:
case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Integrable f
hm : m ≤ m0
hsig : SigmaFinite (Measure.trim μ hm)
⊢ snorm (μ[f|m]) 1 μ ≤ snorm f 1 μ

Next tactic:
calc
    snorm (μ[f|m]) 1 μ ≤ snorm (μ[(|f|)|m]) 1 μ := by
      refine' snorm_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_self (f x): ∀ x, -f x ≤ |f x|)))] with x hx₁ hx₂
      exact abs_le_abs hx₁ hx₂
    _ = snorm f 1 μ := by
      rw [snorm_one_eq_lintegral_nnnorm, snorm_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 [← integral_condexp hm hf.abs]
      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
theorem snorm_one_condexp_le_snorm (f : α → ℝ) : snorm (μ[f|m]) 1 μ ≤ snorm f 1 μ := by
  by_cases hf : Integrable f μ
  swap; · rw [condexp_undef hf, snorm_zero]; exact zero_le _
  by_cases hm : m ≤ m0
  swap; · rw [condexp_of_not_le hm, snorm_zero]; exact zero_le _
  by_cases hsig : SigmaFinite (μ.trim hm)
  swap; · rw [condexp_of_not_sigmaFinite hm hsig, snorm_zero]; exact zero_le _
  calc
    snorm (μ[f|m]) 1 μ ≤ snorm (μ[(|f|)|m]) 1 μ := by
      

Proof state:
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Integrable f
hm : m ≤ m0
hsig : SigmaFinite (Measure.trim μ hm)
⊢ snorm (μ[f|m]) 1 μ ≤ snorm (μ[|f||m]) 1 μ

Next tactic:
refine' snorm_mono_ae _
theorem snorm_one_condexp_le_snorm (f : α → ℝ) : snorm (μ[f|m]) 1 μ ≤ snorm f 1 μ := by
  by_cases hf : Integrable f μ
  swap; · rw [condexp_undef hf, snorm_zero]; exact zero_le _
  by_cases hm : m ≤ m0
  swap; · rw [condexp_of_not_le hm, snorm_zero]; exact zero_le _
  by_cases hsig : SigmaFinite (μ.trim hm)
  swap; · rw [condexp_of_not_sigmaFinite hm hsig, snorm_zero]; exact zero_le _
  calc
    snorm (μ[f|m]) 1 μ ≤ snorm (μ[(|f|)|m]) 1 μ := by
      refine' snorm_mono_ae _
      

Proof state:
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Integrable f
hm : m ≤ m0
hsig : SigmaFinite (Measure.trim μ hm)
⊢ ∀ᵐ (x : α) ∂μ, ‖(μ[f|m]) x‖ ≤ ‖(μ[|f||m]) x‖

Next tactic:
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_self (f x): ∀ x, -f x ≤ |f x|)))] with x hx₁ hx₂
theorem snorm_one_condexp_le_snorm (f : α → ℝ) : snorm (μ[f|m]) 1 μ ≤ snorm f 1 μ := by
  by_cases hf : Integrable f μ
  swap; · rw [condexp_undef hf, snorm_zero]; exact zero_le _
  by_cases hm : m ≤ m0
  swap; · rw [condexp_of_not_le hm, snorm_zero]; exact zero_le _
  by_cases hsig : SigmaFinite (μ.trim hm)
  swap; · rw [condexp_of_not_sigmaFinite hm hsig, snorm_zero]; exact zero_le _
  calc
    snorm (μ[f|m]) 1 μ ≤ snorm (μ[(|f|)|m]) 1 μ := by
      refine' snorm_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_self (f x): ∀ x, -f x ≤ |f x|)))] with x hx₁ hx₂
      

Proof state:
case h
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Integrable f
hm : m ≤ m0
hsig : SigmaFinite (Measure.trim μ hm)
x : α
hx₁ : (μ[f|?m.6495]) x ≤ (μ[fun a => |f a||?m.6495]) x
hx₂ : (-μ[f|?m.5997]) x ≤ (μ[fun a => |f a||?m.5997]) x
⊢ ‖(μ[f|m]) x‖ ≤ ‖(μ[|f||m]) x‖

Next tactic:
exact abs_le_abs hx₁ hx₂
theorem snorm_one_condexp_le_snorm (f : α → ℝ) : snorm (μ[f|m]) 1 μ ≤ snorm f 1 μ := by
  by_cases hf : Integrable f μ
  swap; · rw [condexp_undef hf, snorm_zero]; exact zero_le _
  by_cases hm : m ≤ m0
  swap; · rw [condexp_of_not_le hm, snorm_zero]; exact zero_le _
  by_cases hsig : SigmaFinite (μ.trim hm)
  swap; · rw [condexp_of_not_sigmaFinite hm hsig, snorm_zero]; exact zero_le _
  calc
    snorm (μ[f|m]) 1 μ ≤ snorm (μ[(|f|)|m]) 1 μ := by
      refine' snorm_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_self (f x): ∀ x, -f x ≤ |f x|)))] with x hx₁ hx₂
      exact abs_le_abs hx₁ hx₂
    _ = snorm f 1 μ := by
      

Proof state:
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Integrable f
hm : m ≤ m0
hsig : SigmaFinite (Measure.trim μ hm)
⊢ snorm (μ[|f||m]) 1 μ = snorm f 1 μ

Next tactic:
rw [snorm_one_eq_lintegral_nnnorm, snorm_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]
theorem snorm_one_condexp_le_snorm (f : α → ℝ) : snorm (μ[f|m]) 1 μ ≤ snorm f 1 μ := by
  by_cases hf : Integrable f μ
  swap; · rw [condexp_undef hf, snorm_zero]; exact zero_le _
  by_cases hm : m ≤ m0
  swap; · rw [condexp_of_not_le hm, snorm_zero]; exact zero_le _
  by_cases hsig : SigmaFinite (μ.trim hm)
  swap; · rw [condexp_of_not_sigmaFinite hm hsig, snorm_zero]; exact zero_le _
  calc
    snorm (μ[f|m]) 1 μ ≤ snorm (μ[(|f|)|m]) 1 μ := by
      refine' snorm_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_self (f x): ∀ x, -f x ≤ |f x|)))] with x hx₁ hx₂
      exact abs_le_abs hx₁ hx₂
    _ = snorm f 1 μ := by
      rw [snorm_one_eq_lintegral_nnnorm, snorm_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]
      

Proof state:
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Integrable f
hm : m ≤ m0
hsig : SigmaFinite (Measure.trim μ hm)
⊢ ∫ (x : α), ‖(μ[|f||m]) x‖ ∂μ = ∫ (x : α), ‖f x‖ ∂μ

Next tactic:
simp_rw [Real.norm_eq_abs]
theorem snorm_one_condexp_le_snorm (f : α → ℝ) : snorm (μ[f|m]) 1 μ ≤ snorm f 1 μ := by
  by_cases hf : Integrable f μ
  swap; · rw [condexp_undef hf, snorm_zero]; exact zero_le _
  by_cases hm : m ≤ m0
  swap; · rw [condexp_of_not_le hm, snorm_zero]; exact zero_le _
  by_cases hsig : SigmaFinite (μ.trim hm)
  swap; · rw [condexp_of_not_sigmaFinite hm hsig, snorm_zero]; exact zero_le _
  calc
    snorm (μ[f|m]) 1 μ ≤ snorm (μ[(|f|)|m]) 1 μ := by
      refine' snorm_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_self (f x): ∀ x, -f x ≤ |f x|)))] with x hx₁ hx₂
      exact abs_le_abs hx₁ hx₂
    _ = snorm f 1 μ := by
      rw [snorm_one_eq_lintegral_nnnorm, snorm_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]
      

Proof state:
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Integrable f
hm : m ≤ m0
hsig : SigmaFinite (Measure.trim μ hm)
⊢ ∫ (x : α), |(μ[|f||m]) x| ∂μ = ∫ (x : α), |f x| ∂μ

Next tactic:
rw [← integral_condexp hm hf.abs]
theorem snorm_one_condexp_le_snorm (f : α → ℝ) : snorm (μ[f|m]) 1 μ ≤ snorm f 1 μ := by
  by_cases hf : Integrable f μ
  swap; · rw [condexp_undef hf, snorm_zero]; exact zero_le _
  by_cases hm : m ≤ m0
  swap; · rw [condexp_of_not_le hm, snorm_zero]; exact zero_le _
  by_cases hsig : SigmaFinite (μ.trim hm)
  swap; · rw [condexp_of_not_sigmaFinite hm hsig, snorm_zero]; exact zero_le _
  calc
    snorm (μ[f|m]) 1 μ ≤ snorm (μ[(|f|)|m]) 1 μ := by
      refine' snorm_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_self (f x): ∀ x, -f x ≤ |f x|)))] with x hx₁ hx₂
      exact abs_le_abs hx₁ hx₂
    _ = snorm f 1 μ := by
      rw [snorm_one_eq_lintegral_nnnorm, snorm_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 [← integral_condexp hm hf.abs]
      

Proof state:
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Integrable f
hm : m ≤ m0
hsig : SigmaFinite (Measure.trim μ hm)
⊢ ∫ (x : α), |(μ[|f||m]) x| ∂μ = ∫ (x : α), (μ[fun a => |f a||m]) x ∂μ

Next tactic:
refine' integral_congr_ae _
theorem snorm_one_condexp_le_snorm (f : α → ℝ) : snorm (μ[f|m]) 1 μ ≤ snorm f 1 μ := by
  by_cases hf : Integrable f μ
  swap; · rw [condexp_undef hf, snorm_zero]; exact zero_le _
  by_cases hm : m ≤ m0
  swap; · rw [condexp_of_not_le hm, snorm_zero]; exact zero_le _
  by_cases hsig : SigmaFinite (μ.trim hm)
  swap; · rw [condexp_of_not_sigmaFinite hm hsig, snorm_zero]; exact zero_le _
  calc
    snorm (μ[f|m]) 1 μ ≤ snorm (μ[(|f|)|m]) 1 μ := by
      refine' snorm_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_self (f x): ∀ x, -f x ≤ |f x|)))] with x hx₁ hx₂
      exact abs_le_abs hx₁ hx₂
    _ = snorm f 1 μ := by
      rw [snorm_one_eq_lintegral_nnnorm, snorm_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 [← integral_condexp hm hf.abs]
      refine' integral_congr_ae _
      

Proof state:
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Integrable f
hm : m ≤ m0
hsig : SigmaFinite (Measure.trim μ hm)
⊢ (fun x => |(μ[|f||m]) x|) =ᵐ[μ] fun x => (μ[fun a => |f a||m]) x

Next tactic:
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|))
theorem snorm_one_condexp_le_snorm (f : α → ℝ) : snorm (μ[f|m]) 1 μ ≤ snorm f 1 μ := by
  by_cases hf : Integrable f μ
  swap; · rw [condexp_undef hf, snorm_zero]; exact zero_le _
  by_cases hm : m ≤ m0
  swap; · rw [condexp_of_not_le hm, snorm_zero]; exact zero_le _
  by_cases hsig : SigmaFinite (μ.trim hm)
  swap; · rw [condexp_of_not_sigmaFinite hm hsig, snorm_zero]; exact zero_le _
  calc
    snorm (μ[f|m]) 1 μ ≤ snorm (μ[(|f|)|m]) 1 μ := by
      refine' snorm_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_self (f x): ∀ x, -f x ≤ |f x|)))] with x hx₁ hx₂
      exact abs_le_abs hx₁ hx₂
    _ = snorm f 1 μ := by
      rw [snorm_one_eq_lintegral_nnnorm, snorm_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 [← integral_condexp hm hf.abs]
      refine' integral_congr_ae _
      have : 0 ≤ᵐ[μ] μ[(|f|)|m] := by
        

Proof state:
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f : α → ℝ
hf : Integrable f
hm : m ≤ m0
hsig : SigmaFinite (Measure.trim μ hm)
⊢ 0 ≤ᵐ[μ] μ[|f||m]

Next tactic:
rw [← condexp_zero]