-- Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Restrict.lean
lemma cfcₙ_eq_restrict (f : C(S, R)) (halg : IsUniformEmbedding (algebraMap R S)) {a : A}
    (hpa : p a) (hqa : q a) (h : QuasispectrumRestricts a f) (g : R → R) :
    cfcₙ g a = cfcₙ (fun x ↦ algebraMap R S (g (f x))) a

Proof state:
R : Type u_1
S : Type u_2
A : Type u_3
p q : A → Prop
inst✝²⁶ : Semifield R
inst✝²⁵ : StarRing R
inst✝²⁴ : MetricSpace R
inst✝²³ : IsTopologicalSemiring R
inst✝²² : ContinuousStar R
inst✝²¹ : Field S
inst✝²⁰ : StarRing S
inst✝¹⁹ : MetricSpace S
inst✝¹⁸ : IsTopologicalRing S
inst✝¹⁷ : ContinuousStar S
inst✝¹⁶ : NonUnitalRing A
inst✝¹⁵ : StarRing A
inst✝¹⁴ : Module S A
inst✝¹³ : IsScalarTower S A A
inst✝¹² : SMulCommClass S A A
inst✝¹¹ : Algebra R S
inst✝¹⁰ : Module R A
inst✝⁹ : IsScalarTower R S A
inst✝⁸ : StarModule R S
inst✝⁷ : ContinuousSMul R S
inst✝⁶ : TopologicalSpace A
inst✝⁵ : NonUnitalContinuousFunctionalCalculus S q
inst✝⁴ : CompleteSpace R
inst✝³ : IsScalarTower R A A
inst✝² : SMulCommClass R A A
inst✝¹ : NonUnitalContinuousFunctionalCalculus R p
inst✝ : UniqueHom R A
f : C(S, R)
halg : IsUniformEmbedding ⇑(algebraMap R S)
a : A
hpa : p a
hqa : q a
h : QuasispectrumRestricts a ⇑f
g : R → R
⊢ cfcₙ g a = cfcₙ (fun x => (algebraMap R S) (g (f x))) a

Tactic:
by_cases hg : ContinuousOn g (σₙ R a) ∧ g 0 = 0

Result:
case pos
R : Type u_1
S : Type u_2
A : Type u_3
p q : A → Prop
inst✝²⁶ : Semifield R
inst✝²⁵ : StarRing R
inst✝²⁴ : MetricSpace R
inst✝²³ : IsTopologicalSemiring R
inst✝²² : ContinuousStar R
inst✝²¹ : Field S
inst✝²⁰ : StarRing S
inst✝¹⁹ : MetricSpace S
inst✝¹⁸ : IsTopologicalRing S
inst✝¹⁷ : ContinuousStar S
inst✝¹⁶ : NonUnitalRing A
inst✝¹⁵ : StarRing A
inst✝¹⁴ : Module S A
inst✝¹³ : IsScalarTower S A A
inst✝¹² : SMulCommClass S A A
inst✝¹¹ : Algebra R S
inst✝¹⁰ : Module R A
inst✝⁹ : IsScalarTower R S A
inst✝⁸ : StarModule R S
inst✝⁷ : ContinuousSMul R S
inst✝⁶ : TopologicalSpace A
inst✝⁵ : NonUnitalContinuousFunctionalCalculus S q
inst✝⁴ : CompleteSpace R
inst✝³ : IsScalarTower R A A
inst✝² : SMulCommClass R A A
inst✝¹ : NonUnitalContinuousFunctionalCalculus R p
inst✝ : UniqueHom R A
f : C(S, R)
halg : IsUniformEmbedding ⇑(algebraMap R S)
a : A
hpa : p a
hqa : q a
h : QuasispectrumRestricts a ⇑f
g : R → R
hg : ContinuousOn g (σₙ R a) ∧ g 0 = 0
⊢ cfcₙ g a = cfcₙ (fun x => (algebraMap R S) (g (f x))) a

case neg
R : Type u_1
S : Type u_2
A : Type u_3
p q : A → Prop
inst✝²⁶ : Semifield R
inst✝²⁵ : StarRing R
inst✝²⁴ : MetricSpace R
inst✝²³ : IsTopologicalSemiring R
inst✝²² : ContinuousStar R
inst✝²¹ : Field S
inst✝²⁰ : StarRing S
inst✝¹⁹ : MetricSpace S
inst✝¹⁸ : IsTopologicalRing S
inst✝¹⁷ : ContinuousStar S
inst✝¹⁶ : NonUnitalRing A
inst✝¹⁵ : StarRing A
inst✝¹⁴ : Module S A
inst✝¹³ : IsScalarTower S A A
inst✝¹² : SMulCommClass S A A
inst✝¹¹ : Algebra R S
inst✝¹⁰ : Module R A
inst✝⁹ : IsScalarTower R S A
inst✝⁸ : StarModule R S
inst✝⁷ : ContinuousSMul R S
inst✝⁶ : TopologicalSpace A
inst✝⁵ : NonUnitalContinuousFunctionalCalculus S q
inst✝⁴ : CompleteSpace R
inst✝³ : IsScalarTower R A A
inst✝² : SMulCommClass R A A
inst✝¹ : NonUnitalContinuousFunctionalCalculus R p
inst✝ : UniqueHom R A
f : C(S, R)
halg : IsUniformEmbedding ⇑(algebraMap R S)
a : A
hpa : p a
hqa : q a
h : QuasispectrumRestricts a ⇑f
g : R → R
hg : ¬(ContinuousOn g (σₙ R a) ∧ g 0 = 0)
⊢ cfcₙ g a = cfcₙ (fun x => (algebraMap R S) (g (f x))) a

