l3lab/ntp-mathlib huggingface dataset:
theorem condexp_ae_eq_restrict_zero (hs : MeasurableSet[m] s) (hf : f =ᵐ[μ.restrict s] 0) :
    μ[f|m] =ᵐ[μ.restrict s] 0 := by
  by_cases hm : m ≤ m0
  swap; · simp_rw [condexp_of_not_le hm]; rfl
  by_cases hμm : SigmaFinite (μ.trim hm)
  swap; · simp_rw [condexp_of_not_sigmaFinite hm hμm]; rfl
  haveI : SigmaFinite (μ.trim hm) := hμm
  have : SigmaFinite ((μ.restrict s).trim hm) := by
    rw [← restrict_trim hm _ hs]
    exact Restrict.sigmaFinite _ s
  by_cases hf_int : Integrable f μ
  

Proof state:
case pos
α : Type u_1
𝕜 : Type u_2
E : Type u_3
m m0 : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
μ : Measure α
f : α → E
s : Set α
hs : MeasurableSet s
hf : f =ᵐ[Measure.restrict μ s] 0
hm : m ≤ m0
hμm this✝ : SigmaFinite (Measure.trim μ hm)
this : SigmaFinite (Measure.trim (Measure.restrict μ s) hm)
hf_int : Integrable f
⊢ μ[f|m] =ᵐ[Measure.restrict μ s] 0
case neg
α : Type u_1
𝕜 : Type u_2
E : Type u_3
m m0 : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
μ : Measure α
f : α → E
s : Set α
hs : MeasurableSet s
hf : f =ᵐ[Measure.restrict μ s] 0
hm : m ≤ m0
hμm this✝ : SigmaFinite (Measure.trim μ hm)
this : SigmaFinite (Measure.trim (Measure.restrict μ s) hm)
hf_int : ¬Integrable f
⊢ μ[f|m] =ᵐ[Measure.restrict μ s] 0

Next tactic:
swap
theorem condexp_ae_eq_restrict_zero (hs : MeasurableSet[m] s) (hf : f =ᵐ[μ.restrict s] 0) :
    μ[f|m] =ᵐ[μ.restrict s] 0 := by
  by_cases hm : m ≤ m0
  swap; · simp_rw [condexp_of_not_le hm]; rfl
  by_cases hμm : SigmaFinite (μ.trim hm)
  swap; · simp_rw [condexp_of_not_sigmaFinite hm hμm]; rfl
  haveI : SigmaFinite (μ.trim hm) := hμm
  have : SigmaFinite ((μ.restrict s).trim hm) := by
    rw [← restrict_trim hm _ hs]
    exact Restrict.sigmaFinite _ s
  by_cases hf_int : Integrable f μ
  swap; · 

Proof state:
case neg
α : Type u_1
𝕜 : Type u_2
E : Type u_3
m m0 : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
μ : Measure α
f : α → E
s : Set α
hs : MeasurableSet s
hf : f =ᵐ[Measure.restrict μ s] 0
hm : m ≤ m0
hμm this✝ : SigmaFinite (Measure.trim μ hm)
this : SigmaFinite (Measure.trim (Measure.restrict μ s) hm)
hf_int : ¬Integrable f
⊢ μ[f|m] =ᵐ[Measure.restrict μ s] 0

Next tactic:
rw [condexp_undef hf_int]
theorem condexp_ae_eq_restrict_zero (hs : MeasurableSet[m] s) (hf : f =ᵐ[μ.restrict s] 0) :
    μ[f|m] =ᵐ[μ.restrict s] 0 := by
  by_cases hm : m ≤ m0
  swap; · simp_rw [condexp_of_not_le hm]; rfl
  by_cases hμm : SigmaFinite (μ.trim hm)
  swap; · simp_rw [condexp_of_not_sigmaFinite hm hμm]; rfl
  haveI : SigmaFinite (μ.trim hm) := hμm
  have : SigmaFinite ((μ.restrict s).trim hm) := by
    rw [← restrict_trim hm _ hs]
    exact Restrict.sigmaFinite _ s
  by_cases hf_int : Integrable f μ
  swap; · rw [condexp_undef hf_int]
  

