/-- 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)
  set u : Units (elementalStarAlgebra ℂ a) :=
    Units.map (algebraMap ℂ (elementalStarAlgebra ℂ a)).toMonoidHom (Units.mk0 _ h₁)
  refine' ⟨u.ofNearby _ _, rfl⟩
  simp only [Units.coe_map, Units.val_inv_eq_inv_val, RingHom.toMonoidHom_eq_coe, Units.val_mk0,
    Units.coe_map_inv, MonoidHom.coe_coe, norm_algebraMap', norm_inv, Complex.norm_eq_abs,
    Complex.abs_ofReal, abs_norm, inv_inv]
    --RingHom.coe_monoidHom,
    -- Complex.abs_ofReal, map_inv₀,
  --rw [norm_algebraMap', inv_inv, Complex.norm_eq_abs, abs_norm]I-
  /- Since `a` is invertible, by `spectrum_star_mul_self_of_isStarNormal`, the spectrum (in `A`)
    of `star a * a` is contained in the half-open interval `(0, ‖star a * a‖]`. Therefore, by basic
    spectral mapping properties, the spectrum of `‖star a * a‖ • 1 - star a * a` is contained in
    `[0, ‖star a * a‖)`. -/
  have h₂ : ∀ z ∈ spectrum ℂ (algebraMap ℂ A ‖star a * a‖ - star a * a), ‖z‖₊ < ‖star a * a‖₊ := by
    intro z hz
    rw [← spectrum.singleton_sub_eq, Set.singleton_sub] at hz
    have h₃ : z ∈ Set.Icc (0 : ℂ) ‖star a * a‖ := by
      replace hz := Set.image_subset _ (spectrum_star_mul_self_of_isStarNormal a) hz
      rwa [Set.image_const_sub_Icc, sub_self, sub_zero] at hz
    refine' lt_of_le_of_ne (Complex.real_le_real.1 <| Complex.eq_coe_norm_of_nonneg h₃.1 ▸ h₃.2) _
    · intro hz'
      replace hz' := congr_arg (fun x : ℝ≥0 => ((x : ℝ) : ℂ)) hz'
      simp only [coe_nnnorm] at hz'
      rw [← Complex.eq_coe_norm_of_nonneg h₃.1] at hz'
      obtain ⟨w, hw₁, hw₂⟩ := hz
      refine' (spectrum.zero_not_mem_iff ℂ).mpr h _
      rw [hz', sub_eq_self] at hw₂
      rwa [hw₂] at hw₁
  /- The norm of `‖star a * a‖ • 1 - star a * a` in the subalgebra and in `A` coincide. In `A`,
    because this element is selfadjoint, by `IsSelfAdjoint.spectralRadius_eq_nnnorm`, its norm is
    the supremum of the norms of the elements of the spectrum, which is strictly less than
    `‖star a * a‖` by `h₂` and because the spectrum is compact. -/
  exact ENNReal.coe_lt_coe.1
    (calc
      (‖star a' * a' - algebraMap ℂ _ ‖star a * a‖‖₊ : ℝ≥0∞) =
          ‖algebraMap ℂ A ‖star a * a‖ - star a * a‖₊ :=
        by rw [← nnnorm_neg, neg_sub]; rfl
      _ = spectralRadius ℂ (algebraMap ℂ A ‖star a * a‖ - star a * a) := by
        refine' (IsSelfAdjoint.spectralRadius_eq_nnnorm _).symm
        

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
✝ : Nontrivial A
a' : ↥(elementalStarAlgebra ℂ a) := { val := a, property := (_ : a ∈ elementalStarAlgebra ℂ a) }
h : IsUnit (star a * a)
h₁ : ↑‖star a * a‖ ≠ 0
u : (↥(elementalStarAlgebra ℂ a))ˣ :=
  (Units.map ↑(algebraMap ℂ ↥(elementalStarAlgebra ℂ a))) (Units.mk0 (↑‖star a * a‖) h₁)
h₂ : ∀ z ∈ spectrum ℂ ((algebraMap ℂ A) ↑‖star a * a‖ - star a * a), ‖z‖₊ < ‖star a * a‖₊
⊢ IsSelfAdjoint ((algebraMap ℂ A) ↑‖star a * a‖ - star a * a)

Next tactic:
rw [IsSelfAdjoint, star_sub, star_mul, star_star, ← algebraMap_star_comm]