Proof state:
case neg.inl
R : Type u_1
S : Type u_2
A : Type u_3
p q : A → Prop
inst✝²⁶ : Semifield R
inst✝²⁵ : StarRing R
inst✝²⁴ : MetricSpace R
inst✝²³ : IsTopologicalSemiring R
inst✝²² : ContinuousStar R
inst✝²¹ : Field S
inst✝²⁰ : StarRing S
inst✝¹⁹ : MetricSpace S
inst✝¹⁸ : IsTopologicalRing S
inst✝¹⁷ : ContinuousStar S
inst✝¹⁶ : NonUnitalRing A
inst✝¹⁵ : StarRing A
inst✝¹⁴ : Module S A
inst✝¹³ : IsScalarTower S A A
inst✝¹² : SMulCommClass S A A
inst✝¹¹ : Algebra R S
inst✝¹⁰ : Module R A
inst✝⁹ : IsScalarTower R S A
inst✝⁸ : StarModule R S
inst✝⁷ : ContinuousSMul R S
inst✝⁶ : TopologicalSpace A
inst✝⁵ : NonUnitalContinuousFunctionalCalculus S q
inst✝⁴ : CompleteSpace R
inst✝³ : IsScalarTower R A A
inst✝² : SMulCommClass R A A
inst✝¹ : NonUnitalContinuousFunctionalCalculus R p
inst✝ : UniqueHom R A
f : C(S, R)
halg : IsUniformEmbedding ⇑(algebraMap R S)
a : A
hpa : p a
hqa : q a
h : QuasispectrumRestricts a ⇑f
g : R → R
hg : ¬ContinuousOn g (σₙ R a)
⊢ cfcₙ g a = cfcₙ (fun x => (algebraMap R S) (g (f x))) a

Tactic:
have : ¬ ContinuousOn (fun x ↦ algebraMap R S (g (f x)) : S → S) (σₙ S a) := by
  refine fun hg' ↦ hg ?_
  rw [halg.isEmbedding.continuousOn_iff]
  simpa [halg.isEmbedding.continuousOn_iff, Function.comp_def, h.left_inv _] using
    hg'.comp halg.isEmbedding.continuous.continuousOn
    (fun _ : R ↦ quasispectrum.algebraMap_mem S)

Result:
case neg.inl
R : Type u_1
S : Type u_2
A : Type u_3
p q : A → Prop
inst✝²⁶ : Semifield R
inst✝²⁵ : StarRing R
inst✝²⁴ : MetricSpace R
inst✝²³ : IsTopologicalSemiring R
inst✝²² : ContinuousStar R
inst✝²¹ : Field S
inst✝²⁰ : StarRing S
inst✝¹⁹ : MetricSpace S
inst✝¹⁸ : IsTopologicalRing S
inst✝¹⁷ : ContinuousStar S
inst✝¹⁶ : NonUnitalRing A
inst✝¹⁵ : StarRing A
inst✝¹⁴ : Module S A
inst✝¹³ : IsScalarTower S A A
inst✝¹² : SMulCommClass S A A
inst✝¹¹ : Algebra R S
inst✝¹⁰ : Module R A
inst✝⁹ : IsScalarTower R S A
inst✝⁸ : StarModule R S
inst✝⁷ : ContinuousSMul R S
inst✝⁶ : TopologicalSpace A
inst✝⁵ : NonUnitalContinuousFunctionalCalculus S q
inst✝⁴ : CompleteSpace R
inst✝³ : IsScalarTower R A A
inst✝² : SMulCommClass R A A
inst✝¹ : NonUnitalContinuousFunctionalCalculus R p
inst✝ : UniqueHom R A
f : C(S, R)
halg : IsUniformEmbedding ⇑(algebraMap R S)
a : A
hpa : p a
hqa : q a
h : QuasispectrumRestricts a ⇑f
g : R → R
hg : ¬ContinuousOn g (σₙ R a)
this : ¬ContinuousOn (fun x => (algebraMap R S) (g (f x))) (σₙ S a)
⊢ cfcₙ g a = cfcₙ (fun x => (algebraMap R S) (g (f x))) a

Proof state:
R : Type u_1
S : Type u_2
A : Type u_3
p q : A → Prop
inst✝²⁶ : Semifield R
inst✝²⁵ : StarRing R
inst✝²⁴ : MetricSpace R
inst✝²³ : IsTopologicalSemiring R
inst✝²² : ContinuousStar R
inst✝²¹ : Field S
inst✝²⁰ : StarRing S
inst✝¹⁹ : MetricSpace S
inst✝¹⁸ : IsTopologicalRing S
inst✝¹⁷ : ContinuousStar S
inst✝¹⁶ : NonUnitalRing A
inst✝¹⁵ : StarRing A
inst✝¹⁴ : Module S A
inst✝¹³ : IsScalarTower S A A
inst✝¹² : SMulCommClass S A A
inst✝¹¹ : Algebra R S
inst✝¹⁰ : Module R A
inst✝⁹ : IsScalarTower R S A
inst✝⁸ : StarModule R S
inst✝⁷ : ContinuousSMul R S
inst✝⁶ : TopologicalSpace A
inst✝⁵ : NonUnitalContinuousFunctionalCalculus S q
inst✝⁴ : CompleteSpace R
inst✝³ : IsScalarTower R A A
inst✝² : SMulCommClass R A A
inst✝¹ : NonUnitalContinuousFunctionalCalculus R p
inst✝ : UniqueHom R A
f : C(S, R)
halg : IsUniformEmbedding ⇑(algebraMap R S)
a : A
hpa : p a
hqa : q a
h : QuasispectrumRestricts a ⇑f
g : R → R
hg : ¬g 0 = 0
⊢ ¬(algebraMap R S) (g (f 0)) = 0

Tactic:
simpa [h.map_zero]

Result:
no goals