Proof state:
case pos
α : Type u_1
𝕜 : Type u_2
E : Type u_3
m m0 : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
μ : Measure α
f : α → E
s : Set α
hs : MeasurableSet s
hf : f =ᵐ[Measure.restrict μ s] 0
hm : m ≤ m0
hμm this✝ : SigmaFinite (Measure.trim μ hm)
this : SigmaFinite (Measure.trim (Measure.restrict μ s) hm)
hf_int : Integrable f
⊢ μ[f|m] =ᵐ[Measure.restrict μ s] 0

Next tactic:
refine' ae_eq_of_forall_set_integral_eq_of_sigmaFinite' hm _ _ _ _ _
theorem condexp_ae_eq_restrict_zero (hs : MeasurableSet[m] s) (hf : f =ᵐ[μ.restrict s] 0) :
    μ[f|m] =ᵐ[μ.restrict s] 0 := by
  by_cases hm : m ≤ m0
  swap; · simp_rw [condexp_of_not_le hm]; rfl
  by_cases hμm : SigmaFinite (μ.trim hm)
  swap; · simp_rw [condexp_of_not_sigmaFinite hm hμm]; rfl
  haveI : SigmaFinite (μ.trim hm) := hμm
  have : SigmaFinite ((μ.restrict s).trim hm) := by
    rw [← restrict_trim hm _ hs]
    exact Restrict.sigmaFinite _ s
  by_cases hf_int : Integrable f μ
  swap; · rw [condexp_undef hf_int]
  refine' ae_eq_of_forall_set_integral_eq_of_sigmaFinite' hm _ _ _ _ _
  · 

Proof state:
case pos.refine'_1
α : Type u_1
𝕜 : Type u_2
E : Type u_3
m m0 : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
μ : Measure α
f : α → E
s : Set α
hs : MeasurableSet s
hf : f =ᵐ[Measure.restrict μ s] 0
hm : m ≤ m0
hμm this✝ : SigmaFinite (Measure.trim μ hm)
this : SigmaFinite (Measure.trim (Measure.restrict μ s) hm)
hf_int : Integrable f
⊢ ∀ (s_1 : Set α), MeasurableSet s_1 → ↑↑(Measure.restrict μ s) s_1 < ⊤ → IntegrableOn (μ[f|m]) s_1

Next tactic:
exact fun t _ _ => integrable_condexp.integrableOn.integrableOn
theorem condexp_ae_eq_restrict_zero (hs : MeasurableSet[m] s) (hf : f =ᵐ[μ.restrict s] 0) :
    μ[f|m] =ᵐ[μ.restrict s] 0 := by
  by_cases hm : m ≤ m0
  swap; · simp_rw [condexp_of_not_le hm]; rfl
  by_cases hμm : SigmaFinite (μ.trim hm)
  swap; · simp_rw [condexp_of_not_sigmaFinite hm hμm]; rfl
  haveI : SigmaFinite (μ.trim hm) := hμm
  have : SigmaFinite ((μ.restrict s).trim hm) := by
    rw [← restrict_trim hm _ hs]
    exact Restrict.sigmaFinite _ s
  by_cases hf_int : Integrable f μ
  swap; · rw [condexp_undef hf_int]
  refine' ae_eq_of_forall_set_integral_eq_of_sigmaFinite' hm _ _ _ _ _
  · exact fun t _ _ => integrable_condexp.integrableOn.integrableOn
  · 

Proof state:
case pos.refine'_2
α : Type u_1
𝕜 : Type u_2
E : Type u_3
m m0 : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
μ : Measure α
f : α → E
s : Set α
hs : MeasurableSet s
hf : f =ᵐ[Measure.restrict μ s] 0
hm : m ≤ m0
hμm this✝ : SigmaFinite (Measure.trim μ hm)
this : SigmaFinite (Measure.trim (Measure.restrict μ s) hm)
hf_int : Integrable f
⊢ ∀ (s_1 : Set α), MeasurableSet s_1 → ↑↑(Measure.restrict μ s) s_1 < ⊤ → IntegrableOn 0 s_1

