-- Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Restrict.lean
theorem cfc (f : C(S, R)) (halg : IsUniformEmbedding (algebraMap R S)) (h0 : p 0)
    (h : ∀ a, p a ↔ q a ∧ SpectrumRestricts a f) :
    ContinuousFunctionalCalculus R p where
  predicate_zero := h0
  spectrum_nonempty a ha := ((h a).mp ha).2.image ▸
    (ContinuousFunctionalCalculus.spectrum_nonempty a ((h a).mp ha).1 |>.image f)
  compactSpace_spectrum 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✝¹⁵ : Semifield S
inst✝¹⁴ : StarRing S
inst✝¹³ : MetricSpace S
inst✝¹² : IsTopologicalSemiring S
inst✝¹¹ : ContinuousStar S
inst✝¹⁰ : Ring A
inst✝⁹ : StarRing A
inst✝⁸ : Algebra S A
inst✝⁷ : Algebra R S
inst✝⁶ : Algebra R A
inst✝⁵ : IsScalarTower R S A
inst✝⁴ : StarModule R S
inst✝³ : ContinuousSMul R S
inst✝² : TopologicalSpace A
inst✝¹ : ContinuousFunctionalCalculus S q
inst✝ : CompleteSpace R
f : C(S, R)
halg : IsUniformEmbedding ⇑(algebraMap R S)
h0 : p 0
h : ∀ (a : A), p a ↔ q a ∧ SpectrumRestricts a ⇑f
a : A
⊢ CompactSpace ↑(spectrum R a)

Tactic:
have := ContinuousFunctionalCalculus.compactSpace_spectrum (R := S) a

