l3lab/ntp-mathlib huggingface dataset:
/-- `condexpL2` commutes with taking inner products with constants. See the lemma
`condexpL2_comp_continuousLinearMap` for a more general result about commuting with continuous
linear maps. -/
theorem condexpL2_const_inner (hm : m ≤ m0) (f : Lp E 2 μ) (c : E) :
    condexpL2 𝕜 𝕜 hm (((Lp.memℒp f).const_inner c).toLp fun a => ⟪c, f a⟫) =ᵐ[μ]
    fun a => ⟪c, (condexpL2 E 𝕜 hm f : α → E) a⟫ := by
  rw [lpMeas_coe]
  have h_mem_Lp : Memℒp (fun a => ⟪c, (condexpL2 E 𝕜 hm f : α → E) a⟫) 2 μ := by
    refine' Memℒp.const_inner _ _; rw [lpMeas_coe]; exact Lp.memℒp _
  have h_eq : h_mem_Lp.toLp _ =ᵐ[μ] fun a => ⟪c, (condexpL2 E 𝕜 hm f : α → E) a⟫ :=
    h_mem_Lp.coeFn_toLp
  refine' EventuallyEq.trans _ h_eq
  

Proof state:
α : Type u_1
E : Type u_2
E' : Type u_3
F : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹³ : IsROrC 𝕜
inst✝¹² : NormedAddCommGroup E
inst✝¹¹ : InnerProductSpace 𝕜 E
inst✝¹⁰ : CompleteSpace E
inst✝⁹ : NormedAddCommGroup E'
inst✝⁸ : InnerProductSpace 𝕜 E'
inst✝⁷ : CompleteSpace E'
inst✝⁶ : NormedSpace ℝ E'
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup G
inst✝² : NormedAddCommGroup G'
inst✝¹ : NormedSpace ℝ G'
inst✝ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
hm : m ≤ m0
f : ↥(Lp E 2)
c : E
h_mem_Lp : Memℒp (fun a => inner c (↑↑↑((condexpL2 E 𝕜 hm) f) a)) 2
h_eq :
  ↑↑(Memℒp.toLp (fun a => inner c (↑↑↑((condexpL2 E 𝕜 hm) f) a)) h_mem_Lp) =ᵐ[μ] fun a =>
    inner c (↑↑↑((condexpL2 E 𝕜 hm) f) a)
⊢ ↑↑↑((condexpL2 𝕜 𝕜 hm) (Memℒp.toLp (fun a => inner c (↑↑f a)) (_ : Memℒp (fun a => inner c (↑↑f a)) 2))) =ᵐ[μ]
    ↑↑(Memℒp.toLp (fun a => inner c (↑↑↑((condexpL2 E 𝕜 hm) f) a)) h_mem_Lp)

Next tactic:
refine' Lp.ae_eq_of_forall_set_integral_eq' 𝕜 hm _ _ two_ne_zero ENNReal.coe_ne_top
    (fun s _ hμs => integrableOn_condexpL2_of_measure_ne_top hm hμs.ne _) _ _ _ _
/-- `condexpL2` commutes with taking inner products with constants. See the lemma
`condexpL2_comp_continuousLinearMap` for a more general result about commuting with continuous
linear maps. -/
theorem condexpL2_const_inner (hm : m ≤ m0) (f : Lp E 2 μ) (c : E) :
    condexpL2 𝕜 𝕜 hm (((Lp.memℒp f).const_inner c).toLp fun a => ⟪c, f a⟫) =ᵐ[μ]
    fun a => ⟪c, (condexpL2 E 𝕜 hm f : α → E) a⟫ := by
  rw [lpMeas_coe]
  have h_mem_Lp : Memℒp (fun a => ⟪c, (condexpL2 E 𝕜 hm f : α → E) a⟫) 2 μ := by
    refine' Memℒp.const_inner _ _; rw [lpMeas_coe]; exact Lp.memℒp _
  have h_eq : h_mem_Lp.toLp _ =ᵐ[μ] fun a => ⟪c, (condexpL2 E 𝕜 hm f : α → E) a⟫ :=
    h_mem_Lp.coeFn_toLp
  refine' EventuallyEq.trans _ h_eq
  refine' Lp.ae_eq_of_forall_set_integral_eq' 𝕜 hm _ _ two_ne_zero ENNReal.coe_ne_top
    (fun s _ hμs => integrableOn_condexpL2_of_measure_ne_top hm hμs.ne _) _ _ _ _
  · 