Next tactic:
exact fun t _ _ => (integrable_zero _ _ _).integrableOn
theorem condexp_ae_eq_restrict_zero (hs : MeasurableSet[m] s) (hf : f =ᵐ[μ.restrict s] 0) :
    μ[f|m] =ᵐ[μ.restrict s] 0 := by
  by_cases hm : m ≤ m0
  swap; · simp_rw [condexp_of_not_le hm]; rfl
  by_cases hμm : SigmaFinite (μ.trim hm)
  swap; · simp_rw [condexp_of_not_sigmaFinite hm hμm]; rfl
  haveI : SigmaFinite (μ.trim hm) := hμm
  have : SigmaFinite ((μ.restrict s).trim hm) := by
    rw [← restrict_trim hm _ hs]
    exact Restrict.sigmaFinite _ s
  by_cases hf_int : Integrable f μ
  swap; · rw [condexp_undef hf_int]
  refine' ae_eq_of_forall_set_integral_eq_of_sigmaFinite' hm _ _ _ _ _
  · exact fun t _ _ => integrable_condexp.integrableOn.integrableOn
  · exact fun t _ _ => (integrable_zero _ _ _).integrableOn
  · 

Proof state:
case pos.refine'_3
α : Type u_1
𝕜 : Type u_2
E : Type u_3
m m0 : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
μ : Measure α
f : α → E
s : Set α
hs : MeasurableSet s
hf : f =ᵐ[Measure.restrict μ s] 0
hm : m ≤ m0
hμm this✝ : SigmaFinite (Measure.trim μ hm)
this : SigmaFinite (Measure.trim (Measure.restrict μ s) hm)
hf_int : Integrable f
⊢ ∀ (s_1 : Set α),
    MeasurableSet s_1 →
      ↑↑(Measure.restrict μ s) s_1 < ⊤ →
        ∫ (x : α) in s_1, (μ[f|m]) x ∂Measure.restrict μ s = ∫ (x : α) in s_1, OfNat.ofNat 0 x ∂Measure.restrict μ s

Next tactic:
intro t ht _
theorem condexp_ae_eq_restrict_zero (hs : MeasurableSet[m] s) (hf : f =ᵐ[μ.restrict s] 0) :
    μ[f|m] =ᵐ[μ.restrict s] 0 := by
  by_cases hm : m ≤ m0
  swap; · simp_rw [condexp_of_not_le hm]; rfl
  by_cases hμm : SigmaFinite (μ.trim hm)
  swap; · simp_rw [condexp_of_not_sigmaFinite hm hμm]; rfl
  haveI : SigmaFinite (μ.trim hm) := hμm
  have : SigmaFinite ((μ.restrict s).trim hm) := by
    rw [← restrict_trim hm _ hs]
    exact Restrict.sigmaFinite _ s
  by_cases hf_int : Integrable f μ
  swap; · rw [condexp_undef hf_int]
  refine' ae_eq_of_forall_set_integral_eq_of_sigmaFinite' hm _ _ _ _ _
  · exact fun t _ _ => integrable_condexp.integrableOn.integrableOn
  · exact fun t _ _ => (integrable_zero _ _ _).integrableOn
  · intro t ht _
    

Proof state:
case pos.refine'_3
α : Type u_1
𝕜 : Type u_2
E : Type u_3
m m0 : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
μ : Measure α
f : α → E
s : Set α
hs : MeasurableSet s
hf : f =ᵐ[Measure.restrict μ s] 0
hm : m ≤ m0
hμm this✝ : SigmaFinite (Measure.trim μ hm)
this : SigmaFinite (Measure.trim (Measure.restrict μ s) hm)
hf_int : Integrable f
t : Set α
ht : MeasurableSet t
a✝ : ↑↑(Measure.restrict μ s) t < ⊤
⊢ ∫ (x : α) in t, (μ[f|m]) x ∂Measure.restrict μ s = ∫ (x : α) in t, OfNat.ofNat 0 x ∂Measure.restrict μ s

Next tactic:
rw [Measure.restrict_restrict (hm _ ht), set_integral_condexp hm hf_int (ht.inter hs), ←
      Measure.restrict_restrict (hm _ ht)]
