-- 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:
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✝
⊢ cfcₙ (∑ i ∈ s, f i) a = ∑ i ∈ s, cfcₙ (f i) a

Tactic:
by_cases ha : p a

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
⊢ cfcₙ (∑ i ∈ s, f i) a = ∑ i ∈ s, cfcₙ (f i) a

case neg
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
⊢ cfcₙ (∑ i ∈ s, f i) a = ∑ i ∈ s, cfcₙ (f i) 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
hf' : ContinuousOn (∑ i : { x // x ∈ s }, f ↑i) (σₙ R a)
⊢ cfcₙ (∑ i ∈ s, f i) a = ∑ i ∈ s, cfcₙ (f i) a

Tactic:
rw [← sum_coe_sort s, ← sum_coe_sort s]

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 : { x // x ∈ s }, f ↑i) a = ∑ i : { x // x ∈ s }, cfcₙ (f ↑i) a

Proof state:
case pos.h.e_6.h.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
hsum : s.sum f = fun z => ∑ i ∈ s, f i z
hf' : ContinuousOn (∑ i : { x // x ∈ s }, f ↑i) (σₙ R a)
x✝ : ↑(σₙ R a)
⊢ { toFun := (σₙ R a).restrict (∑ i : { x // x ∈ s }, f ↑i), continuous_toFun := ⋯, map_zero' := ⋯ } x✝ =
    (∑ x : { x // x ∈ s }, { toFun := (σₙ R a).restrict (f ↑x), continuous_toFun := ⋯, map_zero' := ⋯ }) x✝

Tactic:
simp

Result:
no goals

Proof state:
case pos.h.e_6.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
hsum : s.sum f = fun z => ∑ i ∈ s, f i z
hf' : ContinuousOn (∑ i : { x // x ∈ s }, f ↑i) (σₙ R a)
⊢ { toFun := (σₙ R a).restrict (∑ i : { x // x ∈ s }, f ↑i), continuous_toFun := ⋯, map_zero' := ⋯ } =
    ∑ x : { x // x ∈ s }, { toFun := (σₙ R a).restrict (f ↑x), continuous_toFun := ⋯, map_zero' := ⋯ }

Tactic:
ext

Result:
case pos.h.e_6.h.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
hsum : s.sum f = fun z => ∑ i ∈ s, f i z
hf' : ContinuousOn (∑ i : { x // x ∈ s }, f ↑i) (σₙ R a)
x✝ : ↑(σₙ R a)
⊢ { toFun := (σₙ R a).restrict (∑ i : { x // x ∈ s }, f ↑i), continuous_toFun := ⋯, map_zero' := ⋯ } x✝ =
    (∑ x : { x // x ∈ s }, { toFun := (σₙ R a).restrict (f ↑x), continuous_toFun := ⋯, map_zero' := ⋯ }) x✝

Proof state:
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✝

Tactic:
simp

Result:
no goals