Proof state:
case refine'_1
α : Type u_1
E : Type u_2
E' : Type u_3
F : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹³ : IsROrC 𝕜
inst✝¹² : NormedAddCommGroup E
inst✝¹¹ : InnerProductSpace 𝕜 E
inst✝¹⁰ : CompleteSpace E
inst✝⁹ : NormedAddCommGroup E'
inst✝⁸ : InnerProductSpace 𝕜 E'
inst✝⁷ : CompleteSpace E'
inst✝⁶ : NormedSpace ℝ E'
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup G
inst✝² : NormedAddCommGroup G'
inst✝¹ : NormedSpace ℝ G'
inst✝ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
hm : m ≤ m0
f : ↥(Lp E 2)
c : E
h_mem_Lp : Memℒp (fun a => inner c (↑↑↑((condexpL2 E 𝕜 hm) f) a)) 2
h_eq :
  ↑↑(Memℒp.toLp (fun a => inner c (↑↑↑((condexpL2 E 𝕜 hm) f) a)) h_mem_Lp) =ᵐ[μ] fun a =>
    inner c (↑↑↑((condexpL2 E 𝕜 hm) f) a)
⊢ ∀ (s : Set α),
    MeasurableSet s →
      ↑↑μ s < ⊤ → IntegrableOn (↑↑(Memℒp.toLp (fun a => inner c (↑↑↑((condexpL2 E 𝕜 hm) f) a)) h_mem_Lp)) s

Next tactic:
intro s _ hμs
/-- `condexpL2` commutes with taking inner products with constants. See the lemma
`condexpL2_comp_continuousLinearMap` for a more general result about commuting with continuous
linear maps. -/
theorem condexpL2_const_inner (hm : m ≤ m0) (f : Lp E 2 μ) (c : E) :
    condexpL2 𝕜 𝕜 hm (((Lp.memℒp f).const_inner c).toLp fun a => ⟪c, f a⟫) =ᵐ[μ]
    fun a => ⟪c, (condexpL2 E 𝕜 hm f : α → E) a⟫ := by
  rw [lpMeas_coe]
  have h_mem_Lp : Memℒp (fun a => ⟪c, (condexpL2 E 𝕜 hm f : α → E) a⟫) 2 μ := by
    refine' Memℒp.const_inner _ _; rw [lpMeas_coe]; exact Lp.memℒp _
  have h_eq : h_mem_Lp.toLp _ =ᵐ[μ] fun a => ⟪c, (condexpL2 E 𝕜 hm f : α → E) a⟫ :=
    h_mem_Lp.coeFn_toLp
  refine' EventuallyEq.trans _ h_eq
  refine' Lp.ae_eq_of_forall_set_integral_eq' 𝕜 hm _ _ two_ne_zero ENNReal.coe_ne_top
    (fun s _ hμs => integrableOn_condexpL2_of_measure_ne_top hm hμs.ne _) _ _ _ _
  · intro s _ hμs
    

Proof state:
case refine'_1
α : Type u_1
E : Type u_2
E' : Type u_3
F : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹³ : IsROrC 𝕜
inst✝¹² : NormedAddCommGroup E
inst✝¹¹ : InnerProductSpace 𝕜 E
inst✝¹⁰ : CompleteSpace E
inst✝⁹ : NormedAddCommGroup E'
inst✝⁸ : InnerProductSpace 𝕜 E'
inst✝⁷ : CompleteSpace E'
inst✝⁶ : NormedSpace ℝ E'
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup G
inst✝² : NormedAddCommGroup G'
inst✝¹ : NormedSpace ℝ G'
inst✝ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s✝ t : Set α
hm : m ≤ m0
f : ↥(Lp E 2)
c : E
h_mem_Lp : Memℒp (fun a => inner c (↑↑↑((condexpL2 E 𝕜 hm) f) a)) 2
h_eq :
  ↑↑(Memℒp.toLp (fun a => inner c (↑↑↑((condexpL2 E 𝕜 hm) f) a)) h_mem_Lp) =ᵐ[μ] fun a =>
    inner c (↑↑↑((condexpL2 E 𝕜 hm) f) a)
s : Set α
a✝ : MeasurableSet s
hμs : ↑↑μ s < ⊤
⊢ IntegrableOn (↑↑(Memℒp.toLp (fun a => inner c (↑↑↑((condexpL2 E 𝕜 hm) f) a)) h_mem_Lp)) s

