File: Mathlib/Analysis/CstarAlgebra/ContinuousFunctionalCalculus/Unital.lean

full_name: ContinuousFunctionalCalculus.exists_cfc_of_predicate
code: /-- A star `R`-algebra `A` has a *continuous functional calculus* for elements satisfying the
property `p : A → Prop` if

+ for every such element `a : A` there is a star algebra homomorphism
  `cfcHom : C(spectrum R a, R) →⋆ₐ[R] A` sending the (restriction of) the identity map to `a`.
+ `cfcHom` is a closed embedding for which the spectrum of the image of function `f` is its range.
+ `cfcHom` preserves the property `p`.
+ `p 0` is true, which ensures among other things that `p ≠ fun _ ↦ False`.

The property `p` is marked as an `outParam` so that the user need not specify it. In practice,

+ for `R := ℂ`, we choose `p := IsStarNormal`,
+ for `R := ℝ`, we choose `p := IsSelfAdjoint`,
+ for `R := ℝ≥0`, we choose `p := (0 ≤ ·)`.

Instead of directly providing the data we opt instead for a `Prop` class. In all relevant cases,
the continuous functional calculus is uniquely determined, and utilizing this approach
prevents diamonds or problems arising from multiple instances. -/
class ContinuousFunctionalCalculus (R : Type*) {A : Type*} (p : outParam (A → Prop))
    [CommSemiring R] [StarRing R] [MetricSpace R] [TopologicalSemiring R] [ContinuousStar R]
    [Ring A] [StarRing A] [TopologicalSpace A] [Algebra R A] : Prop where
  predicate_zero : p 0
  exists_cfc_of_predicate : ∀ a, p a → ∃ φ : C(spectrum R a, R) →⋆ₐ[R] A,
    ClosedEmbedding φ ∧ φ ((ContinuousMap.id R).restrict <| spectrum R a) = a ∧
      (∀ f, spectrum R (φ f) = Set.range f) ∧ ∀ f, p (φ f)
goal: p a →
  ∃ φ,
    ClosedEmbedding ⇑φ ∧
      φ (ContinuousMap.restrict (spectrum R a) (ContinuousMap.id R)) = a ∧
        (∀ (f : C(↑(spectrum R a), R)), spectrum R (φ f) = Set.range ⇑f) ∧ ∀ (f : C(↑(spectrum R a), R)), p (φ f)

full_name: ContinuousFunctionalCalculus
code: /-- A star `R`-algebra `A` has a *continuous functional calculus* for elements satisfying the
property `p : A → Prop` if

+ for every such element `a : A` there is a star algebra homomorphism
  `cfcHom : C(spectrum R a, R) →⋆ₐ[R] A` sending the (restriction of) the identity map to `a`.
+ `cfcHom` is a closed embedding for which the spectrum of the image of function `f` is its range.
+ `cfcHom` preserves the property `p`.
+ `p 0` is true, which ensures among other things that `p ≠ fun _ ↦ False`.

The property `p` is marked as an `outParam` so that the user need not specify it. In practice,

+ for `R := ℂ`, we choose `p := IsStarNormal`,
+ for `R := ℝ`, we choose `p := IsSelfAdjoint`,
+ for `R := ℝ≥0`, we choose `p := (0 ≤ ·)`.

Instead of directly providing the data we opt instead for a `Prop` class. In all relevant cases,
the continuous functional calculus is uniquely determined, and utilizing this approach
prevents diamonds or problems arising from multiple instances. -/
class ContinuousFunctionalCalculus (R : Type*) {A : Type*} (p : outParam (A → Prop))
    [CommSemiring R] [StarRing R] [MetricSpace R] [TopologicalSemiring R] [ContinuousStar R]
    [Ring A] [StarRing A] [TopologicalSpace A] [Algebra R A] : Prop where
  predicate_zero : p 0
  exists_cfc_of_predicate : ∀ a, p a → ∃ φ : C(spectrum R a, R) →⋆ₐ[R] A,
    ClosedEmbedding φ ∧ φ ((ContinuousMap.id R).restrict <| spectrum R a) = a ∧
      (∀ f, spectrum R (φ f) = Set.range f) ∧ ∀ f, p (φ f)
goal: Prop

full_name: ContinuousFunctionalCalculus.predicate_zero
code: /-- A star `R`-algebra `A` has a *continuous functional calculus* for elements satisfying the
property `p : A → Prop` if

+ for every such element `a : A` there is a star algebra homomorphism
  `cfcHom : C(spectrum R a, R) →⋆ₐ[R] A` sending the (restriction of) the identity map to `a`.
+ `cfcHom` is a closed embedding for which the spectrum of the image of function `f` is its range.
+ `cfcHom` preserves the property `p`.
+ `p 0` is true, which ensures among other things that `p ≠ fun _ ↦ False`.

The property `p` is marked as an `outParam` so that the user need not specify it. In practice,

+ for `R := ℂ`, we choose `p := IsStarNormal`,
+ for `R := ℝ`, we choose `p := IsSelfAdjoint`,
+ for `R := ℝ≥0`, we choose `p := (0 ≤ ·)`.

Instead of directly providing the data we opt instead for a `Prop` class. In all relevant cases,
the continuous functional calculus is uniquely determined, and utilizing this approach
prevents diamonds or problems arising from multiple instances. -/
class ContinuousFunctionalCalculus (R : Type*) {A : Type*} (p : outParam (A → Prop))
    [CommSemiring R] [StarRing R] [MetricSpace R] [TopologicalSemiring R] [ContinuousStar R]
    [Ring A] [StarRing A] [TopologicalSpace A] [Algebra R A] : Prop where
  predicate_zero : p 0
  exists_cfc_of_predicate : ∀ a, p a → ∃ φ : C(spectrum R a, R) →⋆ₐ[R] A,
    ClosedEmbedding φ ∧ φ ((ContinuousMap.id R).restrict <| spectrum R a) = a ∧
      (∀ f, spectrum R (φ f) = Set.range f) ∧ ∀ f, p (φ f)
goal: p 0

