-- Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/NonUnital.lean
lemma cfcₙ_sum {ι : Type*} (f : ι → R → R) (a : A) (s : Finset ι)
    (hf : ∀ i ∈ s, ContinuousOn (f i) (σₙ R a)

Proof state:
case pos
R : Type u_1
A : Type u_2
p : A → Prop
inst✝¹¹ : CommSemiring R
inst✝¹⁰ : Nontrivial R
inst✝⁹ : StarRing R
inst✝⁸ : MetricSpace R
inst✝⁷ : IsTopologicalSemiring R
inst✝⁶ : ContinuousStar R
inst✝⁵ : NonUnitalRing A
inst✝⁴ : StarRing A
inst✝³ : TopologicalSpace A
inst✝² : Module R A
inst✝¹ : IsScalarTower R A A
inst✝ : SMulCommClass R A A
instCFCₙ : NonUnitalContinuousFunctionalCalculus R p
ι : Type u_3
f : ι → R → R
a : A
s : Finset ι
hf : autoParam (∀ i ∈ s, ContinuousOn (f i) (σₙ R a)) _auto✝
hf0 : autoParam (∀ i ∈ s, f i 0 = 0) _auto✝
ha : p a
hsum : s.sum f = fun z => ∑ i ∈ s, f i z
⊢ cfcₙ (∑ i ∈ s, f i) a = ∑ i ∈ s, cfcₙ (f i) a

Tactic:
have hf' : ContinuousOn (∑ i : s, f i) (σₙ R a) := by
  rw [sum_coe_sort s, hsum]
  exact continuousOn_finset_sum s fun i hi => hf i hi

Result:
case pos
R : Type u_1
A : Type u_2
p : A → Prop
inst✝¹¹ : CommSemiring R
inst✝¹⁰ : Nontrivial R
inst✝⁹ : StarRing R
inst✝⁸ : MetricSpace R
inst✝⁷ : IsTopologicalSemiring R
inst✝⁶ : ContinuousStar R
inst✝⁵ : NonUnitalRing A
inst✝⁴ : StarRing A
inst✝³ : TopologicalSpace A
inst✝² : Module R A
inst✝¹ : IsScalarTower R A A
inst✝ : SMulCommClass R A A
instCFCₙ : NonUnitalContinuousFunctionalCalculus R p
ι : Type u_3
f : ι → R → R
a : A
s : Finset ι
hf : autoParam (∀ i ∈ s, ContinuousOn (f i) (σₙ R a)) _auto✝
hf0 : autoParam (∀ i ∈ s, f i 0 = 0) _auto✝
ha : p a
hsum : s.sum f = fun z => ∑ i ∈ s, f i z
hf' : ContinuousOn (∑ i : { x // x ∈ s }, f ↑i) (σₙ R a)
⊢ cfcₙ (∑ i ∈ s, f i) a = ∑ i ∈ s, cfcₙ (f i) a

Proof state:
R : Type u_1
A : Type u_2
p : A → Prop
inst✝¹¹ : CommSemiring R
inst✝¹⁰ : Nontrivial R
inst✝⁹ : StarRing R
inst✝⁸ : MetricSpace R
inst✝⁷ : IsTopologicalSemiring R
inst✝⁶ : ContinuousStar R
inst✝⁵ : NonUnitalRing A
inst✝⁴ : StarRing A
inst✝³ : TopologicalSpace A
inst✝² : Module R A
inst✝¹ : IsScalarTower R A A
inst✝ : SMulCommClass R A A
instCFCₙ : NonUnitalContinuousFunctionalCalculus R p
ι : Type u_3
f : ι → R → R
a : A
s : Finset ι
hf : autoParam (∀ i ∈ s, ContinuousOn (f i) (σₙ R a)) _auto✝
hf0 : autoParam (∀ i ∈ s, f i 0 = 0) _auto✝
ha : p a
hsum : s.sum f = fun z => ∑ i ∈ s, f i z
⊢ ContinuousOn (∑ i : { x // x ∈ s }, f ↑i) (σₙ R a)

Tactic:
rw [sum_coe_sort s, hsum]

Result:
R : Type u_1
A : Type u_2
p : A → Prop
inst✝¹¹ : CommSemiring R
inst✝¹⁰ : Nontrivial R
inst✝⁹ : StarRing R
inst✝⁸ : MetricSpace R
inst✝⁷ : IsTopologicalSemiring R
inst✝⁶ : ContinuousStar R
inst✝⁵ : NonUnitalRing A
inst✝⁴ : StarRing A
inst✝³ : TopologicalSpace A
inst✝² : Module R A
inst✝¹ : IsScalarTower R A A
inst✝ : SMulCommClass R A A
instCFCₙ : NonUnitalContinuousFunctionalCalculus R p
ι : Type u_3
f : ι → R → R
a : A
s : Finset ι
hf : autoParam (∀ i ∈ s, ContinuousOn (f i) (σₙ R a)) _auto✝
hf0 : autoParam (∀ i ∈ s, f i 0 = 0) _auto✝
ha : p a
hsum : s.sum f = fun z => ∑ i ∈ s, f i z
⊢ ContinuousOn (fun z => ∑ i ∈ s, f i z) (σₙ R a)

Proof state:
R : Type u_1
A : Type u_2
p : A → Prop
inst✝¹¹ : CommSemiring R
inst✝¹⁰ : Nontrivial R
inst✝⁹ : StarRing R
inst✝⁸ : MetricSpace R
inst✝⁷ : IsTopologicalSemiring R
inst✝⁶ : ContinuousStar R
inst✝⁵ : NonUnitalRing A
inst✝⁴ : StarRing A
inst✝³ : TopologicalSpace A
inst✝² : Module R A
inst✝¹ : IsScalarTower R A A
inst✝ : SMulCommClass R A A
instCFCₙ : NonUnitalContinuousFunctionalCalculus R p
ι : Type u_3
f : ι → R → R
a : A
s : Finset ι
hf : autoParam (∀ i ∈ s, ContinuousOn (f i) (σₙ R a)) _auto✝
hf0 : autoParam (∀ i ∈ s, f i 0 = 0) _auto✝
ha : p a
⊢ s.sum f = fun z => ∑ i ∈ s, f i z

Tactic:
ext

Result:
case h
R : Type u_1
A : Type u_2
p : A → Prop
inst✝¹¹ : CommSemiring R
inst✝¹⁰ : Nontrivial R
inst✝⁹ : StarRing R
inst✝⁸ : MetricSpace R
inst✝⁷ : IsTopologicalSemiring R
inst✝⁶ : ContinuousStar R
inst✝⁵ : NonUnitalRing A
inst✝⁴ : StarRing A
inst✝³ : TopologicalSpace A
inst✝² : Module R A
inst✝¹ : IsScalarTower R A A
inst✝ : SMulCommClass R A A
instCFCₙ : NonUnitalContinuousFunctionalCalculus R p
ι : Type u_3
f : ι → R → R
a : A
s : Finset ι
hf : autoParam (∀ i ∈ s, ContinuousOn (f i) (σₙ R a)) _auto✝
hf0 : autoParam (∀ i ∈ s, f i 0 = 0) _auto✝
ha : p a
x✝ : R
⊢ s.sum f x✝ = ∑ i ∈ s, f i x✝

Proof state:
R : Type u_1
A : Type u_2
p : A → Prop
inst✝¹¹ : CommSemiring R
inst✝¹⁰ : Nontrivial R
inst✝⁹ : StarRing R
inst✝⁸ : MetricSpace R
inst✝⁷ : IsTopologicalSemiring R
inst✝⁶ : ContinuousStar R
inst✝⁵ : NonUnitalRing A
inst✝⁴ : StarRing A
inst✝³ : TopologicalSpace A
inst✝² : Module R A
inst✝¹ : IsScalarTower R A A
inst✝ : SMulCommClass R A A
instCFCₙ : NonUnitalContinuousFunctionalCalculus R p
ι : Type u_3
f : ι → R → R
a : A
s : Finset ι
hf : autoParam (∀ i ∈ s, ContinuousOn (f i) (σₙ R a)) _auto✝
hf0 : autoParam (∀ i ∈ s, f i 0 = 0) _auto✝
ha : p a
hsum : s.sum f = fun z => ∑ i ∈ s, f i z
⊢ ContinuousOn (fun z => ∑ i ∈ s, f i z) (σₙ R a)

Tactic:
exact continuousOn_finset_sum s fun i hi => hf i hi

Result:
no goals

Proof state:
case pos
R : Type u_1
A : Type u_2
p : A → Prop
inst✝¹¹ : CommSemiring R
inst✝¹⁰ : Nontrivial R
inst✝⁹ : StarRing R
inst✝⁸ : MetricSpace R
inst✝⁷ : IsTopologicalSemiring R
inst✝⁶ : ContinuousStar R
inst✝⁵ : NonUnitalRing A
inst✝⁴ : StarRing A
inst✝³ : TopologicalSpace A
inst✝² : Module R A
inst✝¹ : IsScalarTower R A A
inst✝ : SMulCommClass R A A
instCFCₙ : NonUnitalContinuousFunctionalCalculus R p
ι : Type u_3
f : ι → R → R
a : A
s : Finset ι
hf : autoParam (∀ i ∈ s, ContinuousOn (f i) (σₙ R a)) _auto✝
hf0 : autoParam (∀ i ∈ s, f i 0 = 0) _auto✝
ha : p a
hsum : s.sum f = fun z => ∑ i ∈ s, f i z
hf' : ContinuousOn (∑ i : { x // x ∈ s }, f ↑i) (σₙ R a)
⊢ cfcₙ (∑ i : { x // x ∈ s }, f ↑i) a = ∑ i : { x // x ∈ s }, cfcₙ (f ↑i) a

Tactic:
rw [cfcₙ_apply_pi _ a _ (fun ⟨i, hi⟩ => hf i hi), ← map_sum, cfcₙ_apply _ a hf']

Result:
case pos
R : Type u_1
A : Type u_2
p : A → Prop
inst✝¹¹ : CommSemiring R
inst✝¹⁰ : Nontrivial R
inst✝⁹ : StarRing R
inst✝⁸ : MetricSpace R
inst✝⁷ : IsTopologicalSemiring R
inst✝⁶ : ContinuousStar R
inst✝⁵ : NonUnitalRing A
inst✝⁴ : StarRing A
inst✝³ : TopologicalSpace A
inst✝² : Module R A
inst✝¹ : IsScalarTower R A A
inst✝ : SMulCommClass R A A
instCFCₙ : NonUnitalContinuousFunctionalCalculus R p
ι : Type u_3
f : ι → R → R
a : A
s : Finset ι
hf : autoParam (∀ i ∈ s, ContinuousOn (f i) (σₙ R a)) _auto✝
hf0 : autoParam (∀ i ∈ s, f i 0 = 0) _auto✝
ha : p a
hsum : s.sum f = fun z => ∑ i ∈ s, f i z
hf' : ContinuousOn (∑ i : { x // x ∈ s }, f ↑i) (σₙ R a)
⊢ (cfcₙHom ha) { toFun := (σₙ R a).restrict (∑ i : { x // x ∈ s }, f ↑i), continuous_toFun := ⋯, map_zero' := ⋯ } =
    (cfcₙHom ?m.491068)
      (∑ x : { x // x ∈ s }, { toFun := (σₙ R a).restrict (f ↑x), continuous_toFun := ⋯, map_zero' := ⋯ })

R : Type u_1
A : Type u_2
p : A → Prop
inst✝¹¹ : CommSemiring R
inst✝¹⁰ : Nontrivial R
inst✝⁹ : StarRing R
inst✝⁸ : MetricSpace R
inst✝⁷ : IsTopologicalSemiring R
inst✝⁶ : ContinuousStar R
inst✝⁵ : NonUnitalRing A
inst✝⁴ : StarRing A
inst✝³ : TopologicalSpace A
inst✝² : Module R A
inst✝¹ : IsScalarTower R A A
inst✝ : SMulCommClass R A A
instCFCₙ : NonUnitalContinuousFunctionalCalculus R p
ι : Type u_3
f : ι → R → R
a : A
s : Finset ι
hf : autoParam (∀ i ∈ s, ContinuousOn (f i) (σₙ R a)) _auto✝
hf0 : autoParam (∀ i ∈ s, f i 0 = 0) _auto✝
ha : p a
hsum : s.sum f = fun z => ∑ i ∈ s, f i z
hf' : ContinuousOn (∑ i : { x // x ∈ s }, f ↑i) (σₙ R a)
⊢ p a