Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Lean/Mathlib/Mathlib/Analysis/Normed/Algebra/     Datei vom 15.10.2026 mit Größe 39 kB image not shown  

Quelle  Spectrum.lean   Sprache: Lean

 

/-
Copyright (c) 2021 Jireh Loreaux. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jireh Loreaux
-/

module

public import Mathlib.Analysis.Normed.Algebra.Exponential
public import Mathlib.Analysis.Normed.Algebra.UnitizationL1
public import Mathlib.Analysis.Real.Spectrum
public import Mathlib.FieldTheory.IsAlgClosed.Spectrum
public import Mathlib.Topology.Algebra.Module.Spaces.CharacterSpace

import Mathlib.Analysis.Normed.Ring.Units
import Mathlib.Analysis.SpecialFunctions.Pow.Continuity
import Mathlib.Topology.Semicontinuity.Hemicontinuity

/-!
# The spectrum of elements in a complete normed algebra

This file contains the basic theory for the resolvent and spectrum of a Banach algebra.
Theorems specific to *complex* Banach algebras, such as *Gelfand's formula* can be found in
`Mathlib/Analysis/Normed/Algebra/GelfandFormula.lean`.

## Main definitions

* `spectralRadius : ℝ≥0∞`: supremum of `‖k‖₊` for all `k ∈ quasispectrum �� a`

## Main statements

* `spectrum.isOpen_resolventSet`: the resolvent set is open.
* `spectrum.isClosed`/`quasispectrum.isClosed`: the (quasi)spectrum is closed.
* `spectrum.subset_closedBall_norm`: the spectrum is a subset of closed disk of radius
  equal to the norm.
* `spectrum.isCompact`/`quasispectrum.isCompact`: the (quasi)spectrum is compact.
* `spectralRadius_le_nnNorm`: the spectral radius is bounded above by the norm.

## Implementation notes

`spectralRadius` is defined via `quasispectrum` rather than `spectrum` so that it makes sense for
non-unital normed rings too. When `A` is unital, `quasispectrum �� a = spectrum �� a ∪ {0}`
(`quasispectrum_eq_spectrum_union_zero`), and since `0` never increases the supremum defining
`spectralRadius`, `spectralRadius_eq_of_unital` shows this agrees with the supremum over
`spectrum �� a` alone. In general, we prove results for unital algebras and then transfer them to
the non-unital setting by considering the unital Banach algebra `WithLp 1 (Unitization �� A)`.

Currently, the elementary results in this file (those that work for `NormedField ��`) assume
`CompleteSpace A`, and for the non-unital material, `CompleteSpace ��`. And in the unital case,
the results without `NormOneClass A` involve an unsightly `‖1‖` appearing in various places.
It is possible to remove the occurrences of `‖1‖`, `NormOneClass A`, and to replace
`CompleteSpace A` with `HasSummableGeomSeries A` (and remove `CompleteSpace ��` in the
non-unital case), but it is currently partially blocked for reasons we shall now describe.
To make the substitutions, we need an instance of
`HasSummableGeomSeries (WithLp 1 (Unitization �� A))` under the assumption `HasSummableGeomSeries A`
where `A` is a (possibly non-unital) normed algebra over a normed field `��`. If `A` is already
unital, then it is already possible to write this instance, but if `A` is non-unital, then we cannot
express `HasSummableGeomSeries A` because this is currently restricted to `NormedRing`s, in part
because we have no `Pow ℕ+ A` instance for semigroups, making the necessary statement unpleasant to
express and work with.
-/


@[expose] public section

assert_not_exists ProbabilityTheory.cond
assert_not_exists HasFDerivAt

open NormedSpace Topology -- For `NormedSpace.exp`.
open scoped ENNReal NNReal

/-- The *spectral radius* is the supremum of the `nnNorm` (`‖·‖₊`) of elements in the
quasispectrum, coerced into an element of `ℝ≥0∞`.

It is also possible that `quasispectrum �� a` be unbounded (though not for Banach
algebras, see `spectrum.isBounded`/`quasispectrum.isBounded`, below). In this case,
`spectralRadius a = ∞`.

When `A` is unital, `spectrum` and `quasispectrum` differ only by the inclusion of `0` which does
not affect the spectral radius, so in the unital case, one may take the spectral radius to be the
supremum over the spectrum instead of the quasispectrum (see `spectralRadius_eq_of_unital`). -/

@[wikidata Q249748]
noncomputable def spectralRadius (�� : Type*) {A : Type*}
    [NormedField ��] [NonUnitalRing A] [Module �� A]
    (a : A) : ℝ≥0∞ :=
  ⨆ k ∈ quasispectrum �� a, (‖k‖₊ : ℝ≥0∞)

variable {�� : Type*} {A : Type*}