full_name: UniqueContinuousFunctionalCalculus.eq_of_continuous_of_map_id
code: /-- A class guaranteeing that the continuous functional calculus is uniquely determined by the
properties that it is a continuous star algebra homomorphism mapping the (restriction of) the
identity to `a`. This is the necessary tool used to establish `cfcHom_comp` and the more common
variant `cfc_comp`.

This class has instances, which can be found in
`Mathlib.Analysis.CstarAlgebra.ContinuousFunctionalCalculus.Unique`, in each of the common cases
`ℂ`, `ℝ` and `ℝ≥0` as a consequence of the Stone-Weierstrass theorem.

This class is separate from `ContinuousFunctionalCalculus` primarily because we will later use
`SpectrumRestricts` to derive an instance of `ContinuousFunctionalCalculus` on a scalar subring
from one on a larger ring (i.e., to go from a continuous functional calculus over `ℂ` for normal
elements to one over `ℝ` for selfadjoint elements), and proving this additional property is
preserved would be burdensome or impossible. -/
class UniqueContinuousFunctionalCalculus (R A : Type*) [CommSemiring R] [StarRing R]
    [MetricSpace R] [TopologicalSemiring R] [ContinuousStar R] [Ring A] [StarRing A]
    [TopologicalSpace A] [Algebra R A] : Prop where
  eq_of_continuous_of_map_id (s : Set R) [CompactSpace s]
    (φ ψ : C(s, R) →⋆ₐ[R] A) (hφ : Continuous φ) (hψ : Continuous ψ)
    (h : φ (.restrict s <| .id R) = ψ (.restrict s <| .id R)) :
    φ = ψ
  compactSpace_spectrum (a : A) : CompactSpace (spectrum R a)
goal: φ = ψ

full_name: UniqueContinuousFunctionalCalculus
code: /-- A class guaranteeing that the continuous functional calculus is uniquely determined by the
properties that it is a continuous star algebra homomorphism mapping the (restriction of) the
identity to `a`. This is the necessary tool used to establish `cfcHom_comp` and the more common
variant `cfc_comp`.

This class has instances, which can be found in
`Mathlib.Analysis.CstarAlgebra.ContinuousFunctionalCalculus.Unique`, in each of the common cases
`ℂ`, `ℝ` and `ℝ≥0` as a consequence of the Stone-Weierstrass theorem.

This class is separate from `ContinuousFunctionalCalculus` primarily because we will later use
`SpectrumRestricts` to derive an instance of `ContinuousFunctionalCalculus` on a scalar subring
from one on a larger ring (i.e., to go from a continuous functional calculus over `ℂ` for normal
elements to one over `ℝ` for selfadjoint elements), and proving this additional property is
preserved would be burdensome or impossible. -/
class UniqueContinuousFunctionalCalculus (R A : Type*) [CommSemiring R] [StarRing R]
    [MetricSpace R] [TopologicalSemiring R] [ContinuousStar R] [Ring A] [StarRing A]
    [TopologicalSpace A] [Algebra R A] : Prop where
  eq_of_continuous_of_map_id (s : Set R) [CompactSpace s]
    (φ ψ : C(s, R) →⋆ₐ[R] A) (hφ : Continuous φ) (hψ : Continuous ψ)
    (h : φ (.restrict s <| .id R) = ψ (.restrict s <| .id R)) :
    φ = ψ
  compactSpace_spectrum (a : A) : CompactSpace (spectrum R a)
goal: Prop

full_name: UniqueContinuousFunctionalCalculus.compactSpace_spectrum
code: /-- A class guaranteeing that the continuous functional calculus is uniquely determined by the
properties that it is a continuous star algebra homomorphism mapping the (restriction of) the
identity to `a`. This is the necessary tool used to establish `cfcHom_comp` and the more common
variant `cfc_comp`.

This class has instances, which can be found in
`Mathlib.Analysis.CstarAlgebra.ContinuousFunctionalCalculus.Unique`, in each of the common cases
`ℂ`, `ℝ` and `ℝ≥0` as a consequence of the Stone-Weierstrass theorem.

This class is separate from `ContinuousFunctionalCalculus` primarily because we will later use
`SpectrumRestricts` to derive an instance of `ContinuousFunctionalCalculus` on a scalar subring
from one on a larger ring (i.e., to go from a continuous functional calculus over `ℂ` for normal
elements to one over `ℝ` for selfadjoint elements), and proving this additional property is
preserved would be burdensome or impossible. -/
class UniqueContinuousFunctionalCalculus (R A : Type*) [CommSemiring R] [StarRing R]
    [MetricSpace R] [TopologicalSemiring R] [ContinuousStar R] [Ring A] [StarRing A]
    [TopologicalSpace A] [Algebra R A] : Prop where
  eq_of_continuous_of_map_id (s : Set R) [CompactSpace s]
    (φ ψ : C(s, R) →⋆ₐ[R] A) (hφ : Continuous φ) (hψ : Continuous ψ)
    (h : φ (.restrict s <| .id R) = ψ (.restrict s <| .id R)) :
    φ = ψ
  compactSpace_spectrum (a : A) : CompactSpace (spectrum R a)
goal: CompactSpace ↑(spectrum R a)

full_name: StarAlgHom.ext_continuousMap
code: lemma StarAlgHom.ext_continuousMap [UniqueContinuousFunctionalCalculus R A]
    (a : A) (φ ψ : C(spectrum R a, R) →⋆ₐ[R] A) (hφ : Continuous φ) (hψ : Continuous ψ)
    (h : φ (.restrict (spectrum R a) <| .id R) = ψ (.restrict (spectrum R a) <| .id R)) :
    φ = ψ 
goal: φ = ψ

full_name: cfcHom
code: /-- The star algebra homomorphism underlying a instance of the continuous functional calculus;
a version for continuous functions on the spectrum.

In this case, the user must supply the fact that `a` satisfies the predicate `p`, for otherwise it
may be the case that no star algebra homomorphism exists. For instance if `R := ℝ` and `a` is an
element whose spectrum (in `ℂ`) is disjoint from `ℝ`, then `spectrum ℝ a = ∅` and so there can be
no star algebra homomorphism between these spaces.