Next tactic:
rw [IntegrableOn, integrable_congr (ae_restrict_of_ae h_eq)]
/-- `condexpL2` commutes with taking inner products with constants. See the lemma
`condexpL2_comp_continuousLinearMap` for a more general result about commuting with continuous
linear maps. -/
theorem condexpL2_const_inner (hm : m ≤ m0) (f : Lp E 2 μ) (c : E) :
    condexpL2 𝕜 𝕜 hm (((Lp.memℒp f).const_inner c).toLp fun a => ⟪c, f a⟫) =ᵐ[μ]
    fun a => ⟪c, (condexpL2 E 𝕜 hm f : α → E) a⟫ := by
  rw [lpMeas_coe]
  have h_mem_Lp : Memℒp (fun a => ⟪c, (condexpL2 E 𝕜 hm f : α → E) a⟫) 2 μ := by
    refine' Memℒp.const_inner _ _; rw [lpMeas_coe]; exact Lp.memℒp _
  have h_eq : h_mem_Lp.toLp _ =ᵐ[μ] fun a => ⟪c, (condexpL2 E 𝕜 hm f : α → E) a⟫ :=
    h_mem_Lp.coeFn_toLp
  refine' EventuallyEq.trans _ h_eq
  refine' Lp.ae_eq_of_forall_set_integral_eq' 𝕜 hm _ _ two_ne_zero ENNReal.coe_ne_top
    (fun s _ hμs => integrableOn_condexpL2_of_measure_ne_top hm hμs.ne _) _ _ _ _
  · intro s _ hμs
    rw [IntegrableOn, integrable_congr (ae_restrict_of_ae h_eq)]
    

Proof state:
case refine'_1
α : Type u_1
E : Type u_2
E' : Type u_3
F : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹³ : IsROrC 𝕜
inst✝¹² : NormedAddCommGroup E
inst✝¹¹ : InnerProductSpace 𝕜 E
inst✝¹⁰ : CompleteSpace E
inst✝⁹ : NormedAddCommGroup E'
inst✝⁸ : InnerProductSpace 𝕜 E'
inst✝⁷ : CompleteSpace E'
inst✝⁶ : NormedSpace ℝ E'
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup G
inst✝² : NormedAddCommGroup G'
inst✝¹ : NormedSpace ℝ G'
inst✝ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s✝ t : Set α
hm : m ≤ m0
f : ↥(Lp E 2)
c : E
h_mem_Lp : Memℒp (fun a => inner c (↑↑↑((condexpL2 E 𝕜 hm) f) a)) 2
h_eq :
  ↑↑(Memℒp.toLp (fun a => inner c (↑↑↑((condexpL2 E 𝕜 hm) f) a)) h_mem_Lp) =ᵐ[μ] fun a =>
    inner c (↑↑↑((condexpL2 E 𝕜 hm) f) a)
s : Set α
a✝ : MeasurableSet s
hμs : ↑↑μ s < ⊤
⊢ Integrable fun x => (fun a => inner c (↑↑↑((condexpL2 E 𝕜 hm) f) a)) x

Next tactic:
exact (integrableOn_condexpL2_of_measure_ne_top hm hμs.ne _).const_inner _
/-- `condexpL2` commutes with taking inner products with constants. See the lemma
`condexpL2_comp_continuousLinearMap` for a more general result about commuting with continuous
linear maps. -/
theorem condexpL2_const_inner (hm : m ≤ m0) (f : Lp E 2 μ) (c : E) :
    condexpL2 𝕜 𝕜 hm (((Lp.memℒp f).const_inner c).toLp fun a => ⟪c, f a⟫) =ᵐ[μ]
    fun a => ⟪c, (condexpL2 E 𝕜 hm f : α → E) a⟫ := by
  rw [lpMeas_coe]
  have h_mem_Lp : Memℒp (fun a => ⟪c, (condexpL2 E 𝕜 hm f : α → E) a⟫) 2 μ := by
    refine' Memℒp.const_inner _ _; rw [lpMeas_coe]; exact Lp.memℒp _
  have h_eq : h_mem_Lp.toLp _ =ᵐ[μ] fun a => ⟪c, (condexpL2 E 𝕜 hm f : α → E) a⟫ :=
    h_mem_Lp.coeFn_toLp
  refine' EventuallyEq.trans _ h_eq
  refine' Lp.ae_eq_of_forall_set_integral_eq' 𝕜 hm _ _ two_ne_zero ENNReal.coe_ne_top
    (fun s _ hμs => integrableOn_condexpL2_of_measure_ne_top hm hμs.ne _) _ _ _ _
  · intro s _ hμs
    rw [IntegrableOn, integrable_congr (ae_restrict_of_ae h_eq)]
    exact (integrableOn_condexpL2_of_measure_ne_top hm hμs.ne _).const_inner _
  · 

