awhecmu/canonical-drafter-extract-mathlib huggingface dataset:
-- Lean 4 proof step from Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Restrict (goal)
Goal:
R : Type u_1
S : Type u_2
A : Type u_3
p q : A → Prop
inst : Semifield R
inst_1 : StarRing R
inst_2 : MetricSpace R
inst_3 : IsTopologicalSemiring R
inst_4 : ContinuousStar R
inst_5 : Semifield S
inst_6 : StarRing S
inst_7 : MetricSpace S
inst_8 : IsTopologicalSemiring S
inst_9 : ContinuousStar S
inst_10 : Ring A
inst_11 : StarRing A
inst_12 : Algebra S A
inst_13 : Algebra R S
inst_14 : Algebra R A
inst_15 : IsScalarTower R S A
inst_16 : StarModule R S
inst_17 : ContinuousSMul R S
inst_18 : TopologicalSpace A
inst_19 : ContinuousFunctionalCalculus S A q
f : C(S, R)
halg : IsClosedEmbedding.{u_1, u_2} (X := R) (Y := S) (⇑(algebraMap R S) : (a : R) → S)
h0 : p 0
h : ∀ (a : A), p a ↔ q a ∧ SpectrumRestricts.{u_1, u_2, u_3} (R := R) (S := S) a (⇑f : (a : S) → R)
a : A
ha : p a
g : C((↑(spectrum R a) : Type u_1), R)
s : S
hs :
  Membership.mem (γ := Set S)
    (range (ι := (↑(spectrum S a) : Type u_2))
      (⇑(ContinuousMap.comp { toFun := (⇑(StarAlgHom.ofId R S) : (a : R) → S), continuous_toFun := ⋯ }
            (g.comp
              {
                toFun :=
                  Subtype.map (p := fun (x : S) ↦ x ∈ spectrum S a) (q := fun (x : R) ↦ x ∈ spectrum R a)
                    (⇑f : (a : S) → R) ⋯,
                continuous_toFun := ⋯ :
                ContinuousMap.{u_2, u_1} (↑(spectrum S a) : Type u_2) (↑(spectrum R a) : Type u_1) })) :
        (a : (↑(spectrum S a) : Type u_2)) → S))
    s
⊢ (algebraMap R S : (a : R) → S) ((f : (a : S) → R) s : R) = s
have obtain : ∀ (r : (↑(spectrum S a) : Type u_2)),
  Eq.{u_2 + 1} (α := S)
    ((algebraMap R S : (a : R) → S)
        ((f : (a : S) → R)
            ((ContinuousMap.comp { toFun := (⇑(StarAlgHom.ofId R S) : (a : R) → S), continuous_toFun := sorry }
                    (g.comp
                      {
                        toFun :=
                          Subtype.map (p := fun (x : S) ↦ x ∈ spectrum S a) (q := fun (x : R) ↦ x ∈ spectrum R a)
                            (⇑f : (a : S) → R) sorry,
                        continuous_toFun := sorry :
                        ContinuousMap.{u_2, u_1} (↑(spectrum S a) : Type u_2) (↑(spectrum R a) : Type u_1) }) :
                  (a : (↑(spectrum S a) : Type u_2)) → S)
                r :
              S) :
          R) :
      S)
    ((ContinuousMap.comp { toFun := (⇑(StarAlgHom.ofId R S) : (a : R) → S), continuous_toFun := sorry }
            (g.comp
              {
                toFun :=
                  Subtype.map (p := fun (x : S) ↦ x ∈ spectrum S a) (q := fun (x : R) ↦ x ∈ spectrum R a)
                    (⇑f : (a : S) → R) sorry,
                continuous_toFun := sorry :
                ContinuousMap.{u_2, u_1} (↑(spectrum S a) : Type u_2) (↑(spectrum R a) : Type u_1) }) :
          (a : (↑(spectrum S a) : Type u_2)) → S)
        r :
      S)
