l3lab/ntp-mathlib huggingface dataset:
/-- This lemma is used in the proof of `elementalStarAlgebra.isUnit_of_isUnit_of_isStarNormal`,
which in turn is the key to spectral permanence `StarSubalgebra.spectrum_eq`, which is itself
necessary for the continuous functional calculus. Using the continuous functional calculus, this
lemma can be superseded by one that omits the `IsStarNormal` hypothesis. -/
theorem spectrum_star_mul_self_of_isStarNormal :
    spectrum ℂ (star a * a) ⊆ Set.Icc (0 : ℂ) ‖star a * a‖ := by
  -- this instance should be found automatically, but without providing it Lean goes on a wild
  -- goose chase when trying to apply `spectrum.gelfandTransform_eq`.
  --letI := elementalStarAlgebra.Complex.normedAlgebra a
  rcases subsingleton_or_nontrivial A with ⟨⟩
  · simp only [spectrum.of_subsingleton, Set.empty_subset]
  · set a' : elementalStarAlgebra ℂ a := ⟨a, self_mem ℂ a⟩
    refine' (spectrum.subset_starSubalgebra (star a' * a')).trans _
    rw [← spectrum.gelfandTransform_eq (star a' * a'), ContinuousMap.spectrum_eq_range]
    rintro - ⟨φ, rfl⟩
    

Proof state:
case inr.intro
A : Type u_1
inst✝⁶ : NormedRing A
inst✝⁵ : NormedAlgebra ℂ A
inst✝⁴ : StarRing A
inst✝³ : CstarRing A
inst✝² : StarModule ℂ A
inst✝¹ : CompleteSpace A
a : A
inst✝ : IsStarNormal a
S : StarSubalgebra ℂ A
h✝ : Nontrivial A
a' : ↥(elementalStarAlgebra ℂ a) := { val := a, property := (_ : a ∈ elementalStarAlgebra ℂ a) }
φ : ↑(characterSpace ℂ ↥(elementalStarAlgebra ℂ a))
⊢ ((gelfandTransform ℂ ↥(elementalStarAlgebra ℂ a)) (star a' * a')) φ ∈ Set.Icc 0 ↑‖star a * a‖

Next tactic:
rw [gelfandTransform_apply_apply ℂ _ (star a' * a') φ, map_mul φ, map_star φ]
/-- This lemma is used in the proof of `elementalStarAlgebra.isUnit_of_isUnit_of_isStarNormal`,
which in turn is the key to spectral permanence `StarSubalgebra.spectrum_eq`, which is itself
necessary for the continuous functional calculus. Using the continuous functional calculus, this
lemma can be superseded by one that omits the `IsStarNormal` hypothesis. -/
theorem spectrum_star_mul_self_of_isStarNormal :
    spectrum ℂ (star a * a) ⊆ Set.Icc (0 : ℂ) ‖star a * a‖ := by
  -- this instance should be found automatically, but without providing it Lean goes on a wild
  -- goose chase when trying to apply `spectrum.gelfandTransform_eq`.
  --letI := elementalStarAlgebra.Complex.normedAlgebra a
  rcases subsingleton_or_nontrivial A with ⟨⟩
  · simp only [spectrum.of_subsingleton, Set.empty_subset]
  · set a' : elementalStarAlgebra ℂ a := ⟨a, self_mem ℂ a⟩
    refine' (spectrum.subset_starSubalgebra (star a' * a')).trans _
    rw [← spectrum.gelfandTransform_eq (star a' * a'), ContinuousMap.spectrum_eq_range]
    rintro - ⟨φ, rfl⟩
    rw [gelfandTransform_apply_apply ℂ _ (star a' * a') φ, map_mul φ, map_star φ]
    