Proof state:
case refine'_2
α : Type u_1
E : Type u_2
E' : Type u_3
F : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹³ : IsROrC 𝕜
inst✝¹² : NormedAddCommGroup E
inst✝¹¹ : InnerProductSpace 𝕜 E
inst✝¹⁰ : CompleteSpace E
inst✝⁹ : NormedAddCommGroup E'
inst✝⁸ : InnerProductSpace 𝕜 E'
inst✝⁷ : CompleteSpace E'
inst✝⁶ : NormedSpace ℝ E'
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup G
inst✝² : NormedAddCommGroup G'
inst✝¹ : NormedSpace ℝ G'
inst✝ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
hm : m ≤ m0
f : ↥(Lp E 2)
c : E
h_mem_Lp : Memℒp (fun a => inner c (↑↑↑((condexpL2 E 𝕜 hm) f) a)) 2
h_eq :
  ↑↑(Memℒp.toLp (fun a => inner c (↑↑↑((condexpL2 E 𝕜 hm) f) a)) h_mem_Lp) =ᵐ[μ] fun a =>
    inner c (↑↑↑((condexpL2 E 𝕜 hm) f) a)
⊢ ∀ (s : Set α),
    MeasurableSet s →
      ↑↑μ s < ⊤ →
        ∫ (x : α) in s,
            ↑↑↑((condexpL2 𝕜 𝕜 hm) (Memℒp.toLp (fun a => inner c (↑↑f a)) (_ : Memℒp (fun a => inner c (↑↑f a)) 2)))
              x ∂μ =
          ∫ (x : α) in s, ↑↑(Memℒp.toLp (fun a => inner c (↑↑↑((condexpL2 E 𝕜 hm) f) a)) h_mem_Lp) x ∂μ

Next tactic:
intro s hs hμs
/-- `condexpL2` commutes with taking inner products with constants. See the lemma
`condexpL2_comp_continuousLinearMap` for a more general result about commuting with continuous
linear maps. -/
theorem condexpL2_const_inner (hm : m ≤ m0) (f : Lp E 2 μ) (c : E) :
    condexpL2 𝕜 𝕜 hm (((Lp.memℒp f).const_inner c).toLp fun a => ⟪c, f a⟫) =ᵐ[μ]
    fun a => ⟪c, (condexpL2 E 𝕜 hm f : α → E) a⟫ := by
  rw [lpMeas_coe]
  have h_mem_Lp : Memℒp (fun a => ⟪c, (condexpL2 E 𝕜 hm f : α → E) a⟫) 2 μ := by
    refine' Memℒp.const_inner _ _; rw [lpMeas_coe]; exact Lp.memℒp _
  have h_eq : h_mem_Lp.toLp _ =ᵐ[μ] fun a => ⟪c, (condexpL2 E 𝕜 hm f : α → E) a⟫ :=
    h_mem_Lp.coeFn_toLp
  refine' EventuallyEq.trans _ h_eq
  refine' Lp.ae_eq_of_forall_set_integral_eq' 𝕜 hm _ _ two_ne_zero ENNReal.coe_ne_top
    (fun s _ hμs => integrableOn_condexpL2_of_measure_ne_top hm hμs.ne _) _ _ _ _
  · intro s _ hμs
    rw [IntegrableOn, integrable_congr (ae_restrict_of_ae h_eq)]
    exact (integrableOn_condexpL2_of_measure_ne_top hm hμs.ne _).const_inner _
  · intro s hs hμs
    

Proof state:
case refine'_2
α : Type u_1
E : Type u_2
E' : Type u_3
F : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹³ : IsROrC 𝕜
inst✝¹² : NormedAddCommGroup E
inst✝¹¹ : InnerProductSpace 𝕜 E
inst✝¹⁰ : CompleteSpace E
inst✝⁹ : NormedAddCommGroup E'
inst✝⁸ : InnerProductSpace 𝕜 E'
inst✝⁷ : CompleteSpace E'
inst✝⁶ : NormedSpace ℝ E'
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup G
inst✝² : NormedAddCommGroup G'
inst✝¹ : NormedSpace ℝ G'
inst✝ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s✝ t : Set α
hm : m ≤ m0
f : ↥(Lp E 2)
c : E
h_mem_Lp : Memℒp (fun a => inner c (↑↑↑((condexpL2 E 𝕜 hm) f) a)) 2
h_eq :
  ↑↑(Memℒp.toLp (fun a => inner c (↑↑↑((condexpL2 E 𝕜 hm) f) a)) h_mem_Lp) =ᵐ[μ] fun a =>
    inner c (↑↑↑((condexpL2 E 𝕜 hm) f) a)
s : Set α
hs : MeasurableSet s
hμs : ↑↑μ s < ⊤
⊢ ∫ (x : α) in s,
      ↑↑↑((condexpL2 𝕜 𝕜 hm) (Memℒp.toLp (fun a => inner c (↑↑f a)) (_ : Memℒp (fun a => inner c (↑↑f a)) 2))) x ∂μ =
    ∫ (x : α) in s, ↑↑(Memℒp.toLp (fun a => inner c (↑↑↑((condexpL2 E 𝕜 hm) f) a)) h_mem_Lp) x ∂μ