While `ContinuousFunctionalCalculus` is stated in terms of these homomorphisms, in practice the
user should instead prefer `cfc` over `cfcHom`.
-/
noncomputable def cfcHom : C(spectrum R a, R) →⋆ₐ[R] A 
goal: C(↑(spectrum R a), R) →⋆ₐ[R] A

full_name: cfcHom_closedEmbedding
code: lemma cfcHom_closedEmbedding :
    ClosedEmbedding <| (cfcHom ha : C(spectrum R a, R) →⋆ₐ[R] A) 
goal: ClosedEmbedding ⇑(cfcHom ha)

full_name: cfcHom_id
code: lemma cfcHom_id :
    cfcHom ha ((ContinuousMap.id R).restrict <| spectrum R a) = a 
goal: (cfcHom ha) (ContinuousMap.restrict (spectrum R a) (ContinuousMap.id R)) = a

full_name: cfcHom_map_spectrum
code: /-- The **spectral mapping theorem** for the continuous functional calculus. -/
lemma cfcHom_map_spectrum (f : C(spectrum R a, R)) :
    spectrum R (cfcHom ha f) = Set.range f 
goal: spectrum R ((cfcHom ha) f) = Set.range ⇑f

full_name: cfcHom_predicate
code: lemma cfcHom_predicate (f : C(spectrum R a, R)) :
    p (cfcHom ha f) 
goal: p ((cfcHom ha) f)

full_name: cfcHom_eq_of_continuous_of_map_id
code: lemma cfcHom_eq_of_continuous_of_map_id [UniqueContinuousFunctionalCalculus R A]
    (φ : C(spectrum R a, R) →⋆ₐ[R] A) (hφ₁ : Continuous φ)
    (hφ₂ : φ (.restrict (spectrum R a) <| .id R) = a) : cfcHom ha = φ 
goal: cfcHom ha = φ