Tactic: obtain ⟨r, rfl⟩ := hs
Cleared hypotheses: s, hs
-- Lean 4 proof step from Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Restrict (goal)
Goal:
R : Type u_1
S : Type u_2
A : Type u_3
p q : A → Prop
inst : Semifield R
inst_1 : StarRing R
inst_2 : MetricSpace R
inst_3 : IsTopologicalSemiring R
inst_4 : ContinuousStar R
inst_5 : Semifield S
inst_6 : StarRing S
inst_7 : MetricSpace S
inst_8 : IsTopologicalSemiring S
inst_9 : ContinuousStar S
inst_10 : Ring A
inst_11 : StarRing A
inst_12 : Algebra S A
inst_13 : Algebra R S
inst_14 : Algebra R A
inst_15 : IsScalarTower R S A
inst_16 : StarModule R S
inst_17 : ContinuousSMul R S
inst_18 : TopologicalSpace A
inst_19 : ContinuousFunctionalCalculus S A q
f : C(S, R)
halg : IsClosedEmbedding.{u_1, u_2} (X := R) (Y := S) (⇑(algebraMap R S) : (a : R) → S)
h0 : p 0
h : ∀ (a : A), p a ↔ q a ∧ SpectrumRestricts.{u_1, u_2, u_3} (R := R) (S := S) a (⇑f : (a : S) → R)
a : A
ha : p a
case :
  ∀ (g : C((↑(spectrum R a) : Type u_1), R)),
    p ((starAlgHom (cfcHom (p := q) ⋯) ⋯ : (a : C((↑(spectrum R a) : Type u_1), R)) → A) g)
⊢ ∀ (f_1 : C((↑(spectrum R a) : Type u_1), R)),
    p ((starAlgHom (cfcHom (p := q) ⋯) ⋯ : (a : C((↑(spectrum R a) : Type u_1), R)) → A) f_1)
have case₁ : ∀ (g : C((↑(spectrum R a) : Type u_1), R)),
  q ((starAlgHom (cfcHom (p := q) sorry) sorry : (a : C((↑(spectrum R a) : Type u_1), R)) → A) g) ∧
    SpectrumRestricts.{u_1, u_2, u_3} (R := R) (S := S) (A := A)
      ((starAlgHom (cfcHom (p := q) sorry) sorry : (a : C((↑(spectrum R a) : Type u_1), R)) → A) g : A) (⇑f : (a : S) → R)
Tactic: case predicate_hom =>
      intro g
      rw [h]
      refine ⟨cfcHom_predicate _ _, ?_⟩
      refine .of_rightInvOn (((h a).mp ha).2.left_inv) fun s hs ↦ ?_
      rw [SpectrumRestricts.starAlgHom_apply, cfcHom_map_spectrum] at hs
      obtain ⟨r, rfl⟩ := hs
      simp [((h a).mp ha).2.left_inv _]
-- Lean 4 proof step from Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Restrict (goal)
Goal:
R : Type u_1
S : Type u_2
A : Type u_3
p q : A → Prop
inst : Semifield R
inst_1 : StarRing R
inst_2 : MetricSpace R
inst_3 : IsTopologicalSemiring R
inst_4 : ContinuousStar R
inst_5 : Semifield S
inst_6 : StarRing S
inst_7 : MetricSpace S
inst_8 : IsTopologicalSemiring S
inst_9 : ContinuousStar S
inst_10 : Ring A
inst_11 : StarRing A
inst_12 : Algebra S A
inst_13 : Algebra R S
inst_14 : Algebra R A
inst_15 : IsScalarTower R S A
inst_16 : StarModule R S
inst_17 : ContinuousSMul R S
inst_18 : TopologicalSpace A
inst_19 : ContinuousFunctionalCalculus S A q
f : C(S, R)
halg : IsClosedEmbedding.{u_1, u_2} (X := R) (Y := S) (⇑(algebraMap R S) : (a : R) → S)
h0 : p 0
h : ∀ (a : A), p a ↔ q a ∧ SpectrumRestricts.{u_1, u_2, u_3} (R := R) (S := S) a (⇑f : (a : S) → R)
a : A
ha : p a
case :
  ∀ (g : C((↑(spectrum R a) : Type u_1), R)),
    p ((starAlgHom (cfcHom (p := q) ⋯) ⋯ : (a : C((↑(spectrum R a) : Type u_1), R)) → A) g)
