l3lab/ntp-mathlib huggingface dataset:
theorem condexp_congr_ae (h : f =ᵐ[μ] g) : μ[f|m] =ᵐ[μ] μ[g|m] := by
  by_cases hm : m ≤ m0
  swap; · simp_rw [condexp_of_not_le hm]; rfl
  by_cases hμm : SigmaFinite (μ.trim hm)
  

Proof state:
case pos
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f g : α → F'
s : Set α
h : f =ᵐ[μ] g
hm : m ≤ m0
hμm : SigmaFinite (Measure.trim μ hm)
⊢ μ[f|m] =ᵐ[μ] μ[g|m]
case neg
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f g : α → F'
s : Set α
h : f =ᵐ[μ] g
hm : m ≤ m0
hμm : ¬SigmaFinite (Measure.trim μ hm)
⊢ μ[f|m] =ᵐ[μ] μ[g|m]

Next tactic:
swap
theorem condexp_congr_ae (h : f =ᵐ[μ] g) : μ[f|m] =ᵐ[μ] μ[g|m] := by
  by_cases hm : m ≤ m0
  swap; · simp_rw [condexp_of_not_le hm]; rfl
  by_cases hμm : SigmaFinite (μ.trim hm)
  swap; · 

Proof state:
case neg
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f g : α → F'
s : Set α
h : f =ᵐ[μ] g
hm : m ≤ m0
hμm : ¬SigmaFinite (Measure.trim μ hm)
⊢ μ[f|m] =ᵐ[μ] μ[g|m]

Next tactic:
simp_rw [condexp_of_not_sigmaFinite hm hμm]
theorem condexp_congr_ae (h : f =ᵐ[μ] g) : μ[f|m] =ᵐ[μ] μ[g|m] := 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]; 

Proof state:
case neg
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f g : α → F'
s : Set α
h : f =ᵐ[μ] g
hm : m ≤ m0
hμm : ¬SigmaFinite (Measure.trim μ hm)
⊢ 0 =ᵐ[μ] 0

Next tactic:
rfl
theorem condexp_congr_ae (h : f =ᵐ[μ] g) : μ[f|m] =ᵐ[μ] μ[g|m] := 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
  

Proof state:
case pos
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f g : α → F'
s : Set α
h : f =ᵐ[μ] g
hm : m ≤ m0
hμm : SigmaFinite (Measure.trim μ hm)
⊢ μ[f|m] =ᵐ[μ] μ[g|m]

Next tactic:
haveI : SigmaFinite (μ.trim hm) := hμm
theorem condexp_congr_ae (h : f =ᵐ[μ] g) : μ[f|m] =ᵐ[μ] μ[g|m] := 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
  

Proof state:
case pos
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f g : α → F'
s : Set α
h : f =ᵐ[μ] g
hm : m ≤ m0
hμm this : SigmaFinite (Measure.trim μ hm)
⊢ μ[f|m] =ᵐ[μ] μ[g|m]

Next tactic:
exact (condexp_ae_eq_condexpL1 hm f).trans
    (Filter.EventuallyEq.trans (by rw [condexpL1_congr_ae hm h])
      (condexp_ae_eq_condexpL1 hm g).symm)