Next tactic:
rw [← lpMeas_coe, integral_condexpL2_eq_of_fin_meas_real _ hs hμs.ne,
      integral_congr_ae (ae_restrict_of_ae h_eq), lpMeas_coe, ←
      L2.inner_indicatorConstLp_eq_set_integral_inner 𝕜 (↑(condexpL2 E 𝕜 hm f)) (hm s hs) c hμs.ne,
      ← inner_condexpL2_left_eq_right, condexpL2_indicator_of_measurable _ hs,
      L2.inner_indicatorConstLp_eq_set_integral_inner 𝕜 f (hm s hs) c hμs.ne,
      set_integral_congr_ae (hm s hs)
        ((Memℒp.coeFn_toLp ((Lp.memℒp f).const_inner c)).mono fun x hx _ => hx)]
/-- `condexpL2` commutes with taking inner products with constants. See the lemma
`condexpL2_comp_continuousLinearMap` for a more general result about commuting with continuous
linear maps. -/
theorem condexpL2_const_inner (hm : m ≤ m0) (f : Lp E 2 μ) (c : E) :
    condexpL2 𝕜 𝕜 hm (((Lp.memℒp f).const_inner c).toLp fun a => ⟪c, f a⟫) =ᵐ[μ]
    fun a => ⟪c, (condexpL2 E 𝕜 hm f : α → E) a⟫ := by
  rw [lpMeas_coe]
  have h_mem_Lp : Memℒp (fun a => ⟪c, (condexpL2 E 𝕜 hm f : α → E) a⟫) 2 μ := by
    refine' Memℒp.const_inner _ _; rw [lpMeas_coe]; exact Lp.memℒp _
  have h_eq : h_mem_Lp.toLp _ =ᵐ[μ] fun a => ⟪c, (condexpL2 E 𝕜 hm f : α → E) a⟫ :=
    h_mem_Lp.coeFn_toLp
  refine' EventuallyEq.trans _ h_eq
  refine' Lp.ae_eq_of_forall_set_integral_eq' 𝕜 hm _ _ two_ne_zero ENNReal.coe_ne_top
    (fun s _ hμs => integrableOn_condexpL2_of_measure_ne_top hm hμs.ne _) _ _ _ _
  · intro s _ hμs
    rw [IntegrableOn, integrable_congr (ae_restrict_of_ae h_eq)]
    exact (integrableOn_condexpL2_of_measure_ne_top hm hμs.ne _).const_inner _
  · intro s hs hμs
    rw [← lpMeas_coe, integral_condexpL2_eq_of_fin_meas_real _ hs hμs.ne,
      integral_congr_ae (ae_restrict_of_ae h_eq), lpMeas_coe, ←
      L2.inner_indicatorConstLp_eq_set_integral_inner 𝕜 (↑(condexpL2 E 𝕜 hm f)) (hm s hs) c hμs.ne,
      ← inner_condexpL2_left_eq_right, condexpL2_indicator_of_measurable _ hs,
      L2.inner_indicatorConstLp_eq_set_integral_inner 𝕜 f (hm s hs) c hμs.ne,
      set_integral_congr_ae (hm s hs)
        ((Memℒp.coeFn_toLp ((Lp.memℒp f).const_inner c)).mono fun x hx _ => hx)]
  · 

Proof state:
case refine'_3
α : Type u_1
E : Type u_2
E' : Type u_3
F : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹³ : IsROrC 𝕜
inst✝¹² : NormedAddCommGroup E
inst✝¹¹ : InnerProductSpace 𝕜 E
inst✝¹⁰ : CompleteSpace E
inst✝⁹ : NormedAddCommGroup E'
inst✝⁸ : InnerProductSpace 𝕜 E'
inst✝⁷ : CompleteSpace E'
inst✝⁶ : NormedSpace ℝ E'
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup G
inst✝² : NormedAddCommGroup G'
inst✝¹ : NormedSpace ℝ G'
inst✝ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
hm : m ≤ m0
f : ↥(Lp E 2)
c : E
h_mem_Lp : Memℒp (fun a => inner c (↑↑↑((condexpL2 E 𝕜 hm) f) a)) 2
h_eq :
  ↑↑(Memℒp.toLp (fun a => inner c (↑↑↑((condexpL2 E 𝕜 hm) f) a)) h_mem_Lp) =ᵐ[μ] fun a =>
    inner c (↑↑↑((condexpL2 E 𝕜 hm) f) a)
⊢ AEStronglyMeasurable' m
    (↑↑↑((condexpL2 𝕜 𝕜 hm) (Memℒp.toLp (fun a => inner c (↑↑f a)) (_ : Memℒp (fun a => inner c (↑↑f a)) 2)))) μ