case₁ :
  ∀ (g : C((↑(spectrum R a) : Type u_1), R)),
    q ((starAlgHom (cfcHom (p := q) ⋯) ⋯ : (a : C((↑(spectrum R a) : Type u_1), R)) → A) g) ∧
      SpectrumRestricts.{u_1, u_2, u_3} (R := R) (S := S) (A := A)
        ((starAlgHom (cfcHom (p := q) ⋯) ⋯ : (a : C((↑(spectrum R a) : Type u_1), R)) → A) g : A) (⇑f : (a : S) → R)
⊢ ∀ (f_1 : C((↑(spectrum R a) : Type u_1), R)),
    p ((starAlgHom (cfcHom (p := q) ⋯) ⋯ : (a : C((↑(spectrum R a) : Type u_1), R)) → A) f_1)
have case₂ : ∀ (g : C((↑(spectrum R a) : Type u_1), R)),
  SpectrumRestricts.{u_1, u_2, u_3} (R := R) (S := S) (A := A)
    ((starAlgHom (cfcHom (p := q) sorry) sorry : (a : C((↑(spectrum R a) : Type u_1), R)) → A) g : A) (⇑f : (a : S) → R)
Tactic: case predicate_hom =>
      intro g
      rw [h]
      refine ⟨cfcHom_predicate _ _, ?_⟩
      refine .of_rightInvOn (((h a).mp ha).2.left_inv) fun s hs ↦ ?_
      rw [SpectrumRestricts.starAlgHom_apply, cfcHom_map_spectrum] at hs
      obtain ⟨r, rfl⟩ := hs
      simp [((h a).mp ha).2.left_inv _]
-- Lean 4 proof step from Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Restrict (goal)
Goal:
R : Type u_1
S : Type u_2
A : Type u_3
p q : A → Prop
inst : Semifield R
inst_1 : StarRing R
inst_2 : MetricSpace R
inst_3 : IsTopologicalSemiring R
inst_4 : ContinuousStar R
inst_5 : Semifield S
inst_6 : StarRing S
inst_7 : MetricSpace S
inst_8 : IsTopologicalSemiring S
inst_9 : ContinuousStar S
inst_10 : Ring A
inst_11 : StarRing A
inst_12 : Algebra S A
inst_13 : Algebra R S
inst_14 : Algebra R A
inst_15 : IsScalarTower R S A
inst_16 : StarModule R S
inst_17 : ContinuousSMul R S
inst_18 : TopologicalSpace A
inst_19 : ContinuousFunctionalCalculus S A q
f : C(S, R)
halg : IsClosedEmbedding.{u_1, u_2} (X := R) (Y := S) (⇑(algebraMap R S) : (a : R) → S)
h0 : p 0
h : ∀ (a : A), p a ↔ q a ∧ SpectrumRestricts.{u_1, u_2, u_3} (R := R) (S := S) a (⇑f : (a : S) → R)
a : A
ha : p a
case :
  ∀ (g : C((↑(spectrum R a) : Type u_1), R)),
    p ((starAlgHom (cfcHom (p := q) ⋯) ⋯ : (a : C((↑(spectrum R a) : Type u_1), R)) → A) g)
case₁ :
  ∀ (g : C((↑(spectrum R a) : Type u_1), R)),
    q ((starAlgHom (cfcHom (p := q) ⋯) ⋯ : (a : C((↑(spectrum R a) : Type u_1), R)) → A) g) ∧
      SpectrumRestricts.{u_1, u_2, u_3} (R := R) (S := S) (A := A)
        ((starAlgHom (cfcHom (p := q) ⋯) ⋯ : (a : C((↑(spectrum R a) : Type u_1), R)) → A) g : A) (⇑f : (a : S) → R)
case₂ :
  ∀ (g : C((↑(spectrum R a) : Type u_1), R)),
    SpectrumRestricts.{u_1, u_2, u_3} (R := R) (S := S) (A := A)
      ((starAlgHom (cfcHom (p := q) ⋯) ⋯ : (a : C((↑(spectrum R a) : Type u_1), R)) → A) g : A) (⇑f : (a : S) → R)
⊢ ∀ (f_1 : C((↑(spectrum R a) : Type u_1), R)),
    p ((starAlgHom (cfcHom (p := q) ⋯) ⋯ : (a : C((↑(spectrum R a) : Type u_1), R)) → A) f_1)