theorem condexp_ae_eq_restrict_zero (hs : MeasurableSet[m] s) (hf : f =ᵐ[μ.restrict s] 0) :
    μ[f|m] =ᵐ[μ.restrict s] 0 := by
  by_cases hm : m ≤ m0
  swap; · simp_rw [condexp_of_not_le hm]; rfl
  by_cases hμm : SigmaFinite (μ.trim hm)
  swap; · simp_rw [condexp_of_not_sigmaFinite hm hμm]; rfl
  haveI : SigmaFinite (μ.trim hm) := hμm
  have : SigmaFinite ((μ.restrict s).trim hm) := by
    rw [← restrict_trim hm _ hs]
    exact Restrict.sigmaFinite _ s
  by_cases hf_int : Integrable f μ
  swap; · rw [condexp_undef hf_int]
  refine' ae_eq_of_forall_set_integral_eq_of_sigmaFinite' hm _ _ _ _ _
  · exact fun t _ _ => integrable_condexp.integrableOn.integrableOn
  · exact fun t _ _ => (integrable_zero _ _ _).integrableOn
  · intro t ht _
    rw [Measure.restrict_restrict (hm _ ht), set_integral_condexp hm hf_int (ht.inter hs), ←
      Measure.restrict_restrict (hm _ ht)]
    

Proof state:
case pos.refine'_3
α : Type u_1
𝕜 : Type u_2
E : Type u_3
m m0 : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
μ : Measure α
f : α → E
s : Set α
hs : MeasurableSet s
hf : f =ᵐ[Measure.restrict μ s] 0
hm : m ≤ m0
hμm this✝ : SigmaFinite (Measure.trim μ hm)
this : SigmaFinite (Measure.trim (Measure.restrict μ s) hm)
hf_int : Integrable f
t : Set α
ht : MeasurableSet t
a✝ : ↑↑(Measure.restrict μ s) t < ⊤
⊢ ∫ (x : α) in t, f x ∂Measure.restrict μ s = ∫ (x : α) in t, OfNat.ofNat 0 x ∂Measure.restrict μ s

Next tactic:
refine' set_integral_congr_ae (hm _ ht) _
theorem condexp_ae_eq_restrict_zero (hs : MeasurableSet[m] s) (hf : f =ᵐ[μ.restrict s] 0) :
    μ[f|m] =ᵐ[μ.restrict s] 0 := by
  by_cases hm : m ≤ m0
  swap; · simp_rw [condexp_of_not_le hm]; rfl
  by_cases hμm : SigmaFinite (μ.trim hm)
  swap; · simp_rw [condexp_of_not_sigmaFinite hm hμm]; rfl
  haveI : SigmaFinite (μ.trim hm) := hμm
  have : SigmaFinite ((μ.restrict s).trim hm) := by
    rw [← restrict_trim hm _ hs]
    exact Restrict.sigmaFinite _ s
  by_cases hf_int : Integrable f μ
  swap; · rw [condexp_undef hf_int]
  refine' ae_eq_of_forall_set_integral_eq_of_sigmaFinite' hm _ _ _ _ _
  · exact fun t _ _ => integrable_condexp.integrableOn.integrableOn
  · exact fun t _ _ => (integrable_zero _ _ _).integrableOn
  · intro t ht _
    rw [Measure.restrict_restrict (hm _ ht), set_integral_condexp hm hf_int (ht.inter hs), ←
      Measure.restrict_restrict (hm _ ht)]
    refine' set_integral_congr_ae (hm _ ht) _
    

Proof state:
case pos.refine'_3
α : Type u_1
𝕜 : Type u_2
E : Type u_3
m m0 : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
μ : Measure α
f : α → E
s : Set α
hs : MeasurableSet s
hf : f =ᵐ[Measure.restrict μ s] 0
hm : m ≤ m0
hμm this✝ : SigmaFinite (Measure.trim μ hm)
this : SigmaFinite (Measure.trim (Measure.restrict μ s) hm)
hf_int : Integrable f
t : Set α
ht : MeasurableSet t
a✝ : ↑↑(Measure.restrict μ s) t < ⊤
⊢ ∀ᵐ (x : α) ∂Measure.restrict μ s, x ∈ t → f x = OfNat.ofNat 0 x