Proof state:
case inr.intro
A : Type u_1
inst✝⁶ : NormedRing A
inst✝⁵ : NormedAlgebra ℂ A
inst✝⁴ : StarRing A
inst✝³ : CstarRing A
inst✝² : StarModule ℂ A
inst✝¹ : CompleteSpace A
a : A
inst✝ : IsStarNormal a
S : StarSubalgebra ℂ A
h✝ : Nontrivial A
a' : ↥(elementalStarAlgebra ℂ a) := { val := a, property := (_ : a ∈ elementalStarAlgebra ℂ a) }
φ : ↑(characterSpace ℂ ↥(elementalStarAlgebra ℂ a))
⊢ star (φ a') * φ a' ∈ Set.Icc 0 ↑‖star a * a‖

Next tactic:
rw [Complex.eq_coe_norm_of_nonneg (star_mul_self_nonneg _), ← map_star, ← map_mul]
/-- This lemma is used in the proof of `elementalStarAlgebra.isUnit_of_isUnit_of_isStarNormal`,
which in turn is the key to spectral permanence `StarSubalgebra.spectrum_eq`, which is itself
necessary for the continuous functional calculus. Using the continuous functional calculus, this
lemma can be superseded by one that omits the `IsStarNormal` hypothesis. -/
theorem spectrum_star_mul_self_of_isStarNormal :
    spectrum ℂ (star a * a) ⊆ Set.Icc (0 : ℂ) ‖star a * a‖ := by
  -- this instance should be found automatically, but without providing it Lean goes on a wild
  -- goose chase when trying to apply `spectrum.gelfandTransform_eq`.
  --letI := elementalStarAlgebra.Complex.normedAlgebra a
  rcases subsingleton_or_nontrivial A with ⟨⟩
  · simp only [spectrum.of_subsingleton, Set.empty_subset]
  · set a' : elementalStarAlgebra ℂ a := ⟨a, self_mem ℂ a⟩
    refine' (spectrum.subset_starSubalgebra (star a' * a')).trans _
    rw [← spectrum.gelfandTransform_eq (star a' * a'), ContinuousMap.spectrum_eq_range]
    rintro - ⟨φ, rfl⟩
    rw [gelfandTransform_apply_apply ℂ _ (star a' * a') φ, map_mul φ, map_star φ]
    rw [Complex.eq_coe_norm_of_nonneg (star_mul_self_nonneg _), ← map_star, ← map_mul]
    

Proof state:
case inr.intro
A : Type u_1
inst✝⁶ : NormedRing A
inst✝⁵ : NormedAlgebra ℂ A
inst✝⁴ : StarRing A
inst✝³ : CstarRing A
inst✝² : StarModule ℂ A
inst✝¹ : CompleteSpace A
a : A
inst✝ : IsStarNormal a
S : StarSubalgebra ℂ A
h✝ : Nontrivial A
a' : ↥(elementalStarAlgebra ℂ a) := { val := a, property := (_ : a ∈ elementalStarAlgebra ℂ a) }
φ : ↑(characterSpace ℂ ↥(elementalStarAlgebra ℂ a))
⊢ ↑‖φ (star a' * a')‖ ∈ Set.Icc 0 ↑‖star a * a‖

Next tactic:
exact
      ⟨Complex.zero_le_real.2 (norm_nonneg _),
        Complex.real_le_real.2 (AlgHom.norm_apply_le_self φ (star a' * a'))⟩
/-- This is the key lemma on the way to establishing spectral permanence for C⋆-algebras, which is
established in `StarSubalgebra.spectrum_eq`. This lemma is superseded by
`StarSubalgebra.coe_isUnit`, which does not require an `IsStarNormal` hypothesis and holds for
any closed star subalgebra. -/
theorem elementalStarAlgebra.isUnit_of_isUnit_of_isStarNormal (h : IsUnit a) :
    IsUnit (⟨a, self_mem ℂ a⟩ : elementalStarAlgebra ℂ a) := by
  /- Sketch of proof: Because `a` is normal, it suffices to prove that `star a * a` is invertible
    in `elementalStarAlgebra ℂ a`. For this it suffices to prove that it is sufficiently close to a
    unit, namely `algebraMap ℂ _ ‖star a * a‖`, and in this case the required distance is
    `‖star a * a‖`. So one must show `‖star a * a - algebraMap ℂ _ ‖star a * a‖‖ < ‖star a * a‖`.
    Since `star a * a - algebraMap ℂ _ ‖star a * a‖` is selfadjoint, by a corollary of Gelfand's
    formula for the spectral radius (`IsSelfAdjoint.spectralRadius_eq_nnnorm`) its norm is the
    supremum of the norms of elements in its spectrum (we may use the spectrum in `A` here because
    the norm in `A` and the norm in the subalgebra coincide).

    By `spectrum_star_mul_self_of_isStarNormal`, the spectrum (in the algebra `A`) of `star a * a`
    is contained in the interval `[0, ‖star a * a‖]`, and since `a` (and hence `star a * a`) is
    invertible in `A`, we may omit `0` from this interval. Therefore, by basic spectral mapping
    properties, the spectrum (in the algebra `A`) of `star a * a - algebraMap ℂ _ ‖star a * a‖` is
    contained in `[0, ‖star a * a‖)`. The supremum of the (norms of) elements of the spectrum must
    be *strictly* less that `‖star a * a‖` because the spectrum is compact, which completes the
    proof. -/
  /- We may assume `A` is nontrivial. It suffices to show that `star a * a` is invertible in the
    commutative (because `a` is normal) ring `elementalStarAlgebra ℂ a`. Indeed, by commutativity,
    if `star a * a` is invertible, then so is `a`. -/
  

Proof state:
A : Type u_1
inst✝⁶ : NormedRing A
inst✝⁵ : NormedAlgebra ℂ A
inst✝⁴ : StarRing A
inst✝³ : CstarRing A
inst✝² : StarModule ℂ A
inst✝¹ : CompleteSpace A
a : A
inst✝ : IsStarNormal a
S : StarSubalgebra ℂ A
h : IsUnit a
⊢ IsUnit { val := a, property := (_ : a ∈ elementalStarAlgebra ℂ a) }

Next tactic:
nontriviality A
/-- This is the key lemma on the way to establishing spectral permanence for C⋆-algebras, which is
established in `StarSubalgebra.spectrum_eq`. This lemma is superseded by
`StarSubalgebra.coe_isUnit`, which does not require an `IsStarNormal` hypothesis and holds for
any closed star subalgebra. -/
theorem elementalStarAlgebra.isUnit_of_isUnit_of_isStarNormal (h : IsUnit a) :
    IsUnit (⟨a, self_mem ℂ a⟩ : elementalStarAlgebra ℂ a) := by
  /- Sketch of proof: Because `a` is normal, it suffices to prove that `star a * a` is invertible
    in `elementalStarAlgebra ℂ a`. For this it suffices to prove that it is sufficiently close to a
    unit, namely `algebraMap ℂ _ ‖star a * a‖`, and in this case the required distance is
    `‖star a * a‖`. So one must show `‖star a * a - algebraMap ℂ _ ‖star a * a‖‖ < ‖star a * a‖`.
    Since `star a * a - algebraMap ℂ _ ‖star a * a‖` is selfadjoint, by a corollary of Gelfand's
    formula for the spectral radius (`IsSelfAdjoint.spectralRadius_eq_nnnorm`) its norm is the
    supremum of the norms of elements in its spectrum (we may use the spectrum in `A` here because
    the norm in `A` and the norm in the subalgebra coincide).

    By `spectrum_star_mul_self_of_isStarNormal`, the spectrum (in the algebra `A`) of `star a * a`
    is contained in the interval `[0, ‖star a * a‖]`, and since `a` (and hence `star a * a`) is
    invertible in `A`, we may omit `0` from this interval. Therefore, by basic spectral mapping
    properties, the spectrum (in the algebra `A`) of `star a * a - algebraMap ℂ _ ‖star a * a‖` is
    contained in `[0, ‖star a * a‖)`. The supremum of the (norms of) elements of the spectrum must
    be *strictly* less that `‖star a * a‖` because the spectrum is compact, which completes the
    proof. -/
  /- We may assume `A` is nontrivial. It suffices to show that `star a * a` is invertible in the
    commutative (because `a` is normal) ring `elementalStarAlgebra ℂ a`. Indeed, by commutativity,
    if `star a * a` is invertible, then so is `a`. -/
  nontriviality A
  

Proof state:
A : Type u_1
inst✝⁶ : NormedRing A
inst✝⁵ : NormedAlgebra ℂ A
inst✝⁴ : StarRing A
inst✝³ : CstarRing A
inst✝² : StarModule ℂ A
inst✝¹ : CompleteSpace A
a : A
inst✝ : IsStarNormal a
S : StarSubalgebra ℂ A
h : IsUnit a
✝ : Nontrivial A
⊢ IsUnit { val := a, property := (_ : a ∈ elementalStarAlgebra ℂ a) }

Next tactic:
set a' : elementalStarAlgebra ℂ a := ⟨a, self_mem ℂ a⟩
/-- This is the key lemma on the way to establishing spectral permanence for C⋆-algebras, which is
established in `StarSubalgebra.spectrum_eq`. This lemma is superseded by
`StarSubalgebra.coe_isUnit`, which does not require an `IsStarNormal` hypothesis and holds for
any closed star subalgebra. -/
theorem elementalStarAlgebra.isUnit_of_isUnit_of_isStarNormal (h : IsUnit a) :
    IsUnit (⟨a, self_mem ℂ a⟩ : elementalStarAlgebra ℂ a) := by
  /- Sketch of proof: Because `a` is normal, it suffices to prove that `star a * a` is invertible
    in `elementalStarAlgebra ℂ a`. For this it suffices to prove that it is sufficiently close to a
    unit, namely `algebraMap ℂ _ ‖star a * a‖`, and in this case the required distance is
    `‖star a * a‖`. So one must show `‖star a * a - algebraMap ℂ _ ‖star a * a‖‖ < ‖star a * a‖`.
    Since `star a * a - algebraMap ℂ _ ‖star a * a‖` is selfadjoint, by a corollary of Gelfand's
    formula for the spectral radius (`IsSelfAdjoint.spectralRadius_eq_nnnorm`) its norm is the
    supremum of the norms of elements in its spectrum (we may use the spectrum in `A` here because
    the norm in `A` and the norm in the subalgebra coincide).

    By `spectrum_star_mul_self_of_isStarNormal`, the spectrum (in the algebra `A`) of `star a * a`
    is contained in the interval `[0, ‖star a * a‖]`, and since `a` (and hence `star a * a`) is
    invertible in `A`, we may omit `0` from this interval. Therefore, by basic spectral mapping
    properties, the spectrum (in the algebra `A`) of `star a * a - algebraMap ℂ _ ‖star a * a‖` is
    contained in `[0, ‖star a * a‖)`. The supremum of the (norms of) elements of the spectrum must
    be *strictly* less that `‖star a * a‖` because the spectrum is compact, which completes the
    proof. -/
  /- We may assume `A` is nontrivial. It suffices to show that `star a * a` is invertible in the
    commutative (because `a` is normal) ring `elementalStarAlgebra ℂ a`. Indeed, by commutativity,
    if `star a * a` is invertible, then so is `a`. -/
  nontriviality A
  set a' : elementalStarAlgebra ℂ a := ⟨a, self_mem ℂ a⟩
  

Proof state:
A : Type u_1
inst✝⁶ : NormedRing A
inst✝⁵ : NormedAlgebra ℂ A
inst✝⁴ : StarRing A
inst✝³ : CstarRing A
inst✝² : StarModule ℂ A
inst✝¹ : CompleteSpace A
a : A
inst✝ : IsStarNormal a
S : StarSubalgebra ℂ A
h : IsUnit a
✝ : Nontrivial A
a' : ↥(elementalStarAlgebra ℂ a) := { val := a, property := (_ : a ∈ elementalStarAlgebra ℂ a) }
⊢ IsUnit a'

Next tactic:
suffices : IsUnit (star a' * a')
/-- This is the key lemma on the way to establishing spectral permanence for C⋆-algebras, which is
established in `StarSubalgebra.spectrum_eq`. This lemma is superseded by
`StarSubalgebra.coe_isUnit`, which does not require an `IsStarNormal` hypothesis and holds for
any closed star subalgebra. -/
theorem elementalStarAlgebra.isUnit_of_isUnit_of_isStarNormal (h : IsUnit a) :
    IsUnit (⟨a, self_mem ℂ a⟩ : elementalStarAlgebra ℂ a) := by
  /- Sketch of proof: Because `a` is normal, it suffices to prove that `star a * a` is invertible
    in `elementalStarAlgebra ℂ a`. For this it suffices to prove that it is sufficiently close to a
    unit, namely `algebraMap ℂ _ ‖star a * a‖`, and in this case the required distance is
    `‖star a * a‖`. So one must show `‖star a * a - algebraMap ℂ _ ‖star a * a‖‖ < ‖star a * a‖`.
    Since `star a * a - algebraMap ℂ _ ‖star a * a‖` is selfadjoint, by a corollary of Gelfand's
    formula for the spectral radius (`IsSelfAdjoint.spectralRadius_eq_nnnorm`) its norm is the
    supremum of the norms of elements in its spectrum (we may use the spectrum in `A` here because
    the norm in `A` and the norm in the subalgebra coincide).

    By `spectrum_star_mul_self_of_isStarNormal`, the spectrum (in the algebra `A`) of `star a * a`
    is contained in the interval `[0, ‖star a * a‖]`, and since `a` (and hence `star a * a`) is
    invertible in `A`, we may omit `0` from this interval. Therefore, by basic spectral mapping
    properties, the spectrum (in the algebra `A`) of `star a * a - algebraMap ℂ _ ‖star a * a‖` is
    contained in `[0, ‖star a * a‖)`. The supremum of the (norms of) elements of the spectrum must
    be *strictly* less that `‖star a * a‖` because the spectrum is compact, which completes the
    proof. -/
  /- We may assume `A` is nontrivial. It suffices to show that `star a * a` is invertible in the
    commutative (because `a` is normal) ring `elementalStarAlgebra ℂ a`. Indeed, by commutativity,
    if `star a * a` is invertible, then so is `a`. -/
  nontriviality A
  set a' : elementalStarAlgebra ℂ a := ⟨a, self_mem ℂ a⟩
  suffices : IsUnit (star a' * a'); 

Proof state:
A : Type u_1
inst✝⁶ : NormedRing A
inst✝⁵ : NormedAlgebra ℂ A
inst✝⁴ : StarRing A
inst✝³ : CstarRing A
inst✝² : StarModule ℂ A
inst✝¹ : CompleteSpace A
a : A
inst✝ : IsStarNormal a
S : StarSubalgebra ℂ A
h : IsUnit a
✝ : Nontrivial A
a' : ↥(elementalStarAlgebra ℂ a) := { val := a, property := (_ : a ∈ elementalStarAlgebra ℂ a) }
this : IsUnit (star a' * a')
⊢ IsUnit a'
case this
A : Type u_1
inst✝⁶ : NormedRing A
inst✝⁵ : NormedAlgebra ℂ A
inst✝⁴ : StarRing A
inst✝³ : CstarRing A
inst✝² : StarModule ℂ A
inst✝¹ : CompleteSpace A
a : A
inst✝ : IsStarNormal a
S : StarSubalgebra ℂ A
h : IsUnit a
✝ : Nontrivial A
a' : ↥(elementalStarAlgebra ℂ a) := { val := a, property := (_ : a ∈ elementalStarAlgebra ℂ a) }
⊢ IsUnit (star a' * a')

Next tactic:
exact (IsUnit.mul_iff.1 this).2
/-- This is the key lemma on the way to establishing spectral permanence for C⋆-algebras, which is
established in `StarSubalgebra.spectrum_eq`. This lemma is superseded by
`StarSubalgebra.coe_isUnit`, which does not require an `IsStarNormal` hypothesis and holds for
any closed star subalgebra. -/
theorem elementalStarAlgebra.isUnit_of_isUnit_of_isStarNormal (h : IsUnit a) :
    IsUnit (⟨a, self_mem ℂ a⟩ : elementalStarAlgebra ℂ a) := by
  /- Sketch of proof: Because `a` is normal, it suffices to prove that `star a * a` is invertible
    in `elementalStarAlgebra ℂ a`. For this it suffices to prove that it is sufficiently close to a
    unit, namely `algebraMap ℂ _ ‖star a * a‖`, and in this case the required distance is
    `‖star a * a‖`. So one must show `‖star a * a - algebraMap ℂ _ ‖star a * a‖‖ < ‖star a * a‖`.
    Since `star a * a - algebraMap ℂ _ ‖star a * a‖` is selfadjoint, by a corollary of Gelfand's
    formula for the spectral radius (`IsSelfAdjoint.spectralRadius_eq_nnnorm`) its norm is the
    supremum of the norms of elements in its spectrum (we may use the spectrum in `A` here because
    the norm in `A` and the norm in the subalgebra coincide).

    By `spectrum_star_mul_self_of_isStarNormal`, the spectrum (in the algebra `A`) of `star a * a`
    is contained in the interval `[0, ‖star a * a‖]`, and since `a` (and hence `star a * a`) is
    invertible in `A`, we may omit `0` from this interval. Therefore, by basic spectral mapping
    properties, the spectrum (in the algebra `A`) of `star a * a - algebraMap ℂ _ ‖star a * a‖` is
    contained in `[0, ‖star a * a‖)`. The supremum of the (norms of) elements of the spectrum must
    be *strictly* less that `‖star a * a‖` because the spectrum is compact, which completes the
    proof. -/
  /- We may assume `A` is nontrivial. It suffices to show that `star a * a` is invertible in the
    commutative (because `a` is normal) ring `elementalStarAlgebra ℂ a`. Indeed, by commutativity,
    if `star a * a` is invertible, then so is `a`. -/
  nontriviality A
  set a' : elementalStarAlgebra ℂ a := ⟨a, self_mem ℂ a⟩
  suffices : IsUnit (star a' * a'); exact (IsUnit.mul_iff.1 this).2
  

Proof state:
case this
A : Type u_1
inst✝⁶ : NormedRing A
inst✝⁵ : NormedAlgebra ℂ A
inst✝⁴ : StarRing A
inst✝³ : CstarRing A
inst✝² : StarModule ℂ A
inst✝¹ : CompleteSpace A
a : A
inst✝ : IsStarNormal a
S : StarSubalgebra ℂ A
h : IsUnit a
✝ : Nontrivial A
a' : ↥(elementalStarAlgebra ℂ a) := { val := a, property := (_ : a ∈ elementalStarAlgebra ℂ a) }
⊢ IsUnit (star a' * a')

Next tactic:
replace h := (show Commute (star a) a from star_comm_self' a).isUnit_mul_iff.2 ⟨h.star, h⟩
/-- This is the key lemma on the way to establishing spectral permanence for C⋆-algebras, which is
established in `StarSubalgebra.spectrum_eq`. This lemma is superseded by
`StarSubalgebra.coe_isUnit`, which does not require an `IsStarNormal` hypothesis and holds for
any closed star subalgebra. -/
theorem elementalStarAlgebra.isUnit_of_isUnit_of_isStarNormal (h : IsUnit a) :
    IsUnit (⟨a, self_mem ℂ a⟩ : elementalStarAlgebra ℂ a) := by
  /- Sketch of proof: Because `a` is normal, it suffices to prove that `star a * a` is invertible
    in `elementalStarAlgebra ℂ a`. For this it suffices to prove that it is sufficiently close to a
    unit, namely `algebraMap ℂ _ ‖star a * a‖`, and in this case the required distance is
    `‖star a * a‖`. So one must show `‖star a * a - algebraMap ℂ _ ‖star a * a‖‖ < ‖star a * a‖`.
    Since `star a * a - algebraMap ℂ _ ‖star a * a‖` is selfadjoint, by a corollary of Gelfand's
    formula for the spectral radius (`IsSelfAdjoint.spectralRadius_eq_nnnorm`) its norm is the
    supremum of the norms of elements in its spectrum (we may use the spectrum in `A` here because
    the norm in `A` and the norm in the subalgebra coincide).

    By `spectrum_star_mul_self_of_isStarNormal`, the spectrum (in the algebra `A`) of `star a * a`
    is contained in the interval `[0, ‖star a * a‖]`, and since `a` (and hence `star a * a`) is
    invertible in `A`, we may omit `0` from this interval. Therefore, by basic spectral mapping
    properties, the spectrum (in the algebra `A`) of `star a * a - algebraMap ℂ _ ‖star a * a‖` is
    contained in `[0, ‖star a * a‖)`. The supremum of the (norms of) elements of the spectrum must
    be *strictly* less that `‖star a * a‖` because the spectrum is compact, which completes the
    proof. -/
  /- We may assume `A` is nontrivial. It suffices to show that `star a * a` is invertible in the
    commutative (because `a` is normal) ring `elementalStarAlgebra ℂ a`. Indeed, by commutativity,
    if `star a * a` is invertible, then so is `a`. -/
  nontriviality A
  set a' : elementalStarAlgebra ℂ a := ⟨a, self_mem ℂ a⟩
  suffices : IsUnit (star a' * a'); exact (IsUnit.mul_iff.1 this).2
  replace h := (show Commute (star a) a from star_comm_self' a).isUnit_mul_iff.2 ⟨h.star, h⟩
  /- Since `a` is invertible, `‖star a * a‖ ≠ 0`, so `‖star a * a‖ • 1` is invertible in
    `elementalStarAlgebra ℂ a`, and so it suffices to show that the distance between this unit and
    `star a * a` is less than `‖star a * a‖`. -/
  

Proof state:
case this
A : Type u_1
inst✝⁶ : NormedRing A
inst✝⁵ : NormedAlgebra ℂ A
inst✝⁴ : StarRing A
inst✝³ : CstarRing A
inst✝² : StarModule ℂ A
inst✝¹ : CompleteSpace A
a : A
inst✝ : IsStarNormal a
S : StarSubalgebra ℂ A
✝ : Nontrivial A
a' : ↥(elementalStarAlgebra ℂ a) := { val := a, property := (_ : a ∈ elementalStarAlgebra ℂ a) }
h : IsUnit (star a * a)
⊢ IsUnit (star a' * a')

Next tactic:
have h₁ : (‖star a * a‖ : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr (norm_ne_zero_iff.mpr h.ne_zero)
/-- This is the key lemma on the way to establishing spectral permanence for C⋆-algebras, which is
established in `StarSubalgebra.spectrum_eq`. This lemma is superseded by
`StarSubalgebra.coe_isUnit`, which does not require an `IsStarNormal` hypothesis and holds for
any closed star subalgebra. -/
theorem elementalStarAlgebra.isUnit_of_isUnit_of_isStarNormal (h : IsUnit a) :
    IsUnit (⟨a, self_mem ℂ a⟩ : elementalStarAlgebra ℂ a) := by
  /- Sketch of proof: Because `a` is normal, it suffices to prove that `star a * a` is invertible
    in `elementalStarAlgebra ℂ a`. For this it suffices to prove that it is sufficiently close to a
    unit, namely `algebraMap ℂ _ ‖star a * a‖`, and in this case the required distance is
    `‖star a * a‖`. So one must show `‖star a * a - algebraMap ℂ _ ‖star a * a‖‖ < ‖star a * a‖`.
    Since `star a * a - algebraMap ℂ _ ‖star a * a‖` is selfadjoint, by a corollary of Gelfand's
    formula for the spectral radius (`IsSelfAdjoint.spectralRadius_eq_nnnorm`) its norm is the
    supremum of the norms of elements in its spectrum (we may use the spectrum in `A` here because
    the norm in `A` and the norm in the subalgebra coincide).

    By `spectrum_star_mul_self_of_isStarNormal`, the spectrum (in the algebra `A`) of `star a * a`
    is contained in the interval `[0, ‖star a * a‖]`, and since `a` (and hence `star a * a`) is
    invertible in `A`, we may omit `0` from this interval. Therefore, by basic spectral mapping
    properties, the spectrum (in the algebra `A`) of `star a * a - algebraMap ℂ _ ‖star a * a‖` is
    contained in `[0, ‖star a * a‖)`. The supremum of the (norms of) elements of the spectrum must
    be *strictly* less that `‖star a * a‖` because the spectrum is compact, which completes the
    proof. -/
  /- We may assume `A` is nontrivial. It suffices to show that `star a * a` is invertible in the
    commutative (because `a` is normal) ring `elementalStarAlgebra ℂ a`. Indeed, by commutativity,
    if `star a * a` is invertible, then so is `a`. -/
  nontriviality A
  set a' : elementalStarAlgebra ℂ a := ⟨a, self_mem ℂ a⟩
  suffices : IsUnit (star a' * a'); exact (IsUnit.mul_iff.1 this).2
  replace h := (show Commute (star a) a from star_comm_self' a).isUnit_mul_iff.2 ⟨h.star, h⟩
  /- Since `a` is invertible, `‖star a * a‖ ≠ 0`, so `‖star a * a‖ • 1` is invertible in
    `elementalStarAlgebra ℂ a`, and so it suffices to show that the distance between this unit and
    `star a * a` is less than `‖star a * a‖`. -/
  have h₁ : (‖star a * a‖ : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr (norm_ne_zero_iff.mpr h.ne_zero)
  

Proof state:
case this
A : Type u_1
inst✝⁶ : NormedRing A
inst✝⁵ : NormedAlgebra ℂ A
inst✝⁴ : StarRing A
inst✝³ : CstarRing A
inst✝² : StarModule ℂ A
inst✝¹ : CompleteSpace A
a : A
inst✝ : IsStarNormal a
S : StarSubalgebra ℂ A
✝ : Nontrivial A
a' : ↥(elementalStarAlgebra ℂ a) := { val := a, property := (_ : a ∈ elementalStarAlgebra ℂ a) }
h : IsUnit (star a * a)
h₁ : ↑‖star a * a‖ ≠ 0
⊢ IsUnit (star a' * a')

Next tactic:
set u : Units (elementalStarAlgebra ℂ a) :=
    Units.map (algebraMap ℂ (elementalStarAlgebra ℂ a)).toMonoidHom (Units.mk0 _ h₁)