have case₃ : ∀ (g : C((↑(spectrum R a) : Type u_1), R)) (s : S)
  (hs :
    s ∈
      spectrum.{u_2, u_3} S (A := A)
        ((starAlgHom (cfcHom (p := q) sorry) sorry : (a : C((↑(spectrum R a) : Type u_1), R)) → A) g : A)),
  (algebraMap R S : (a : R) → S) ((f : (a : S) → R) s : R) = s
Tactic: case predicate_hom =>
      intro g
      rw [h]
      refine ⟨cfcHom_predicate _ _, ?_⟩
      refine .of_rightInvOn (((h a).mp ha).2.left_inv) fun s hs ↦ ?_
      rw [SpectrumRestricts.starAlgHom_apply, cfcHom_map_spectrum] at hs
      obtain ⟨r, rfl⟩ := hs
      simp [((h a).mp ha).2.left_inv _]
-- Lean 4 proof step from Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Restrict (goal)
Goal:
R : Type u_1
S : Type u_2
A : Type u_3
p q : A → Prop
inst : Semifield R
inst_1 : StarRing R
inst_2 : MetricSpace R
inst_3 : IsTopologicalSemiring R
inst_4 : ContinuousStar R
inst_5 : Semifield S
inst_6 : StarRing S
inst_7 : MetricSpace S
inst_8 : IsTopologicalSemiring S
inst_9 : ContinuousStar S
inst_10 : Ring A
inst_11 : StarRing A
inst_12 : Algebra S A
inst_13 : Algebra R S
inst_14 : Algebra R A
inst_15 : IsScalarTower R S A
inst_16 : StarModule R S
inst_17 : ContinuousSMul R S
inst_18 : TopologicalSpace A
inst_19 : ContinuousFunctionalCalculus S A q
f : C(S, R)
halg : IsClosedEmbedding.{u_1, u_2} (X := R) (Y := S) (⇑(algebraMap R S) : (a : R) → S)
h0 : p 0
h : ∀ (a : A), p a ↔ q a ∧ SpectrumRestricts.{u_1, u_2, u_3} (R := R) (S := S) a (⇑f : (a : S) → R)
a : A
ha : p a
case :
  ∀ (g : C((↑(spectrum R a) : Type u_1), R)),
    p ((starAlgHom (cfcHom (p := q) ⋯) ⋯ : (a : C((↑(spectrum R a) : Type u_1), R)) → A) g)
case₁ :
  ∀ (g : C((↑(spectrum R a) : Type u_1), R)),
    q ((starAlgHom (cfcHom (p := q) ⋯) ⋯ : (a : C((↑(spectrum R a) : Type u_1), R)) → A) g) ∧
      SpectrumRestricts.{u_1, u_2, u_3} (R := R) (S := S) (A := A)
        ((starAlgHom (cfcHom (p := q) ⋯) ⋯ : (a : C((↑(spectrum R a) : Type u_1), R)) → A) g : A) (⇑f : (a : S) → R)
case₂ :
  ∀ (g : C((↑(spectrum R a) : Type u_1), R)),
    SpectrumRestricts.{u_1, u_2, u_3} (R := R) (S := S) (A := A)
      ((starAlgHom (cfcHom (p := q) ⋯) ⋯ : (a : C((↑(spectrum R a) : Type u_1), R)) → A) g : A) (⇑f : (a : S) → R)
case₃ :
  ∀ (g : C((↑(spectrum R a) : Type u_1), R)) (s : S)
    (hs :
      s ∈
        spectrum.{u_2, u_3} S (A := A)
          ((starAlgHom (cfcHom (p := q) ⋯) ⋯ : (a : C((↑(spectrum R a) : Type u_1), R)) → A) g : A)),
    (algebraMap R S : (a : R) → S) ((f : (a : S) → R) s : R) = s
⊢ ∀ (f_1 : C((↑(spectrum R a) : Type u_1), R)),
    p ((starAlgHom (cfcHom (p := q) ⋯) ⋯ : (a : C((↑(spectrum R a) : Type u_1), R)) → A) f_1)
