-- 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 ∧ QuasispectrumRestricts a f) :
    NonUnitalContinuousFunctionalCalculus R p where
  predicate_zero := h0
  compactSpace_quasispectrum a

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✝¹⁹ : 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
f : C(S, R)
halg : IsUniformEmbedding ⇑(algebraMap R S)
h0 : p 0
h : ∀ (a : A), p a ↔ q a ∧ QuasispectrumRestricts a ⇑f
a : A
ha : p a
g : C(↑(σₙ R a), R)₀
y : ↑(σₙ R a)
⊢ (algebraMap R S) (g (Subtype.map ⇑f ⋯ ⟨(algebraMap R S) ↑y, ⋯⟩)) = (algebraMap R S) (g y)

Tactic:
congr

Result:
case h.mpr.intro.h.e_6.h.h.e_6.h
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
f : C(S, R)
halg : IsUniformEmbedding ⇑(algebraMap R S)
h0 : p 0
h : ∀ (a : A), p a ↔ q a ∧ QuasispectrumRestricts a ⇑f
a : A
ha : p a
g : C(↑(σₙ R a), R)₀
y : ↑(σₙ R a)
⊢ Subtype.map ⇑f ⋯ ⟨(algebraMap R S) ↑y, ⋯⟩ = y

Proof state:
case h.mp.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✝¹⁹ : 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
f : C(S, R)
halg : IsUniformEmbedding ⇑(algebraMap R S)
h0 : p 0
h : ∀ (a : A), p a ↔ q a ∧ QuasispectrumRestricts a ⇑f
a : A
ha : p a
g : C(↑(σₙ R a), R)₀
x : R
y : ↑(σₙ S a)
hy :
  ({ toFun := ⇑(StarAlgHom.ofId R S), continuous_toFun := ⋯, map_zero' := ⋯ }.comp
        (g.comp { toFun := Subtype.map ⇑f ⋯, continuous_toFun := ⋯, map_zero' := ⋯ }))
      y =
    (algebraMap R S) x
this :
  f
      (({ toFun := ⇑(StarAlgHom.ofId R S), continuous_toFun := ⋯, map_zero' := ⋯ }.comp
          (g.comp { toFun := Subtype.map ⇑f ⋯, continuous_toFun := ⋯, map_zero' := ⋯ }))
        y) =
    f ((algebraMap R S) x)
⊢ x ∈ range ⇑g

Tactic:
simp only [nonUnitalStarAlgHom_postcomp_apply, NonUnitalStarAlgHom.coe_coe,
  Function.comp_apply, comp_apply, coe_mk, ContinuousMap.coe_mk, StarAlgHom.ofId_apply]
  at this

Result:
case h.mp.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✝¹⁹ : 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
f : C(S, R)
halg : IsUniformEmbedding ⇑(algebraMap R S)
h0 : p 0
h : ∀ (a : A), p a ↔ q a ∧ QuasispectrumRestricts a ⇑f
a : A
ha : p a
g : C(↑(σₙ R a), R)₀
x : R
y : ↑(σₙ S a)
hy :
  ({ toFun := ⇑(StarAlgHom.ofId R S), continuous_toFun := ⋯, map_zero' := ⋯ }.comp
        (g.comp { toFun := Subtype.map ⇑f ⋯, continuous_toFun := ⋯, map_zero' := ⋯ }))
      y =
    (algebraMap R S) x
this : f ((algebraMap R S) (g (Subtype.map ⇑f ⋯ y))) = f ((algebraMap R S) x)
⊢ x ∈ range ⇑g

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✝¹⁹ : 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
f : C(S, R)
halg : IsUniformEmbedding ⇑(algebraMap R S)
h0 : p 0
h : ∀ (a : A), p a ↔ q a ∧ QuasispectrumRestricts a ⇑f
a : A
ha : p a
g : C(↑(σₙ R a), R)₀
y : ↑(σₙ R a)
⊢ g y ∈
    ⇑(algebraMap R S) ⁻¹'
      range
        ⇑({ toFun := ⇑(StarAlgHom.ofId R S), continuous_toFun := ⋯, map_zero' := ⋯ }.comp
            (g.comp { toFun := Subtype.map ⇑f ⋯, continuous_toFun := ⋯, map_zero' := ⋯ }))

Tactic:
rw [Set.mem_preimage]

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✝¹⁹ : 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
f : C(S, R)
halg : IsUniformEmbedding ⇑(algebraMap R S)
h0 : p 0
h : ∀ (a : A), p a ↔ q a ∧ QuasispectrumRestricts a ⇑f
a : A
ha : p a
g : C(↑(σₙ R a), R)₀
y : ↑(σₙ R a)
⊢ (algebraMap R S) (g y) ∈
    range
      ⇑({ toFun := ⇑(StarAlgHom.ofId R S), continuous_toFun := ⋯, map_zero' := ⋯ }.comp
          (g.comp { toFun := Subtype.map ⇑f ⋯, continuous_toFun := ⋯, map_zero' := ⋯ }))