Next tactic:
rw [← lpMeas_coe]
/-- `condexpL2` commutes with taking inner products with constants. See the lemma
`condexpL2_comp_continuousLinearMap` for a more general result about commuting with continuous
linear maps. -/
theorem condexpL2_const_inner (hm : m ≤ m0) (f : Lp E 2 μ) (c : E) :
    condexpL2 𝕜 𝕜 hm (((Lp.memℒp f).const_inner c).toLp fun a => ⟪c, f a⟫) =ᵐ[μ]
    fun a => ⟪c, (condexpL2 E 𝕜 hm f : α → E) a⟫ := by
  rw [lpMeas_coe]
  have h_mem_Lp : Memℒp (fun a => ⟪c, (condexpL2 E 𝕜 hm f : α → E) a⟫) 2 μ := by
    refine' Memℒp.const_inner _ _; rw [lpMeas_coe]; exact Lp.memℒp _
  have h_eq : h_mem_Lp.toLp _ =ᵐ[μ] fun a => ⟪c, (condexpL2 E 𝕜 hm f : α → E) a⟫ :=
    h_mem_Lp.coeFn_toLp
  refine' EventuallyEq.trans _ h_eq
  refine' Lp.ae_eq_of_forall_set_integral_eq' 𝕜 hm _ _ two_ne_zero ENNReal.coe_ne_top
    (fun s _ hμs => integrableOn_condexpL2_of_measure_ne_top hm hμs.ne _) _ _ _ _
  · intro s _ hμs
    rw [IntegrableOn, integrable_congr (ae_restrict_of_ae h_eq)]
    exact (integrableOn_condexpL2_of_measure_ne_top hm hμs.ne _).const_inner _
  · intro s hs hμs
    rw [← lpMeas_coe, integral_condexpL2_eq_of_fin_meas_real _ hs hμs.ne,
      integral_congr_ae (ae_restrict_of_ae h_eq), lpMeas_coe, ←
      L2.inner_indicatorConstLp_eq_set_integral_inner 𝕜 (↑(condexpL2 E 𝕜 hm f)) (hm s hs) c hμs.ne,
      ← inner_condexpL2_left_eq_right, condexpL2_indicator_of_measurable _ hs,
      L2.inner_indicatorConstLp_eq_set_integral_inner 𝕜 f (hm s hs) c hμs.ne,
      set_integral_congr_ae (hm s hs)
        ((Memℒp.coeFn_toLp ((Lp.memℒp f).const_inner c)).mono fun x hx _ => hx)]
  · rw [← lpMeas_coe]; 

Proof state:
case refine'_3
α : Type u_1
E : Type u_2
E' : Type u_3
F : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹³ : IsROrC 𝕜
inst✝¹² : NormedAddCommGroup E
inst✝¹¹ : InnerProductSpace 𝕜 E
inst✝¹⁰ : CompleteSpace E
inst✝⁹ : NormedAddCommGroup E'
inst✝⁸ : InnerProductSpace 𝕜 E'
inst✝⁷ : CompleteSpace E'
inst✝⁶ : NormedSpace ℝ E'
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup G
inst✝² : NormedAddCommGroup G'
inst✝¹ : NormedSpace ℝ G'
inst✝ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
hm : m ≤ m0
f : ↥(Lp E 2)
c : E
h_mem_Lp : Memℒp (fun a => inner c (↑↑↑((condexpL2 E 𝕜 hm) f) a)) 2
h_eq :
  ↑↑(Memℒp.toLp (fun a => inner c (↑↑↑((condexpL2 E 𝕜 hm) f) a)) h_mem_Lp) =ᵐ[μ] fun a =>
    inner c (↑↑↑((condexpL2 E 𝕜 hm) f) a)
⊢ AEStronglyMeasurable' m
    (↑↑↑((condexpL2 𝕜 𝕜 hm) (Memℒp.toLp (fun a => inner c (↑↑f a)) (_ : Memℒp (fun a => inner c (↑↑f a)) 2)))) μ