have case₄ : ∀ (g : C((↑(spectrum R a) : Type u_1), R)) (s : S)
  (hs :
    Membership.mem (γ := Set S)
      (range (ι := (↑(spectrum S a) : Type u_2))
        (⇑(ContinuousMap.comp { toFun := (⇑(StarAlgHom.ofId R S) : (a : R) → S), continuous_toFun := sorry }
              (g.comp
                {
                  toFun :=
                    Subtype.map (p := fun (x : S) ↦ x ∈ spectrum S a) (q := fun (x : R) ↦ x ∈ spectrum R a)
                      (⇑f : (a : S) → R) sorry,
                  continuous_toFun := sorry :
                  ContinuousMap.{u_2, u_1} (↑(spectrum S a) : Type u_2) (↑(spectrum R a) : Type u_1) })) :
          (a : (↑(spectrum S a) : Type u_2)) → S))
      s),
  (algebraMap R S : (a : R) → S) ((f : (a : S) → R) s : R) = s
Tactic: case predicate_hom =>
      intro g
      rw [h]
      refine ⟨cfcHom_predicate _ _, ?_⟩
      refine .of_rightInvOn (((h a).mp ha).2.left_inv) fun s hs ↦ ?_
      rw [SpectrumRestricts.starAlgHom_apply, cfcHom_map_spectrum] at hs
      obtain ⟨r, rfl⟩ := hs
      simp [((h a).mp ha).2.left_inv _]
-- Lean 4 proof step from Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Restrict (goal)
Goal:
R : Type u_1
S : Type u_2
A : Type u_3
p q : A → Prop
inst : Semifield R
inst_1 : StarRing R
inst_2 : MetricSpace R
inst_3 : IsTopologicalSemiring R
inst_4 : ContinuousStar R
inst_5 : Semifield S
inst_6 : StarRing S
inst_7 : MetricSpace S
inst_8 : IsTopologicalSemiring S
inst_9 : ContinuousStar S
inst_10 : Ring A
inst_11 : StarRing A
inst_12 : Algebra S A
inst_13 : Algebra R S
inst_14 : Algebra R A
inst_15 : IsScalarTower R S A
inst_16 : StarModule R S
inst_17 : ContinuousSMul R S
inst_18 : TopologicalSpace A
inst_19 : ContinuousFunctionalCalculus S A q
inst_20 : ContinuousFunctionalCalculus R A p
inst_21 : ContinuousMap.UniqueHom R A
f : C(S, R)
a : A
hpa : p a
hqa : q a
h : SpectrumRestricts.{u_1, u_2, u_3} (R := R) (S := S) a (⇑f : (a : S) → R)
⊢ Eq (α := C((↑(spectrum R a) : Type u_1), R) →⋆ₐ[R] A) (cfcHom (p := p) hpa) (starAlgHom (cfcHom (p := q) hqa) h)
have hφ₁ : Continuous[_, inst_18] (⇑(starAlgHom (cfcHom (p := q) hqa) h) : (a : C((↑(spectrum R a) : Type u_1), R)) → A)
Tactic: apply cfcHom_eq_of_continuous_of_map_id
-- Lean 4 proof step from Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Restrict (goal)
Goal:
R : Type u_1
S : Type u_2
A : Type u_3
p q : A → Prop
inst : Semifield R
inst_1 : StarRing R
inst_2 : MetricSpace R
inst_3 : IsTopologicalSemiring R
inst_4 : ContinuousStar R
inst_5 : Semifield S
inst_6 : StarRing S
inst_7 : MetricSpace S
inst_8 : IsTopologicalSemiring S
inst_9 : ContinuousStar S
inst_10 : Ring A
inst_11 : StarRing A
inst_12 : Algebra S A
inst_13 : Algebra R S
inst_14 : Algebra R A
inst_15 : IsScalarTower R S A
inst_16 : StarModule R S
inst_17 : ContinuousSMul R S
inst_18 : TopologicalSpace A
inst_19 : ContinuousFunctionalCalculus S A q
inst_20 : ContinuousFunctionalCalculus R A p
inst_21 : ContinuousMap.UniqueHom R A
f : C(S, R)
a : A
hpa : p a
hqa : q a
h : SpectrumRestricts.{u_1, u_2, u_3} (R := R) (S := S) a (⇑f : (a : S) → R)
hφ₁ : Continuous[_, inst_18] (⇑(starAlgHom (cfcHom (p := q) hqa) h) : (a : C((↑(spectrum R a) : Type u_1), R)) → A)
⊢ Eq (α := C((↑(spectrum R a) : Type u_1), R) →⋆ₐ[R] A) (cfcHom (p := p) hpa) (starAlgHom (cfcHom (p := q) hqa) h)
have hφ₂ : (starAlgHom (cfcHom (p := q) hqa) h : (a : C((↑(spectrum R a) : Type u_1), R)) → A)
    (ContinuousMap.restrict (spectrum R a) (ContinuousMap.id R)) =
  a