Next tactic:
filter_upwards [hf] with x hx _ using hx
theorem condexp_ae_eq_restrict_zero (hs : MeasurableSet[m] s) (hf : f =ᵐ[μ.restrict s] 0) :
    μ[f|m] =ᵐ[μ.restrict s] 0 := by
  by_cases hm : m ≤ m0
  swap; · simp_rw [condexp_of_not_le hm]; rfl
  by_cases hμm : SigmaFinite (μ.trim hm)
  swap; · simp_rw [condexp_of_not_sigmaFinite hm hμm]; rfl
  haveI : SigmaFinite (μ.trim hm) := hμm
  have : SigmaFinite ((μ.restrict s).trim hm) := by
    rw [← restrict_trim hm _ hs]
    exact Restrict.sigmaFinite _ s
  by_cases hf_int : Integrable f μ
  swap; · rw [condexp_undef hf_int]
  refine' ae_eq_of_forall_set_integral_eq_of_sigmaFinite' hm _ _ _ _ _
  · exact fun t _ _ => integrable_condexp.integrableOn.integrableOn
  · exact fun t _ _ => (integrable_zero _ _ _).integrableOn
  · intro t ht _
    rw [Measure.restrict_restrict (hm _ ht), set_integral_condexp hm hf_int (ht.inter hs), ←
      Measure.restrict_restrict (hm _ ht)]
    refine' set_integral_congr_ae (hm _ ht) _
    filter_upwards [hf] with x hx _ using hx
  · 

Proof state:
case pos.refine'_4
α : Type u_1
𝕜 : Type u_2
E : Type u_3
m m0 : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
μ : Measure α
f : α → E
s : Set α
hs : MeasurableSet s
hf : f =ᵐ[Measure.restrict μ s] 0
hm : m ≤ m0
hμm this✝ : SigmaFinite (Measure.trim μ hm)
this : SigmaFinite (Measure.trim (Measure.restrict μ s) hm)
hf_int : Integrable f
⊢ AEStronglyMeasurable' m (μ[f|m]) (Measure.restrict μ s)

Next tactic:
exact stronglyMeasurable_condexp.aeStronglyMeasurable'
theorem condexp_ae_eq_restrict_zero (hs : MeasurableSet[m] s) (hf : f =ᵐ[μ.restrict s] 0) :
    μ[f|m] =ᵐ[μ.restrict s] 0 := by
  by_cases hm : m ≤ m0
  swap; · simp_rw [condexp_of_not_le hm]; rfl
  by_cases hμm : SigmaFinite (μ.trim hm)
  swap; · simp_rw [condexp_of_not_sigmaFinite hm hμm]; rfl
  haveI : SigmaFinite (μ.trim hm) := hμm
  have : SigmaFinite ((μ.restrict s).trim hm) := by
    rw [← restrict_trim hm _ hs]
    exact Restrict.sigmaFinite _ s
  by_cases hf_int : Integrable f μ
  swap; · rw [condexp_undef hf_int]
  refine' ae_eq_of_forall_set_integral_eq_of_sigmaFinite' hm _ _ _ _ _
  · exact fun t _ _ => integrable_condexp.integrableOn.integrableOn
  · exact fun t _ _ => (integrable_zero _ _ _).integrableOn
  · intro t ht _
    rw [Measure.restrict_restrict (hm _ ht), set_integral_condexp hm hf_int (ht.inter hs), ←
      Measure.restrict_restrict (hm _ ht)]
    refine' set_integral_congr_ae (hm _ ht) _
    filter_upwards [hf] with x hx _ using hx
  · exact stronglyMeasurable_condexp.aeStronglyMeasurable'
  · 

Proof state:
case pos.refine'_5
α : Type u_1
𝕜 : Type u_2
E : Type u_3
m m0 : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
μ : Measure α
f : α → E
s : Set α
hs : MeasurableSet s
hf : f =ᵐ[Measure.restrict μ s] 0
hm : m ≤ m0
hμm this✝ : SigmaFinite (Measure.trim μ hm)
this : SigmaFinite (Measure.trim (Measure.restrict μ s) hm)
hf_int : Integrable f
⊢ AEStronglyMeasurable' m 0 (Measure.restrict μ s)