Next tactic:
exact lpMeas.aeStronglyMeasurable' _
/-- `condexpL2` commutes with taking inner products with constants. See the lemma
`condexpL2_comp_continuousLinearMap` for a more general result about commuting with continuous
linear maps. -/
theorem condexpL2_const_inner (hm : m ≤ m0) (f : Lp E 2 μ) (c : E) :
    condexpL2 𝕜 𝕜 hm (((Lp.memℒp f).const_inner c).toLp fun a => ⟪c, f a⟫) =ᵐ[μ]
    fun a => ⟪c, (condexpL2 E 𝕜 hm f : α → E) a⟫ := by
  rw [lpMeas_coe]
  have h_mem_Lp : Memℒp (fun a => ⟪c, (condexpL2 E 𝕜 hm f : α → E) a⟫) 2 μ := by
    refine' Memℒp.const_inner _ _; rw [lpMeas_coe]; exact Lp.memℒp _
  have h_eq : h_mem_Lp.toLp _ =ᵐ[μ] fun a => ⟪c, (condexpL2 E 𝕜 hm f : α → E) a⟫ :=
    h_mem_Lp.coeFn_toLp
  refine' EventuallyEq.trans _ h_eq
  refine' Lp.ae_eq_of_forall_set_integral_eq' 𝕜 hm _ _ two_ne_zero ENNReal.coe_ne_top
    (fun s _ hμs => integrableOn_condexpL2_of_measure_ne_top hm hμs.ne _) _ _ _ _
  · intro s _ hμs
    rw [IntegrableOn, integrable_congr (ae_restrict_of_ae h_eq)]
    exact (integrableOn_condexpL2_of_measure_ne_top hm hμs.ne _).const_inner _
  · intro s hs hμs
    rw [← lpMeas_coe, integral_condexpL2_eq_of_fin_meas_real _ hs hμs.ne,
      integral_congr_ae (ae_restrict_of_ae h_eq), lpMeas_coe, ←
      L2.inner_indicatorConstLp_eq_set_integral_inner 𝕜 (↑(condexpL2 E 𝕜 hm f)) (hm s hs) c hμs.ne,
      ← inner_condexpL2_left_eq_right, condexpL2_indicator_of_measurable _ hs,
      L2.inner_indicatorConstLp_eq_set_integral_inner 𝕜 f (hm s hs) c hμs.ne,
      set_integral_congr_ae (hm s hs)
        ((Memℒp.coeFn_toLp ((Lp.memℒp f).const_inner c)).mono fun x hx _ => hx)]
  · rw [← lpMeas_coe]; exact lpMeas.aeStronglyMeasurable' _
  · 

Proof state:
case refine'_4
α : Type u_1
E : Type u_2
E' : Type u_3
F : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹³ : IsROrC 𝕜
inst✝¹² : NormedAddCommGroup E
inst✝¹¹ : InnerProductSpace 𝕜 E
inst✝¹⁰ : CompleteSpace E
inst✝⁹ : NormedAddCommGroup E'
inst✝⁸ : InnerProductSpace 𝕜 E'
inst✝⁷ : CompleteSpace E'
inst✝⁶ : NormedSpace ℝ E'
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup G
inst✝² : NormedAddCommGroup G'
inst✝¹ : NormedSpace ℝ G'
inst✝ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
hm : m ≤ m0
f : ↥(Lp E 2)
c : E
h_mem_Lp : Memℒp (fun a => inner c (↑↑↑((condexpL2 E 𝕜 hm) f) a)) 2
h_eq :
  ↑↑(Memℒp.toLp (fun a => inner c (↑↑↑((condexpL2 E 𝕜 hm) f) a)) h_mem_Lp) =ᵐ[μ] fun a =>
    inner c (↑↑↑((condexpL2 E 𝕜 hm) f) a)
⊢ AEStronglyMeasurable' m (↑↑(Memℒp.toLp (fun a => inner c (↑↑↑((condexpL2 E 𝕜 hm) f) a)) h_mem_Lp)) μ