Tactic: apply cfcHom_eq_of_continuous_of_map_id
-- Lean 4 proof step from Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Restrict (goal)
Goal:
R : Type u_1
S : Type u_2
A : Type u_3
p q : A → Prop
inst : Semifield R
inst_1 : StarRing R
inst_2 : MetricSpace R
inst_3 : IsTopologicalSemiring R
inst_4 : ContinuousStar R
inst_5 : Semifield S
inst_6 : StarRing S
inst_7 : MetricSpace S
inst_8 : IsTopologicalSemiring S
inst_9 : ContinuousStar S
inst_10 : Ring A
inst_11 : StarRing A
inst_12 : Algebra S A
inst_13 : Algebra R S
inst_14 : Algebra R A
inst_15 : IsScalarTower R S A
inst_16 : StarModule R S
inst_17 : ContinuousSMul R S
inst_18 : TopologicalSpace A
inst_19 : ContinuousFunctionalCalculus S A q
inst_20 : ContinuousFunctionalCalculus R A p
inst_21 : ContinuousMap.UniqueHom R A
f : C(S, R)
halg : IsClosedEmbedding.{u_1, u_2} (X := R) (Y := S) (⇑(algebraMap R S) : (a : R) → S)
a : A
hpa : p a
hqa : q a
h : SpectrumRestricts.{u_1, u_2, u_3} (R := R) (S := S) a (⇑f : (a : S) → R)
g : R → R
⊢ cfc (p := p) g a = cfc (p := q) (fun (x : S) ↦ (algebraMap R S : (a : R) → S) (g ((f : (a : S) → R) x))) a
have pos : ∀ (hg : ContinuousOn g (spectrum R a)),
  cfc (p := p) g a = cfc (p := q) (fun (x : S) ↦ (algebraMap R S : (a : R) → S) (g ((f : (a : S) → R) x))) a
Tactic: by_cases hg : ContinuousOn g (spectrum R a)
-- Lean 4 proof step from Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Restrict (goal)
Goal:
R : Type u_1
S : Type u_2
A : Type u_3
p q : A → Prop
inst : Semifield R
inst_1 : StarRing R
inst_2 : MetricSpace R
inst_3 : IsTopologicalSemiring R
inst_4 : ContinuousStar R
inst_5 : Semifield S
inst_6 : StarRing S
inst_7 : MetricSpace S
inst_8 : IsTopologicalSemiring S
inst_9 : ContinuousStar S
inst_10 : Ring A
inst_11 : StarRing A
inst_12 : Algebra S A
inst_13 : Algebra R S
inst_14 : Algebra R A
inst_15 : IsScalarTower R S A
inst_16 : StarModule R S
inst_17 : ContinuousSMul R S
inst_18 : TopologicalSpace A
inst_19 : ContinuousFunctionalCalculus S A q
inst_20 : ContinuousFunctionalCalculus R A p
inst_21 : ContinuousMap.UniqueHom R A
f : C(S, R)
halg : IsClosedEmbedding.{u_1, u_2} (X := R) (Y := S) (⇑(algebraMap R S) : (a : R) → S)
a : A
hpa : p a
hqa : q a
h : SpectrumRestricts.{u_1, u_2, u_3} (R := R) (S := S) a (⇑f : (a : S) → R)
g : R → R
pos :
  ∀ (hg : ContinuousOn g (spectrum R a)),
    cfc (p := p) g a = cfc (p := q) (fun (x : S) ↦ (algebraMap R S : (a : R) → S) (g ((f : (a : S) → R) x))) a
