-- Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Integral.lean
/-- The continuous functional calculus commutes with integration. -/
lemma cfc_integral' [TopologicalSpace X] [OpensMeasurableSpace X] (f : X → 𝕜 → 𝕜)
    (bound : X → ℝ) (a : A) [SecondCountableTopologyEither X C(spectrum 𝕜 a, 𝕜)]
    (hf : Continuous (fun x => (spectrum 𝕜 a).restrict (f x)).uncurry)
    (hbound : ∀ x, ∀ z ∈ spectrum 𝕜 a, ‖f x z‖ ≤ ‖bound x‖)
    (hbound_finite_integral : HasFiniteIntegral bound μ) (ha : p a

Proof state:
X : Type u_1
𝕜 : Type u_2
A : Type u_3
p : A → Prop
inst✝¹⁰ : RCLike 𝕜
inst✝⁹ : MeasurableSpace X
μ : Measure X
inst✝⁸ : NormedRing A
inst✝⁷ : StarRing A
inst✝⁶ : NormedAlgebra 𝕜 A
inst✝⁵ : NormedAlgebra ℝ A
inst✝⁴ : CompleteSpace A
inst✝³ : ContinuousFunctionalCalculus 𝕜 p
inst✝² : TopologicalSpace X
inst✝¹ : OpensMeasurableSpace X
f : X → 𝕜 → 𝕜
bound : X → ℝ
a : A
inst✝ : SecondCountableTopologyEither X C(↑(spectrum 𝕜 a), 𝕜)
hf : Continuous (Function.uncurry fun x => (spectrum 𝕜 a).restrict (f x))
hbound : ∀ (x : X), ∀ z ∈ spectrum 𝕜 a, ‖f x z‖ ≤ ‖bound x‖
hbound_finite_integral : HasFiniteIntegral bound μ
ha : autoParam (p a) _auto✝
⊢ cfc (fun r => ∫ (x : X), f x r ∂μ) a = ∫ (x : X), cfc (f x) a ∂μ

Tactic:
refine cfc_integral f bound a ?_ ?_ hbound hbound_finite_integral

Result:
case refine_1
X : Type u_1
𝕜 : Type u_2
A : Type u_3
p : A → Prop
inst✝¹⁰ : RCLike 𝕜
inst✝⁹ : MeasurableSpace X
μ : Measure X
inst✝⁸ : NormedRing A
inst✝⁷ : StarRing A
inst✝⁶ : NormedAlgebra 𝕜 A
inst✝⁵ : NormedAlgebra ℝ A
inst✝⁴ : CompleteSpace A
inst✝³ : ContinuousFunctionalCalculus 𝕜 p
inst✝² : TopologicalSpace X
inst✝¹ : OpensMeasurableSpace X
f : X → 𝕜 → 𝕜
bound : X → ℝ
a : A
inst✝ : SecondCountableTopologyEither X C(↑(spectrum 𝕜 a), 𝕜)
hf : Continuous (Function.uncurry fun x => (spectrum 𝕜 a).restrict (f x))
hbound : ∀ (x : X), ∀ z ∈ spectrum 𝕜 a, ‖f x z‖ ≤ ‖bound x‖
hbound_finite_integral : HasFiniteIntegral bound μ
ha : autoParam (p a) _auto✝
⊢ ∀ (x : X), ContinuousOn (f x) (spectrum 𝕜 a)

case refine_2
X : Type u_1
𝕜 : Type u_2
A : Type u_3
p : A → Prop
inst✝¹⁰ : RCLike 𝕜
inst✝⁹ : MeasurableSpace X
μ : Measure X
inst✝⁸ : NormedRing A
inst✝⁷ : StarRing A
inst✝⁶ : NormedAlgebra 𝕜 A
inst✝⁵ : NormedAlgebra ℝ A
inst✝⁴ : CompleteSpace A
inst✝³ : ContinuousFunctionalCalculus 𝕜 p
inst✝² : TopologicalSpace X
inst✝¹ : OpensMeasurableSpace X
f : X → 𝕜 → 𝕜
bound : X → ℝ
a : A
inst✝ : SecondCountableTopologyEither X C(↑(spectrum 𝕜 a), 𝕜)
hf : Continuous (Function.uncurry fun x => (spectrum 𝕜 a).restrict (f x))
hbound : ∀ (x : X), ∀ z ∈ spectrum 𝕜 a, ‖f x z‖ ≤ ‖bound x‖
hbound_finite_integral : HasFiniteIntegral bound μ
ha : autoParam (p a) _auto✝
⊢ Continuous fun x => { toFun := (spectrum 𝕜 a).restrict (f x), continuous_toFun := ⋯ }

Proof state:
case refine_2
X : Type u_1
𝕜 : Type u_2
A : Type u_3
p : A → Prop
inst✝¹⁰ : RCLike 𝕜
inst✝⁹ : MeasurableSpace X
μ : Measure X
inst✝⁸ : NormedRing A
inst✝⁷ : StarRing A
inst✝⁶ : NormedAlgebra 𝕜 A
inst✝⁵ : NormedAlgebra ℝ A
inst✝⁴ : CompleteSpace A
inst✝³ : ContinuousFunctionalCalculus 𝕜 p
inst✝² : TopologicalSpace X
inst✝¹ : OpensMeasurableSpace X
f : X → 𝕜 → 𝕜
bound : X → ℝ
a : A
inst✝ : SecondCountableTopologyEither X C(↑(spectrum 𝕜 a), 𝕜)
hf : Continuous (Function.uncurry fun x => (spectrum 𝕜 a).restrict (f x))
hbound : ∀ (x : X), ∀ z ∈ spectrum 𝕜 a, ‖f x z‖ ≤ ‖bound x‖
hbound_finite_integral : HasFiniteIntegral bound μ
ha : autoParam (p a) _auto✝
⊢ Continuous fun x => { toFun := (spectrum 𝕜 a).restrict (f x), continuous_toFun := ⋯ }

Tactic:
exact ContinuousMap.curry ⟨_, hf⟩ |>.continuous

Result:
no goals