Next tactic:
refine' AEStronglyMeasurable'.congr _ h_eq.symm
/-- `condexpL2` commutes with taking inner products with constants. See the lemma
`condexpL2_comp_continuousLinearMap` for a more general result about commuting with continuous
linear maps. -/
theorem condexpL2_const_inner (hm : m ≤ m0) (f : Lp E 2 μ) (c : E) :
    condexpL2 𝕜 𝕜 hm (((Lp.memℒp f).const_inner c).toLp fun a => ⟪c, f a⟫) =ᵐ[μ]
    fun a => ⟪c, (condexpL2 E 𝕜 hm f : α → E) a⟫ := by
  rw [lpMeas_coe]
  have h_mem_Lp : Memℒp (fun a => ⟪c, (condexpL2 E 𝕜 hm f : α → E) a⟫) 2 μ := by
    refine' Memℒp.const_inner _ _; rw [lpMeas_coe]; exact Lp.memℒp _
  have h_eq : h_mem_Lp.toLp _ =ᵐ[μ] fun a => ⟪c, (condexpL2 E 𝕜 hm f : α → E) a⟫ :=
    h_mem_Lp.coeFn_toLp
  refine' EventuallyEq.trans _ h_eq
  refine' Lp.ae_eq_of_forall_set_integral_eq' 𝕜 hm _ _ two_ne_zero ENNReal.coe_ne_top
    (fun s _ hμs => integrableOn_condexpL2_of_measure_ne_top hm hμs.ne _) _ _ _ _
  · intro s _ hμs
    rw [IntegrableOn, integrable_congr (ae_restrict_of_ae h_eq)]
    exact (integrableOn_condexpL2_of_measure_ne_top hm hμs.ne _).const_inner _
  · intro s hs hμs
    rw [← lpMeas_coe, integral_condexpL2_eq_of_fin_meas_real _ hs hμs.ne,
      integral_congr_ae (ae_restrict_of_ae h_eq), lpMeas_coe, ←
      L2.inner_indicatorConstLp_eq_set_integral_inner 𝕜 (↑(condexpL2 E 𝕜 hm f)) (hm s hs) c hμs.ne,
      ← inner_condexpL2_left_eq_right, condexpL2_indicator_of_measurable _ hs,
      L2.inner_indicatorConstLp_eq_set_integral_inner 𝕜 f (hm s hs) c hμs.ne,
      set_integral_congr_ae (hm s hs)
        ((Memℒp.coeFn_toLp ((Lp.memℒp f).const_inner c)).mono fun x hx _ => hx)]
  · rw [← lpMeas_coe]; exact lpMeas.aeStronglyMeasurable' _
  · refine' AEStronglyMeasurable'.congr _ h_eq.symm
    

Proof state:
case refine'_4
α : Type u_1
E : Type u_2
E' : Type u_3
F : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹³ : IsROrC 𝕜
inst✝¹² : NormedAddCommGroup E
inst✝¹¹ : InnerProductSpace 𝕜 E
inst✝¹⁰ : CompleteSpace E
inst✝⁹ : NormedAddCommGroup E'
inst✝⁸ : InnerProductSpace 𝕜 E'
inst✝⁷ : CompleteSpace E'
inst✝⁶ : NormedSpace ℝ E'
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup G
inst✝² : NormedAddCommGroup G'
inst✝¹ : NormedSpace ℝ G'
inst✝ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
hm : m ≤ m0
f : ↥(Lp E 2)
c : E
h_mem_Lp : Memℒp (fun a => inner c (↑↑↑((condexpL2 E 𝕜 hm) f) a)) 2
h_eq :
  ↑↑(Memℒp.toLp (fun a => inner c (↑↑↑((condexpL2 E 𝕜 hm) f) a)) h_mem_Lp) =ᵐ[μ] fun a =>
    inner c (↑↑↑((condexpL2 E 𝕜 hm) f) a)
⊢ AEStronglyMeasurable' m (fun a => inner c (↑↑↑((condexpL2 E 𝕜 hm) f) a)) μ

Next tactic:
exact (lpMeas.aeStronglyMeasurable' _).const_inner _
/-- `condexpL2` verifies the equality of integrals defining the conditional expectation. -/
theorem integral_condexpL2_eq (hm : m ≤ m0) (f : Lp E' 2 μ) (hs : MeasurableSet[m] s)
    (hμs : μ s ≠ ∞) : ∫ x in s, (condexpL2 E' 𝕜 hm f : α → E') x ∂μ = ∫ x in s, f x ∂μ := by
  

Proof state:
α : Type u_1
E : Type u_2
E' : Type u_3
F : Type u_4
G : Type u_5
G' : Type u_6
𝕜 : Type u_7
p : ℝ≥0∞
inst✝¹³ : IsROrC 𝕜
inst✝¹² : NormedAddCommGroup E
inst✝¹¹ : InnerProductSpace 𝕜 E
inst✝¹⁰ : CompleteSpace E
inst✝⁹ : NormedAddCommGroup E'
inst✝⁸ : InnerProductSpace 𝕜 E'
inst✝⁷ : CompleteSpace E'
inst✝⁶ : NormedSpace ℝ E'
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup G
inst✝² : NormedAddCommGroup G'
inst✝¹ : NormedSpace ℝ G'
inst✝ : CompleteSpace G'
m m0 : MeasurableSpace α
μ : Measure α
s t : Set α
hm : m ≤ m0
f : ↥(Lp E' 2)
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
⊢ ∫ (x : α) in s, ↑↑↑((condexpL2 E' 𝕜 hm) f) x ∂μ = ∫ (x : α) in s, ↑↑f x ∂μ

Next tactic:
rw [← sub_eq_zero, lpMeas_coe, ←
    integral_sub' (integrableOn_Lp_of_measure_ne_top _ fact_one_le_two_ennreal.elim hμs)
      (integrableOn_Lp_of_measure_ne_top _ fact_one_le_two_ennreal.elim hμs)]