full_name: cfcHom_comp
code: theorem cfcHom_comp [UniqueContinuousFunctionalCalculus R A] (f : C(spectrum R a, R))
    (f' : C(spectrum R a, spectrum R (cfcHom ha f)))
    (hff' : ∀ x, f x = f' x) (g : C(spectrum R (cfcHom ha f), R)) :
    cfcHom ha (g.comp f') = cfcHom (cfcHom_predicate ha f) g 
goal: (cfcHom ha) (g.comp f') = (cfcHom ⋯) g

full_name: definition._@.Mathlib.Analysis.CstarAlgebra.ContinuousFunctionalCalculus.Unital._hyg.1196
code: /-- This is the *continuous functional calculus* of an element `a : A` applied to bare functions.
When either `a` does not satisfy the predicate `p` (i.e., `a` is not `IsStarNormal`,
`IsSelfAdjoint`, or `0 ≤ a` when `R` is `ℂ`, `ℝ`, or `ℝ≥0`, respectively), or when `f : R → R` is
not continuous on the spectrum of `a`, then `cfc f a` returns the junk value `0`.

This is the primary declaration intended for widespread use of the continuous functional calculus,
and all the API applies to this declaration. For more information, see the module documentation
for `Analysis.CstarAlgebra.ContinuousFunctionalCalculus.Unital`. -/
noncomputable irreducible_def cfc (f : R → R) (a : A) : A 
goal: A

full_name: cfc
code: /-- This is the *continuous functional calculus* of an element `a : A` applied to bare functions.
When either `a` does not satisfy the predicate `p` (i.e., `a` is not `IsStarNormal`,
`IsSelfAdjoint`, or `0 ≤ a` when `R` is `ℂ`, `ℝ`, or `ℝ≥0`, respectively), or when `f : R → R` is
not continuous on the spectrum of `a`, then `cfc f a` returns the junk value `0`.

This is the primary declaration intended for widespread use of the continuous functional calculus,
and all the API applies to this declaration. For more information, see the module documentation
for `Analysis.CstarAlgebra.ContinuousFunctionalCalculus.Unital`. -/
noncomputable irreducible_def cfc (f : R → R) (a : A) : A 
goal: A

full_name: cfc_def
code: /-- This is the *continuous functional calculus* of an element `a : A` applied to bare functions.
When either `a` does not satisfy the predicate `p` (i.e., `a` is not `IsStarNormal`,
`IsSelfAdjoint`, or `0 ≤ a` when `R` is `ℂ`, `ℝ`, or `ℝ≥0`, respectively), or when `f : R → R` is
not continuous on the spectrum of `a`, then `cfc f a` returns the junk value `0`.

This is the primary declaration intended for widespread use of the continuous functional calculus,
and all the API applies to this declaration. For more information, see the module documentation
for `Analysis.CstarAlgebra.ContinuousFunctionalCalculus.Unital`. -/
noncomputable irreducible_def cfc (f : R → R) (a : A) : A 
goal: cfc f a =
  if h : p a ∧ ContinuousOn f (spectrum R a) then
    (cfcHom ⋯) { toFun := (spectrum R a).restrict f, continuous_toFun := ⋯ }
  else 0

full_name: wrapped._@.Mathlib.Analysis.CstarAlgebra.ContinuousFunctionalCalculus.Unital._hyg.1196
code: /-- This is the *continuous functional calculus* of an element `a : A` applied to bare functions.
When either `a` does not satisfy the predicate `p` (i.e., `a` is not `IsStarNormal`,
`IsSelfAdjoint`, or `0 ≤ a` when `R` is `ℂ`, `ℝ`, or `ℝ≥0`, respectively), or when `f : R → R` is
not continuous on the spectrum of `a`, then `cfc f a` returns the junk value `0`.

This is the primary declaration intended for widespread use of the continuous functional calculus,
and all the API applies to this declaration. For more information, see the module documentation
for `Analysis.CstarAlgebra.ContinuousFunctionalCalculus.Unital`. -/
noncomputable irreducible_def cfc (f : R → R) (a : A) : A 
goal: Subtype (Eq @definition✝)

full_name: cfc_apply
code: lemma cfc_apply : cfc f a = cfcHom (a := a) ha ⟨_, hf.restrict⟩ 
goal: cfc f a = (cfcHom ha) { toFun := (spectrum R a).restrict f, continuous_toFun := ⋯ }

full_name: cfc_apply_pi
code: lemma cfc_apply_pi {ι : Type*} (f : ι → R → R) (a : A) (ha : p a := by cfc_tac)
    (hf : ∀ i, ContinuousOn (f i) (spectrum R a) := by cfc_cont_tac) :
    (fun i => cfc (f i) a) = (fun i => cfcHom (a := a) ha ⟨_, (hf i).restrict⟩) 
goal: (fun i => cfc (f i) a) = fun i => (cfcHom ha) { toFun := (spectrum R a).restrict (f i), continuous_toFun := ⋯ }

full_name: cfc_apply_of_not_and
code: lemma cfc_apply_of_not_and {f : R → R} (a : A) (ha : ¬ (p a ∧ ContinuousOn f (spectrum R a))) :
    cfc f a = 0 
goal: cfc f a = 0

full_name: cfc_apply_of_not_predicate
code: lemma cfc_apply_of_not_predicate {f : R → R} (a : A) (ha : ¬ p a) :
    cfc f a = 0 
goal: cfc f a = 0

full_name: cfc_apply_of_not_continuousOn
code: lemma cfc_apply_of_not_continuousOn {f : R → R} (a : A) (hf : ¬ ContinuousOn f (spectrum R a)) :
    cfc f a = 0 
goal: cfc f a = 0

full_name: cfcHom_eq_cfc_extend
code: lemma cfcHom_eq_cfc_extend {a : A} (g : R → R) (ha : p a) (f : C(spectrum R a, R)) :
    cfcHom ha f = cfc (Function.extend Subtype.val f g) a 
goal: (cfcHom ha) f = cfc (Function.extend Subtype.val (⇑f) g) a

full_name: cfc_cases
code: lemma cfc_cases (P : A → Prop) (a : A) (f : R → R) (h₀ : P 0)
    (haf : (hf : ContinuousOn f (spectrum R a)) → (ha : p a) → P (cfcHom ha ⟨_, hf.restrict⟩)) :
    P (cfc f a) 
goal: P (cfc f a)

full_name: cfc_id
code: lemma cfc_id : cfc (id : R → R) a = a 
goal: cfc id a = a

full_name: cfc_id'
code: lemma cfc_id' : cfc (fun x : R ↦ x) a = a 
goal: cfc (fun x => x) a = a

full_name: cfc_map_spectrum
code: /-- The **spectral mapping theorem** for the continuous functional calculus. -/
lemma cfc_map_spectrum : spectrum R (cfc f a) = f '' spectrum R a 
goal: spectrum R (cfc f a) = f '' spectrum R a

full_name: cfc_const
code: lemma cfc_const (r : R) (a : A) (ha : p a := by cfc_tac) :
    cfc (fun _ ↦ r) a = algebraMap R A r 
goal: cfc (fun x => r) a = (algebraMap R A) r

full_name: cfc_predicate_zero
code: lemma cfc_predicate_zero : p 0 
goal: p 0

full_name: cfc_predicate
code: lemma cfc_predicate (f : R → R) (a : A) : p (cfc f a) 
goal: p (cfc f a)

full_name: cfc_predicate_algebraMap
code: lemma cfc_predicate_algebraMap (r : R) : p (algebraMap R A r) 
goal: p ((algebraMap R A) r)

full_name: cfc_predicate_one
code: lemma cfc_predicate_one : p 1 
goal: p 1

full_name: cfc_congr
code: lemma cfc_congr {f g : R → R} {a : A} (hfg : (spectrum R a).EqOn f g) :
    cfc f a = cfc g a 
goal: cfc f a = cfc g a

full_name: eqOn_of_cfc_eq_cfc
code: lemma eqOn_of_cfc_eq_cfc {f g : R → R} {a : A} (h : cfc f a = cfc g a)
    (hf : ContinuousOn f (spectrum R a) := by cfc_cont_tac)
    (hg : ContinuousOn g (spectrum R a) := by cfc_cont_tac) (ha : p a := by cfc_tac) :
    (spectrum R a).EqOn f g 
goal: Set.EqOn f g (spectrum R a)

full_name: cfc_eq_cfc_iff_eqOn
code: lemma cfc_eq_cfc_iff_eqOn : cfc f a = cfc g a ↔ (spectrum R a).EqOn f g 
goal: cfc f a = cfc g a ↔ Set.EqOn f g (spectrum R a)

full_name: cfc_one
code: lemma cfc_one : cfc (1 : R → R) a = 1 
goal: cfc 1 a = 1

full_name: cfc_const_one
code: lemma cfc_const_one : cfc (fun _ : R ↦ 1) a = 1 
goal: cfc (fun x => 1) a = 1

full_name: cfc_zero
code: @[simp]
lemma cfc_zero : cfc (0 : R → R) a = 0 
goal: cfc 0 a = 0

full_name: cfc_const_zero
code: @[simp]
lemma cfc_const_zero : cfc (fun _ : R ↦ 0) a = 0 
goal: cfc (fun x => 0) a = 0

full_name: cfc_mul
code: lemma cfc_mul (f g : R → R) (a : A) (hf : ContinuousOn f (spectrum R a) := by cfc_cont_tac)
    (hg : ContinuousOn g (spectrum R a) := by cfc_cont_tac) :
    cfc (fun x ↦ f x * g x) a = cfc f a * cfc g a 
goal: cfc (fun x => f x * g x) a = cfc f a * cfc g a

full_name: cfc_pow
code: lemma cfc_pow (f : R → R) (n : ℕ) (a : A)
    (hf : ContinuousOn f (spectrum R a) := by cfc_cont_tac) (ha : p a := by cfc_tac) :
    cfc (fun x ↦ (f x) ^ n) a = cfc f a ^ n 
goal: cfc (fun x => f x ^ n) a = cfc f a ^ n

full_name: cfc_add
code: lemma cfc_add (f g : R → R) (hf : ContinuousOn f (spectrum R a) := by cfc_cont_tac)
    (hg : ContinuousOn g (spectrum R a) := by cfc_cont_tac) :
    cfc (fun x ↦ f x + g x) a = cfc f a + cfc g a 
goal: cfc (fun x => f x + g x) a = cfc f a + cfc g a

full_name: cfc_const_add
code: lemma cfc_const_add (r : R) (f : R → R) (a : A)
    (hf : ContinuousOn f (spectrum R a) := by cfc_cont_tac) (ha : p a := by cfc_tac) :
    cfc (fun x => r + f x) a = algebraMap R A r + cfc f a 
goal: cfc (fun x => r + f x) a = (algebraMap R A) r + cfc f a

full_name: cfc_add_const
code: lemma cfc_add_const (r : R) (f : R → R) (a : A)
    (hf : ContinuousOn f (spectrum R a) := by cfc_cont_tac) (ha : p a := by cfc_tac) :
    cfc (fun x => f x + r) a = cfc f a + algebraMap R A r 
goal: cfc (fun x => f x + r) a = cfc f a + (algebraMap R A) r

full_name: cfc_sum
code: lemma cfc_sum {ι : Type*} (f : ι → R → R) (a : A) (s : Finset ι)
    (hf : ∀ i ∈ s, ContinuousOn (f i) (spectrum R a) := by cfc_cont_tac) :
    cfc (∑ i in s, f i)  a = ∑ i in s, cfc (f i) a 
goal: cfc (∑ i ∈ s, f i) a = ∑ i ∈ s, cfc (f i) a

full_name: cfc_sum_univ
code: lemma cfc_sum_univ {ι : Type*} [Fintype ι] (f : ι → R → R) (a : A)
    (hf : ∀ i, ContinuousOn (f i) (spectrum R a) := by cfc_cont_tac) :
    cfc (∑ i, f i) a = ∑ i, cfc (f i) a 
goal: cfc (∑ i : ι, f i) a = ∑ i : ι, cfc (f i) a

full_name: cfc_smul
code: lemma cfc_smul {S : Type*} [SMul S R] [ContinuousConstSMul S R]
    [SMulZeroClass S A] [IsScalarTower S R A] [IsScalarTower S R (R → R)]
    (s : S) (f : R → R) (a : A) (hf : ContinuousOn f (spectrum R a) := by cfc_cont_tac) :
    cfc (fun x ↦ s • f x) a = s • cfc f a 
goal: cfc (fun x => s • f x) a = s • cfc f a

full_name: cfc_const_mul
code: lemma cfc_const_mul (r : R) (f : R → R) (a : A)
    (hf : ContinuousOn f (spectrum R a) := by cfc_cont_tac) :
    cfc (fun x ↦ r * f x) a = r • cfc f a 
goal: cfc (fun x => r * f x) a = r • cfc f a

full_name: cfc_star
code: lemma cfc_star (f : R → R) (a : A) : cfc (fun x ↦ star (f x)) a = star (cfc f a) 
goal: cfc (fun x => star (f x)) a = star (cfc f a)

full_name: cfc_pow_id
code: lemma cfc_pow_id (a : A) (n : ℕ) (ha : p a := by cfc_tac) : cfc (· ^ n : R → R) a = a ^ n 
goal: cfc (fun x => x ^ n) a = a ^ n

full_name: cfc_smul_id
code: lemma cfc_smul_id {S : Type*} [SMul S R] [ContinuousConstSMul S R]
    [SMulZeroClass S A] [IsScalarTower S R A] [IsScalarTower S R (R → R)]
    (s : S) (a : A) (ha : p a := by cfc_tac) : cfc (s • · : R → R) a = s • a 
goal: cfc (fun x => s • x) a = s • a

full_name: cfc_const_mul_id
code: lemma cfc_const_mul_id (r : R) (a : A) (ha : p a := by cfc_tac) : cfc (r * ·) a = r • a 
goal: cfc (fun x => r * x) a = r • a

full_name: cfc_star_id
code: lemma cfc_star_id : cfc (star · : R → R) a = star a 
goal: cfc (fun x => star x) a = star a

full_name: cfc_eval_X
code: lemma cfc_eval_X (ha : p a := by cfc_tac) : cfc (X : R[X]).eval a = a 
goal: cfc (fun a => Polynomial.eval a Polynomial.X) a = a

full_name: cfc_eval_C
code: lemma cfc_eval_C (r : R) (a : A) (ha : p a := by cfc_tac) :
    cfc (C r).eval a = algebraMap R A r 
goal: cfc (fun a => Polynomial.eval a (Polynomial.C r)) a = (algebraMap R A) r

full_name: cfc_map_polynomial
code: lemma cfc_map_polynomial (q : R[X]) (f : R → R) (a : A) (ha : p a := by cfc_tac)
    (hf : ContinuousOn f (spectrum R a) := by cfc_cont_tac) :
    cfc (fun x ↦ q.eval (f x)) a = aeval (cfc f a) q 
goal: cfc (fun x => Polynomial.eval (f x) q) a = (Polynomial.aeval (cfc f a)) q

full_name: cfc_polynomial
code: lemma cfc_polynomial (q : R[X]) (a : A) (ha : p a := by cfc_tac) :
    cfc q.eval a = aeval a q 
goal: cfc (fun a => Polynomial.eval a q) a = (Polynomial.aeval a) q

full_name: cfc_comp
code: lemma cfc_comp (g f : R → R) (a : A) (ha : p a := by cfc_tac)
    (hg : ContinuousOn g (f '' spectrum R a) := by cfc_cont_tac)
    (hf : ContinuousOn f (spectrum R a) := by cfc_cont_tac) :
    cfc (g ∘ f) a = cfc g (cfc f a) 
goal: cfc (g ∘ f) a = cfc g (cfc f a)

full_name: cfc_comp'
code: lemma cfc_comp' (g f : R → R) (a : A) (hg : ContinuousOn g (f '' spectrum R a) := by cfc_cont_tac)
    (hf : ContinuousOn f (spectrum R a) := by cfc_cont_tac) (ha : p a := by cfc_tac) :
    cfc (g <| f ·) a = cfc g (cfc f a) 
goal: cfc (fun x => g (f x)) a = cfc g (cfc f a)

full_name: cfc_comp_pow
code: lemma cfc_comp_pow (f : R → R) (n : ℕ) (a : A)
    (hf : ContinuousOn f ((· ^ n) '' (spectrum R a)) := by cfc_cont_tac) (ha : p a := by cfc_tac) :
    cfc (f <| · ^ n) a = cfc f (a ^ n) 
goal: cfc (fun x => f (x ^ n)) a = cfc f (a ^ n)

full_name: cfc_comp_smul
code: lemma cfc_comp_smul {S : Type*} [SMul S R] [ContinuousConstSMul S R] [SMulZeroClass S A]
    [IsScalarTower S R A] [IsScalarTower S R (R → R)] (s : S) (f : R → R) (a : A)
    (hf : ContinuousOn f ((s • ·) '' (spectrum R a)) := by cfc_cont_tac) (ha : p a := by cfc_tac) :
    cfc (f <| s • ·) a = cfc f (s • a) 
goal: cfc (fun x => f (s • x)) a = cfc f (s • a)

full_name: cfc_comp_const_mul
code: lemma cfc_comp_const_mul (r : R) (f : R → R) (a : A)
    (hf : ContinuousOn f ((r * ·) '' (spectrum R a)) := by cfc_cont_tac)  (ha : p a := by cfc_tac) :
    cfc (f <| r * ·) a = cfc f (r • a) 
goal: cfc (fun x => f (r * x)) a = cfc f (r • a)

full_name: cfc_comp_star
code: lemma cfc_comp_star (f : R → R) (a : A)
    (hf : ContinuousOn f (star '' (spectrum R a)) := by cfc_cont_tac) (ha : p a := by cfc_tac) :
    cfc (f <| star ·) a = cfc f (star a) 
goal: cfc (fun x => f (star x)) a = cfc f (star a)

full_name: cfc_comp_polynomial
code: lemma cfc_comp_polynomial (q : R[X]) (f : R → R) (a : A)
    (hf : ContinuousOn f (q.eval '' (spectrum R a)) := by cfc_cont_tac) (ha : p a := by cfc_tac) :
    cfc (f <| q.eval ·) a = cfc f (aeval a q) 
goal: cfc (fun x => f (Polynomial.eval x q)) a = cfc f ((Polynomial.aeval a) q)

full_name: CFC.eq_algebraMap_of_spectrum_subset_singleton
code: lemma CFC.eq_algebraMap_of_spectrum_subset_singleton (r : R) (h_spec : spectrum R a ⊆ {r})
    (ha : p a := by cfc_tac) : a = algebraMap R A r 
goal: a = (algebraMap R A) r

full_name: CFC.eq_zero_of_spectrum_subset_zero
code: lemma CFC.eq_zero_of_spectrum_subset_zero (h_spec : spectrum R a ⊆ {0}) (ha : p a := by cfc_tac) :
    a = 0 
goal: a = 0

full_name: CFC.eq_one_of_spectrum_subset_one
code: lemma CFC.eq_one_of_spectrum_subset_one (h_spec : spectrum R a ⊆ {1}) (ha : p a := by cfc_tac) :
    a = 1 
goal: a = 1

full_name: CFC.spectrum_algebraMap_subset
code: lemma CFC.spectrum_algebraMap_subset (r : R) : spectrum R (algebraMap R A r) ⊆ {r} 
goal: spectrum R ((algebraMap R A) r) ⊆ {r}

full_name: CFC.spectrum_algebraMap_eq
code: lemma CFC.spectrum_algebraMap_eq [Nontrivial A] (r : R) :
    spectrum R (algebraMap R A r) = {r} 
goal: spectrum R ((algebraMap R A) r) = {r}

full_name: CFC.spectrum_zero_eq
code: lemma CFC.spectrum_zero_eq [Nontrivial A] :
    spectrum R (0 : A) = {0} 
goal: spectrum R 0 = {0}

full_name: CFC.spectrum_one_eq
code: lemma CFC.spectrum_one_eq [Nontrivial A] :
    spectrum R (1 : A) = {1} 
goal: spectrum R 1 = {1}

full_name: cfc_algebraMap
code: @[simp]
lemma cfc_algebraMap (r : R) (f : R → R) : cfc f (algebraMap R A r) = algebraMap R A (f r) 
goal: cfc f ((algebraMap R A) r) = (algebraMap R A) (f r)

full_name: cfc_apply_zero
code: @[simp] lemma cfc_apply_zero {f : R → R} : cfc f (0 : A) = algebraMap R A (f 0) 
goal: cfc f 0 = (algebraMap R A) (f 0)

full_name: cfc_apply_one
code: @[simp] lemma cfc_apply_one {f : R → R} : cfc f (1 : A) = algebraMap R A (f 1) 
goal: cfc f 1 = (algebraMap R A) (f 1)

full_name: isUnit_cfc_iff
code: lemma isUnit_cfc_iff (hf : ContinuousOn f (spectrum R a) := by cfc_cont_tac)
    (ha : p a := by cfc_tac) : IsUnit (cfc f a) ↔ ∀ x ∈ spectrum R a, f x ≠ 0 
goal: IsUnit (cfc f a) ↔ ∀ x ∈ spectrum R a, f x ≠ 0

full_name: val_cfcUnits
code: /-- Bundle `cfc f a` into a unit given a proof that `f` is nonzero on the spectrum of `a`. -/
@[simps]
noncomputable def cfcUnits (hf' : ∀ x ∈ spectrum R a, f x ≠ 0)
    (hf : ContinuousOn f (spectrum R a) := by cfc_cont_tac) (ha : p a := by cfc_tac) : Aˣ 
goal: ↑(cfcUnits f a hf' hf ha) = cfc f a

full_name: cfcUnits
code: /-- Bundle `cfc f a` into a unit given a proof that `f` is nonzero on the spectrum of `a`. -/
@[simps]
noncomputable def cfcUnits (hf' : ∀ x ∈ spectrum R a, f x ≠ 0)
    (hf : ContinuousOn f (spectrum R a) := by cfc_cont_tac) (ha : p a := by cfc_tac) : Aˣ 
goal: Aˣ

full_name: val_inv_cfcUnits
code: /-- Bundle `cfc f a` into a unit given a proof that `f` is nonzero on the spectrum of `a`. -/
@[simps]
noncomputable def cfcUnits (hf' : ∀ x ∈ spectrum R a, f x ≠ 0)
    (hf : ContinuousOn f (spectrum R a) := by cfc_cont_tac) (ha : p a := by cfc_tac) : Aˣ 
goal: ↑(cfcUnits f a hf' hf ha)⁻¹ = cfc (fun x => (f x)⁻¹) a

full_name: cfcUnits_pow
code: lemma cfcUnits_pow (hf' : ∀ x ∈ spectrum R a, f x ≠ 0) (n : ℕ)
    (hf : ContinuousOn f (spectrum R a) := by cfc_cont_tac) (ha : p a := by cfc_tac) :
    (cfcUnits f a hf') ^ n =
      cfcUnits (forall₂_imp (fun _ _ ↦ pow_ne_zero n) hf') (hf := hf.pow n) 
goal: cfcUnits f a hf' hf ha ^ n = cfcUnits (fun x => f x ^ n) a ⋯ ⋯ ha

full_name: cfc_inv
code: lemma cfc_inv (hf' : ∀ x ∈ spectrum R a, f x ≠ 0)
    (hf : ContinuousOn f (spectrum R a) := by cfc_cont_tac) (ha : p a := by cfc_tac) :
    cfc (fun x ↦ (f x) ⁻¹) a = Ring.inverse (cfc f a) 
goal: cfc (fun x => (f x)⁻¹) a = Ring.inverse (cfc f a)

full_name: cfc_inv_id
code: lemma cfc_inv_id (a : Aˣ) (ha : p a := by cfc_tac) :
    cfc (fun x ↦ x⁻¹ : R → R) (a : A) = a⁻¹ 
goal: cfc (fun x => x⁻¹) ↑a = ↑a⁻¹

full_name: cfc_map_div
code: lemma cfc_map_div (f g : R → R) (a : A) (hg' : ∀ x ∈ spectrum R a, g x ≠ 0)
    (hf : ContinuousOn f (spectrum R a) := by cfc_cont_tac)
    (hg : ContinuousOn g (spectrum R a) := by cfc_cont_tac) (ha : p a := by cfc_tac) :
    cfc (fun x ↦ f x / g x) a = cfc f a * Ring.inverse (cfc g a) 
goal: cfc (fun x => f x / g x) a = cfc f a * Ring.inverse (cfc g a)

full_name: Units.continuousOn_inv₀_spectrum
code: @[fun_prop]
lemma Units.continuousOn_inv₀_spectrum (a : Aˣ) : ContinuousOn (· ⁻¹) (spectrum R (a : A)) 
goal: ContinuousOn (fun x => x⁻¹) (spectrum R ↑a)

full_name: Units.continuousOn_zpow₀_spectrum
code: @[fun_prop]
lemma Units.continuousOn_zpow₀_spectrum (a : Aˣ) (n : ℤ) :
    ContinuousOn (· ^ n) (spectrum R (a : A)) 
goal: ContinuousOn (fun x => x ^ n) (spectrum R ↑a)

full_name: cfc_comp_inv
code: lemma cfc_comp_inv (f : R → R) (a : Aˣ)
    (hf : ContinuousOn f ((· ⁻¹) '' (spectrum R (a : A))) := by cfc_cont_tac)
    (ha : p a := by cfc_tac) :
    cfc (fun x ↦ f x⁻¹) (a : A) = cfc f (↑a⁻¹ : A) 
goal: cfc (fun x => f x⁻¹) ↑a = cfc f ↑a⁻¹

full_name: cfcUnits_zpow
code: lemma cfcUnits_zpow (hf' : ∀ x ∈ spectrum R a, f x ≠ 0) (n : ℤ)
    (hf : ContinuousOn f (spectrum R a) := by cfc_cont_tac) (ha : p a := by cfc_tac) :
    (cfcUnits f a hf') ^ n =
      cfcUnits (f ^ n) a (forall₂_imp (fun _ _ ↦ zpow_ne_zero n) hf')
        (hf.zpow₀ n (forall₂_imp (fun _ _ ↦ Or.inl) hf')) 
goal: cfcUnits f a hf' hf ha ^ n = cfcUnits (f ^ n) a ⋯ ⋯ ha

full_name: cfc_zpow
code: lemma cfc_zpow (a : Aˣ) (n : ℤ) (ha : p a := by cfc_tac) :
    cfc (fun x : R ↦ x ^ n) (a : A) = ↑(a ^ n) 
goal: cfc (fun x => x ^ n) ↑a = ↑(a ^ n)

full_name: cfc_comp_zpow
code: lemma cfc_comp_zpow (f : R → R) (n : ℤ) (a : Aˣ)
    (hf : ContinuousOn f ((· ^ n) '' (spectrum R (a : A))) := by cfc_cont_tac)
    (ha : p a := by cfc_tac) :
    cfc (fun x ↦ f (x ^ n)) (a : A) = cfc f (↑(a ^ n) : A) 
goal: cfc (fun x => f (x ^ n)) ↑a = cfc f ↑(a ^ n)

full_name: cfc_sub
code: lemma cfc_sub : cfc (fun x ↦ f x - g x) a = cfc f a - cfc g a 
goal: cfc (fun x => f x - g x) a = cfc f a - cfc g a

full_name: cfc_neg
code: lemma cfc_neg : cfc (fun x ↦ - (f x)) a = - (cfc f a) 
goal: cfc (fun x => -f x) a = -cfc f a

full_name: cfc_neg_id
code: lemma cfc_neg_id (ha : p a := by cfc_tac) : cfc (- · : R → R) a = -a 
goal: cfc (fun x => -x) a = -a

full_name: cfc_comp_neg
code: lemma cfc_comp_neg (hf : ContinuousOn f ((- ·) '' (spectrum R (a : A))) := by cfc_cont_tac)
    (ha : p a := by cfc_tac) : cfc (f <| - ·) a = cfc f (-a) 
goal: cfc (fun x => f (-x)) a = cfc f (-a)

full_name: cfcHom_mono
code: lemma cfcHom_mono {a : A} (ha : p a) {f g : C(spectrum R a, R)} (hfg : f ≤ g) :
    cfcHom ha f ≤ cfcHom ha g 
goal: (cfcHom ha) f ≤ (cfcHom ha) g

full_name: cfcHom_nonneg_iff
code: lemma cfcHom_nonneg_iff {a : A} (ha : p a) {f : C(spectrum R a, R)} :
    0 ≤ cfcHom ha f ↔ 0 ≤ f 
goal: 0 ≤ (cfcHom ha) f ↔ 0 ≤ f

full_name: cfc_mono
code: lemma cfc_mono {f g : R → R} {a : A} (h : ∀ x ∈ spectrum R a, f x ≤ g x)
    (hf : ContinuousOn f (spectrum R a) := by cfc_cont_tac)
    (hg : ContinuousOn g (spectrum R a) := by cfc_cont_tac) :
    cfc f a ≤ cfc g a 
goal: cfc f a ≤ cfc g a

full_name: cfc_nonneg_iff
code: lemma cfc_nonneg_iff (f : R → R) (a : A) (hf : ContinuousOn f (spectrum R a) := by cfc_cont_tac)
    (ha : p a := by cfc_tac) : 0 ≤ cfc f a ↔ ∀ x ∈ spectrum R a, 0 ≤ f x 
goal: 0 ≤ cfc f a ↔ ∀ x ∈ spectrum R a, 0 ≤ f x

full_name: StarOrderedRing.nonneg_iff_spectrum_nonneg
code: lemma StarOrderedRing.nonneg_iff_spectrum_nonneg (a : A) (ha : p a := by cfc_tac) :
    0 ≤ a ↔ ∀ x ∈ spectrum R a, 0 ≤ x 
goal: 0 ≤ a ↔ ∀ x ∈ spectrum R a, 0 ≤ x

full_name: cfc_nonneg
code: lemma cfc_nonneg {f : R → R} {a : A} (h : ∀ x ∈ spectrum R a, 0 ≤ f x) :
    0 ≤ cfc f a 
goal: 0 ≤ cfc f a

full_name: cfc_nonpos
code: lemma cfc_nonpos (f : R → R) (a : A) (h : ∀ x ∈ spectrum R a, f x ≤ 0) :
    cfc f a ≤ 0 
goal: cfc f a ≤ 0

full_name: cfc_le_algebraMap
code: lemma cfc_le_algebraMap (f : R → R) (r : R) (a : A) (h : ∀ x ∈ spectrum R a, f x ≤ r)
    (hf : ContinuousOn f (spectrum R a) := by cfc_cont_tac) (ha : p a := by cfc_tac) :
    cfc f a ≤ algebraMap R A r 
goal: cfc f a ≤ (algebraMap R A) r

full_name: algebraMap_le_cfc
code: lemma algebraMap_le_cfc (f : R → R) (r : R) (a : A) (h : ∀ x ∈ spectrum R a, r ≤ f x)
    (hf : ContinuousOn f (spectrum R a) := by cfc_cont_tac) (ha : p a := by cfc_tac) :
    algebraMap R A r ≤ cfc f a 
goal: (algebraMap R A) r ≤ cfc f a

full_name: le_algebraMap_of_spectrum_le
code: lemma le_algebraMap_of_spectrum_le {r : R} {a : A} (h : ∀ x ∈ spectrum R a, x ≤ r)
    (ha : p a := by cfc_tac) : a ≤ algebraMap R A r 
goal: a ≤ (algebraMap R A) r

full_name: algebraMap_le_of_le_spectrum
code: lemma algebraMap_le_of_le_spectrum {r : R} {a : A} (h : ∀ x ∈ spectrum R a, r ≤ x)
    (ha : p a := by cfc_tac) : algebraMap R A r ≤ a 
goal: (algebraMap R A) r ≤ a

full_name: cfc_le_one
code: lemma cfc_le_one (f : R → R) (a : A) (h : ∀ x ∈ spectrum R a, f x ≤ 1) : cfc f a ≤ 1 
goal: cfc f a ≤ 1

full_name: one_le_cfc
code: lemma one_le_cfc (f : R → R) (a : A) (h : ∀ x ∈ spectrum R a, 1 ≤ f x)
    (hf : ContinuousOn f (spectrum R a) := by cfc_cont_tac) (ha : p a := by cfc_tac) :
    1 ≤ cfc f a 
goal: 1 ≤ cfc f a

full_name: cfcHom_le_iff
code: lemma cfcHom_le_iff {a : A} (ha : p a) {f g : C(spectrum R a, R)} :
    cfcHom ha f ≤ cfcHom ha g ↔ f ≤ g 
goal: (cfcHom ha) f ≤ (cfcHom ha) g ↔ f ≤ g

full_name: cfc_le_iff
code: lemma cfc_le_iff (f g : R → R) (a : A) (hf : ContinuousOn f (spectrum R a) := by cfc_cont_tac)
    (hg : ContinuousOn g (spectrum R a) := by cfc_cont_tac) (ha : p a := by cfc_tac) :
    cfc f a ≤ cfc g a ↔ ∀ x ∈ spectrum R a, f x ≤ g x 
goal: cfc f a ≤ cfc g a ↔ ∀ x ∈ spectrum R a, f x ≤ g x

full_name: cfc_nonpos_iff
code: lemma cfc_nonpos_iff (f : R → R) (a : A) (hf : ContinuousOn f (spectrum R a) := by cfc_cont_tac)
    (ha : p a := by cfc_tac) : cfc f a ≤ 0 ↔ ∀ x ∈ spectrum R a, f x ≤ 0 
goal: cfc f a ≤ 0 ↔ ∀ x ∈ spectrum R a, f x ≤ 0