Result:
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✝¹⁵ : Semifield S
inst✝¹⁴ : StarRing S
inst✝¹³ : MetricSpace S
inst✝¹² : IsTopologicalSemiring S
inst✝¹¹ : ContinuousStar S
inst✝¹⁰ : Ring A
inst✝⁹ : StarRing A
inst✝⁸ : Algebra S A
inst✝⁷ : Algebra R S
inst✝⁶ : Algebra R A
inst✝⁵ : IsScalarTower R S A
inst✝⁴ : StarModule R S
inst✝³ : ContinuousSMul R S
inst✝² : TopologicalSpace A
inst✝¹ : ContinuousFunctionalCalculus S q
inst✝ : CompleteSpace R
f : C(S, R)
halg : IsUniformEmbedding ⇑(algebraMap R S)
h0 : p 0
h : ∀ (a : A), p a ↔ q a ∧ SpectrumRestricts a ⇑f
a : A
this : CompactSpace ↑(spectrum S a)
⊢ CompactSpace ↑(spectrum R 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✝¹⁵ : Semifield S
inst✝¹⁴ : StarRing S
inst✝¹³ : MetricSpace S
inst✝¹² : IsTopologicalSemiring S
inst✝¹¹ : ContinuousStar S
inst✝¹⁰ : Ring A
inst✝⁹ : StarRing A
inst✝⁸ : Algebra S A
inst✝⁷ : Algebra R S
inst✝⁶ : Algebra R A
inst✝⁵ : IsScalarTower R S A
inst✝⁴ : StarModule R S
inst✝³ : ContinuousSMul R S
inst✝² : TopologicalSpace A
inst✝¹ : ContinuousFunctionalCalculus S q
inst✝ : CompleteSpace R
f : C(S, R)
halg : IsUniformEmbedding ⇑(algebraMap R S)
h0 : p 0
h : ∀ (a : A), p a ↔ q a ∧ SpectrumRestricts a ⇑f
a : A
this : IsCompact (spectrum S a)
⊢ IsCompact (spectrum R a)

Tactic:
simpa using halg.isClosedEmbedding.isCompact_preimage this

Result:
no goals

Proof state:
case h.mpr.intro
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✝¹⁵ : Semifield S
inst✝¹⁴ : StarRing S
inst✝¹³ : MetricSpace S
inst✝¹² : IsTopologicalSemiring S
inst✝¹¹ : ContinuousStar S
inst✝¹⁰ : Ring A
inst✝⁹ : StarRing A
inst✝⁸ : Algebra S A
inst✝⁷ : Algebra R S
inst✝⁶ : Algebra R A
inst✝⁵ : IsScalarTower R S A
inst✝⁴ : StarModule R S
inst✝³ : ContinuousSMul R S
inst✝² : TopologicalSpace A
inst✝¹ : ContinuousFunctionalCalculus S q
inst✝ : CompleteSpace R
f : C(S, R)
halg : IsUniformEmbedding ⇑(algebraMap R S)
h0 : p 0
h : ∀ (a : A), p a ↔ q a ∧ SpectrumRestricts a ⇑f
a : A
ha : p a
g : C(↑(spectrum R a), R)
y : ↑(spectrum R a)
⊢ ({ toFun := ⇑(StarAlgHom.ofId R S), continuous_toFun := ⋯ }.comp
        (g.comp { toFun := Subtype.map ⇑f ⋯, continuous_toFun := ⋯ }))
      ⟨(algebraMap R S) ↑y, ⋯⟩ =
    (algebraMap R S) (g y)

Tactic:
simp only [ContinuousMap.coe_mk, ContinuousMap.comp_apply, StarAlgHom.ofId_apply]

Result:
case h.mpr.intro
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✝¹⁵ : Semifield S
inst✝¹⁴ : StarRing S
inst✝¹³ : MetricSpace S
inst✝¹² : IsTopologicalSemiring S
inst✝¹¹ : ContinuousStar S
inst✝¹⁰ : Ring A
inst✝⁹ : StarRing A
inst✝⁸ : Algebra S A
inst✝⁷ : Algebra R S
inst✝⁶ : Algebra R A
inst✝⁵ : IsScalarTower R S A
inst✝⁴ : StarModule R S
inst✝³ : ContinuousSMul R S
inst✝² : TopologicalSpace A
inst✝¹ : ContinuousFunctionalCalculus S q
inst✝ : CompleteSpace R
f : C(S, R)
halg : IsUniformEmbedding ⇑(algebraMap R S)
h0 : p 0
h : ∀ (a : A), p a ↔ q a ∧ SpectrumRestricts a ⇑f
a : A
ha : p a
g : C(↑(spectrum R a), R)
y : ↑(spectrum R a)
⊢ (algebraMap R S) (g (Subtype.map ⇑f ⋯ ⟨(algebraMap R S) ↑y, ⋯⟩)) = (algebraMap R S) (g y)

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✝¹⁵ : Semifield S
inst✝¹⁴ : StarRing S
inst✝¹³ : MetricSpace S
inst✝¹² : IsTopologicalSemiring S
inst✝¹¹ : ContinuousStar S
inst✝¹⁰ : Ring A
inst✝⁹ : StarRing A
inst✝⁸ : Algebra S A
inst✝⁷ : Algebra R S
inst✝⁶ : Algebra R A
inst✝⁵ : IsScalarTower R S A
inst✝⁴ : StarModule R S
inst✝³ : ContinuousSMul R S
inst✝² : TopologicalSpace A
inst✝¹ : ContinuousFunctionalCalculus S q
inst✝ : CompleteSpace R
f : C(S, R)
halg : IsUniformEmbedding ⇑(algebraMap R S)
h0 : p 0
h : ∀ (a : A), p a ↔ q a ∧ SpectrumRestricts a ⇑f
a : A
ha : p a
⊢ ∀ (f_1 : C(↑(spectrum R a), R)), p ((starAlgHom (cfcHom ⋯) ⋯) f_1)

Tactic:
intro g

Result:
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✝¹⁵ : Semifield S
inst✝¹⁴ : StarRing S
inst✝¹³ : MetricSpace S
inst✝¹² : IsTopologicalSemiring S
inst✝¹¹ : ContinuousStar S
inst✝¹⁰ : Ring A
inst✝⁹ : StarRing A
inst✝⁸ : Algebra S A
inst✝⁷ : Algebra R S
inst✝⁶ : Algebra R A
inst✝⁵ : IsScalarTower R S A
inst✝⁴ : StarModule R S
inst✝³ : ContinuousSMul R S
inst✝² : TopologicalSpace A
inst✝¹ : ContinuousFunctionalCalculus S q
inst✝ : CompleteSpace R
f : C(S, R)
halg : IsUniformEmbedding ⇑(algebraMap R S)
h0 : p 0
h : ∀ (a : A), p a ↔ q a ∧ SpectrumRestricts a ⇑f
a : A
ha : p a
g : C(↑(spectrum R a), R)
⊢ p ((starAlgHom (cfcHom ⋯) ⋯) g)