@[simp]
theorem Unitization.spectralRadius_inr [NormedField ��] [NonUnitalRing A]
    [Module �� A] [IsScalarTower �� A A] [SMulCommClass �� A A] (a : A) :
    spectralRadius �� (a : Unitization �� A) = spectralRadius �� a := by
  simp [spectralRadius, quasispectrum_eq_spectrum_union_zero, ← quasispectrum_eq_spectrum_inr']

namespace spectrum

section SpectrumCompact

open Filter

variable [NormedField ��]

local notation "σ" => spectrum ��
local notation "σₙ" => quasispectrum ��
local notation "ρ" => resolventSet ��
local notation "↑ₐ" => algebraMap �� A

section Algebra

section NonUnital

variable [NonUnitalRing A] [Module �� A]

@[simp]
theorem SpectralRadius.of_subsingleton [Subsingleton A] (a : A) :
    spectralRadius �� a = 0 := by
  simp [spectralRadius]

@[simp]
theorem spectralRadius_zero : spectralRadius �� (0 : A) = 0 := by
  simp [spectralRadius]

end NonUnital

section Unital

variable [Ring A] [Algebra �� A]

lemma _root_.spectralRadius_eq_of_unital (a : A) :
    spectralRadius �� a = ⨆ k ∈ spectrum �� a, (‖k‖₊ : ℝ≥0∞) := by
  simp [spectralRadius, quasispectrum_eq_spectrum_union_zero, iSup_or, iSup_sup_eq]

@[simp]
theorem spectralRadius_one [Nontrivial A] :
    spectralRadius �� (1 : A) = 1 := by
  simp [spectralRadius_eq_of_unital]

theorem mem_resolventSet_of_spectralRadius_lt {a : A} {k : ��}
    (h : spectralRadius �� a < ‖k‖₊) : k ∈ ρ a := by
  rw [spectralRadius_eq_of_unital] at h
  contrapose! h
  grw [← le_iSup₂ k h]

lemma spectralRadius_pow_le (a : A) (n : ℕ) (hn : n ≠ 0) :
    (spectralRadius �� a) ^ n ≤ spectralRadius �� (a ^ n) := by
  simp only [spectralRadius_eq_of_unital, ENNReal.iSup₂_pow_of_ne_zero _ hn]
  refine iSup₂_le fun x hx ↦ ?_
  apply le_iSup₂_of_le (x ^ n) (spectrum.pow_mem_pow a n hx)
  simp

lemma spectralRadius_pow_le' [Nontrivial A] (a : A) (n : ℕ) :
    (spectralRadius �� a) ^ n ≤ spectralRadius �� (a ^ n) := by
  cases n
  · simp
  · exact spectralRadius_pow_le a _ (by simp)

end Unital

end Algebra

section Unital

variable [NormedRing A] [NormedAlgebra �� A] [CompleteSpace A]

theorem isOpen_resolventSet (a : A) : IsOpen (ρ a) :=
  Units.isOpen.preimage (by fun_prop)

@[simp]
protected theorem isClosed (a : A) : IsClosed (σ a) :=
  (isOpen_resolventSet a).isClosed_compl

theorem mem_resolventSet_of_norm_lt_mul {a : A} {k : ��} (h : ‖a‖ * ‖(1 : A)‖ < ‖k‖) : k ∈ ρ a := by
  rw [resolventSet, Set.mem_ofPred_eq, Algebra.algebraMap_eq_smul_one]
  nontriviality A
  have hk : k ≠ 0 :=
    ne_zero_of_norm_ne_zero ((mul_nonneg (norm_nonneg _) (norm_nonneg _)).trans_lt h).ne'
  let ku := Units.map ↑ₐ.toMonoidHom (Units.mk0 k hk)
  rw [← inv_inv ‖(1 : A)‖,
    mul_inv_lt_iff₀' (inv_pos.2 <| norm_pos_iff.2 (one_ne_zero : (1 : A) ≠ 0))] at h
  have hku : ‖-a‖ < ‖(↑ku⁻¹ : A)‖⁻¹ := by simpa [ku, norm_algebraMap] using h
  simpa [ku, sub_eq_add_neg, Algebra.algebraMap_eq_smul_one] using (ku.add (-a) hku).isUnit

theorem mem_resolventSet_of_norm_lt [NormOneClass A] {a : A} {k : ��} (h : ‖a‖ < ‖k‖) : k ∈ ρ a :=
  mem_resolventSet_of_norm_lt_mul (by rwa [norm_one, mul_one])

theorem norm_le_norm_mul_of_mem {a : A} {k : ��} (hk : k ∈ σ a) : ‖k‖ ≤ ‖a‖ * ‖(1 : A)‖ :=
  le_of_not_gt <| mt mem_resolventSet_of_norm_lt_mul hk

theorem norm_le_norm_of_mem [NormOneClass A] {a : A} {k : ��} (hk : k ∈ σ a) : ‖k‖ ≤ ‖a‖ :=
  le_of_not_gt <| mt mem_resolventSet_of_norm_lt hk

theorem subset_closedBall_norm_mul (a : A) : σ a ⊆ Metric.closedBall (0 : ��) (‖a‖ * ‖(1 : A)‖) :=
  fun k hk => by simp [norm_le_norm_mul_of_mem hk]

theorem subset_closedBall_norm [NormOneClass A] (a : A) : σ a ⊆ Metric.closedBall (0 : ��) ‖a‖ :=
  fun k hk => by simp [norm_le_norm_of_mem hk]

@[simp]
theorem isBounded (a : A) : Bornology.IsBounded (σ a) :=
  Metric.isBounded_closedBall.subset (subset_closedBall_norm_mul a)

@[simp]
protected theorem isCompact [ProperSpace ��] (a : A) : IsCompact (σ a) :=
  Metric.isCompact_of_isClosed_isBounded (spectrum.isClosed a) (isBounded a)

grind_pattern spectrum.isCompact => IsCompact (spectrum �� a)

instance instCompactSpace [ProperSpace ��] (a : A) : CompactSpace (spectrum �� a) :=
  isCompact_iff_compactSpace.mp <| spectrum.isCompact a

instance instCompactSpaceNNReal {A : Type*} [NormedRing A] [NormedAlgebra ℝ A]
    (a : A) [CompactSpace (spectrum ℝ a)] : CompactSpace (spectrum ℝ≥0 a) := by
  rw [← isCompact_iff_compactSpace] at *
  rw [← preimage_algebraMap ℝ]
  exact isClosed_nonneg.isClosedEmbedding_subtypeVal.isCompact_preimage <| by assumption

@[simp]
theorem isCompact_nnreal {A : Type*} [NormedRing A] [NormedAlgebra ℝ A]
    (a : A) [CompactSpace (spectrum ℝ a)] : IsCompact (spectrum ℝ≥0 a) := by
  rw [isCompact_iff_compactSpace]
  infer_instance

grind_pattern isCompact_nnreal => IsCompact (spectrum ℝ≥0 a)

theorem exists_nnNorm_eq_spectralRadius_of_nonempty [ProperSpace ��] {a : A}
    (ha : (spectrum �� a).Nonempty) :
    ∃ k ∈ spectrum �� a, (‖k‖₊ : ℝ≥0∞) = spectralRadius �� a := by
  obtain ⟨k, hk, h⟩ := (spectrum.isCompact a).exists_isMaxOn ha continuous_nnNorm.continuousOn
  rw [spectralRadius_eq_of_unital]
  exact ⟨k, hk, le_antisymm (by grw [← le_iSup₂ k hk]) (iSup₂_le <| mod_cast h)⟩

@[deprecated (since := "2026-10-31")]
alias exists_nnnorm_eq_spectralRadius_of_nonempty := exists_nnNorm_eq_spectralRadius_of_nonempty

theorem spectralRadius_lt_of_forall_lt_of_nonempty [ProperSpace ��] {a : A} {r : ℝ≥0}
    (ha : (spectrum �� a).Nonempty) (hr : ∀ k ∈ spectrum �� a, ‖k‖₊ < r) :
    spectralRadius �� a < r := by
  rw [spectralRadius_eq_of_unital]
  exact sSup_image.symm.trans_lt <| ((spectrum.isCompact a).sSup_lt_iff_of_continuous ha
    continuous_eNorm.continuousOn (r : ℝ≥0∞)).mpr (by simpa using hr)

end Unital

section NNReal

open NNReal

variable {A : Type*} [NormedRing A] [NormedAlgebra ℝ A] [CompleteSpace A] [NormOneClass A]

theorem le_nnNorm_of_mem {a : A} {r : ℝ≥0} (hr : r ∈ spectrum ℝ≥0 a) :
    r ≤ ‖a‖₊ := calc
  r ≤ ‖(r : ℝ)‖ := Real.le_norm_self _
  _ ≤ ‖a‖ := norm_le_norm_of_mem hr

@[deprecated (since := "2026-10-31")] alias le_nnnorm_of_mem := le_nnNorm_of_mem

theorem coe_le_norm_of_mem {a : A} {r : ℝ≥0} (hr : r ∈ spectrum ℝ≥0 a) :
    r ≤ ‖a‖ :=
  coe_mono <| le_nnNorm_of_mem hr

end NNReal

section Unital

variable [NormedRing A] [NormedAlgebra �� A] [CompleteSpace A]

open ENNReal Polynomial

variable (��)

theorem spectralRadius_le_pow_nnNorm_pow_one_div (a : A) (n : ℕ) :
    spectralRadius �� a ≤ (‖a ^ (n + 1)‖₊ : ℝ≥0∞) ^ (1 / (n + 1) : ℝ) *
      (‖(1 : A)‖₊ : ℝ≥0∞) ^ (1 / (n + 1) : ℝ) := by
  rw [spectralRadius_eq_of_unital]
  refine iSup₂_le fun k hk => ?_
  -- apply easy direction of the spectral mapping theorem for polynomials
  have pow_mem : k ^ (n + 1) ∈ σ (a ^ (n + 1)) := by
    simpa only [one_mul, Algebra.algebraMap_eq_smul_one, one_smul, aeval_monomial, one_mul,
      eval_monomial] using subset_polynomial_aeval a (@monomial �� _ (n + 1) (1 : ��)) ⟨k, hk, rfl⟩
  -- power of the norm is bounded by norm of the power
  have nnNorm_pow_le : (↑(‖k‖₊ ^ (n + 1)) : ℝ≥0∞) ≤ ‖a ^ (n + 1)‖₊ * ‖(1 : A)‖₊ := by
    simpa only [Real.toNNReal_mul (norm_nonneg _), norm_toNNReal, nnNorm_pow k (n + 1),
      ENNReal.coe_mul] using coe_mono (Real.toNNReal_mono (norm_le_norm_mul_of_mem pow_mem))
  -- take (n + 1)ᵗʰ roots and clean up the left-hand side
  have hn : 0 < ((n + 1 : ℕ) : ℝ) := mod_cast Nat.succ_pos'
  convert monotone_rpow_of_nonneg (one_div_pos.mpr hn).le nnNorm_pow_le
  all_goals dsimp
  · rw [one_div, pow_rpow_inv_natCast]
    positivity
  rw [Nat.cast_succ, ENNReal.coe_mul_rpow]

@[deprecated (since := "2026-10-31")]
alias spectralRadius_le_pow_nnnorm_pow_one_div := spectralRadius_le_pow_nnNorm_pow_one_div

theorem spectralRadius_le_liminf_pow_nnNorm_pow_one_div (a : A) :
    spectralRadius �� a ≤ atTop.liminf fun n : ℕ => (‖a ^ n‖₊ : ℝ≥0∞) ^ (1 / n : ℝ) := by
  refine ENNReal.le_of_forall_lt_one_mul_le fun ε hε => ?_
  by_cases h : ε = 0
  · simp [h]
  simp only [ENNReal.mul_le_iff_le_inv h (hε.trans_le le_top).ne, mul_comm ε⁻¹,
    liminf_eq_iSup_iInf_of_nat', ENNReal.iSup_mul]
  conv_rhs => arg 1; intro i; rw [ENNReal.iInf_mul (by simp [h])]
  rw [← ENNReal.inv_lt_inv, inv_one] at hε
  obtain ⟨N, hN⟩ := eventually_atTop.mp
    (ENNReal.eventually_pow_one_div_le (ENNReal.coe_ne_top : ↑‖(1 : A)‖₊ ≠ ∞) hε)
  refine le_trans ?_ (le_iSup _ (N + 1))
  refine le_iInf fun n => ?_
  simp only [← add_assoc]
  refine (spectralRadius_le_pow_nnNorm_pow_one_div �� a (n + N)).trans ?_
  norm_cast
  grw [hN (n + N + 1) (by lia)]

@[deprecated (since := "2026-10-31")]
alias spectralRadius_le_liminf_pow_nnnorm_pow_one_div :=
  spectralRadius_le_liminf_pow_nnNorm_pow_one_div

end Unital

end SpectrumCompact

section resolvent

open Filter Asymptotics Bornology

open scoped Topology

variable [NontriviallyNormedField ��] [NormedRing A] [NormedAlgebra �� A] [CompleteSpace A]

local notation "ρ" => resolventSet ��
local notation "↑ₐ" => algebraMap �� A

theorem eventually_isUnit_resolvent (a : A) : ∀ᶠ z in cobounded ��, IsUnit (resolvent a z) := by
  rw [atTop_basis_Ioi.cobounded_of_norm.eventually_iff]
  exact ⟨‖a‖ * ‖(1 : A)‖, trivial, fun _ ↦ isUnit_resolvent.mp ∘ mem_resolventSet_of_norm_lt_mul⟩

theorem resolvent_isBigO_inv (a : A) : resolvent a =O[cobounded ��] Inv.inv :=
  have h : (fun z ↦ resolvent (z⁻¹ • a) (1 : ��)) =O[cobounded ��] (fun _ ↦ (1 : ℝ)) := by
    simpa [Function.comp_def, resolvent] using
      (NormedRing.inverse_one_sub_norm (R := A)).comp_tendsto
        (by simpa using (tendsto_inv₀_cobounded (α := ��)).smul_const a)
  calc
    resolvent a =ᶠ[cobounded ��] fun z ↦ z⁻¹ • resolvent (z⁻¹ • a) (1 : ��) := by
      filter_upwards [isBounded_singleton (x := 0)] with z hz
      lift z to ��ˣ using Ne.isUnit hz
      simpa [Units.smul_def] using congr(z⁻¹ • $(units_smul_resolvent_self (r := z) (a := a)))
    _ =O[cobounded ��] (· ⁻¹) := .of_norm_right <| by
      simpa using (isBigO_refl (· ⁻¹) (cobounded ��)).norm_right.smul h

theorem resolvent_tendsto_cobounded (a : A) : Tendsto (resolvent a) (cobounded ��) (�� 0) :=
  resolvent_isBigO_inv a |>.trans_tendsto tendsto_inv₀_cobounded

end resolvent

section OneSubSMul

open ContinuousMultilinearMap ENNReal FormalMultilinearSeries

open scoped NNReal ENNReal

variable [NontriviallyNormedField ��] [NormedRing A] [NormedAlgebra �� A]

variable (��) in
/-- In a Banach algebra `A` over a nontrivially normed field `��`, for any `a : A` the
power series with coefficients `a ^ n` represents the function `(1 - z • a)⁻¹` in a disk of
radius `‖a‖₊⁻¹`. -/

theorem hasFPowerSeriesOnBall_inverse_one_sub_smul [HasSummableGeomSeries A] (a : A) :
    HasFPowerSeriesOnBall (fun z : �� => Ring.inverse (1 - z • a))
      (fun n => ContinuousMultilinearMap.mkPiRing �� (Fin n) (a ^ n)) 0 ‖a‖₊⁻¹ :=
  { r_le := by
      refine le_of_forall_nnreal_lt fun r hr =>
        le_radius_of_bound_nnreal _ (max 1 ‖(1 : A)‖₊) fun n => ?_
      rw [← norm_toNNReal, norm_mkPiRing, norm_toNNReal]
      rcases n with - | n
      · simp
      · grw [nnNorm_pow_le' a n.succ_pos, ← le_max_left]
        by_cases h : ‖a‖₊ = 0
        · simp [h, pow_succ']
        · rw [← coe_inv h, coe_lt_coe, NNReal.lt_inv_iff_mul_lt h] at hr
          simpa only [← mul_pow, mul_comm] using! pow_le_one' hr.le n.succ
    r_pos := ENNReal.inv_pos.mpr coe_ne_top
    hasSum := fun {y} hy => by
      have norm_lt : ‖y • a‖ < 1 := by
        by_cases h : ‖a‖₊ = 0
        · simp only [nnNorm_eq_zero.mp h, norm_zero, zero_lt_one, smul_zero]
        · have nnNorm_lt : ‖y‖₊ < ‖a‖₊⁻¹ := by
            simpa only [← coe_inv h, mem_ball_zero_iff, Metric.eball_coe] using! hy
          rwa [← coe_nnNorm, ← Real.lt_toNNReal_iff_coe_lt, Real.toNNReal_one, nnNorm_smul,
            ← NNReal.lt_inv_iff_mul_lt h]
      simpa [← smul_pow, (summable_geometric_of_norm_lt_one norm_lt).hasSum_iff] using!
        (NormedRing.inverse_one_sub _ norm_lt).symm }

theorem isUnit_one_sub_smul_of_lt_inv_radius {a : A} {z : ��} (h : ↑‖z‖₊ < (spectralRadius �� a)⁻¹) :
    IsUnit (1 - z • a) := by
  by_cases hz : z = 0
  · simp only [hz, isUnit_one, sub_zero, zero_smul]
  · let u := Units.mk0 z hz
    suffices hu : IsUnit (u⁻¹ • (1 : A) - a) by
      rwa [IsUnit.smul_sub_iff_sub_inv_smul, inv_inv u] at hu
    rw [Units.smul_def, ← Algebra.algebraMap_eq_smul_one, ← mem_resolventSet_iff]
    refine mem_resolventSet_of_spectralRadius_lt ?_
    rwa [Units.val_inv_eq_inv_val, nnNorm_inv,
      coe_inv (nnNorm_ne_zero_iff.mpr (Units.val_mk0 hz ▸ hz : (u : ��) ≠ 0)), lt_inv_iff_lt_inv]

end OneSubSMul


section ExpMapping

local notation "↑ₐ" => algebraMap �� A

/-- For `�� = ℝ` or `�� = ℂ`, `exp` maps the spectrum of `a` into the spectrum of `exp a`. -/
theorem exp_mem_exp [RCLike ��] [NormedRing A] [NormedAlgebra �� A] [CompleteSpace A]
    (a : A) {z : ��} (hz : z ∈ spectrum �� a) : exp z ∈ spectrum �� (exp a) := by
  let +nondep : NormedAlgebra ℚ A := .restrictScalars ℚ �� A
  have hexpmul : exp a = exp (a - ↑ₐ z) * ↑ₐ (exp z) := by
    rw [algebraMap_exp_comm z, ← exp_add_of_commute (Algebra.commutes z (a - ↑ₐ z)).symm,
      sub_add_cancel]
  let b := ∑' n : ℕ, ((n + 1).factorial⁻¹ : ��) • (a - ↑ₐ z) ^ n
  have hb : Summable fun n : ℕ => ((n + 1).factorial⁻¹ : ��) • (a - ↑ₐ z) ^ n := by
    refine .of_norm_bounded_eventually (Real.summable_pow_div_factorial ‖a - ↑ₐ z‖) ?_
    filter_upwards [Filter.eventually_cofinite_ne 0] with n hn
    rw [norm_smul, mul_comm, norm_inv, RCLike.norm_natCast, ← div_eq_mul_inv]
    gcongr
    · exact norm_pow_le' _ (pos_iff_ne_zero.mpr hn)
    · exact n.le_succ
  have h₀ : (∑' n : ℕ, ((n + 1).factorial⁻¹ : ��) • (a - ↑ₐ z) ^ (n + 1)) = (a - ↑ₐ z) * b := by
    simpa only [mul_smul_comm, pow_succ'] using hb.tsum_mul_left (a - ↑ₐ z)
  have h₁ : (∑' n : ℕ, ((n + 1).factorial⁻¹ : ��) • (a - ↑ₐ z) ^ (n + 1)) = b * (a - ↑ₐ z) := by
    simpa only [pow_succ, Algebra.smul_mul_assoc] using hb.tsum_mul_right (a - ↑ₐ z)
  have h₃ : exp (a - ↑ₐ z) = 1 + (a - ↑ₐ z) * b := by
    rw [exp_eq_tsum ��]
    convert (expSeries_summable' (�� := ��) (a - ↑ₐ z)).tsum_eq_zero_add
    · simp only [Nat.factorial_zero, Nat.cast_one, inv_one, pow_zero, one_smul]
    · exact h₀.symm
  rw [spectrum.mem_iff, IsUnit.sub_iff, ← one_mul (↑ₐ (exp z)), hexpmul, ← _root_.sub_mul,
    Commute.isUnit_mul_iff (Algebra.commutes (exp z) (exp (a - ↑ₐ z) - 1)).symm,
    sub_eq_iff_eq_add'.mpr h₃, Commute.isUnit_mul_iff (h₀ ▸ h₁ : (a - ↑ₐ z) * b = b * (a - ↑ₐ z))]
  exact not_and_of_not_left _ (not_and_of_not_left _ ((not_iff_not.mpr IsUnit.sub_iff).mp hz))

end ExpMapping

end spectrum

section quasispectrum

variable [NormedField ��] [NonUnitalNormedRing A] [NormedSpace �� A]
variable [IsScalarTower �� A A] [SMulCommClass �� A A]

open WithLp in
private lemma quasispectrum_eq_spectrum_toLp_inr (a : A) :
    quasispectrum �� a = spectrum �� (toLp 1 (a : Unitization �� A)) := by
  simpa [Unitization.quasispectrum_eq_spectrum_inr ��, unitizationAlgEquiv] using
    AlgEquiv.spectrum_eq (WithLp.unitizationAlgEquiv ��).symm (a : Unitization �� A) |>.symm

variable [CompleteSpace ��] [CompleteSpace A]

namespace quasispectrum

omit [CompleteSpace ��] in
@[simp]
theorem isCompact [ProperSpace ��] (a : A) : IsCompact (quasispectrum �� a) := by
  rw [quasispectrum_eq_spectrum_toLp_inr]
  exact spectrum.isCompact _

grind_pattern isCompact => IsCompact (quasispectrum �� a)

instance instCompactSpace [ProperSpace ��] (a : A) :
    CompactSpace (quasispectrum �� a) :=
  isCompact_iff_compactSpace.mp <| isCompact a

instance instCompactSpaceNNReal {A : Type*} [NonUnitalNormedRing A] [NormedSpace ℝ A]
    [IsScalarTower ℝ A A] [SMulCommClass ℝ A A] (a : A) [CompactSpace (quasispectrum ℝ a)] :
    CompactSpace (quasispectrum ℝ≥0 a) := by
  rw [← isCompact_iff_compactSpace] at *
  rw [← preimage_algebraMap ℝ]
  exact isClosed_nonneg.isClosedEmbedding_subtypeVal.isCompact_preimage ‹_›

@[simp]
theorem isCompact_nnreal {A : Type*} [NonUnitalNormedRing A] [NormedSpace ℝ A] [IsScalarTower ℝ A A]
    [SMulCommClass ℝ A A] (a : A) [CompactSpace (quasispectrum ℝ a)] :
    IsCompact (quasispectrum ℝ≥0 a) := by
  rw [isCompact_iff_compactSpace]
  infer_instance

grind_pattern isCompact_nnreal => IsCompact (quasispectrum ℝ≥0 a)

theorem isClosed (a : A) : IsClosed (quasispectrum �� a) := by
  rw [quasispectrum_eq_spectrum_toLp_inr]
  exact spectrum.isClosed _

theorem isBounded (a : A) : Bornology.IsBounded (quasispectrum �� a) := by
  rw [quasispectrum_eq_spectrum_toLp_inr]
  exact spectrum.isBounded _

theorem norm_le_norm_of_mem {a : A} {k : ��} (hk : k ∈ quasispectrum �� a) :
    ‖k‖ ≤ ‖a‖ := by
  rw [quasispectrum_eq_spectrum_toLp_inr] at hk
  simpa [WithLp.unitization_norm_inr a] using spectrum.norm_le_norm_of_mem hk

end quasispectrum

open quasispectrum

theorem spectralRadius_le_nnNorm (a : A) : spectralRadius �� a ≤ ‖a‖₊ :=
  iSup₂_le fun _ => mod_cast norm_le_norm_of_mem

@[deprecated (since := "2026-10-31")] alias spectralRadius_le_nnnorm := spectralRadius_le_nnNorm

@[deprecated (since := "2026-08-13")]
alias spectrum.spectralRadius_le_nnnorm := spectralRadius_le_nnNorm

omit [CompleteSpace ��] in
theorem exists_nnNorm_quasispectrum_eq_spectralRadius [ProperSpace ��] (a : A) :
    ∃ k ∈ quasispectrum �� a, (‖k‖₊ : ℝ≥0∞) = spectralRadius �� a := by
  obtain ⟨k, hk, h⟩ := (isCompact a).exists_isMaxOn (nonempty �� a) continuous_nnNorm.continuousOn
  unfold spectralRadius
  exact ⟨k, hk, le_antisymm (by grw [← le_iSup₂ k hk]) (iSup₂_le <| mod_cast h)⟩

@[deprecated (since := "2026-10-31")]
alias exists_nnnorm_quasispectrum_eq_spectralRadius := exists_nnNorm_quasispectrum_eq_spectralRadius

omit [CompleteSpace ��] in
theorem spectralRadius_lt_of_forall_quasispectrum_lt [ProperSpace ��] {a : A} {r : ℝ≥0}
    (hr : ∀ k ∈ quasispectrum �� a, ‖k‖₊ < r) : spectralRadius �� a < r :=
  sSup_image.symm.trans_lt <| ((isCompact a).sSup_lt_iff_of_continuous
    (nonempty �� a) continuous_eNorm.continuousOn (r : ℝ≥0∞)).mpr (by simpa using hr)

end quasispectrum

namespace AlgHom

section NormedField

variable {F : Type*} [NormedField ��] [NormedRing A] [NormedAlgebra �� A] [CompleteSpace A]

local notation "↑ₐ" => algebraMap �� A

instance (priority := 100) [FunLike F A ��] [AlgHomClass F �� A ��] :
    ContinuousLinearMapClass F �� A �� :=
  { AlgHomClass.linearMapClass with
    map_continuous := fun φ =>
      AddMonoidHomClass.continuous_of_bound φ ‖(1 : A)‖ fun a =>
        mul_comm ‖a‖ ‖(1 : A)‖ ▸ spectrum.norm_le_norm_mul_of_mem (apply_mem_spectrum φ _) }

/-- An algebra homomorphism into the base field, as a continuous linear map (since it is
automatically bounded). -/

def toContinuousLinearMap (φ : A →ₐ[��] ��) : StrongDual �� A :=
  { φ.toLinearMap with }

@[simp]
theorem coe_toContinuousLinearMap (φ : A →ₐ[��] ��) : ⇑φ.toContinuousLinearMap = φ :=
  rfl

theorem norm_apply_le_self_mul_norm_one [FunLike F A ��] [AlgHomClass F �� A ��] (f : F) (a : A) :
    ‖f a‖ ≤ ‖a‖ * ‖(1 : A)‖ :=
  spectrum.norm_le_norm_mul_of_mem (apply_mem_spectrum f _)

theorem norm_apply_le_self [NormOneClass A] [FunLike F A ��] [AlgHomClass F �� A ��]
    (f : F) (a : A) : ‖f a‖ ≤ ‖a‖ :=
  spectrum.norm_le_norm_of_mem (apply_mem_spectrum f _)

end NormedField

section NontriviallyNormedField

variable [NontriviallyNormedField ��] [NormedRing A] [NormedAlgebra �� A] [CompleteSpace A]

local notation "↑ₐ" => algebraMap �� A

@[simp]
theorem toContinuousLinearMap_norm [NormOneClass A] (φ : A →ₐ[��] ��) :
    ‖φ.toContinuousLinearMap‖ = 1 :=
  ContinuousLinearMap.opNorm_eq_of_bounds zero_le_one
    (fun a => (one_mul ‖a‖).symm ▸ spectrum.norm_le_norm_of_mem (apply_mem_spectrum φ _))
    fun _ _ h => by simpa only [coe_toContinuousLinearMap, map_one, norm_one, mul_one] using h 1

end NontriviallyNormedField

end AlgHom

namespace WeakDual

namespace CharacterSpace

variable [NontriviallyNormedField ��] [NormedRing A] [CompleteSpace A]
variable [NormedAlgebra �� A]

/-- The equivalence between characters and algebra homomorphisms into the base field. -/
noncomputable def equivAlgHom : characterSpace �� A ≃ (A →ₐ[��] ��) where
  toFun := toAlgHom
  invFun f :=
    { val := f.toContinuousLinearMap
      property := by rw [eq_set_map_one_map_mul]; exact ⟨map_one f, map_mul f⟩ }

@[simp]
theorem equivAlgHom_coe (f : characterSpace �� A) : ⇑(equivAlgHom f) = f :=
  rfl

@[simp]
theorem equivAlgHom_symm_coe (f : A →ₐ[��] ��) : ⇑(equivAlgHom.symm f) = f :=
  rfl

end CharacterSpace

end WeakDual

section BoundarySpectrum

local notation "σ" => spectrum

variable {�� A SA : Type*} [NormedRing A] [CompleteSpace A] [SetLike SA A] [SubringClass SA A]

open Filter Set

open scoped Topology

section NormedField

variable [NormedField ��] [NormedAlgebra �� A] [instSMulMem : SMulMemClass SA �� A]
variable (S : SA) [hS : IsClosed (S : Set A)] (x : S)

set_option backward.isDefEq.respectTransparency.types false in
open SubalgebraClass in
include instSMulMem in
/-- Let `S` be a closed subalgebra of a Banach algebra `A`. If `a : S` is invertible in `A`,
and for all `x : S` sufficiently close to `a` within some filter `l`, `x` is invertible in `S`,
then `a` is invertible in `S` as well. -/

lemma _root_.Subalgebra.isUnit_of_isUnit_val_of_eventually {l : Filter S} {a : S}
    (ha : IsUnit (a : A)) (hla : l ≤ �� a) (hl : ∀ᶠ x in l, IsUnit x) (hl' : l.NeBot) :
    IsUnit a := by
  have hla₂ : Tendsto Ring.inverse (map (val S) l) (�� (↑ha.unit⁻¹ : A)) := by
    rw [← Ring.inverse_unit]
    exact (NormedRing.inverse_continuousAt _).tendsto.comp <|
      continuousAt_subtype_val.tendsto.comp <| map_mono hla
  suffices mem : (↑ha.unit⁻¹ : A) ∈ S by
    refine ⟨⟨a, ⟨(↑ha.unit⁻¹ : A), mem⟩, ?_, ?_⟩, rfl⟩
    all_goals ext; simp
  apply hS.mem_of_tendsto hla₂
  rw [Filter.eventually_map]
  apply hl.mono fun x hx ↦ ?_
  suffices Ring.inverse (val S x) = (val S ↑hx.unit⁻¹) from this ▸ Subtype.property _
  rw [← (hx.map (val S)).unit_spec, Ring.inverse_unit (hx.map (val S)).unit, val]
  apply Units.mul_eq_one_iff_inv_eq.mp
  simpa [-IsUnit.mul_val_inv] using congr(($hx.mul_val_inv : A))

/-- If `S : Subalgebra �� A` is a closed subalgebra of a Banach algebra `A`, then for any
`x : S`, the boundary of the spectrum of `x` relative to `S` is a subset of the spectrum of
`↑x : A` relative to `A`. -/

lemma _root_.Subalgebra.frontier_spectrum : frontier (σ �� x) ⊆ σ �� (x : A) := by
  have : CompleteSpace S := hS.completeSpace_coe
  intro μ hμ
  by_contra h
  rw [spectrum.notMem_iff] at h
  rw [← frontier_compl, (spectrum.isClosed _).isOpen_compl.frontier_eq, Set.mem_sdiff] at hμ
  obtain ⟨hμ₁, hμ₂⟩ := hμ
  rw [mem_closure_iff_clusterPt] at hμ₁
  apply hμ₂
  rw [mem_compl_iff, spectrum.notMem_iff]
  refine Subalgebra.isUnit_of_isUnit_val_of_eventually S h ?_ ?_ <| .map hμ₁ (algebraMap �� S · - x)
  · calc
      _ ≤ map _ (�� μ) := map_mono (by simp)
      _ ≤ _ := by rw [← Filter.Tendsto, ← ContinuousAt]; fun_prop
  · rw [eventually_map]
    apply Eventually.filter_mono inf_le_right
    simp [spectrum.notMem_iff]

/-- If `S` is a closed subalgebra of a Banach algebra `A`, then for any `x : S`, the boundary of
the spectrum of `x` relative to `S` is a subset of the boundary of the spectrum of `↑x : A`
relative to `A`. -/

lemma Subalgebra.frontier_subset_frontier :
    frontier (σ �� x) ⊆ frontier (σ �� (x : A)) := by
  rw [frontier_eq_closure_inter_closure (s := σ �� (x : A)),
    (spectrum.isClosed (x : A)).closure_eq]
  apply subset_inter (frontier_spectrum S x)
  rw [frontier_eq_closure_inter_closure]
  grw [inter_subset_right, spectrum.subset_subalgebra]

open Set

open scoped Notation

/-- If `S` is a closed subalgebra of a Banach algebra `A`, then for any `x : S`, the spectrum of `x`
is the spectrum of `↑x : A` along with the connected components of the complement of the spectrum of
`↑x : A` which contain an element of the spectrum of `x : S`. -/

lemma Subalgebra.spectrum_sUnion_connectedComponentIn :
    σ �� x = σ �� (x : A) ∪ (⋃ z ∈ (σ �� x \ σ �� (x : A)), connectedComponentIn (σ �� (x : A))ᶜ z) := by
  suffices IsClopen ((σ �� (x : A))ᶜ ↓∩ (σ �� x \ σ �� (x : A))) by
    rw [← this.biUnion_connectedComponentIn (sdiff_subset_compl _ _),
      union_sdiff_cancel (spectrum.subset_subalgebra x)]
  have : CompleteSpace S := hS.completeSpace_coe
  have h_open : IsOpen (σ �� x \ σ �� (x : A)) := by
    rw [← (spectrum.isClosed (�� := ��) x).closure_eq, closure_eq_interior_union_frontier,
      union_sdiff_distrib, sdiff_eq_empty.mpr (frontier_spectrum S x),
      sdiff_eq_compl_inter, union_empty]
    exact (spectrum.isClosed _).isOpen_compl.inter isOpen_interior
  apply isClopen_preimage_val h_open
  suffices h_frontier : frontier (σ �� x \ σ �� (x : A)) ⊆ frontier (σ �� (x : A)) from
    disjoint_of_subset_left h_frontier <| disjoint_compl_right.frontier_left
      (spectrum.isClosed _).isOpen_compl
  grw [sdiff_eq_compl_inter, frontier_inter_subset, inter_subset_left, inter_subset_right,
    frontier_compl, frontier_subset_frontier, union_self]

/-- Let `S` be a closed subalgebra of a Banach algebra `A`, and let `x : S`. If `z` is in the
spectrum of `x`, then the connected component of `z` in the complement of the spectrum of `↑x : A`
is bounded (or else `z` actually belongs to the spectrum of `↑x : A`). -/

lemma Subalgebra.spectrum_isBounded_connectedComponentIn {z : ��} (hz : z ∈ σ �� x) :
    Bornology.IsBounded (connectedComponentIn (σ �� (x : A))ᶜ z) := by
  by_cases hz' : z ∈ σ �� (x : A)
  · simp [connectedComponentIn_eq_empty (show z ∉ (σ �� (x : A))ᶜ from not_not.mpr hz')]
  · have : CompleteSpace S := hS.completeSpace_coe
    suffices connectedComponentIn (σ �� (x : A))ᶜ z ⊆ σ �� x from spectrum.isBounded x |>.subset this
    rw [spectrum_sUnion_connectedComponentIn S]
    exact subset_biUnion_of_mem (mem_sdiff_of_mem hz hz') |>.trans subset_union_right

end NormedField

variable [NontriviallyNormedField ��] [NormedAlgebra �� A] [SMulMemClass SA �� A]
variable (S : SA) [hS : IsClosed (S : Set A)] (x : S)

/-- Let `S` be a closed subalgebra of a Banach algebra `A`. If for `x : S` the complement of the
spectrum of `↑x : A` is connected, then `spectrum �� x = spectrum �� (x : A)`. -/

lemma Subalgebra.spectrum_eq_of_isPreconnected_compl (h : IsPreconnected (σ �� (x : A))ᶜ) :
    σ �� x = σ �� (x : A) := by
  suffices σ �� x \ σ �� (x : A) = ∅ by
    rw [spectrum_sUnion_connectedComponentIn, this]
    simp
  refine eq_empty_of_forall_notMem fun z hz ↦ NormedSpace.unbounded_univ �� �� ?_
  obtain ⟨hz, hz'⟩ := mem_sdiff _ |>.mp hz
  have := (spectrum.isBounded (x : A)).union <|
    h.connectedComponentIn hz' ▸ spectrum_isBounded_connectedComponentIn S x hz
  simpa

end BoundarySpectrum

/-- If `��₁` is a normed field contained as subfield of a larger normed field `��₂`, and if `a : A`
is an element (in a possibly non-unital `��₂`-algebra) whose `��₂` quasispectrum restricts to `��₁`,
then the spectral radii over each scalar field coincide. -/

lemma QuasispectrumRestricts.spectralRadius_eq {��₁ ��₂ A : Type*} [NormedField ��₁]
    [NormedField ��₂] [NonUnitalRing A] [Module ��₁ A] [Module ��₂ A] [NormedAlgebra ��₁ ��₂]
    [IsScalarTower ��₁ ��₂ A] [IsScalarTower ��₂ A A] [SMulCommClass ��₂ A A]
    {f : ��₂ → ��₁} {a : A} (h : QuasispectrumRestricts a f) :
    spectralRadius ��₁ a = spectralRadius ��₂ a := by
  rw [spectralRadius, spectralRadius]
  have := algebraMap_isometry ��₁ ��₂ |>.nnNorm_map_of_map_zero (map_zero _)
  apply le_antisymm
  all_goals apply iSup₂_le fun x hx ↦ ?_
  · grw [← this, ← le_iSup₂ _ ?_]
    exact (quasispectrum.algebraMap_mem_iff _).mpr hx
  · obtain ⟨y, hy, rfl⟩ := h.algebraMap_image.symm ▸ hx
    grw [this, ← le_iSup₂ y hy]

namespace SpectrumRestricts

open NNReal ENNReal

/-- If `��₁` is a normed field contained as subfield of a larger normed field `��₂`, and if `a : A`
is an element whose `��₂` spectrum restricts to `��₁`, then the spectral radii over each scalar
field coincide. -/

lemma spectralRadius_eq {��₁ ��₂ A : Type*} [NormedField ��₁] [NormedField ��₂]
    [NormedRing A] [NormedAlgebra ��₁ A] [NormedAlgebra ��₂ A] [NormedAlgebra ��₁ ��₂]
    [IsScalarTower ��₁ ��₂ A] {f : ��₂ → ��₁} {a : A} (h : SpectrumRestricts a f) :
    spectralRadius ��₁ a = spectralRadius ��₂ a :=
  QuasispectrumRestricts.spectralRadius_eq h

variable {A : Type*} [Ring A]

lemma nnreal_iff_spectralRadius_le [Algebra ℝ A] {a : A} {t : ℝ≥0} (ht : spectralRadius ℝ a ≤ t) :
    SpectrumRestricts a ContinuousMap.realToNNReal ↔
      spectralRadius ℝ (algebraMap ℝ A t - a) ≤ t := by
  simp only [spectralRadius_eq_of_unital] at ht ⊢
  have : spectrum ℝ a ⊆ Set.Icc (-t) t := by
    intro x hx
    rw [Set.mem_Icc, ← abs_le, ← Real.norm_eq_abs, ← coe_nnNorm, NNReal.coe_le_coe,
      ← ENNReal.coe_le_coe]
    exact le_iSup₂ (α := ℝ≥0∞) x hx |>.trans ht
  rw [nnreal_iff]
  refine ⟨fun h ↦ iSup₂_le fun x hx ↦ ?_, fun h ↦ ?_⟩
  · rw [← spectrum.singleton_sub_eq] at hx
    obtain ⟨y, hy, rfl⟩ : ∃ y ∈ spectrum ℝ a, ↑t - y = x := by simpa using hx
    obtain ⟨hty, hyt⟩ := Set.mem_Icc.mp <| this hy
    lift y to ℝ≥0 using h y hy
    rw [← NNReal.coe_sub (mod_cast hyt)]
    simp
  · replace h : ∀ x ∈ spectrum ℝ a, ‖t - x‖₊ ≤ t := by
      simpa [spectralRadius, iSup₂_le_iff, ← spectrum.singleton_sub_eq] using h
    gconvert h with x hx h_le
    rw [← NNReal.coe_le_coe, coe_nnNorm, Real.norm_eq_abs, abs_le] at h_le
    linarith [h_le.2]

lemma _root_.NNReal.spectralRadius_mem_spectrum {A : Type*} [NormedRing A] [NormedAlgebra ℝ A]
    [CompleteSpace A] {a : A} (ha : (spectrum ℝ a).Nonempty)
    (ha' : SpectrumRestricts a ContinuousMap.realToNNReal) :
    (spectralRadius ℝ a).toNNReal ∈ spectrum ℝ≥0 a := by
  obtain ⟨x, hx₁, hx₂⟩ := spectrum.exists_nnNorm_eq_spectralRadius_of_nonempty ha
  rw [← hx₂, ENNReal.toNNReal_coe, ← spectrum.algebraMap_mem_iff ℝ, NNReal.algebraMap_eq_coe]
  have : 0 ≤ x := ha'.rightInvOn hx₁ ▸ NNReal.zero_le_coe
  convert hx₁
  simpa

lemma _root_.Real.spectralRadius_mem_spectrum {A : Type*} [NormedRing A] [NormedAlgebra ℝ A]
    [CompleteSpace A] {a : A} (ha : (spectrum ℝ a).Nonempty)
    (ha' : SpectrumRestricts a ContinuousMap.realToNNReal) :
    (spectralRadius ℝ a).toReal ∈ spectrum ℝ a :=
  NNReal.spectralRadius_mem_spectrum ha ha'

lemma _root_.Real.spectralRadius_mem_spectrum_or {A : Type*} [NormedRing A] [NormedAlgebra ℝ A]
    [CompleteSpace A] {a : A} (ha : (spectrum ℝ a).Nonempty) :
    (spectralRadius ℝ a).toReal ∈ spectrum ℝ a ∨ -(spectralRadius ℝ a).toReal ∈ spectrum ℝ a := by
  obtain ⟨x, hx₁, hx₂⟩ := spectrum.exists_nnNorm_eq_spectralRadius_of_nonempty ha
  simp only [← hx₂, ENNReal.coe_toReal, coe_nnNorm, Real.norm_eq_abs]
  exact abs_choice x |>.imp (fun h ↦ by rwa [h]) (fun h ↦ by simpa [h])

end SpectrumRestricts

namespace QuasispectrumRestricts

open NNReal ENNReal
local notation "σₙ" => quasispectrum

lemma compactSpace {R S A : Type*} [Semifield R] [Field S] [NonUnitalRing A]
    [Algebra R S] [Module R A] [Module S A] [IsScalarTower S A A] [SMulCommClass S A A]
    [IsScalarTower R S A] [TopologicalSpace R] [TopologicalSpace S] {a : A} (f : C(S, R))
    (h : QuasispectrumRestricts a f) [h_cpct : CompactSpace (σₙ S a)] :
    CompactSpace (σₙ R a) := by
  rw [← isCompact_iff_compactSpace] at h_cpct ⊢
  exact h.image ▸ h_cpct.image (map_continuous f)

end QuasispectrumRestricts

section UpperHemicontinuous

open Filter Set Topology

variable (�� A)

lemma upperHemicontinuous_spectrum [NormedField ��] [ProperSpace ��]
    [NormedRing A] [NormedAlgebra �� A] [CompleteSpace A] :
    UpperHemicontinuous (spectrum �� : A → Set ��) := by
  /- It suffices to use the sequential characterization of upper hemicontinuity.
  Suppose that `a : ℕ → A` converges to `a₀`, `x : ℕ → ��` converges to `x₀`, and for all `n`,
  `x n ∈ spectrum �� (a n)`. -/

  rw [upperHemicontinuous_iff]
  refine fun a₀ ↦ .of_sequences
    (isCompact_closedBall 0 ((‖a₀‖ + 1) * ‖(1 : A)‖)).isSeqCompact ?_ <|
    fun a ha x hx_mem x₀ hx ↦ ?_
  /- We must show that `spectrum �� (a n)` is eventually contained in some fixed compact set
  (we've chosen `closedBall 0 ((‖a₀‖ + 1) * ‖(1 : A)‖)`). This follows since the spectrum of any
  `b` is bounded `‖b‖ * ‖1‖` and `a` converges to `a₀`.  -/

  · filter_upwards [Metric.closedBall_mem_nhds a₀ zero_lt_one] with a ha
    apply spectrum.subset_closedBall_norm_mul a |>.trans <| Metric.closedBall_subset_closedBall ?_
    gcongr
    apply norm_le_norm_add_norm_sub' a a₀ |>.trans
    gcongr
    simpa [dist_eq_norm] using ha
  /- Finally, `x₀ ∈ spectrum �� a₀` since `algebraMap �� A x₀ - a₀` is not invertible, being itself
  the limit of the non-invertible elements `algebraMap �� A (x n) - (a n)`. -/

  · exact nonunits.isClosed.mem_of_tendsto
      (continuous_algebraMap �� A |>.tendsto x₀ |>.comp hx |>.sub ha) <| .of_forall hx_mem

/-- The map `a ↦ spectrum ℝ≥0 a` is upper hemicontinuous. -/
theorem upperHemicontinuous_spectrum_nnreal [NormedRing A] [NormedAlgebra ℝ A] [CompleteSpace A] :
    UpperHemicontinuous (spectrum ℝ≥0 : A → Set ℝ≥0) := by
  obtain ⟨⟨h₁, -⟩, h₂⟩ : IsClosedEmbedding ((↑) : ℝ≥0 → ℝ) := NNReal.isClosedEmbedding_coe
  exact upperHemicontinuous_spectrum ℝ A |>.isInducing_comp h₁ h₂

open WithLp in
/-- The map `a ↦ quasispectrum �� a` is upper hemicontinuous. -/
theorem upperHemicontinuous_quasispectrum [NontriviallyNormedField ��] [ProperSpace ��]
    [NonUnitalNormedRing A] [NormedSpace �� A] [SMulCommClass �� A A] [IsScalarTower �� A A]
    [CompleteSpace A] :
    UpperHemicontinuous (quasispectrum �� : A → Set ��) := by
  convert
    upperHemicontinuous_spectrum �� (WithLp 1 (Unitization �� A)) |>.comp
      unitization_isometry_inr.continuous
  ext1 a
  rw [quasispectrum_eq_spectrum_toLp_inr]
  congr

/-- The map `a ↦ quasispectrum ℝ≥0 a` is upper hemicontinuous. -/
theorem upperHemicontinuous_quasispectrum_nnreal [NonUnitalNormedRing A]
    [NormedSpace ℝ A] [SMulCommClass ℝ A A] [IsScalarTower ℝ A A] [CompleteSpace A] :
    UpperHemicontinuous (quasispectrum ℝ≥0 : A → Set ℝ≥0) := by
  obtain ⟨⟨h₁, -⟩, h₂⟩ := NNReal.isClosedEmbedding_coe
  simpa [← NNReal.algebraMap_eq_coe] using
    upperHemicontinuous_quasispectrum ℝ A |>.isInducing_comp h₁ h₂

end UpperHemicontinuous

Messung
CHZG
9010010096

¤ Dauer der Verarbeitung: 0.66 Sekunden  ¤

*© Formatika GbR, Deutschland