⊢ cfc (p := p) g a = cfc (p := q) (fun (x : S) ↦ (algebraMap R S : (a : R) → S) (g ((f : (a : S) → R) x))) a
have neg : ∀ (hg : ¬ContinuousOn g (spectrum R a)),
  cfc (p := p) g a = cfc (p := q) (fun (x : S) ↦ (algebraMap R S : (a : R) → S) (g ((f : (a : S) → R) x))) a
Tactic: by_cases hg : ContinuousOn g (spectrum R a)
-- Lean 4 proof step from Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Restrict (goal)
Goal:
R : Type u_1
S : Type u_2
A : Type u_3
p q : A → Prop
inst : Semifield R
inst_1 : StarRing R
inst_2 : MetricSpace R
inst_3 : IsTopologicalSemiring R
inst_4 : ContinuousStar R
inst_5 : Semifield S
inst_6 : StarRing S
inst_7 : MetricSpace S
inst_8 : IsTopologicalSemiring S
inst_9 : ContinuousStar S
inst_10 : Ring A
inst_11 : StarRing A
inst_12 : Algebra S A
inst_13 : Algebra R S
inst_14 : Algebra R A
inst_15 : IsScalarTower R S A
inst_16 : StarModule R S
inst_17 : ContinuousSMul R S
inst_18 : TopologicalSpace A
inst_19 : ContinuousFunctionalCalculus S A q
inst_20 : ContinuousFunctionalCalculus R A p
inst_21 : ContinuousMap.UniqueHom R A
f : C(S, R)
halg : IsClosedEmbedding.{u_1, u_2} (X := R) (Y := S) (⇑(algebraMap R S) : (a : R) → S)
a : A
hpa : p a
hqa : q a
h : SpectrumRestricts.{u_1, u_2, u_3} (R := R) (S := S) a (⇑f : (a : S) → R)
g : R → R
hg : ContinuousOn g (spectrum R a)
⊢ cfc.{u_2, u_3} (R := S) (p := q)
      (Function.extend (α := { x : S // x ∈ spectrum S a }) (Subtype.val (p := fun (x : S) ↦ x ∈ spectrum S a))
        (⇑(ContinuousMap.comp { toFun := (⇑(StarAlgHom.ofId R S) : (a : R) → S), continuous_toFun := ⋯ : C(R, S) }
              ({ toFun := (spectrum R a).restrict (π := fun (a : R) ↦ R) g, continuous_toFun := ⋯ :
                    C((↑(spectrum R a) : Type u_1), R) }.comp
                {
                  toFun :=
                    Subtype.map (p := fun (x : S) ↦ x ∈ spectrum S a) (q := fun (x : R) ↦ x ∈ spectrum R a)
                      (⇑f : (a : S) → R) ⋯,
                  continuous_toFun := ⋯ :
                  ContinuousMap.{u_2, u_1} (↑(spectrum S a) : Type u_2) (↑(spectrum R a) : Type u_1) })) :
          (a : (↑(spectrum S a) : Type u_2)) → S)
        0)
      a =
    cfc (p := q) (fun (x : S) ↦ (algebraMap R S : (a : R) → S) (g ((f : (a : S) → R) x))) a
have apply : ∀ (x : S) (hx : x ∈ spectrum S a),
  Eq (α := S)
    (Function.extend (α := { x : S // x ∈ spectrum S a }) (Subtype.val (p := fun (x : S) ↦ x ∈ spectrum S a))
        (⇑(ContinuousMap.comp { toFun := (⇑(StarAlgHom.ofId R S) : (a : R) → S), continuous_toFun := sorry }
              ({ toFun := (spectrum R a).restrict (π := fun (a : R) ↦ R) g, continuous_toFun := sorry :
                    C((↑(spectrum R a) : Type u_1), R) }.comp
                {
                  toFun :=
                    Subtype.map (p := fun (x : S) ↦ x ∈ spectrum S a) (q := fun (x : R) ↦ x ∈ spectrum R a)
                      (⇑f : (a : S) → R) sorry,
                  continuous_toFun := sorry :
                  ContinuousMap.{u_2, u_1} (↑(spectrum S a) : Type u_2) (↑(spectrum R a) : Type u_1) })) :
          (a : (↑(spectrum S a) : Type u_2)) → S)
        0 x :
      S)
    ((algebraMap R S : (a : R) → S) (g ((f : (a : S) → R) x)) : S)
Tactic: apply cfc_congr fun x hx ↦ ?_
-- Lean 4 proof step from Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Restrict (goal)
Goal:
R : Type u_1
S : Type u_2
A : Type u_3
p q : A → Prop
inst : Semifield R
inst_1 : StarRing R
inst_2 : MetricSpace R
inst_3 : IsTopologicalSemiring R
inst_4 : ContinuousStar R
inst_5 : Semifield S
inst_6 : StarRing S
inst_7 : MetricSpace S
inst_8 : IsTopologicalSemiring S
inst_9 : ContinuousStar S
inst_10 : Ring A
inst_11 : StarRing A
inst_12 : Algebra S A
inst_13 : Algebra R S
inst_14 : Algebra R A
inst_15 : IsScalarTower R S A
inst_16 : StarModule R S
inst_17 : ContinuousSMul R S
inst_18 : TopologicalSpace A
inst_19 : ContinuousFunctionalCalculus S A q
inst_20 : ContinuousFunctionalCalculus R A p
inst_21 : ContinuousMap.UniqueHom R A
f : C(S, R)
halg : IsClosedEmbedding.{u_1, u_2} (X := R) (Y := S) (⇑(algebraMap R S) : (a : R) → S)
a : A
hpa : p a
hqa : q a
h : SpectrumRestricts.{u_1, u_2, u_3} (R := R) (S := S) a (⇑f : (a : S) → R)
g : R → R
hg : ContinuousOn g (spectrum R a)
x : S
hx : x ∈ spectrum S a
⊢ Eq (α := S)
    (Function.extend (α := { x : S // x ∈ spectrum S a }) (Subtype.val (p := fun (x : S) ↦ x ∈ spectrum S a))
        (⇑(ContinuousMap.comp { toFun := (⇑(StarAlgHom.ofId R S) : (a : R) → S), continuous_toFun := ⋯ }
              ({ toFun := (spectrum R a).restrict (π := fun (a : R) ↦ R) g, continuous_toFun := ⋯ :
                    C((↑(spectrum R a) : Type u_1), R) }.comp
                {
                  toFun :=
                    Subtype.map (p := fun (x : S) ↦ x ∈ spectrum S a) (q := fun (x : R) ↦ x ∈ spectrum R a)
                      (⇑f : (a : S) → R) ⋯,
                  continuous_toFun := ⋯ :
                  ContinuousMap.{u_2, u_1} (↑(spectrum S a) : Type u_2) (↑(spectrum R a) : Type u_1) })) :
          (a : (↑(spectrum S a) : Type u_2)) → S)
        0 x :
      S)
    ((algebraMap R S : (a : R) → S) (g ((f : (a : S) → R) x)) : S)
have lift : ∀ (x : { x : S // x ∈ spectrum S a }),
  Eq (α := S)
    (Function.extend (α := { x : S // x ∈ spectrum S a }) (Subtype.val (p := fun (x : S) ↦ x ∈ spectrum S a))
        (⇑(ContinuousMap.comp { toFun := (⇑(StarAlgHom.ofId R S) : (a : R) → S), continuous_toFun := sorry }
              ({ toFun := (spectrum R a).restrict (π := fun (a : R) ↦ R) g, continuous_toFun := sorry :
                    C((↑(spectrum R a) : Type u_1), R) }.comp
                {
                  toFun :=
                    Subtype.map (p := fun (x : S) ↦ x ∈ spectrum S a) (q := fun (x : R) ↦ x ∈ spectrum R a)
                      (⇑f : (a : S) → R) sorry,
                  continuous_toFun := sorry :
                  ContinuousMap.{u_2, u_1} (↑(spectrum S a) : Type u_2) (↑(spectrum R a) : Type u_1) })) :
          (a : (↑(spectrum S a) : Type u_2)) → S)
        0 (↑x : S) :
      S)
    ((algebraMap R S : (a : R) → S) (g ((f : (a : S) → R) (↑x : S))) : S)
Tactic: lift x to spectrum S a using hx
Cleared hypotheses: x, hx