Next tactic:
exact stronglyMeasurable_zero.aeStronglyMeasurable'
/-- Auxiliary lemma for `condexp_indicator`. -/
theorem condexp_indicator_aux (hs : MeasurableSet[m] s) (hf : f =ᵐ[μ.restrict sᶜ] 0) :
    μ[s.indicator f|m] =ᵐ[μ] s.indicator (μ[f|m]) := by
  

Proof state:
α : Type u_1
𝕜 : Type u_2
E : Type u_3
m m0 : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
μ : Measure α
f : α → E
s : Set α
hs : MeasurableSet s
hf : f =ᵐ[Measure.restrict μ sᶜ] 0
⊢ μ[Set.indicator s f|m] =ᵐ[μ] Set.indicator s (μ[f|m])

Next tactic:
by_cases hm : m ≤ m0
/-- Auxiliary lemma for `condexp_indicator`. -/
theorem condexp_indicator_aux (hs : MeasurableSet[m] s) (hf : f =ᵐ[μ.restrict sᶜ] 0) :
    μ[s.indicator f|m] =ᵐ[μ] s.indicator (μ[f|m]) := by
  by_cases hm : m ≤ m0
  

Proof state:
case pos
α : Type u_1
𝕜 : Type u_2
E : Type u_3
m m0 : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
μ : Measure α
f : α → E
s : Set α
hs : MeasurableSet s
hf : f =ᵐ[Measure.restrict μ sᶜ] 0
hm : m ≤ m0
⊢ μ[Set.indicator s f|m] =ᵐ[μ] Set.indicator s (μ[f|m])
case neg
α : Type u_1
𝕜 : Type u_2
E : Type u_3
m m0 : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
μ : Measure α
f : α → E
s : Set α
hs : MeasurableSet s
hf : f =ᵐ[Measure.restrict μ sᶜ] 0
hm : ¬m ≤ m0
⊢ μ[Set.indicator s f|m] =ᵐ[μ] Set.indicator s (μ[f|m])

Next tactic:
swap
/-- Auxiliary lemma for `condexp_indicator`. -/
theorem condexp_indicator_aux (hs : MeasurableSet[m] s) (hf : f =ᵐ[μ.restrict sᶜ] 0) :
    μ[s.indicator f|m] =ᵐ[μ] s.indicator (μ[f|m]) := by
  by_cases hm : m ≤ m0
  swap; · 

Proof state:
case neg
α : Type u_1
𝕜 : Type u_2
E : Type u_3
m m0 : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
μ : Measure α
f : α → E
s : Set α
hs : MeasurableSet s
hf : f =ᵐ[Measure.restrict μ sᶜ] 0
hm : ¬m ≤ m0
⊢ μ[Set.indicator s f|m] =ᵐ[μ] Set.indicator s (μ[f|m])