theorem condexp_congr_ae (h : f =ᵐ[μ] g) : μ[f|m] =ᵐ[μ] μ[g|m] := 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
  exact (condexp_ae_eq_condexpL1 hm f).trans
    (Filter.EventuallyEq.trans (by 

Proof state:
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f g : α → F'
s : Set α
h : f =ᵐ[μ] g
hm : m ≤ m0
hμm this : SigmaFinite (Measure.trim μ hm)
⊢ ↑↑(condexpL1 hm μ f) =ᵐ[μ] ↑↑(condexpL1 hm μ g)

Next tactic:
rw [condexpL1_congr_ae hm h]
theorem condexp_of_aestronglyMeasurable' (hm : m ≤ m0) [hμm : SigmaFinite (μ.trim hm)] {f : α → F'}
    (hf : AEStronglyMeasurable' m f μ) (hfi : Integrable f μ) : μ[f|m] =ᵐ[μ] f := by
  

Proof state:
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f✝ g : α → F'
s : Set α
hm : m ≤ m0
hμm : SigmaFinite (Measure.trim μ hm)
f : α → F'
hf : AEStronglyMeasurable' m f μ
hfi : Integrable f
⊢ μ[f|m] =ᵐ[μ] f

Next tactic:
refine' ((condexp_congr_ae hf.ae_eq_mk).trans _).trans hf.ae_eq_mk.symm
theorem condexp_of_aestronglyMeasurable' (hm : m ≤ m0) [hμm : SigmaFinite (μ.trim hm)] {f : α → F'}
    (hf : AEStronglyMeasurable' m f μ) (hfi : Integrable f μ) : μ[f|m] =ᵐ[μ] f := by
  refine' ((condexp_congr_ae hf.ae_eq_mk).trans _).trans hf.ae_eq_mk.symm
  

Proof state:
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f✝ g : α → F'
s : Set α
hm : m ≤ m0
hμm : SigmaFinite (Measure.trim μ hm)
f : α → F'
hf : AEStronglyMeasurable' m f μ
hfi : Integrable f
⊢ μ[AEStronglyMeasurable'.mk f hf|m] =ᵐ[μ] AEStronglyMeasurable'.mk f hf

Next tactic:
rw [condexp_of_stronglyMeasurable hm hf.stronglyMeasurable_mk
    ((integrable_congr hf.ae_eq_mk).mp hfi)]
theorem integrable_condexp : Integrable (μ[f|m]) μ := by
  

Proof state:
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f g : α → F'
s : Set α
⊢ Integrable (μ[f|m])

Next tactic:
by_cases hm : m ≤ m0
theorem integrable_condexp : Integrable (μ[f|m]) μ := by
  by_cases hm : m ≤ m0
  

Proof state:
case pos
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f g : α → F'
s : Set α
hm : m ≤ m0
⊢ Integrable (μ[f|m])
case neg
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f g : α → F'
s : Set α
hm : ¬m ≤ m0
⊢ Integrable (μ[f|m])

Next tactic:
swap
theorem integrable_condexp : Integrable (μ[f|m]) μ := by
  by_cases hm : m ≤ m0
  swap; · 

Proof state:
case neg
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f g : α → F'
s : Set α
hm : ¬m ≤ m0
⊢ Integrable (μ[f|m])

Next tactic:
rw [condexp_of_not_le hm]
theorem integrable_condexp : Integrable (μ[f|m]) μ := by
  by_cases hm : m ≤ m0
  swap; · rw [condexp_of_not_le hm]; 

Proof state:
case neg
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f g : α → F'
s : Set α
hm : ¬m ≤ m0
⊢ Integrable 0

Next tactic:
exact integrable_zero _ _ _
theorem integrable_condexp : Integrable (μ[f|m]) μ := by
  by_cases hm : m ≤ m0
  swap; · rw [condexp_of_not_le hm]; exact integrable_zero _ _ _
  

Proof state:
case pos
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f g : α → F'
s : Set α
hm : m ≤ m0
⊢ Integrable (μ[f|m])

Next tactic:
by_cases hμm : SigmaFinite (μ.trim hm)
theorem integrable_condexp : Integrable (μ[f|m]) μ := by
  by_cases hm : m ≤ m0
  swap; · rw [condexp_of_not_le hm]; exact integrable_zero _ _ _
  by_cases hμm : SigmaFinite (μ.trim hm)
  

Proof state:
case pos
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f g : α → F'
s : Set α
hm : m ≤ m0
hμm : SigmaFinite (Measure.trim μ hm)
⊢ Integrable (μ[f|m])
case neg
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f g : α → F'
s : Set α
hm : m ≤ m0
hμm : ¬SigmaFinite (Measure.trim μ hm)
⊢ Integrable (μ[f|m])

Next tactic:
swap
theorem integrable_condexp : Integrable (μ[f|m]) μ := by
  by_cases hm : m ≤ m0
  swap; · rw [condexp_of_not_le hm]; exact integrable_zero _ _ _
  by_cases hμm : SigmaFinite (μ.trim hm)
  swap; · 

Proof state:
case neg
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f g : α → F'
s : Set α
hm : m ≤ m0
hμm : ¬SigmaFinite (Measure.trim μ hm)
⊢ Integrable (μ[f|m])

Next tactic:
rw [condexp_of_not_sigmaFinite hm hμm]
theorem integrable_condexp : Integrable (μ[f|m]) μ := by
  by_cases hm : m ≤ m0
  swap; · rw [condexp_of_not_le hm]; exact integrable_zero _ _ _
  by_cases hμm : SigmaFinite (μ.trim hm)
  swap; · rw [condexp_of_not_sigmaFinite hm hμm]; 

Proof state:
case neg
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f g : α → F'
s : Set α
hm : m ≤ m0
hμm : ¬SigmaFinite (Measure.trim μ hm)
⊢ Integrable 0

Next tactic:
exact integrable_zero _ _ _
theorem integrable_condexp : Integrable (μ[f|m]) μ := by
  by_cases hm : m ≤ m0
  swap; · rw [condexp_of_not_le hm]; exact integrable_zero _ _ _
  by_cases hμm : SigmaFinite (μ.trim hm)
  swap; · rw [condexp_of_not_sigmaFinite hm hμm]; exact integrable_zero _ _ _
  

Proof state:
case pos
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f g : α → F'
s : Set α
hm : m ≤ m0
hμm : SigmaFinite (Measure.trim μ hm)
⊢ Integrable (μ[f|m])

Next tactic:
haveI : SigmaFinite (μ.trim hm) := hμm
theorem integrable_condexp : Integrable (μ[f|m]) μ := by
  by_cases hm : m ≤ m0
  swap; · rw [condexp_of_not_le hm]; exact integrable_zero _ _ _
  by_cases hμm : SigmaFinite (μ.trim hm)
  swap; · rw [condexp_of_not_sigmaFinite hm hμm]; exact integrable_zero _ _ _
  haveI : SigmaFinite (μ.trim hm) := hμm
  

Proof state:
case pos
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f g : α → F'
s : Set α
hm : m ≤ m0
hμm this : SigmaFinite (Measure.trim μ hm)
⊢ Integrable (μ[f|m])

Next tactic:
exact (integrable_condexpL1 f).congr (condexp_ae_eq_condexpL1 hm f).symm
/-- The integral of the conditional expectation `μ[f|hm]` over an `m`-measurable set is equal to
the integral of `f` on that set. -/
theorem set_integral_condexp (hm : m ≤ m0) [SigmaFinite (μ.trim hm)] (hf : Integrable f μ)
    (hs : MeasurableSet[m] s) : ∫ x in s, (μ[f|m]) x ∂μ = ∫ x in s, f x ∂μ := by
  

Proof state:
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁷ : IsROrC 𝕜
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace 𝕜 F
inst✝⁴ : NormedAddCommGroup F'
inst✝³ : NormedSpace 𝕜 F'
inst✝² : NormedSpace ℝ F'
inst✝¹ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f g : α → F'
s : Set α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hf : Integrable f
hs : MeasurableSet s
⊢ ∫ (x : α) in s, (μ[f|m]) x ∂μ = ∫ (x : α) in s, f x ∂μ

Next tactic:
rw [set_integral_congr_ae (hm s hs) ((condexp_ae_eq_condexpL1 hm f).mono fun x hx _ => hx)]
/-- The integral of the conditional expectation `μ[f|hm]` over an `m`-measurable set is equal to
the integral of `f` on that set. -/
theorem set_integral_condexp (hm : m ≤ m0) [SigmaFinite (μ.trim hm)] (hf : Integrable f μ)
    (hs : MeasurableSet[m] s) : ∫ x in s, (μ[f|m]) x ∂μ = ∫ x in s, f x ∂μ := by
  rw [set_integral_congr_ae (hm s hs) ((condexp_ae_eq_condexpL1 hm f).mono fun x hx _ => hx)]
  

Proof state:
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁷ : IsROrC 𝕜
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace 𝕜 F
inst✝⁴ : NormedAddCommGroup F'
inst✝³ : NormedSpace 𝕜 F'
inst✝² : NormedSpace ℝ F'
inst✝¹ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f g : α → F'
s : Set α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hf : Integrable f
hs : MeasurableSet s
⊢ ∫ (x : α) in s, ↑↑(condexpL1 hm μ f) x ∂μ = ∫ (x : α) in s, f x ∂μ

Next tactic:
exact set_integral_condexpL1 hf hs
theorem integral_condexp (hm : m ≤ m0) [hμm : SigmaFinite (μ.trim hm)] (hf : Integrable f μ) :
    ∫ x, (μ[f|m]) x ∂μ = ∫ x, f x ∂μ := by
  

Proof state:
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f g : α → F'
s : Set α
hm : m ≤ m0
hμm : SigmaFinite (Measure.trim μ hm)
hf : Integrable f
⊢ ∫ (x : α), (μ[f|m]) x ∂μ = ∫ (x : α), f x ∂μ

Next tactic:
suffices ∫ x in Set.univ, (μ[f|m]) x ∂μ = ∫ x in Set.univ, f x ∂μ by
    simp_rw [integral_univ] at this; exact this
theorem integral_condexp (hm : m ≤ m0) [hμm : SigmaFinite (μ.trim hm)] (hf : Integrable f μ) :
    ∫ x, (μ[f|m]) x ∂μ = ∫ x, f x ∂μ := by
  suffices ∫ x in Set.univ, (μ[f|m]) x ∂μ = ∫ x in Set.univ, f x ∂μ by
    

Proof state:
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f g : α → F'
s : Set α
hm : m ≤ m0
hμm : SigmaFinite (Measure.trim μ hm)
hf : Integrable f
this : ∫ (x : α) in Set.univ, (μ[f|m]) x ∂μ = ∫ (x : α) in Set.univ, f x ∂μ
⊢ ∫ (x : α), (μ[f|m]) x ∂μ = ∫ (x : α), f x ∂μ

Next tactic:
simp_rw [integral_univ] at this
theorem integral_condexp (hm : m ≤ m0) [hμm : SigmaFinite (μ.trim hm)] (hf : Integrable f μ) :
    ∫ x, (μ[f|m]) x ∂μ = ∫ x, f x ∂μ := by
  suffices ∫ x in Set.univ, (μ[f|m]) x ∂μ = ∫ x in Set.univ, f x ∂μ by
    simp_rw [integral_univ] at this; 

Proof state:
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f g : α → F'
s : Set α
hm : m ≤ m0
hμm : SigmaFinite (Measure.trim μ hm)
hf : Integrable f
this : ∫ (x : α), (μ[f|m]) x ∂μ = ∫ (x : α), f x ∂μ
⊢ ∫ (x : α), (μ[f|m]) x ∂μ = ∫ (x : α), f x ∂μ

Next tactic:
exact this
theorem integral_condexp (hm : m ≤ m0) [hμm : SigmaFinite (μ.trim hm)] (hf : Integrable f μ) :
    ∫ x, (μ[f|m]) x ∂μ = ∫ x, f x ∂μ := by
  suffices ∫ x in Set.univ, (μ[f|m]) x ∂μ = ∫ x in Set.univ, f x ∂μ by
    simp_rw [integral_univ] at this; exact this
  

Proof state:
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f g : α → F'
s : Set α
hm : m ≤ m0
hμm : SigmaFinite (Measure.trim μ hm)
hf : Integrable f
⊢ ∫ (x : α) in Set.univ, (μ[f|m]) x ∂μ = ∫ (x : α) in Set.univ, f x ∂μ

Next tactic:
exact set_integral_condexp hm hf (@MeasurableSet.univ _ m)
/-- **Uniqueness of the conditional expectation**
If a function is a.e. `m`-measurable, verifies an integrability condition and has same integral
as `f` on all `m`-measurable sets, then it is a.e. equal to `μ[f|hm]`. -/
theorem ae_eq_condexp_of_forall_set_integral_eq (hm : m ≤ m0) [SigmaFinite (μ.trim hm)]
    {f g : α → F'} (hf : Integrable f μ)
    (hg_int_finite : ∀ s, MeasurableSet[m] s → μ s < ∞ → IntegrableOn g s μ)
    (hg_eq : ∀ s : Set α, MeasurableSet[m] s → μ s < ∞ → ∫ x in s, g x ∂μ = ∫ x in s, f x ∂μ)
    (hgm : AEStronglyMeasurable' m g μ) : g =ᵐ[μ] μ[f|m] := by
  

Proof state:
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁷ : IsROrC 𝕜
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace 𝕜 F
inst✝⁴ : NormedAddCommGroup F'
inst✝³ : NormedSpace 𝕜 F'
inst✝² : NormedSpace ℝ F'
inst✝¹ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f✝ g✝ : α → F'
s : Set α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f g : α → F'
hf : Integrable f
hg_int_finite : ∀ (s : Set α), MeasurableSet s → ↑↑μ s < ⊤ → IntegrableOn g s
hg_eq : ∀ (s : Set α), MeasurableSet s → ↑↑μ s < ⊤ → ∫ (x : α) in s, g x ∂μ = ∫ (x : α) in s, f x ∂μ
hgm : AEStronglyMeasurable' m g μ
⊢ g =ᵐ[μ] μ[f|m]

Next tactic:
refine' ae_eq_of_forall_set_integral_eq_of_sigmaFinite' hm hg_int_finite
    (fun s _ _ => integrable_condexp.integrableOn) (fun s hs hμs => _) hgm
    (StronglyMeasurable.aeStronglyMeasurable' stronglyMeasurable_condexp)
/-- **Uniqueness of the conditional expectation**
If a function is a.e. `m`-measurable, verifies an integrability condition and has same integral
as `f` on all `m`-measurable sets, then it is a.e. equal to `μ[f|hm]`. -/
theorem ae_eq_condexp_of_forall_set_integral_eq (hm : m ≤ m0) [SigmaFinite (μ.trim hm)]
    {f g : α → F'} (hf : Integrable f μ)
    (hg_int_finite : ∀ s, MeasurableSet[m] s → μ s < ∞ → IntegrableOn g s μ)
    (hg_eq : ∀ s : Set α, MeasurableSet[m] s → μ s < ∞ → ∫ x in s, g x ∂μ = ∫ x in s, f x ∂μ)
    (hgm : AEStronglyMeasurable' m g μ) : g =ᵐ[μ] μ[f|m] := by
  refine' ae_eq_of_forall_set_integral_eq_of_sigmaFinite' hm hg_int_finite
    (fun s _ _ => integrable_condexp.integrableOn) (fun s hs hμs => _) hgm
    (StronglyMeasurable.aeStronglyMeasurable' stronglyMeasurable_condexp)
  

Proof state:
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁷ : IsROrC 𝕜
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace 𝕜 F
inst✝⁴ : NormedAddCommGroup F'
inst✝³ : NormedSpace 𝕜 F'
inst✝² : NormedSpace ℝ F'
inst✝¹ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f✝ g✝ : α → F'
s✝ : Set α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
f g : α → F'
hf : Integrable f
hg_int_finite : ∀ (s : Set α), MeasurableSet s → ↑↑μ s < ⊤ → IntegrableOn g s
hg_eq : ∀ (s : Set α), MeasurableSet s → ↑↑μ s < ⊤ → ∫ (x : α) in s, g x ∂μ = ∫ (x : α) in s, f x ∂μ
hgm : AEStronglyMeasurable' m g μ
s : Set α
hs : MeasurableSet s
hμs : ↑↑μ s < ⊤
⊢ ∫ (x : α) in s, g x ∂μ = ∫ (x : α) in s, (μ[f|m]) x ∂μ

Next tactic:
rw [hg_eq s hs hμs, set_integral_condexp hm hf hs]
theorem condexp_bot' [hμ : NeZero μ] (f : α → F') :
    μ[f|⊥] = fun _ => (μ Set.univ).toReal⁻¹ • ∫ x, f x ∂μ := by
  

Proof state:
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f✝ g : α → F'
s : Set α
hμ : NeZero μ
f : α → F'
⊢ μ[f|⊥] = fun x => (ENNReal.toReal (↑↑μ Set.univ))⁻¹ • ∫ (x : α), f x ∂μ

Next tactic:
by_cases hμ_finite : IsFiniteMeasure μ
theorem condexp_bot' [hμ : NeZero μ] (f : α → F') :
    μ[f|⊥] = fun _ => (μ Set.univ).toReal⁻¹ • ∫ x, f x ∂μ := by
  by_cases hμ_finite : IsFiniteMeasure μ
  

Proof state:
case pos
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f✝ g : α → F'
s : Set α
hμ : NeZero μ
f : α → F'
hμ_finite : IsFiniteMeasure μ
⊢ μ[f|⊥] = fun x => (ENNReal.toReal (↑↑μ Set.univ))⁻¹ • ∫ (x : α), f x ∂μ
case neg
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f✝ g : α → F'
s : Set α
hμ : NeZero μ
f : α → F'
hμ_finite : ¬IsFiniteMeasure μ
⊢ μ[f|⊥] = fun x => (ENNReal.toReal (↑↑μ Set.univ))⁻¹ • ∫ (x : α), f x ∂μ

Next tactic:
swap
theorem condexp_bot' [hμ : NeZero μ] (f : α → F') :
    μ[f|⊥] = fun _ => (μ Set.univ).toReal⁻¹ • ∫ x, f x ∂μ := by
  by_cases hμ_finite : IsFiniteMeasure μ
  swap
  · 

Proof state:
case neg
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f✝ g : α → F'
s : Set α
hμ : NeZero μ
f : α → F'
hμ_finite : ¬IsFiniteMeasure μ
⊢ μ[f|⊥] = fun x => (ENNReal.toReal (↑↑μ Set.univ))⁻¹ • ∫ (x : α), f x ∂μ

Next tactic:
have h : ¬SigmaFinite (μ.trim bot_le) := by rwa [sigmaFinite_trim_bot_iff]
theorem condexp_bot' [hμ : NeZero μ] (f : α → F') :
    μ[f|⊥] = fun _ => (μ Set.univ).toReal⁻¹ • ∫ x, f x ∂μ := by
  by_cases hμ_finite : IsFiniteMeasure μ
  swap
  · have h : ¬SigmaFinite (μ.trim bot_le) := by 

Proof state:
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f✝ g : α → F'
s : Set α
hμ : NeZero μ
f : α → F'
hμ_finite : ¬IsFiniteMeasure μ
⊢ ¬SigmaFinite (Measure.trim μ (_ : ⊥ ≤ m0))

Next tactic:
rwa [sigmaFinite_trim_bot_iff]