Next tactic:
simp_rw [condexp_of_not_le hm, Set.indicator_zero']
/-- Auxiliary lemma for `condexp_indicator`. -/
theorem condexp_indicator_aux (hs : MeasurableSet[m] s) (hf : f =ᵐ[μ.restrict sᶜ] 0) :
    μ[s.indicator f|m] =ᵐ[μ] s.indicator (μ[f|m]) := by
  by_cases hm : m ≤ m0
  swap; · simp_rw [condexp_of_not_le hm, Set.indicator_zero']; 

Proof state:
case neg
α : Type u_1
𝕜 : Type u_2
E : Type u_3
m m0 : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
μ : Measure α
f : α → E
s : Set α
hs : MeasurableSet s
hf : f =ᵐ[Measure.restrict μ sᶜ] 0
hm : ¬m ≤ m0
⊢ 0 =ᵐ[μ] 0

Next tactic:
rfl
/-- Auxiliary lemma for `condexp_indicator`. -/
theorem condexp_indicator_aux (hs : MeasurableSet[m] s) (hf : f =ᵐ[μ.restrict sᶜ] 0) :
    μ[s.indicator f|m] =ᵐ[μ] s.indicator (μ[f|m]) := by
  by_cases hm : m ≤ m0
  swap; · simp_rw [condexp_of_not_le hm, Set.indicator_zero']; rfl
  

Proof state:
case pos
α : Type u_1
𝕜 : Type u_2
E : Type u_3
m m0 : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
μ : Measure α
f : α → E
s : Set α
hs : MeasurableSet s
hf : f =ᵐ[Measure.restrict μ sᶜ] 0
hm : m ≤ m0
⊢ μ[Set.indicator s f|m] =ᵐ[μ] Set.indicator s (μ[f|m])

Next tactic:
have hsf_zero : ∀ g : α → E, g =ᵐ[μ.restrict sᶜ] 0 → s.indicator g =ᵐ[μ] g := fun g =>
    indicator_ae_eq_of_restrict_compl_ae_eq_zero (hm _ hs)
/-- Auxiliary lemma for `condexp_indicator`. -/
theorem condexp_indicator_aux (hs : MeasurableSet[m] s) (hf : f =ᵐ[μ.restrict sᶜ] 0) :
    μ[s.indicator f|m] =ᵐ[μ] s.indicator (μ[f|m]) := by
  by_cases hm : m ≤ m0
  swap; · simp_rw [condexp_of_not_le hm, Set.indicator_zero']; rfl
  have hsf_zero : ∀ g : α → E, g =ᵐ[μ.restrict sᶜ] 0 → s.indicator g =ᵐ[μ] g := fun g =>
    indicator_ae_eq_of_restrict_compl_ae_eq_zero (hm _ hs)
  

Proof state:
case pos
α : Type u_1
𝕜 : Type u_2
E : Type u_3
m m0 : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
μ : Measure α
f : α → E
s : Set α
hs : MeasurableSet s
hf : f =ᵐ[Measure.restrict μ sᶜ] 0
hm : m ≤ m0
hsf_zero : ∀ (g : α → E), g =ᵐ[Measure.restrict μ sᶜ] 0 → Set.indicator s g =ᵐ[μ] g
⊢ μ[Set.indicator s f|m] =ᵐ[μ] Set.indicator s (μ[f|m])

Next tactic:
refine' ((hsf_zero (μ[f|m]) (condexp_ae_eq_restrict_zero hs.compl hf)).trans _).symm
/-- Auxiliary lemma for `condexp_indicator`. -/
theorem condexp_indicator_aux (hs : MeasurableSet[m] s) (hf : f =ᵐ[μ.restrict sᶜ] 0) :
    μ[s.indicator f|m] =ᵐ[μ] s.indicator (μ[f|m]) := by
  by_cases hm : m ≤ m0
  swap; · simp_rw [condexp_of_not_le hm, Set.indicator_zero']; rfl
  have hsf_zero : ∀ g : α → E, g =ᵐ[μ.restrict sᶜ] 0 → s.indicator g =ᵐ[μ] g := fun g =>
    indicator_ae_eq_of_restrict_compl_ae_eq_zero (hm _ hs)
  refine' ((hsf_zero (μ[f|m]) (condexp_ae_eq_restrict_zero hs.compl hf)).trans _).symm
  

Proof state:
case pos
α : Type u_1
𝕜 : Type u_2
E : Type u_3
m m0 : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
μ : Measure α
f : α → E
s : Set α
hs : MeasurableSet s
hf : f =ᵐ[Measure.restrict μ sᶜ] 0
hm : m ≤ m0
hsf_zero : ∀ (g : α → E), g =ᵐ[Measure.restrict μ sᶜ] 0 → Set.indicator s g =ᵐ[μ] g
⊢ μ[f|m] =ᵐ[μ] μ[Set.indicator s f|m]

Next tactic:
exact condexp_congr_ae (hsf_zero f hf).symm
/-- The conditional expectation of the indicator of a function over an `m`-measurable set with
respect to the σ-algebra `m` is a.e. equal to the indicator of the conditional expectation. -/
theorem condexp_indicator (hf_int : Integrable f μ) (hs : MeasurableSet[m] s) :
    μ[s.indicator f|m] =ᵐ[μ] s.indicator (μ[f|m]) := by
  

Proof state:
α : Type u_1
𝕜 : Type u_2
E : Type u_3
m m0 : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
μ : Measure α
f : α → E
s : Set α
hf_int : Integrable f
hs : MeasurableSet s
⊢ μ[Set.indicator s f|m] =ᵐ[μ] Set.indicator s (μ[f|m])

Next tactic:
by_cases hm : m ≤ m0
/-- The conditional expectation of the indicator of a function over an `m`-measurable set with
respect to the σ-algebra `m` is a.e. equal to the indicator of the conditional expectation. -/
theorem condexp_indicator (hf_int : Integrable f μ) (hs : MeasurableSet[m] s) :
    μ[s.indicator f|m] =ᵐ[μ] s.indicator (μ[f|m]) := by
  by_cases hm : m ≤ m0
  

Proof state:
case pos
α : Type u_1
𝕜 : Type u_2
E : Type u_3
m m0 : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
μ : Measure α
f : α → E
s : Set α
hf_int : Integrable f
hs : MeasurableSet s
hm : m ≤ m0
⊢ μ[Set.indicator s f|m] =ᵐ[μ] Set.indicator s (μ[f|m])
case neg
α : Type u_1
𝕜 : Type u_2
E : Type u_3
m m0 : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
μ : Measure α
f : α → E
s : Set α
hf_int : Integrable f
hs : MeasurableSet s
hm : ¬m ≤ m0
⊢ μ[Set.indicator s f|m] =ᵐ[μ] Set.indicator s (μ[f|m])

Next tactic:
swap
/-- The conditional expectation of the indicator of a function over an `m`-measurable set with
respect to the σ-algebra `m` is a.e. equal to the indicator of the conditional expectation. -/
theorem condexp_indicator (hf_int : Integrable f μ) (hs : MeasurableSet[m] s) :
    μ[s.indicator f|m] =ᵐ[μ] s.indicator (μ[f|m]) := by
  by_cases hm : m ≤ m0
  swap; · 

Proof state:
case neg
α : Type u_1
𝕜 : Type u_2
E : Type u_3
m m0 : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
μ : Measure α
f : α → E
s : Set α
hf_int : Integrable f
hs : MeasurableSet s
hm : ¬m ≤ m0
⊢ μ[Set.indicator s f|m] =ᵐ[μ] Set.indicator s (μ[f|m])

Next tactic:
simp_rw [condexp_of_not_le hm, Set.indicator_zero']
/-- The conditional expectation of the indicator of a function over an `m`-measurable set with
respect to the σ-algebra `m` is a.e. equal to the indicator of the conditional expectation. -/
theorem condexp_indicator (hf_int : Integrable f μ) (hs : MeasurableSet[m] s) :
    μ[s.indicator f|m] =ᵐ[μ] s.indicator (μ[f|m]) := by
  by_cases hm : m ≤ m0
  swap; · simp_rw [condexp_of_not_le hm, Set.indicator_zero']; 

Proof state:
case neg
α : Type u_1
𝕜 : Type u_2
E : Type u_3
m m0 : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
μ : Measure α
f : α → E
s : Set α
hf_int : Integrable f
hs : MeasurableSet s
hm : ¬m ≤ m0
⊢ 0 =ᵐ[μ] 0

Next tactic:
rfl
/-- The conditional expectation of the indicator of a function over an `m`-measurable set with
respect to the σ-algebra `m` is a.e. equal to the indicator of the conditional expectation. -/
theorem condexp_indicator (hf_int : Integrable f μ) (hs : MeasurableSet[m] s) :
    μ[s.indicator f|m] =ᵐ[μ] s.indicator (μ[f|m]) := by
  by_cases hm : m ≤ m0
  swap; · simp_rw [condexp_of_not_le hm, Set.indicator_zero']; rfl
  

Proof state:
case pos
α : Type u_1
𝕜 : Type u_2
E : Type u_3
m m0 : MeasurableSpace α
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
μ : Measure α
f : α → E
s : Set α
hf_int : Integrable f
hs : MeasurableSet s
hm : m ≤ m0
⊢ μ[Set.indicator s f|m] =ᵐ[μ] Set.indicator s (μ[f|m])

Next tactic:
by_cases hμm : SigmaFinite (μ.trim hm)