diff --git "a/Extracted/Mathlib/TacticPrediction/Mathlib_Algebra_Algebra_Spectrum.jsonl" "b/Extracted/Mathlib/TacticPrediction/Mathlib_Algebra_Algebra_Spectrum.jsonl" new file mode 100644--- /dev/null +++ "b/Extracted/Mathlib/TacticPrediction/Mathlib_Algebra_Algebra_Spectrum.jsonl" @@ -0,0 +1,128 @@ +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\nr : Rˣ\ns : R\na : A\nh : IsUnit (r • ↑ₐ s - a)\n⊢ (↑ₐ s - r⁻¹ • a) * r • ↑(IsUnit.unit h)⁻¹ = 1","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by ","nextTactic":"rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]","declUpToTactic":"/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.82_0.OiCHPrqZcVJoE6f","decl":"/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\nr : Rˣ\ns : R\na : A\nh : IsUnit (r • ↑ₐ s - a)\n⊢ r • ↑(IsUnit.unit h)⁻¹ * (↑ₐ s - r⁻¹ • a) = 1","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by ","nextTactic":"rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]","declUpToTactic":"/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.82_0.OiCHPrqZcVJoE6f","decl":"/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\nr : R\na : A\n⊢ r ∉ σ a ↔ IsUnit (↑ₐ r - a)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n ","nextTactic":"apply not_iff_not.mp","declUpToTactic":"theorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.111_0.OiCHPrqZcVJoE6f","decl":"theorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\nr : R\na : A\n⊢ ¬r ∉ σ a ↔ ¬IsUnit (↑ₐ r - a)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n ","nextTactic":"simp [Set.not_not_mem, mem_iff]","declUpToTactic":"theorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.111_0.OiCHPrqZcVJoE6f","decl":"theorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na : A\n⊢ 0 ∈ σ a ↔ ¬IsUnit a","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n ","nextTactic":"rw [mem_iff]","declUpToTactic":"theorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.118_0.OiCHPrqZcVJoE6f","decl":"theorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na : A\n⊢ ¬IsUnit (↑ₐ 0 - a) ↔ ¬IsUnit a","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n ","nextTactic":"rw [map_zero]","declUpToTactic":"theorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.118_0.OiCHPrqZcVJoE6f","decl":"theorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na : A\n⊢ ¬IsUnit (0 - a) ↔ ¬IsUnit a","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n ","nextTactic":"rw [zero_sub]","declUpToTactic":"theorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.118_0.OiCHPrqZcVJoE6f","decl":"theorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na : A\n⊢ ¬IsUnit (-a) ↔ ¬IsUnit a","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n ","nextTactic":"rw [IsUnit.neg_iff]","declUpToTactic":"theorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.118_0.OiCHPrqZcVJoE6f","decl":"theorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na : A\n⊢ 0 ∉ σ a ↔ IsUnit a","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n ","nextTactic":"rw [zero_mem_iff]","declUpToTactic":"theorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.127_0.OiCHPrqZcVJoE6f","decl":"theorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na : A\n⊢ ¬¬IsUnit a ↔ IsUnit a","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n ","nextTactic":"rw [Classical.not_not]","declUpToTactic":"theorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.127_0.OiCHPrqZcVJoE6f","decl":"theorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\nr : R\na b c : A\nh₁ : (↑ₐ r - a) * b = 1\nh₂ : c * (↑ₐ r - a) = 1\n⊢ b * (↑ₐ r - a) = 1","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by ","nextTactic":"rwa [← left_inv_eq_right_inv h₂ h₁]","declUpToTactic":"theorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.139_0.OiCHPrqZcVJoE6f","decl":"theorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a "} +{"state":"R : Type u\nA : Type v\ninst✝³ : CommSemiring R\ninst✝² : Ring A\ninst✝¹ : Algebra R A\ninst✝ : Subsingleton A\na : A\n⊢ resolventSet R a = univ","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n ","nextTactic":"simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]","declUpToTactic":"@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.148_0.OiCHPrqZcVJoE6f","decl":"@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ "} +{"state":"R : Type u\nA : Type v\ninst✝³ : CommSemiring R\ninst✝² : Ring A\ninst✝¹ : Algebra R A\ninst✝ : Subsingleton A\na : A\n⊢ σ a = ∅","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n ","nextTactic":"rw [spectrum]","declUpToTactic":"@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.153_0.OiCHPrqZcVJoE6f","decl":"@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ "} +{"state":"R : Type u\nA : Type v\ninst✝³ : CommSemiring R\ninst✝² : Ring A\ninst✝¹ : Algebra R A\ninst✝ : Subsingleton A\na : A\n⊢ (resolventSet R a)ᶜ = ∅","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n ","nextTactic":"rw [resolventSet_of_subsingleton]","declUpToTactic":"@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.153_0.OiCHPrqZcVJoE6f","decl":"@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ "} +{"state":"R : Type u\nA : Type v\ninst✝³ : CommSemiring R\ninst✝² : Ring A\ninst✝¹ : Algebra R A\ninst✝ : Subsingleton A\na : A\n⊢ univᶜ = ∅","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n ","nextTactic":"rw [Set.compl_univ]","declUpToTactic":"@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.153_0.OiCHPrqZcVJoE6f","decl":"@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\nr : Rˣ\ns : R\na : A\n⊢ r • resolvent a s = resolvent (r⁻¹ • a) (r⁻¹ • s)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n ","nextTactic":"by_cases h : s ∈ spectrum R a","declUpToTactic":"theorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.164_0.OiCHPrqZcVJoE6f","decl":"theorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) "} +{"state":"case pos\nR : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\nr : Rˣ\ns : R\na : A\nh : s ∈ σ a\n⊢ r • resolvent a s = resolvent (r⁻¹ • a) (r⁻¹ • s)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · ","nextTactic":"rw [mem_iff] at h","declUpToTactic":"theorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.164_0.OiCHPrqZcVJoE6f","decl":"theorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) "} +{"state":"case pos\nR : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\nr : Rˣ\ns : R\na : A\nh : ¬IsUnit (↑ₐ s - a)\n⊢ r • resolvent a s = resolvent (r⁻¹ • a) (r⁻¹ • s)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n ","nextTactic":"simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *","declUpToTactic":"theorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.164_0.OiCHPrqZcVJoE6f","decl":"theorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) "} +{"state":"case pos\nR : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\nr : Rˣ\ns : R\na : A\nh : ¬IsUnit (s • 1 - a)\n⊢ r • Ring.inverse (s • 1 - a) = Ring.inverse ((r⁻¹ • s) • 1 - r⁻¹ • a)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n ","nextTactic":"rw [smul_assoc]","declUpToTactic":"theorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.164_0.OiCHPrqZcVJoE6f","decl":"theorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) "} +{"state":"case pos\nR : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\nr : Rˣ\ns : R\na : A\nh : ¬IsUnit (s • 1 - a)\n⊢ r • Ring.inverse (s • 1 - a) = Ring.inverse (r⁻¹ • s • 1 - r⁻¹ • a)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n ","nextTactic":"rw [← smul_sub]","declUpToTactic":"theorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.164_0.OiCHPrqZcVJoE6f","decl":"theorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) "} +{"state":"case pos\nR : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\nr : Rˣ\ns : R\na : A\nh : ¬IsUnit (s • 1 - a)\n⊢ r • Ring.inverse (s • 1 - a) = Ring.inverse (r⁻¹ • (s • 1 - a))","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n ","nextTactic":"have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)","declUpToTactic":"theorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.164_0.OiCHPrqZcVJoE6f","decl":"theorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\nr : Rˣ\ns : R\na : A\nh : ¬IsUnit (s • 1 - a)\nhu : IsUnit (r⁻¹ • (s • 1 - a))\n⊢ IsUnit (s • 1 - a)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by ","nextTactic":"simpa only [smul_inv_smul] using IsUnit.smul r hu","declUpToTactic":"theorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.164_0.OiCHPrqZcVJoE6f","decl":"theorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) "} +{"state":"case pos\nR : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\nr : Rˣ\ns : R\na : A\nh : ¬IsUnit (s • 1 - a)\nh' : ¬IsUnit (r⁻¹ • (s • 1 - a))\n⊢ r • Ring.inverse (s • 1 - a) = Ring.inverse (r⁻¹ • (s • 1 - a))","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n ","nextTactic":"simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]","declUpToTactic":"theorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.164_0.OiCHPrqZcVJoE6f","decl":"theorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) "} +{"state":"case neg\nR : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\nr : Rˣ\ns : R\na : A\nh : s ∉ σ a\n⊢ r • resolvent a s = resolvent (r⁻¹ • a) (r⁻¹ • s)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · ","nextTactic":"simp only [resolvent]","declUpToTactic":"theorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.164_0.OiCHPrqZcVJoE6f","decl":"theorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) "} +{"state":"case neg\nR : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\nr : Rˣ\ns : R\na : A\nh : s ∉ σ a\n⊢ r • Ring.inverse (↑ₐ s - a) = Ring.inverse (↑ₐ (r⁻¹ • s) - r⁻¹ • a)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n ","nextTactic":"have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h","declUpToTactic":"theorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.164_0.OiCHPrqZcVJoE6f","decl":"theorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\nr : Rˣ\ns : R\na : A\nh : s ∉ σ a\n⊢ IsUnit (r • ↑ₐ (r⁻¹ • s) - a)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n ","nextTactic":"simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h","declUpToTactic":"theorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.164_0.OiCHPrqZcVJoE6f","decl":"theorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) "} +{"state":"case neg\nR : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\nr : Rˣ\ns : R\na : A\nh : s ∉ σ a\nh' : IsUnit (r • ↑ₐ (r⁻¹ • s) - a)\n⊢ r • Ring.inverse (↑ₐ s - a) = Ring.inverse (↑ₐ (r⁻¹ • s) - r⁻¹ • a)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n ","nextTactic":"rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]","declUpToTactic":"theorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.164_0.OiCHPrqZcVJoE6f","decl":"theorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) "} +{"state":"case neg\nR : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\nr : Rˣ\ns : R\na : A\nh : s ∉ σ a\nh' : IsUnit (r • ↑ₐ (r⁻¹ • s) - a)\n⊢ r • ↑(IsUnit.unit (_ : IsUnit (↑ₐ s - a)))⁻¹ = r • ↑(IsUnit.unit h')⁻¹","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n ","nextTactic":"simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]","declUpToTactic":"theorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.164_0.OiCHPrqZcVJoE6f","decl":"theorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r���¹ • a) (r⁻¹ • s : R) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\nr : Rˣ\na : A\n⊢ r • resolvent a ↑r = resolvent (r⁻¹ • a) 1","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n ","nextTactic":"simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a","declUpToTactic":"theorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.182_0.OiCHPrqZcVJoE6f","decl":"theorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\nr : Rˣ\na : Aˣ\nh : ↑r ∈ resolventSet R ↑a\n⊢ ↑r⁻¹ ∈ resolventSet R ↑a⁻¹","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n ","nextTactic":"rw [mem_resolventSet_iff] at h ⊢","declUpToTactic":"theorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.193_0.OiCHPrqZcVJoE6f","decl":"theorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\nr : Rˣ\na : Aˣ\nh : IsUnit (↑ₐ ↑r - ↑a)\n⊢ IsUnit (↑ₐ ↑r⁻¹ - ↑a⁻¹)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n ","nextTactic":"rw [Algebra.algebraMap_eq_smul_one] at h ⊢","declUpToTactic":"theorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.193_0.OiCHPrqZcVJoE6f","decl":"theorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\nr : Rˣ\na : Aˣ\nh : IsUnit (↑r • 1 - ↑a)\n⊢ IsUnit (↑r⁻¹ • 1 - ↑a⁻¹)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n ","nextTactic":"rw [← Units.smul_def] at h ⊢","declUpToTactic":"theorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.193_0.OiCHPrqZcVJoE6f","decl":"theorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\nr : Rˣ\na : Aˣ\nh : IsUnit (r • 1 - ↑a)\n⊢ IsUnit (r⁻¹ • 1 - ↑a⁻¹)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n ","nextTactic":"rw [IsUnit.smul_sub_iff_sub_inv_smul]","declUpToTactic":"theorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.193_0.OiCHPrqZcVJoE6f","decl":"theorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\nr : Rˣ\na : Aˣ\nh : IsUnit (r • 1 - ↑a)\n⊢ IsUnit (1 - r⁻¹⁻¹ • ↑a⁻¹)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n ","nextTactic":"rw [inv_inv]","declUpToTactic":"theorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.193_0.OiCHPrqZcVJoE6f","decl":"theorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\nr : Rˣ\na : Aˣ\nh : IsUnit (r • 1 - ↑a)\n⊢ IsUnit (1 - r • ↑a⁻¹)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n ","nextTactic":"rw [IsUnit.sub_iff]","declUpToTactic":"theorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.193_0.OiCHPrqZcVJoE6f","decl":"theorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\nr : Rˣ\na : Aˣ\nh : IsUnit (r • 1 - ↑a)\n⊢ IsUnit (r • ↑a⁻¹ - 1)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n ","nextTactic":"have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]","declUpToTactic":"theorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.193_0.OiCHPrqZcVJoE6f","decl":"theorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\nr : Rˣ\na : Aˣ\nh : IsUnit (r • 1 - ↑a)\n⊢ ↑a * (r • ↑a⁻¹ - 1) = r • 1 - ↑a","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n ","nextTactic":"rw [mul_sub]","declUpToTactic":"theorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.193_0.OiCHPrqZcVJoE6f","decl":"theorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\nr : Rˣ\na : Aˣ\nh : IsUnit (r • 1 - ↑a)\n⊢ ↑a * r • ↑a⁻¹ - ↑a * 1 = r • 1 - ↑a","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n ","nextTactic":"rw [mul_smul_comm]","declUpToTactic":"theorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.193_0.OiCHPrqZcVJoE6f","decl":"theorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\nr : Rˣ\na : Aˣ\nh : IsUnit (r • 1 - ��a)\n⊢ r • (↑a * ↑a⁻¹) - ↑a * 1 = r • 1 - ↑a","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n ","nextTactic":"rw [a.mul_inv]","declUpToTactic":"theorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.193_0.OiCHPrqZcVJoE6f","decl":"theorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\nr : Rˣ\na : Aˣ\nh : IsUnit (r • 1 - ↑a)\n⊢ r • 1 - ↑a * 1 = r • 1 - ↑a","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n ","nextTactic":"rw [mul_one]","declUpToTactic":"theorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.193_0.OiCHPrqZcVJoE6f","decl":"theorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\nr : Rˣ\na : Aˣ\nh : IsUnit (r • 1 - ↑a)\nh₁ : ↑a * (r • ↑a⁻¹ - 1) = r • 1 - ↑a\n⊢ IsUnit (r • ↑a⁻¹ - 1)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n ","nextTactic":"have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]","declUpToTactic":"theorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.193_0.OiCHPrqZcVJoE6f","decl":"theorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\nr : Rˣ\na : Aˣ\nh : IsUnit (r • 1 - ↑a)\nh₁ : ↑a * (r • ↑a⁻¹ - 1) = r • 1 - ↑a\n⊢ (r • ↑a⁻¹ - 1) * ↑a = r • 1 - ↑a","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n ","nextTactic":"rw [sub_mul]","declUpToTactic":"theorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.193_0.OiCHPrqZcVJoE6f","decl":"theorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\nr : Rˣ\na : Aˣ\nh : IsUnit (r • 1 - ↑a)\nh₁ : ↑a * (r • ↑a⁻¹ - 1) = r • 1 - ↑a\n⊢ r • ↑a⁻¹ * ↑a - 1 * ↑a = r • 1 - ↑a","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n ","nextTactic":"rw [smul_mul_assoc]","declUpToTactic":"theorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.193_0.OiCHPrqZcVJoE6f","decl":"theorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\nr : Rˣ\na : Aˣ\nh : IsUnit (r • 1 - ↑a)\nh₁ : ↑a * (r • ↑a⁻¹ - 1) = r • 1 - ↑a\n⊢ r • (↑a⁻¹ * ↑a) - 1 * ↑a = r • 1 - ↑a","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n ","nextTactic":"rw [a.inv_mul]","declUpToTactic":"theorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.193_0.OiCHPrqZcVJoE6f","decl":"theorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\nr : Rˣ\na : Aˣ\nh : IsUnit (r • 1 - ↑a)\nh₁ : ↑a * (r • ↑a⁻¹ - 1) = r • 1 - ↑a\n⊢ r • 1 - 1 * ↑a = r • 1 - ↑a","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n ","nextTactic":"rw [one_mul]","declUpToTactic":"theorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.193_0.OiCHPrqZcVJoE6f","decl":"theorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\nr : Rˣ\na : Aˣ\nh : IsUnit (r • 1 - ↑a)\nh₁ : ↑a * (r • ↑a⁻¹ - 1) = r • 1 - ↑a\nh₂ : (r • ↑a⁻¹ - 1) * ↑a = r • 1 - ↑a\n⊢ IsUnit (r • ↑a⁻¹ - 1)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n ","nextTactic":"have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁","declUpToTactic":"theorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.193_0.OiCHPrqZcVJoE6f","decl":"theorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\nr : Rˣ\na : Aˣ\nh : IsUnit (r • 1 - ↑a)\nh₁ : ↑a * (r • ↑a⁻¹ - 1) = r • 1 - ↑a\nh₂ : (r • ↑a⁻¹ - 1) * ↑a = r • 1 - ↑a\n⊢ Commute (↑a) (r • ↑a⁻¹ - 1)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by ","nextTactic":"rwa [← h₂] at h₁","declUpToTactic":"theorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.193_0.OiCHPrqZcVJoE6f","decl":"theorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\nr : Rˣ\na : Aˣ\nh : IsUnit (r • 1 - ↑a)\nh₁ : ↑a * (r • ↑a⁻¹ - 1) = r • 1 - ↑a\nh₂ : (r • ↑a⁻¹ - 1) * ↑a = r • 1 - ↑a\nhcomm : Commute (↑a) (r • ↑a⁻¹ - 1)\n⊢ IsUnit (r • ↑a⁻¹ - 1)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n ","nextTactic":"exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2","declUpToTactic":"theorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.193_0.OiCHPrqZcVJoE6f","decl":"theorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na : Aˣ\n⊢ 0 ∈ resolventSet R ↑a","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n ","nextTactic":"simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit","declUpToTactic":"theorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.219_0.OiCHPrqZcVJoE6f","decl":"theorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na : A\nr s : R\n⊢ r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n ","nextTactic":"simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]","declUpToTactic":"theorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.227_0.OiCHPrqZcVJoE6f","decl":"theorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na : A\nr s : R\n⊢ r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n ","nextTactic":"rw [add_mem_iff]","declUpToTactic":"theorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.231_0.OiCHPrqZcVJoE6f","decl":"theorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na : A\nr s : R\n⊢ r ∈ σ (-↑ₐ s + (↑ₐ s + a)) ↔ r ∈ σ a","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n ","nextTactic":"rw [neg_add_cancel_left]","declUpToTactic":"theorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.231_0.OiCHPrqZcVJoE6f","decl":"theorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na : A\ns : R\nr : Rˣ\n⊢ r • s ∈ σ (r • a) ↔ s ∈ σ a","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n ","nextTactic":"simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]","declUpToTactic":"theorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.236_0.OiCHPrqZcVJoE6f","decl":"theorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na : A\nr : Rˣ\n⊢ σ (r • a) = r • σ a","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a �� r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ","nextTactic":"ext x","declUpToTactic":"theorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.241_0.OiCHPrqZcVJoE6f","decl":"theorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a "} +{"state":"case h\nR : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na : A\nr : Rˣ\nx : R\n⊢ x ∈ σ (r • a) ↔ x ∈ r • σ a","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n ","nextTactic":"have x_eq : x = r • r⁻¹ • x := by simp","declUpToTactic":"theorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.241_0.OiCHPrqZcVJoE6f","decl":"theorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na : A\nr : Rˣ\nx : R\n⊢ x = r • r⁻¹ • x","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by ","nextTactic":"simp","declUpToTactic":"theorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.241_0.OiCHPrqZcVJoE6f","decl":"theorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a "} +{"state":"case h\nR : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na : A\nr : Rˣ\nx : R\nx_eq : x = r • r⁻¹ • x\n⊢ x ∈ σ (r • a) ↔ x ∈ r • σ a","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n ","nextTactic":"nth_rw 1 [x_eq]","declUpToTactic":"theorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.241_0.OiCHPrqZcVJoE6f","decl":"theorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a "} +{"state":"case h\nR : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na : A\nr : Rˣ\nx : R\nx_eq : x = r • r⁻¹ • x\n⊢ r • r⁻¹ • x ∈ σ (r • a) ↔ x ∈ r • σ a","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n ","nextTactic":"rw [smul_mem_smul_iff]","declUpToTactic":"theorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.241_0.OiCHPrqZcVJoE6f","decl":"theorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a "} +{"state":"case h\nR : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na : A\nr : Rˣ\nx : R\nx_eq : x = r • r⁻¹ • x\n⊢ r⁻¹ • x ∈ σ a ↔ x ∈ r • σ a","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n ","nextTactic":"constructor","declUpToTactic":"theorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.241_0.OiCHPrqZcVJoE6f","decl":"theorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a "} +{"state":"case h.mp\nR : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na : A\nr : Rˣ\nx : R\nx_eq : x = r • r⁻¹ • x\n⊢ r⁻¹ • x ∈ σ a → x ∈ r • σ a","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · ","nextTactic":"exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩","declUpToTactic":"theorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.241_0.OiCHPrqZcVJoE6f","decl":"theorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na : A\nr : Rˣ\nx : R\nx_eq : x = r • r⁻¹ • x\nh : r⁻¹ • x ∈ σ a\n⊢ r • r⁻¹ • x = x","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by ","nextTactic":"simp","declUpToTactic":"theorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.241_0.OiCHPrqZcVJoE6f","decl":"theorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a "} +{"state":"case h.mpr\nR : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na : A\nr : Rˣ\nx : R\nx_eq : x = r • r⁻¹ • x\n⊢ x ∈ r • σ a → r⁻¹ • x ∈ σ a","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · ","nextTactic":"rintro ⟨w, _, (x'_eq : r • w = x)⟩","declUpToTactic":"theorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.241_0.OiCHPrqZcVJoE6f","decl":"theorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a "} +{"state":"case h.mpr.intro.intro\nR : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na : A\nr : Rˣ\nx : R\nx_eq : x = r • r⁻¹ • x\nw : R\nleft✝ : w ∈ σ a\nx'_eq : r • w = x\n⊢ r⁻¹ • x ∈ σ a","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ��h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n ","nextTactic":"simpa [← x'_eq ]","declUpToTactic":"theorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.241_0.OiCHPrqZcVJoE6f","decl":"theorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na b : A\nr : Rˣ\n⊢ ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n ","nextTactic":"have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]","declUpToTactic":"theorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.253_0.OiCHPrqZcVJoE6f","decl":"theorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na b : A\nr : Rˣ\n⊢ ∀ (x y : A), IsUnit (1 - x * y) → IsUnit (1 - y * x)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n ","nextTactic":"refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩","declUpToTactic":"theorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.253_0.OiCHPrqZcVJoE6f","decl":"theorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) "} +{"state":"case refine'_1\nR : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na b : A\nr : Rˣ\nx y : A\nh : IsUnit (1 - x * y)\n⊢ (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) = 1\ncase refine'_2\nR : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na b : A\nr : Rˣ\nx y : A\nh : IsUnit (1 - x * y)\n⊢ (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) = 1","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n ","nextTactic":"calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]","declUpToTactic":"theorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.253_0.OiCHPrqZcVJoE6f","decl":"theorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na b : A\nr : Rˣ\nx y : A\nh : IsUnit (1 - x * y)\n⊢ (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) = 1 - y * x + y * ((1 - x * y) * (IsUnit.unit h).inv) * x","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by ","nextTactic":"noncomm_ring","declUpToTactic":"theorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.253_0.OiCHPrqZcVJoE6f","decl":"theorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na b : A\nr : Rˣ\nx y : A\nh : IsUnit (1 - x * y)\n⊢ 1 - y * x + y * ((1 - x * y) * (IsUnit.unit h).inv) * x = 1","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by ","nextTactic":"simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]","declUpToTactic":"theorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.253_0.OiCHPrqZcVJoE6f","decl":"theorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) "} +{"state":"case refine'_2\nR : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na b : A\nr : Rˣ\nx y : A\nh : IsUnit (1 - x * y)\n⊢ (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) = 1","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n ","nextTactic":"calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]","declUpToTactic":"theorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.253_0.OiCHPrqZcVJoE6f","decl":"theorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na b : A\nr : Rˣ\nx y : A\nh : IsUnit (1 - x * y)\n⊢ (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) = 1 - y * x + y * ((IsUnit.unit h).inv * (1 - x * y)) * x","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by ","nextTactic":"noncomm_ring","declUpToTactic":"theorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.253_0.OiCHPrqZcVJoE6f","decl":"theorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na b : A\nr : Rˣ\nx y : A\nh : IsUnit (1 - x * y)\n⊢ 1 - y * x + y * ((IsUnit.unit h).inv * (1 - x * y)) * x = 1","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by ","nextTactic":"simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]","declUpToTactic":"theorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.253_0.OiCHPrqZcVJoE6f","decl":"theorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na b : A\nr : Rˣ\nh₁ : ∀ (x y : A), IsUnit (1 - x * y) → IsUnit (1 - y * x)\n⊢ ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n ","nextTactic":"have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))","declUpToTactic":"theorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.253_0.OiCHPrqZcVJoE6f","decl":"theorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na b : A\nr : Rˣ\nh₁ : ∀ (x y : A), IsUnit (1 - x * y) → IsUnit (1 - y * x)\nthis : IsUnit (1 - r⁻¹ • a * b) ↔ IsUnit (1 - b * r⁻¹ • a)\n⊢ ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n ","nextTactic":"rw [mul_smul_comm r⁻¹ b a] at this","declUpToTactic":"theorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.253_0.OiCHPrqZcVJoE6f","decl":"theorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommSemiring R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na b : A\nr : Rˣ\nh₁ : ∀ (x y : A), IsUnit (1 - x * y) → IsUnit (1 - y * x)\nthis : IsUnit (1 - r⁻¹ • a * b) ↔ IsUnit (1 - r⁻¹ • (b * a))\n⊢ ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n ","nextTactic":"simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]","declUpToTactic":"theorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.253_0.OiCHPrqZcVJoE6f","decl":"theorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) "} +{"state":"R : Type u\nA : Type v\ninst✝⁵ : CommSemiring R\ninst✝⁴ : Ring A\ninst✝³ : Algebra R A\ninst✝² : InvolutiveStar R\ninst✝¹ : StarRing A\ninst✝ : StarModule R A\nr : R\na : A\n⊢ star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n ","nextTactic":"refine' ⟨fun h => _, fun h => _⟩","declUpToTactic":"theorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.279_0.OiCHPrqZcVJoE6f","decl":"theorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) "} +{"state":"case refine'_1\nR : Type u\nA : Type v\ninst✝⁵ : CommSemiring R\ninst✝⁴ : Ring A\ninst✝³ : Algebra R A\ninst✝² : InvolutiveStar R\ninst✝¹ : StarRing A\ninst✝ : StarModule R A\nr : R\na : A\nh : star r ∈ resolventSet R a\n⊢ r ∈ resolventSet R (star a)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n ","nextTactic":"simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h","declUpToTactic":"theorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ��� r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.279_0.OiCHPrqZcVJoE6f","decl":"theorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) "} +{"state":"case refine'_2\nR : Type u\nA : Type v\ninst✝⁵ : CommSemiring R\ninst✝⁴ : Ring A\ninst✝³ : Algebra R A\ninst✝² : InvolutiveStar R\ninst✝¹ : StarRing A\ninst✝ : StarModule R A\nr : R\na : A\nh : r ∈ resolventSet R (star a)\n⊢ star r ∈ resolventSet R a","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n ","nextTactic":"simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h","declUpToTactic":"theorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.279_0.OiCHPrqZcVJoE6f","decl":"theorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) "} +{"state":"R : Type u\nA : Type v\ninst✝⁵ : CommSemiring R\ninst✝⁴ : Ring A\ninst✝³ : Algebra R A\ninst✝² : InvolutiveStar R\ninst✝¹ : StarRing A\ninst✝ : StarModule R A\na : A\n⊢ σ (star a) = star (σ a)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ","nextTactic":"ext","declUpToTactic":"protected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.286_0.OiCHPrqZcVJoE6f","decl":"protected theorem map_star (a : A) : σ (star a) = star (σ a) "} +{"state":"case h\nR : Type u\nA : Type v\ninst✝⁵ : CommSemiring R\ninst✝⁴ : Ring A\ninst✝³ : Algebra R A\ninst✝² : InvolutiveStar R\ninst✝¹ : StarRing A\ninst✝ : StarModule R A\na : A\nx✝ : R\n⊢ x✝ ∈ σ (star a) ↔ x✝ ∈ star (σ a)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n ","nextTactic":"simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm","declUpToTactic":"protected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.286_0.OiCHPrqZcVJoE6f","decl":"protected theorem map_star (a : A) : σ (star a) = star (σ a) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommRing R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na : A\nr x : R\n⊢ x ∈ {r} + σ a ↔ x ∈ σ (↑ₐ r + a)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n ","nextTactic":"rw [singleton_add]","declUpToTactic":"theorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.316_0.OiCHPrqZcVJoE6f","decl":"theorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommRing R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na : A\nr x : R\n⊢ x ∈ (fun x => r + x) '' σ a ↔ x ∈ σ (↑ₐ r + a)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n ","nextTactic":"rw [image_add_left]","declUpToTactic":"theorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.316_0.OiCHPrqZcVJoE6f","decl":"theorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommRing R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na : A\nr x : R\n⊢ x ∈ (fun x => -r + x) ⁻¹' σ a ↔ x ∈ σ (↑ₐ r + a)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n ","nextTactic":"rw [mem_preimage]","declUpToTactic":"theorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.316_0.OiCHPrqZcVJoE6f","decl":"theorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommRing R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na : A\nr x : R\n⊢ -r + x ∈ σ a ↔ x ∈ σ (↑ₐ r + a)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n ","nextTactic":"rw [add_comm]","declUpToTactic":"theorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.316_0.OiCHPrqZcVJoE6f","decl":"theorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommRing R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na : A\nr x : R\n⊢ x + -r ∈ σ a ↔ x ∈ σ (↑ₐ r + a)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n ","nextTactic":"rw [add_mem_iff]","declUpToTactic":"theorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.316_0.OiCHPrqZcVJoE6f","decl":"theorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommRing R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na : A\nr x : R\n⊢ x ∈ σ (-↑ₐ (-r) + a) ↔ x ∈ σ (↑ₐ r + a)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n ","nextTactic":"rw [map_neg]","declUpToTactic":"theorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.316_0.OiCHPrqZcVJoE6f","decl":"theorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommRing R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na : A\nr x : R\n⊢ x ∈ σ (- -↑ₐ r + a) ↔ x ∈ σ (↑ₐ r + a)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n ","nextTactic":"rw [neg_neg]","declUpToTactic":"theorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.316_0.OiCHPrqZcVJoE6f","decl":"theorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommRing R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na : A\nx : R\n⊢ x ∈ -σ a ↔ x ∈ σ (-a)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = �� := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n rw [neg_neg]\n#align spectrum.singleton_add_eq spectrum.singleton_add_eq\n\ntheorem add_singleton_eq (a : A) (r : R) : σ a + {r} = σ (a + ↑ₐ r) :=\n add_comm {r} (σ a) ▸ add_comm (algebraMap R A r) a ▸ singleton_add_eq a r\n#align spectrum.add_singleton_eq spectrum.add_singleton_eq\n\ntheorem vadd_eq (a : A) (r : R) : r +ᵥ σ a = σ (↑ₐ r + a) :=\n singleton_add.symm.trans <| singleton_add_eq a r\n#align spectrum.vadd_eq spectrum.vadd_eq\n\ntheorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n ","nextTactic":"simp only [mem_neg, mem_iff, map_neg, ← neg_add', IsUnit.neg_iff, sub_neg_eq_add]","declUpToTactic":"theorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.335_0.OiCHPrqZcVJoE6f","decl":"theorem neg_eq (a : A) : -σ a = σ (-a) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommRing R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na : A\nr : R\n⊢ {r} - σ a = σ (↑ₐ r - a)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n rw [neg_neg]\n#align spectrum.singleton_add_eq spectrum.singleton_add_eq\n\ntheorem add_singleton_eq (a : A) (r : R) : σ a + {r} = σ (a + ↑ₐ r) :=\n add_comm {r} (σ a) ▸ add_comm (algebraMap R A r) a ▸ singleton_add_eq a r\n#align spectrum.add_singleton_eq spectrum.add_singleton_eq\n\ntheorem vadd_eq (a : A) (r : R) : r +ᵥ σ a = σ (↑ₐ r + a) :=\n singleton_add.symm.trans <| singleton_add_eq a r\n#align spectrum.vadd_eq spectrum.vadd_eq\n\ntheorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n simp only [mem_neg, mem_iff, map_neg, ← neg_add', IsUnit.neg_iff, sub_neg_eq_add]\n#align spectrum.neg_eq spectrum.neg_eq\n\ntheorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n ","nextTactic":"rw [sub_eq_add_neg]","declUpToTactic":"theorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.340_0.OiCHPrqZcVJoE6f","decl":"theorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommRing R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na : A\nr : R\n⊢ {r} + -σ a = σ (↑ₐ r - a)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n rw [neg_neg]\n#align spectrum.singleton_add_eq spectrum.singleton_add_eq\n\ntheorem add_singleton_eq (a : A) (r : R) : σ a + {r} = σ (a + ↑ₐ r) :=\n add_comm {r} (σ a) ▸ add_comm (algebraMap R A r) a ▸ singleton_add_eq a r\n#align spectrum.add_singleton_eq spectrum.add_singleton_eq\n\ntheorem vadd_eq (a : A) (r : R) : r +ᵥ σ a = σ (↑ₐ r + a) :=\n singleton_add.symm.trans <| singleton_add_eq a r\n#align spectrum.vadd_eq spectrum.vadd_eq\n\ntheorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n simp only [mem_neg, mem_iff, map_neg, ← neg_add', IsUnit.neg_iff, sub_neg_eq_add]\n#align spectrum.neg_eq spectrum.neg_eq\n\ntheorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n ","nextTactic":"rw [neg_eq]","declUpToTactic":"theorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.340_0.OiCHPrqZcVJoE6f","decl":"theorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommRing R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na : A\nr : R\n⊢ {r} + σ (-a) = σ (↑ₐ r - a)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n rw [neg_neg]\n#align spectrum.singleton_add_eq spectrum.singleton_add_eq\n\ntheorem add_singleton_eq (a : A) (r : R) : σ a + {r} = σ (a + ↑ₐ r) :=\n add_comm {r} (σ a) ▸ add_comm (algebraMap R A r) a ▸ singleton_add_eq a r\n#align spectrum.add_singleton_eq spectrum.add_singleton_eq\n\ntheorem vadd_eq (a : A) (r : R) : r +ᵥ σ a = σ (↑ₐ r + a) :=\n singleton_add.symm.trans <| singleton_add_eq a r\n#align spectrum.vadd_eq spectrum.vadd_eq\n\ntheorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n simp only [mem_neg, mem_iff, map_neg, ← neg_add', IsUnit.neg_iff, sub_neg_eq_add]\n#align spectrum.neg_eq spectrum.neg_eq\n\ntheorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n rw [neg_eq]\n ","nextTactic":"rw [singleton_add_eq]","declUpToTactic":"theorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n rw [neg_eq]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.340_0.OiCHPrqZcVJoE6f","decl":"theorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommRing R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na : A\nr : R\n⊢ σ (↑ₐ r + -a) = σ (↑ₐ r - a)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n rw [neg_neg]\n#align spectrum.singleton_add_eq spectrum.singleton_add_eq\n\ntheorem add_singleton_eq (a : A) (r : R) : σ a + {r} = σ (a + ↑ₐ r) :=\n add_comm {r} (σ a) ▸ add_comm (algebraMap R A r) a ▸ singleton_add_eq a r\n#align spectrum.add_singleton_eq spectrum.add_singleton_eq\n\ntheorem vadd_eq (a : A) (r : R) : r +ᵥ σ a = σ (↑ₐ r + a) :=\n singleton_add.symm.trans <| singleton_add_eq a r\n#align spectrum.vadd_eq spectrum.vadd_eq\n\ntheorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n simp only [mem_neg, mem_iff, map_neg, ← neg_add', IsUnit.neg_iff, sub_neg_eq_add]\n#align spectrum.neg_eq spectrum.neg_eq\n\ntheorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n rw [neg_eq]\n rw [singleton_add_eq]\n ","nextTactic":"rw [sub_eq_add_neg]","declUpToTactic":"theorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n rw [neg_eq]\n rw [singleton_add_eq]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.340_0.OiCHPrqZcVJoE6f","decl":"theorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) "} +{"state":"R : Type u\nA : Type v\ninst✝² : CommRing R\ninst✝¹ : Ring A\ninst✝ : Algebra R A\na : A\nr : R\n⊢ σ a - {r} = σ (a - ↑ₐ r)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n rw [neg_neg]\n#align spectrum.singleton_add_eq spectrum.singleton_add_eq\n\ntheorem add_singleton_eq (a : A) (r : R) : σ a + {r} = σ (a + ↑ₐ r) :=\n add_comm {r} (σ a) ▸ add_comm (algebraMap R A r) a ▸ singleton_add_eq a r\n#align spectrum.add_singleton_eq spectrum.add_singleton_eq\n\ntheorem vadd_eq (a : A) (r : R) : r +ᵥ σ a = σ (↑ₐ r + a) :=\n singleton_add.symm.trans <| singleton_add_eq a r\n#align spectrum.vadd_eq spectrum.vadd_eq\n\ntheorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n simp only [mem_neg, mem_iff, map_neg, ← neg_add', IsUnit.neg_iff, sub_neg_eq_add]\n#align spectrum.neg_eq spectrum.neg_eq\n\ntheorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n rw [neg_eq]\n rw [singleton_add_eq]\n rw [sub_eq_add_neg]\n#align spectrum.singleton_sub_eq spectrum.singleton_sub_eq\n\ntheorem sub_singleton_eq (a : A) (r : R) : σ a - {r} = σ (a - ↑ₐ r) := by\n ","nextTactic":"simpa only [neg_sub, neg_eq] using congr_arg Neg.neg (singleton_sub_eq a r)","declUpToTactic":"theorem sub_singleton_eq (a : A) (r : R) : σ a - {r} = σ (a - ↑ₐ r) := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.347_0.OiCHPrqZcVJoE6f","decl":"theorem sub_singleton_eq (a : A) (r : R) : σ a - {r} = σ (a - ↑ₐ r) "} +{"state":"𝕜 : Type u\nA : Type v\ninst✝³ : Field 𝕜\ninst✝² : Ring A\ninst✝¹ : Algebra 𝕜 A\ninst✝ : Nontrivial A\n⊢ σ 0 = {0}","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n rw [neg_neg]\n#align spectrum.singleton_add_eq spectrum.singleton_add_eq\n\ntheorem add_singleton_eq (a : A) (r : R) : σ a + {r} = σ (a + ↑ₐ r) :=\n add_comm {r} (σ a) ▸ add_comm (algebraMap R A r) a ▸ singleton_add_eq a r\n#align spectrum.add_singleton_eq spectrum.add_singleton_eq\n\ntheorem vadd_eq (a : A) (r : R) : r +ᵥ σ a = σ (↑ₐ r + a) :=\n singleton_add.symm.trans <| singleton_add_eq a r\n#align spectrum.vadd_eq spectrum.vadd_eq\n\ntheorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n simp only [mem_neg, mem_iff, map_neg, ← neg_add', IsUnit.neg_iff, sub_neg_eq_add]\n#align spectrum.neg_eq spectrum.neg_eq\n\ntheorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n rw [neg_eq]\n rw [singleton_add_eq]\n rw [sub_eq_add_neg]\n#align spectrum.singleton_sub_eq spectrum.singleton_sub_eq\n\ntheorem sub_singleton_eq (a : A) (r : R) : σ a - {r} = σ (a - ↑ₐ r) := by\n simpa only [neg_sub, neg_eq] using congr_arg Neg.neg (singleton_sub_eq a r)\n#align spectrum.sub_singleton_eq spectrum.sub_singleton_eq\n\nend ScalarRing\n\nsection ScalarField\n\nvariable {𝕜 : Type u} {A : Type v}\n\nvariable [Field 𝕜] [Ring A] [Algebra 𝕜 A]\n\nlocal notation \"σ\" => spectrum 𝕜\n\nlocal notation \"↑ₐ\" => algebraMap 𝕜 A\n\n/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n ","nextTactic":"refine' Set.Subset.antisymm _ (by simp [Algebra.algebraMap_eq_smul_one, mem_iff])","declUpToTactic":"/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.363_0.OiCHPrqZcVJoE6f","decl":"/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} "} +{"state":"𝕜 : Type u\nA : Type v\ninst✝³ : Field 𝕜\ninst✝² : Ring A\ninst✝¹ : Algebra 𝕜 A\ninst✝ : Nontrivial A\n⊢ {0} ⊆ σ 0","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n rw [neg_neg]\n#align spectrum.singleton_add_eq spectrum.singleton_add_eq\n\ntheorem add_singleton_eq (a : A) (r : R) : σ a + {r} = σ (a + ↑ₐ r) :=\n add_comm {r} (σ a) ▸ add_comm (algebraMap R A r) a ▸ singleton_add_eq a r\n#align spectrum.add_singleton_eq spectrum.add_singleton_eq\n\ntheorem vadd_eq (a : A) (r : R) : r +ᵥ σ a = σ (↑ₐ r + a) :=\n singleton_add.symm.trans <| singleton_add_eq a r\n#align spectrum.vadd_eq spectrum.vadd_eq\n\ntheorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n simp only [mem_neg, mem_iff, map_neg, ← neg_add', IsUnit.neg_iff, sub_neg_eq_add]\n#align spectrum.neg_eq spectrum.neg_eq\n\ntheorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n rw [neg_eq]\n rw [singleton_add_eq]\n rw [sub_eq_add_neg]\n#align spectrum.singleton_sub_eq spectrum.singleton_sub_eq\n\ntheorem sub_singleton_eq (a : A) (r : R) : σ a - {r} = σ (a - ↑ₐ r) := by\n simpa only [neg_sub, neg_eq] using congr_arg Neg.neg (singleton_sub_eq a r)\n#align spectrum.sub_singleton_eq spectrum.sub_singleton_eq\n\nend ScalarRing\n\nsection ScalarField\n\nvariable {𝕜 : Type u} {A : Type v}\n\nvariable [Field 𝕜] [Ring A] [Algebra 𝕜 A]\n\nlocal notation \"σ\" => spectrum 𝕜\n\nlocal notation \"↑ₐ\" => algebraMap 𝕜 A\n\n/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n refine' Set.Subset.antisymm _ (by ","nextTactic":"simp [Algebra.algebraMap_eq_smul_one, mem_iff]","declUpToTactic":"/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n refine' Set.Subset.antisymm _ (by ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.363_0.OiCHPrqZcVJoE6f","decl":"/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} "} +{"state":"𝕜 : Type u\nA : Type v\ninst✝³ : Field 𝕜\ninst✝² : Ring A\ninst✝¹ : Algebra 𝕜 A\ninst✝ : Nontrivial A\n⊢ σ 0 ⊆ {0}","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n rw [neg_neg]\n#align spectrum.singleton_add_eq spectrum.singleton_add_eq\n\ntheorem add_singleton_eq (a : A) (r : R) : σ a + {r} = σ (a + ↑ₐ r) :=\n add_comm {r} (σ a) ▸ add_comm (algebraMap R A r) a ▸ singleton_add_eq a r\n#align spectrum.add_singleton_eq spectrum.add_singleton_eq\n\ntheorem vadd_eq (a : A) (r : R) : r +ᵥ σ a = σ (↑ₐ r + a) :=\n singleton_add.symm.trans <| singleton_add_eq a r\n#align spectrum.vadd_eq spectrum.vadd_eq\n\ntheorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n simp only [mem_neg, mem_iff, map_neg, ← neg_add', IsUnit.neg_iff, sub_neg_eq_add]\n#align spectrum.neg_eq spectrum.neg_eq\n\ntheorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n rw [neg_eq]\n rw [singleton_add_eq]\n rw [sub_eq_add_neg]\n#align spectrum.singleton_sub_eq spectrum.singleton_sub_eq\n\ntheorem sub_singleton_eq (a : A) (r : R) : σ a - {r} = σ (a - ↑ₐ r) := by\n simpa only [neg_sub, neg_eq] using congr_arg Neg.neg (singleton_sub_eq a r)\n#align spectrum.sub_singleton_eq spectrum.sub_singleton_eq\n\nend ScalarRing\n\nsection ScalarField\n\nvariable {𝕜 : Type u} {A : Type v}\n\nvariable [Field 𝕜] [Ring A] [Algebra 𝕜 A]\n\nlocal notation \"σ\" => spectrum 𝕜\n\nlocal notation \"↑ₐ\" => algebraMap 𝕜 A\n\n/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n refine' Set.Subset.antisymm _ (by simp [Algebra.algebraMap_eq_smul_one, mem_iff])\n ","nextTactic":"rw [spectrum]","declUpToTactic":"/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n refine' Set.Subset.antisymm _ (by simp [Algebra.algebraMap_eq_smul_one, mem_iff])\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.363_0.OiCHPrqZcVJoE6f","decl":"/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} "} +{"state":"𝕜 : Type u\nA : Type v\ninst✝³ : Field 𝕜\ninst✝² : Ring A\ninst✝¹ : Algebra 𝕜 A\ninst✝ : Nontrivial A\n⊢ (resolventSet 𝕜 0)ᶜ ⊆ {0}","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n rw [neg_neg]\n#align spectrum.singleton_add_eq spectrum.singleton_add_eq\n\ntheorem add_singleton_eq (a : A) (r : R) : σ a + {r} = σ (a + ↑ₐ r) :=\n add_comm {r} (σ a) ▸ add_comm (algebraMap R A r) a ▸ singleton_add_eq a r\n#align spectrum.add_singleton_eq spectrum.add_singleton_eq\n\ntheorem vadd_eq (a : A) (r : R) : r +ᵥ σ a = σ (↑ₐ r + a) :=\n singleton_add.symm.trans <| singleton_add_eq a r\n#align spectrum.vadd_eq spectrum.vadd_eq\n\ntheorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n simp only [mem_neg, mem_iff, map_neg, ← neg_add', IsUnit.neg_iff, sub_neg_eq_add]\n#align spectrum.neg_eq spectrum.neg_eq\n\ntheorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n rw [neg_eq]\n rw [singleton_add_eq]\n rw [sub_eq_add_neg]\n#align spectrum.singleton_sub_eq spectrum.singleton_sub_eq\n\ntheorem sub_singleton_eq (a : A) (r : R) : σ a - {r} = σ (a - ↑ₐ r) := by\n simpa only [neg_sub, neg_eq] using congr_arg Neg.neg (singleton_sub_eq a r)\n#align spectrum.sub_singleton_eq spectrum.sub_singleton_eq\n\nend ScalarRing\n\nsection ScalarField\n\nvariable {𝕜 : Type u} {A : Type v}\n\nvariable [Field 𝕜] [Ring A] [Algebra 𝕜 A]\n\nlocal notation \"σ\" => spectrum 𝕜\n\nlocal notation \"↑ₐ\" => algebraMap 𝕜 A\n\n/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n refine' Set.Subset.antisymm _ (by simp [Algebra.algebraMap_eq_smul_one, mem_iff])\n rw [spectrum]\n ","nextTactic":"rw [Set.compl_subset_comm]","declUpToTactic":"/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n refine' Set.Subset.antisymm _ (by simp [Algebra.algebraMap_eq_smul_one, mem_iff])\n rw [spectrum]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.363_0.OiCHPrqZcVJoE6f","decl":"/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} "} +{"state":"𝕜 : Type u\nA : Type v\ninst✝³ : Field 𝕜\ninst✝² : Ring A\ninst✝¹ : Algebra 𝕜 A\ninst✝ : Nontrivial A\n⊢ {0}ᶜ ⊆ resolventSet 𝕜 0","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n rw [neg_neg]\n#align spectrum.singleton_add_eq spectrum.singleton_add_eq\n\ntheorem add_singleton_eq (a : A) (r : R) : σ a + {r} = σ (a + ↑ₐ r) :=\n add_comm {r} (σ a) ▸ add_comm (algebraMap R A r) a ▸ singleton_add_eq a r\n#align spectrum.add_singleton_eq spectrum.add_singleton_eq\n\ntheorem vadd_eq (a : A) (r : R) : r +ᵥ σ a = σ (↑ₐ r + a) :=\n singleton_add.symm.trans <| singleton_add_eq a r\n#align spectrum.vadd_eq spectrum.vadd_eq\n\ntheorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n simp only [mem_neg, mem_iff, map_neg, ← neg_add', IsUnit.neg_iff, sub_neg_eq_add]\n#align spectrum.neg_eq spectrum.neg_eq\n\ntheorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n rw [neg_eq]\n rw [singleton_add_eq]\n rw [sub_eq_add_neg]\n#align spectrum.singleton_sub_eq spectrum.singleton_sub_eq\n\ntheorem sub_singleton_eq (a : A) (r : R) : σ a - {r} = σ (a - ↑ₐ r) := by\n simpa only [neg_sub, neg_eq] using congr_arg Neg.neg (singleton_sub_eq a r)\n#align spectrum.sub_singleton_eq spectrum.sub_singleton_eq\n\nend ScalarRing\n\nsection ScalarField\n\nvariable {𝕜 : Type u} {A : Type v}\n\nvariable [Field 𝕜] [Ring A] [Algebra 𝕜 A]\n\nlocal notation \"σ\" => spectrum 𝕜\n\nlocal notation \"↑ₐ\" => algebraMap 𝕜 A\n\n/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n refine' Set.Subset.antisymm _ (by simp [Algebra.algebraMap_eq_smul_one, mem_iff])\n rw [spectrum]\n rw [Set.compl_subset_comm]\n ","nextTactic":"intro k hk","declUpToTactic":"/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n refine' Set.Subset.antisymm _ (by simp [Algebra.algebraMap_eq_smul_one, mem_iff])\n rw [spectrum]\n rw [Set.compl_subset_comm]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.363_0.OiCHPrqZcVJoE6f","decl":"/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} "} +{"state":"𝕜 : Type u\nA : Type v\ninst✝³ : Field 𝕜\ninst✝² : Ring A\ninst✝¹ : Algebra 𝕜 A\ninst✝ : Nontrivial A\nk : 𝕜\nhk : k ∈ {0}ᶜ\n⊢ k ∈ resolventSet 𝕜 0","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ��¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n rw [neg_neg]\n#align spectrum.singleton_add_eq spectrum.singleton_add_eq\n\ntheorem add_singleton_eq (a : A) (r : R) : σ a + {r} = σ (a + ↑ₐ r) :=\n add_comm {r} (σ a) ▸ add_comm (algebraMap R A r) a ▸ singleton_add_eq a r\n#align spectrum.add_singleton_eq spectrum.add_singleton_eq\n\ntheorem vadd_eq (a : A) (r : R) : r +ᵥ σ a = σ (↑ₐ r + a) :=\n singleton_add.symm.trans <| singleton_add_eq a r\n#align spectrum.vadd_eq spectrum.vadd_eq\n\ntheorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n simp only [mem_neg, mem_iff, map_neg, ← neg_add', IsUnit.neg_iff, sub_neg_eq_add]\n#align spectrum.neg_eq spectrum.neg_eq\n\ntheorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n rw [neg_eq]\n rw [singleton_add_eq]\n rw [sub_eq_add_neg]\n#align spectrum.singleton_sub_eq spectrum.singleton_sub_eq\n\ntheorem sub_singleton_eq (a : A) (r : R) : σ a - {r} = σ (a - ↑ₐ r) := by\n simpa only [neg_sub, neg_eq] using congr_arg Neg.neg (singleton_sub_eq a r)\n#align spectrum.sub_singleton_eq spectrum.sub_singleton_eq\n\nend ScalarRing\n\nsection ScalarField\n\nvariable {𝕜 : Type u} {A : Type v}\n\nvariable [Field 𝕜] [Ring A] [Algebra 𝕜 A]\n\nlocal notation \"σ\" => spectrum 𝕜\n\nlocal notation \"↑ₐ\" => algebraMap 𝕜 A\n\n/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n refine' Set.Subset.antisymm _ (by simp [Algebra.algebraMap_eq_smul_one, mem_iff])\n rw [spectrum]\n rw [Set.compl_subset_comm]\n intro k hk\n ","nextTactic":"rw [Set.mem_compl_singleton_iff] at hk","declUpToTactic":"/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n refine' Set.Subset.antisymm _ (by simp [Algebra.algebraMap_eq_smul_one, mem_iff])\n rw [spectrum]\n rw [Set.compl_subset_comm]\n intro k hk\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.363_0.OiCHPrqZcVJoE6f","decl":"/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} "} +{"state":"𝕜 : Type u\nA : Type v\ninst✝³ : Field 𝕜\ninst✝² : Ring A\ninst✝¹ : Algebra 𝕜 A\ninst✝ : Nontrivial A\nk : 𝕜\nhk : k ≠ 0\n⊢ k ∈ resolventSet 𝕜 0","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n rw [neg_neg]\n#align spectrum.singleton_add_eq spectrum.singleton_add_eq\n\ntheorem add_singleton_eq (a : A) (r : R) : σ a + {r} = σ (a + ↑ₐ r) :=\n add_comm {r} (σ a) ▸ add_comm (algebraMap R A r) a ▸ singleton_add_eq a r\n#align spectrum.add_singleton_eq spectrum.add_singleton_eq\n\ntheorem vadd_eq (a : A) (r : R) : r +ᵥ σ a = σ (↑ₐ r + a) :=\n singleton_add.symm.trans <| singleton_add_eq a r\n#align spectrum.vadd_eq spectrum.vadd_eq\n\ntheorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n simp only [mem_neg, mem_iff, map_neg, ← neg_add', IsUnit.neg_iff, sub_neg_eq_add]\n#align spectrum.neg_eq spectrum.neg_eq\n\ntheorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n rw [neg_eq]\n rw [singleton_add_eq]\n rw [sub_eq_add_neg]\n#align spectrum.singleton_sub_eq spectrum.singleton_sub_eq\n\ntheorem sub_singleton_eq (a : A) (r : R) : σ a - {r} = σ (a - ↑ₐ r) := by\n simpa only [neg_sub, neg_eq] using congr_arg Neg.neg (singleton_sub_eq a r)\n#align spectrum.sub_singleton_eq spectrum.sub_singleton_eq\n\nend ScalarRing\n\nsection ScalarField\n\nvariable {𝕜 : Type u} {A : Type v}\n\nvariable [Field 𝕜] [Ring A] [Algebra 𝕜 A]\n\nlocal notation \"σ\" => spectrum 𝕜\n\nlocal notation \"↑ₐ\" => algebraMap 𝕜 A\n\n/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n refine' Set.Subset.antisymm _ (by simp [Algebra.algebraMap_eq_smul_one, mem_iff])\n rw [spectrum]\n rw [Set.compl_subset_comm]\n intro k hk\n rw [Set.mem_compl_singleton_iff] at hk\n ","nextTactic":"have : IsUnit (Units.mk0 k hk • (1 : A)) := IsUnit.smul (Units.mk0 k hk) isUnit_one","declUpToTactic":"/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n refine' Set.Subset.antisymm _ (by simp [Algebra.algebraMap_eq_smul_one, mem_iff])\n rw [spectrum]\n rw [Set.compl_subset_comm]\n intro k hk\n rw [Set.mem_compl_singleton_iff] at hk\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.363_0.OiCHPrqZcVJoE6f","decl":"/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} "} +{"state":"𝕜 : Type u\nA : Type v\ninst✝³ : Field 𝕜\ninst✝² : Ring A\ninst✝¹ : Algebra 𝕜 A\ninst�� : Nontrivial A\nk : 𝕜\nhk : k ≠ 0\nthis : IsUnit (Units.mk0 k hk • 1)\n⊢ k ∈ resolventSet 𝕜 0","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n rw [neg_neg]\n#align spectrum.singleton_add_eq spectrum.singleton_add_eq\n\ntheorem add_singleton_eq (a : A) (r : R) : σ a + {r} = σ (a + ↑ₐ r) :=\n add_comm {r} (σ a) ▸ add_comm (algebraMap R A r) a ▸ singleton_add_eq a r\n#align spectrum.add_singleton_eq spectrum.add_singleton_eq\n\ntheorem vadd_eq (a : A) (r : R) : r +ᵥ σ a = σ (↑ₐ r + a) :=\n singleton_add.symm.trans <| singleton_add_eq a r\n#align spectrum.vadd_eq spectrum.vadd_eq\n\ntheorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n simp only [mem_neg, mem_iff, map_neg, ← neg_add', IsUnit.neg_iff, sub_neg_eq_add]\n#align spectrum.neg_eq spectrum.neg_eq\n\ntheorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n rw [neg_eq]\n rw [singleton_add_eq]\n rw [sub_eq_add_neg]\n#align spectrum.singleton_sub_eq spectrum.singleton_sub_eq\n\ntheorem sub_singleton_eq (a : A) (r : R) : σ a - {r} = σ (a - ↑ₐ r) := by\n simpa only [neg_sub, neg_eq] using congr_arg Neg.neg (singleton_sub_eq a r)\n#align spectrum.sub_singleton_eq spectrum.sub_singleton_eq\n\nend ScalarRing\n\nsection ScalarField\n\nvariable {𝕜 : Type u} {A : Type v}\n\nvariable [Field 𝕜] [Ring A] [Algebra 𝕜 A]\n\nlocal notation \"σ\" => spectrum 𝕜\n\nlocal notation \"↑ₐ\" => algebraMap 𝕜 A\n\n/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n refine' Set.Subset.antisymm _ (by simp [Algebra.algebraMap_eq_smul_one, mem_iff])\n rw [spectrum]\n rw [Set.compl_subset_comm]\n intro k hk\n rw [Set.mem_compl_singleton_iff] at hk\n have : IsUnit (Units.mk0 k hk • (1 : A)) := IsUnit.smul (Units.mk0 k hk) isUnit_one\n ","nextTactic":"simpa [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one]","declUpToTactic":"/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n refine' Set.Subset.antisymm _ (by simp [Algebra.algebraMap_eq_smul_one, mem_iff])\n rw [spectrum]\n rw [Set.compl_subset_comm]\n intro k hk\n rw [Set.mem_compl_singleton_iff] at hk\n have : IsUnit (Units.mk0 k hk • (1 : A)) := IsUnit.smul (Units.mk0 k hk) isUnit_one\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.363_0.OiCHPrqZcVJoE6f","decl":"/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} "} +{"state":"𝕜 : Type u\nA : Type v\ninst✝³ : Field 𝕜\ninst✝² : Ring A\ninst✝¹ : Algebra 𝕜 A\ninst✝ : Nontrivial A\nk : 𝕜\n⊢ σ (↑ₐ k) = {k}","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n rw [neg_neg]\n#align spectrum.singleton_add_eq spectrum.singleton_add_eq\n\ntheorem add_singleton_eq (a : A) (r : R) : σ a + {r} = σ (a + ↑ₐ r) :=\n add_comm {r} (σ a) ▸ add_comm (algebraMap R A r) a ▸ singleton_add_eq a r\n#align spectrum.add_singleton_eq spectrum.add_singleton_eq\n\ntheorem vadd_eq (a : A) (r : R) : r +ᵥ σ a = σ (↑ₐ r + a) :=\n singleton_add.symm.trans <| singleton_add_eq a r\n#align spectrum.vadd_eq spectrum.vadd_eq\n\ntheorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n simp only [mem_neg, mem_iff, map_neg, ← neg_add', IsUnit.neg_iff, sub_neg_eq_add]\n#align spectrum.neg_eq spectrum.neg_eq\n\ntheorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n rw [neg_eq]\n rw [singleton_add_eq]\n rw [sub_eq_add_neg]\n#align spectrum.singleton_sub_eq spectrum.singleton_sub_eq\n\ntheorem sub_singleton_eq (a : A) (r : R) : σ a - {r} = σ (a - ↑ₐ r) := by\n simpa only [neg_sub, neg_eq] using congr_arg Neg.neg (singleton_sub_eq a r)\n#align spectrum.sub_singleton_eq spectrum.sub_singleton_eq\n\nend ScalarRing\n\nsection ScalarField\n\nvariable {𝕜 : Type u} {A : Type v}\n\nvariable [Field 𝕜] [Ring A] [Algebra 𝕜 A]\n\nlocal notation \"σ\" => spectrum 𝕜\n\nlocal notation \"↑ₐ\" => algebraMap 𝕜 A\n\n/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n refine' Set.Subset.antisymm _ (by simp [Algebra.algebraMap_eq_smul_one, mem_iff])\n rw [spectrum]\n rw [Set.compl_subset_comm]\n intro k hk\n rw [Set.mem_compl_singleton_iff] at hk\n have : IsUnit (Units.mk0 k hk • (1 : A)) := IsUnit.smul (Units.mk0 k hk) isUnit_one\n simpa [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one]\n#align spectrum.zero_eq spectrum.zero_eq\n\n@[simp]\ntheorem scalar_eq [Nontrivial A] (k : 𝕜) : σ (↑ₐ k) = {k} := by\n ","nextTactic":"rw [← add_zero (↑ₐ k)]","declUpToTactic":"@[simp]\ntheorem scalar_eq [Nontrivial A] (k : 𝕜) : σ (↑ₐ k) = {k} := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.375_0.OiCHPrqZcVJoE6f","decl":"@[simp]\ntheorem scalar_eq [Nontrivial A] (k : 𝕜) : σ (↑ₐ k) = {k} "} +{"state":"𝕜 : Type u\nA : Type v\ninst✝³ : Field 𝕜\ninst✝² : Ring A\ninst✝¹ : Algebra 𝕜 A\ninst✝ : Nontrivial A\nk : 𝕜\n⊢ σ (↑ₐ k + 0) = {k}","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n rw [neg_neg]\n#align spectrum.singleton_add_eq spectrum.singleton_add_eq\n\ntheorem add_singleton_eq (a : A) (r : R) : σ a + {r} = σ (a + ↑ₐ r) :=\n add_comm {r} (σ a) ▸ add_comm (algebraMap R A r) a ▸ singleton_add_eq a r\n#align spectrum.add_singleton_eq spectrum.add_singleton_eq\n\ntheorem vadd_eq (a : A) (r : R) : r +ᵥ σ a = σ (↑ₐ r + a) :=\n singleton_add.symm.trans <| singleton_add_eq a r\n#align spectrum.vadd_eq spectrum.vadd_eq\n\ntheorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n simp only [mem_neg, mem_iff, map_neg, ← neg_add', IsUnit.neg_iff, sub_neg_eq_add]\n#align spectrum.neg_eq spectrum.neg_eq\n\ntheorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n rw [neg_eq]\n rw [singleton_add_eq]\n rw [sub_eq_add_neg]\n#align spectrum.singleton_sub_eq spectrum.singleton_sub_eq\n\ntheorem sub_singleton_eq (a : A) (r : R) : σ a - {r} = σ (a - ↑ₐ r) := by\n simpa only [neg_sub, neg_eq] using congr_arg Neg.neg (singleton_sub_eq a r)\n#align spectrum.sub_singleton_eq spectrum.sub_singleton_eq\n\nend ScalarRing\n\nsection ScalarField\n\nvariable {𝕜 : Type u} {A : Type v}\n\nvariable [Field 𝕜] [Ring A] [Algebra 𝕜 A]\n\nlocal notation \"σ\" => spectrum 𝕜\n\nlocal notation \"↑ₐ\" => algebraMap 𝕜 A\n\n/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n refine' Set.Subset.antisymm _ (by simp [Algebra.algebraMap_eq_smul_one, mem_iff])\n rw [spectrum]\n rw [Set.compl_subset_comm]\n intro k hk\n rw [Set.mem_compl_singleton_iff] at hk\n have : IsUnit (Units.mk0 k hk • (1 : A)) := IsUnit.smul (Units.mk0 k hk) isUnit_one\n simpa [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one]\n#align spectrum.zero_eq spectrum.zero_eq\n\n@[simp]\ntheorem scalar_eq [Nontrivial A] (k : 𝕜) : σ (↑ₐ k) = {k} := by\n rw [← add_zero (↑ₐ k)]\n ","nextTactic":"rw [← singleton_add_eq]","declUpToTactic":"@[simp]\ntheorem scalar_eq [Nontrivial A] (k : 𝕜) : σ (↑ₐ k) = {k} := by\n rw [← add_zero (↑ₐ k)]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.375_0.OiCHPrqZcVJoE6f","decl":"@[simp]\ntheorem scalar_eq [Nontrivial A] (k : 𝕜) : σ (↑ₐ k) = {k} "} +{"state":"𝕜 : Type u\nA : Type v\ninst✝³ : Field 𝕜\ninst✝² : Ring A\ninst✝¹ : Algebra 𝕜 A\ninst✝ : Nontrivial A\nk : 𝕜\n⊢ {k} + σ 0 = {k}","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n rw [neg_neg]\n#align spectrum.singleton_add_eq spectrum.singleton_add_eq\n\ntheorem add_singleton_eq (a : A) (r : R) : σ a + {r} = σ (a + ↑ₐ r) :=\n add_comm {r} (σ a) ▸ add_comm (algebraMap R A r) a ▸ singleton_add_eq a r\n#align spectrum.add_singleton_eq spectrum.add_singleton_eq\n\ntheorem vadd_eq (a : A) (r : R) : r +ᵥ σ a = σ (↑ₐ r + a) :=\n singleton_add.symm.trans <| singleton_add_eq a r\n#align spectrum.vadd_eq spectrum.vadd_eq\n\ntheorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n simp only [mem_neg, mem_iff, map_neg, ← neg_add', IsUnit.neg_iff, sub_neg_eq_add]\n#align spectrum.neg_eq spectrum.neg_eq\n\ntheorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n rw [neg_eq]\n rw [singleton_add_eq]\n rw [sub_eq_add_neg]\n#align spectrum.singleton_sub_eq spectrum.singleton_sub_eq\n\ntheorem sub_singleton_eq (a : A) (r : R) : σ a - {r} = σ (a - ↑ₐ r) := by\n simpa only [neg_sub, neg_eq] using congr_arg Neg.neg (singleton_sub_eq a r)\n#align spectrum.sub_singleton_eq spectrum.sub_singleton_eq\n\nend ScalarRing\n\nsection ScalarField\n\nvariable {𝕜 : Type u} {A : Type v}\n\nvariable [Field 𝕜] [Ring A] [Algebra 𝕜 A]\n\nlocal notation \"σ\" => spectrum 𝕜\n\nlocal notation \"↑ₐ\" => algebraMap 𝕜 A\n\n/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n refine' Set.Subset.antisymm _ (by simp [Algebra.algebraMap_eq_smul_one, mem_iff])\n rw [spectrum]\n rw [Set.compl_subset_comm]\n intro k hk\n rw [Set.mem_compl_singleton_iff] at hk\n have : IsUnit (Units.mk0 k hk • (1 : A)) := IsUnit.smul (Units.mk0 k hk) isUnit_one\n simpa [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one]\n#align spectrum.zero_eq spectrum.zero_eq\n\n@[simp]\ntheorem scalar_eq [Nontrivial A] (k : 𝕜) : σ (↑ₐ k) = {k} := by\n rw [← add_zero (↑ₐ k)]\n rw [← singleton_add_eq]\n ","nextTactic":"rw [zero_eq]","declUpToTactic":"@[simp]\ntheorem scalar_eq [Nontrivial A] (k : 𝕜) : σ (↑ₐ k) = {k} := by\n rw [← add_zero (↑ₐ k)]\n rw [← singleton_add_eq]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.375_0.OiCHPrqZcVJoE6f","decl":"@[simp]\ntheorem scalar_eq [Nontrivial A] (k : 𝕜) : σ (↑ₐ k) = {k} "} +{"state":"𝕜 : Type u\nA : Type v\ninst✝³ : Field 𝕜\ninst✝² : Ring A\ninst✝¹ : Algebra 𝕜 A\ninst✝ : Nontrivial A\nk : 𝕜\n⊢ {k} + {0} = {k}","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n rw [neg_neg]\n#align spectrum.singleton_add_eq spectrum.singleton_add_eq\n\ntheorem add_singleton_eq (a : A) (r : R) : σ a + {r} = σ (a + ↑ₐ r) :=\n add_comm {r} (σ a) ▸ add_comm (algebraMap R A r) a ▸ singleton_add_eq a r\n#align spectrum.add_singleton_eq spectrum.add_singleton_eq\n\ntheorem vadd_eq (a : A) (r : R) : r +ᵥ σ a = σ (↑ₐ r + a) :=\n singleton_add.symm.trans <| singleton_add_eq a r\n#align spectrum.vadd_eq spectrum.vadd_eq\n\ntheorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n simp only [mem_neg, mem_iff, map_neg, ← neg_add', IsUnit.neg_iff, sub_neg_eq_add]\n#align spectrum.neg_eq spectrum.neg_eq\n\ntheorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n rw [neg_eq]\n rw [singleton_add_eq]\n rw [sub_eq_add_neg]\n#align spectrum.singleton_sub_eq spectrum.singleton_sub_eq\n\ntheorem sub_singleton_eq (a : A) (r : R) : σ a - {r} = σ (a - ↑ₐ r) := by\n simpa only [neg_sub, neg_eq] using congr_arg Neg.neg (singleton_sub_eq a r)\n#align spectrum.sub_singleton_eq spectrum.sub_singleton_eq\n\nend ScalarRing\n\nsection ScalarField\n\nvariable {𝕜 : Type u} {A : Type v}\n\nvariable [Field 𝕜] [Ring A] [Algebra 𝕜 A]\n\nlocal notation \"σ\" => spectrum 𝕜\n\nlocal notation \"↑ₐ\" => algebraMap 𝕜 A\n\n/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n refine' Set.Subset.antisymm _ (by simp [Algebra.algebraMap_eq_smul_one, mem_iff])\n rw [spectrum]\n rw [Set.compl_subset_comm]\n intro k hk\n rw [Set.mem_compl_singleton_iff] at hk\n have : IsUnit (Units.mk0 k hk • (1 : A)) := IsUnit.smul (Units.mk0 k hk) isUnit_one\n simpa [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one]\n#align spectrum.zero_eq spectrum.zero_eq\n\n@[simp]\ntheorem scalar_eq [Nontrivial A] (k : 𝕜) : σ (↑ₐ k) = {k} := by\n rw [← add_zero (↑ₐ k)]\n rw [← singleton_add_eq]\n rw [zero_eq]\n ","nextTactic":"rw [Set.singleton_add_singleton]","declUpToTactic":"@[simp]\ntheorem scalar_eq [Nontrivial A] (k : 𝕜) : σ (↑ₐ k) = {k} := by\n rw [← add_zero (↑ₐ k)]\n rw [← singleton_add_eq]\n rw [zero_eq]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.375_0.OiCHPrqZcVJoE6f","decl":"@[simp]\ntheorem scalar_eq [Nontrivial A] (k : 𝕜) : σ (↑ₐ k) = {k} "} +{"state":"𝕜 : Type u\nA : Type v\ninst✝³ : Field 𝕜\ninst✝² : Ring A\ninst✝¹ : Algebra 𝕜 A\ninst✝ : Nontrivial A\nk : 𝕜\n⊢ {k + 0} = {k}","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n rw [neg_neg]\n#align spectrum.singleton_add_eq spectrum.singleton_add_eq\n\ntheorem add_singleton_eq (a : A) (r : R) : σ a + {r} = σ (a + ↑ₐ r) :=\n add_comm {r} (σ a) ▸ add_comm (algebraMap R A r) a ▸ singleton_add_eq a r\n#align spectrum.add_singleton_eq spectrum.add_singleton_eq\n\ntheorem vadd_eq (a : A) (r : R) : r +ᵥ σ a = σ (↑ₐ r + a) :=\n singleton_add.symm.trans <| singleton_add_eq a r\n#align spectrum.vadd_eq spectrum.vadd_eq\n\ntheorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n simp only [mem_neg, mem_iff, map_neg, ← neg_add', IsUnit.neg_iff, sub_neg_eq_add]\n#align spectrum.neg_eq spectrum.neg_eq\n\ntheorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n rw [neg_eq]\n rw [singleton_add_eq]\n rw [sub_eq_add_neg]\n#align spectrum.singleton_sub_eq spectrum.singleton_sub_eq\n\ntheorem sub_singleton_eq (a : A) (r : R) : σ a - {r} = σ (a - ↑ₐ r) := by\n simpa only [neg_sub, neg_eq] using congr_arg Neg.neg (singleton_sub_eq a r)\n#align spectrum.sub_singleton_eq spectrum.sub_singleton_eq\n\nend ScalarRing\n\nsection ScalarField\n\nvariable {𝕜 : Type u} {A : Type v}\n\nvariable [Field 𝕜] [Ring A] [Algebra 𝕜 A]\n\nlocal notation \"σ\" => spectrum 𝕜\n\nlocal notation \"↑ₐ\" => algebraMap 𝕜 A\n\n/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n refine' Set.Subset.antisymm _ (by simp [Algebra.algebraMap_eq_smul_one, mem_iff])\n rw [spectrum]\n rw [Set.compl_subset_comm]\n intro k hk\n rw [Set.mem_compl_singleton_iff] at hk\n have : IsUnit (Units.mk0 k hk • (1 : A)) := IsUnit.smul (Units.mk0 k hk) isUnit_one\n simpa [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one]\n#align spectrum.zero_eq spectrum.zero_eq\n\n@[simp]\ntheorem scalar_eq [Nontrivial A] (k : 𝕜) : σ (↑ₐ k) = {k} := by\n rw [← add_zero (↑ₐ k)]\n rw [← singleton_add_eq]\n rw [zero_eq]\n rw [Set.singleton_add_singleton]\n ","nextTactic":"rw [add_zero]","declUpToTactic":"@[simp]\ntheorem scalar_eq [Nontrivial A] (k : 𝕜) : σ (↑ₐ k) = {k} := by\n rw [← add_zero (↑ₐ k)]\n rw [← singleton_add_eq]\n rw [zero_eq]\n rw [Set.singleton_add_singleton]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.375_0.OiCHPrqZcVJoE6f","decl":"@[simp]\ntheorem scalar_eq [Nontrivial A] (k : 𝕜) : σ (↑ₐ k) = {k} "} +{"state":"𝕜 : Type u\nA : Type v\ninst✝³ : Field 𝕜\ninst✝² : Ring A\ninst✝¹ : Algebra 𝕜 A\ninst✝ : Nontrivial A\n⊢ σ 1 = σ (↑ₐ 1)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n rw [neg_neg]\n#align spectrum.singleton_add_eq spectrum.singleton_add_eq\n\ntheorem add_singleton_eq (a : A) (r : R) : σ a + {r} = σ (a + ↑ₐ r) :=\n add_comm {r} (σ a) ▸ add_comm (algebraMap R A r) a ▸ singleton_add_eq a r\n#align spectrum.add_singleton_eq spectrum.add_singleton_eq\n\ntheorem vadd_eq (a : A) (r : R) : r +ᵥ σ a = σ (↑ₐ r + a) :=\n singleton_add.symm.trans <| singleton_add_eq a r\n#align spectrum.vadd_eq spectrum.vadd_eq\n\ntheorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n simp only [mem_neg, mem_iff, map_neg, ← neg_add', IsUnit.neg_iff, sub_neg_eq_add]\n#align spectrum.neg_eq spectrum.neg_eq\n\ntheorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n rw [neg_eq]\n rw [singleton_add_eq]\n rw [sub_eq_add_neg]\n#align spectrum.singleton_sub_eq spectrum.singleton_sub_eq\n\ntheorem sub_singleton_eq (a : A) (r : R) : σ a - {r} = σ (a - ↑ₐ r) := by\n simpa only [neg_sub, neg_eq] using congr_arg Neg.neg (singleton_sub_eq a r)\n#align spectrum.sub_singleton_eq spectrum.sub_singleton_eq\n\nend ScalarRing\n\nsection ScalarField\n\nvariable {𝕜 : Type u} {A : Type v}\n\nvariable [Field 𝕜] [Ring A] [Algebra 𝕜 A]\n\nlocal notation \"σ\" => spectrum 𝕜\n\nlocal notation \"↑ₐ\" => algebraMap 𝕜 A\n\n/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n refine' Set.Subset.antisymm _ (by simp [Algebra.algebraMap_eq_smul_one, mem_iff])\n rw [spectrum]\n rw [Set.compl_subset_comm]\n intro k hk\n rw [Set.mem_compl_singleton_iff] at hk\n have : IsUnit (Units.mk0 k hk • (1 : A)) := IsUnit.smul (Units.mk0 k hk) isUnit_one\n simpa [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one]\n#align spectrum.zero_eq spectrum.zero_eq\n\n@[simp]\ntheorem scalar_eq [Nontrivial A] (k : 𝕜) : σ (↑ₐ k) = {k} := by\n rw [← add_zero (↑ₐ k)]\n rw [← singleton_add_eq]\n rw [zero_eq]\n rw [Set.singleton_add_singleton]\n rw [add_zero]\n#align spectrum.scalar_eq spectrum.scalar_eq\n\n@[simp]\ntheorem one_eq [Nontrivial A] : σ (1 : A) = {1} :=\n calc\n σ (1 : A) = σ (↑ₐ 1) := by ","nextTactic":"rw [Algebra.algebraMap_eq_smul_one, one_smul]","declUpToTactic":"@[simp]\ntheorem one_eq [Nontrivial A] : σ (1 : A) = {1} :=\n calc\n σ (1 : A) = σ (↑ₐ 1) := by ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.384_0.OiCHPrqZcVJoE6f","decl":"@[simp]\ntheorem one_eq [Nontrivial A] : σ (1 : A) = {1} "} +{"state":"𝕜 : Type u\nA : Type v\ninst✝³ : Field 𝕜\ninst✝² : Ring A\ninst✝¹ : Algebra 𝕜 A\ninst✝ : Nontrivial A\nk : 𝕜\na : A\nha : Set.Nonempty (σ a)\n⊢ σ (k • a) = k • σ a","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n rw [neg_neg]\n#align spectrum.singleton_add_eq spectrum.singleton_add_eq\n\ntheorem add_singleton_eq (a : A) (r : R) : σ a + {r} = σ (a + ↑ₐ r) :=\n add_comm {r} (σ a) ▸ add_comm (algebraMap R A r) a ▸ singleton_add_eq a r\n#align spectrum.add_singleton_eq spectrum.add_singleton_eq\n\ntheorem vadd_eq (a : A) (r : R) : r +ᵥ σ a = σ (↑ₐ r + a) :=\n singleton_add.symm.trans <| singleton_add_eq a r\n#align spectrum.vadd_eq spectrum.vadd_eq\n\ntheorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n simp only [mem_neg, mem_iff, map_neg, ← neg_add', IsUnit.neg_iff, sub_neg_eq_add]\n#align spectrum.neg_eq spectrum.neg_eq\n\ntheorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n rw [neg_eq]\n rw [singleton_add_eq]\n rw [sub_eq_add_neg]\n#align spectrum.singleton_sub_eq spectrum.singleton_sub_eq\n\ntheorem sub_singleton_eq (a : A) (r : R) : σ a - {r} = σ (a - ↑ₐ r) := by\n simpa only [neg_sub, neg_eq] using congr_arg Neg.neg (singleton_sub_eq a r)\n#align spectrum.sub_singleton_eq spectrum.sub_singleton_eq\n\nend ScalarRing\n\nsection ScalarField\n\nvariable {𝕜 : Type u} {A : Type v}\n\nvariable [Field 𝕜] [Ring A] [Algebra 𝕜 A]\n\nlocal notation \"σ\" => spectrum 𝕜\n\nlocal notation \"↑ₐ\" => algebraMap 𝕜 A\n\n/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n refine' Set.Subset.antisymm _ (by simp [Algebra.algebraMap_eq_smul_one, mem_iff])\n rw [spectrum]\n rw [Set.compl_subset_comm]\n intro k hk\n rw [Set.mem_compl_singleton_iff] at hk\n have : IsUnit (Units.mk0 k hk • (1 : A)) := IsUnit.smul (Units.mk0 k hk) isUnit_one\n simpa [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one]\n#align spectrum.zero_eq spectrum.zero_eq\n\n@[simp]\ntheorem scalar_eq [Nontrivial A] (k : 𝕜) : σ (↑ₐ k) = {k} := by\n rw [← add_zero (↑ₐ k)]\n rw [← singleton_add_eq]\n rw [zero_eq]\n rw [Set.singleton_add_singleton]\n rw [add_zero]\n#align spectrum.scalar_eq spectrum.scalar_eq\n\n@[simp]\ntheorem one_eq [Nontrivial A] : σ (1 : A) = {1} :=\n calc\n σ (1 : A) = σ (↑ₐ 1) := by rw [Algebra.algebraMap_eq_smul_one, one_smul]\n _ = {1} := scalar_eq 1\n\n#align spectrum.one_eq spectrum.one_eq\n\n/-- the assumption `(σ a).Nonempty` is necessary and cannot be removed without\nfurther conditions on the algebra `A` and scalar field `𝕜`. -/\ntheorem smul_eq_smul [Nontrivial A] (k : 𝕜) (a : A) (ha : (σ a).Nonempty) :\n σ (k • a) = k • σ a := by\n ","nextTactic":"rcases eq_or_ne k 0 with (rfl | h)","declUpToTactic":"/-- the assumption `(σ a).Nonempty` is necessary and cannot be removed without\nfurther conditions on the algebra `A` and scalar field `𝕜`. -/\ntheorem smul_eq_smul [Nontrivial A] (k : 𝕜) (a : A) (ha : (σ a).Nonempty) :\n σ (k • a) = k • σ a := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.392_0.OiCHPrqZcVJoE6f","decl":"/-- the assumption `(σ a).Nonempty` is necessary and cannot be removed without\nfurther conditions on the algebra `A` and scalar field `𝕜`. -/\ntheorem smul_eq_smul [Nontrivial A] (k : 𝕜) (a : A) (ha : (σ a).Nonempty) :\n σ (k • a) = k • σ a "} +{"state":"case inl\n𝕜 : Type u\nA : Type v\ninst✝³ : Field 𝕜\ninst✝² : Ring A\ninst✝¹ : Algebra 𝕜 A\ninst✝ : Nontrivial A\na : A\nha : Set.Nonempty (σ a)\n⊢ σ (0 • a) = 0 • σ a","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n rw [neg_neg]\n#align spectrum.singleton_add_eq spectrum.singleton_add_eq\n\ntheorem add_singleton_eq (a : A) (r : R) : σ a + {r} = σ (a + ↑ₐ r) :=\n add_comm {r} (σ a) ▸ add_comm (algebraMap R A r) a ▸ singleton_add_eq a r\n#align spectrum.add_singleton_eq spectrum.add_singleton_eq\n\ntheorem vadd_eq (a : A) (r : R) : r +ᵥ σ a = σ (↑ₐ r + a) :=\n singleton_add.symm.trans <| singleton_add_eq a r\n#align spectrum.vadd_eq spectrum.vadd_eq\n\ntheorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n simp only [mem_neg, mem_iff, map_neg, ← neg_add', IsUnit.neg_iff, sub_neg_eq_add]\n#align spectrum.neg_eq spectrum.neg_eq\n\ntheorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n rw [neg_eq]\n rw [singleton_add_eq]\n rw [sub_eq_add_neg]\n#align spectrum.singleton_sub_eq spectrum.singleton_sub_eq\n\ntheorem sub_singleton_eq (a : A) (r : R) : σ a - {r} = σ (a - ↑ₐ r) := by\n simpa only [neg_sub, neg_eq] using congr_arg Neg.neg (singleton_sub_eq a r)\n#align spectrum.sub_singleton_eq spectrum.sub_singleton_eq\n\nend ScalarRing\n\nsection ScalarField\n\nvariable {𝕜 : Type u} {A : Type v}\n\nvariable [Field 𝕜] [Ring A] [Algebra 𝕜 A]\n\nlocal notation \"σ\" => spectrum 𝕜\n\nlocal notation \"↑ₐ\" => algebraMap 𝕜 A\n\n/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n refine' Set.Subset.antisymm _ (by simp [Algebra.algebraMap_eq_smul_one, mem_iff])\n rw [spectrum]\n rw [Set.compl_subset_comm]\n intro k hk\n rw [Set.mem_compl_singleton_iff] at hk\n have : IsUnit (Units.mk0 k hk • (1 : A)) := IsUnit.smul (Units.mk0 k hk) isUnit_one\n simpa [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one]\n#align spectrum.zero_eq spectrum.zero_eq\n\n@[simp]\ntheorem scalar_eq [Nontrivial A] (k : 𝕜) : σ (↑ₐ k) = {k} := by\n rw [← add_zero (↑ₐ k)]\n rw [← singleton_add_eq]\n rw [zero_eq]\n rw [Set.singleton_add_singleton]\n rw [add_zero]\n#align spectrum.scalar_eq spectrum.scalar_eq\n\n@[simp]\ntheorem one_eq [Nontrivial A] : σ (1 : A) = {1} :=\n calc\n σ (1 : A) = σ (↑ₐ 1) := by rw [Algebra.algebraMap_eq_smul_one, one_smul]\n _ = {1} := scalar_eq 1\n\n#align spectrum.one_eq spectrum.one_eq\n\n/-- the assumption `(σ a).Nonempty` is necessary and cannot be removed without\nfurther conditions on the algebra `A` and scalar field `𝕜`. -/\ntheorem smul_eq_smul [Nontrivial A] (k : 𝕜) (a : A) (ha : (σ a).Nonempty) :\n σ (k • a) = k • σ a := by\n rcases eq_or_ne k 0 with (rfl | h)\n · ","nextTactic":"simpa [ha, zero_smul_set] using (show {(0 : 𝕜)} = (0 : Set 𝕜) from rfl)","declUpToTactic":"/-- the assumption `(σ a).Nonempty` is necessary and cannot be removed without\nfurther conditions on the algebra `A` and scalar field `𝕜`. -/\ntheorem smul_eq_smul [Nontrivial A] (k : 𝕜) (a : A) (ha : (σ a).Nonempty) :\n σ (k • a) = k • σ a := by\n rcases eq_or_ne k 0 with (rfl | h)\n · ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.392_0.OiCHPrqZcVJoE6f","decl":"/-- the assumption `(σ a).Nonempty` is necessary and cannot be removed without\nfurther conditions on the algebra `A` and scalar field `𝕜`. -/\ntheorem smul_eq_smul [Nontrivial A] (k : 𝕜) (a : A) (ha : (σ a).Nonempty) :\n σ (k • a) = k • σ a "} +{"state":"case inr\n𝕜 : Type u\nA : Type v\ninst✝³ : Field 𝕜\ninst✝² : Ring A\ninst✝¹ : Algebra 𝕜 A\ninst✝ : Nontrivial A\nk : 𝕜\na : A\nha : Set.Nonempty (σ a)\nh : k ≠ 0\n⊢ σ (k • a) = k • σ a","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n rw [neg_neg]\n#align spectrum.singleton_add_eq spectrum.singleton_add_eq\n\ntheorem add_singleton_eq (a : A) (r : R) : σ a + {r} = σ (a + ↑ₐ r) :=\n add_comm {r} (σ a) ▸ add_comm (algebraMap R A r) a ▸ singleton_add_eq a r\n#align spectrum.add_singleton_eq spectrum.add_singleton_eq\n\ntheorem vadd_eq (a : A) (r : R) : r +ᵥ σ a = σ (↑ₐ r + a) :=\n singleton_add.symm.trans <| singleton_add_eq a r\n#align spectrum.vadd_eq spectrum.vadd_eq\n\ntheorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n simp only [mem_neg, mem_iff, map_neg, ← neg_add', IsUnit.neg_iff, sub_neg_eq_add]\n#align spectrum.neg_eq spectrum.neg_eq\n\ntheorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n rw [neg_eq]\n rw [singleton_add_eq]\n rw [sub_eq_add_neg]\n#align spectrum.singleton_sub_eq spectrum.singleton_sub_eq\n\ntheorem sub_singleton_eq (a : A) (r : R) : σ a - {r} = σ (a - ↑ₐ r) := by\n simpa only [neg_sub, neg_eq] using congr_arg Neg.neg (singleton_sub_eq a r)\n#align spectrum.sub_singleton_eq spectrum.sub_singleton_eq\n\nend ScalarRing\n\nsection ScalarField\n\nvariable {𝕜 : Type u} {A : Type v}\n\nvariable [Field 𝕜] [Ring A] [Algebra 𝕜 A]\n\nlocal notation \"σ\" => spectrum 𝕜\n\nlocal notation \"↑ₐ\" => algebraMap 𝕜 A\n\n/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n refine' Set.Subset.antisymm _ (by simp [Algebra.algebraMap_eq_smul_one, mem_iff])\n rw [spectrum]\n rw [Set.compl_subset_comm]\n intro k hk\n rw [Set.mem_compl_singleton_iff] at hk\n have : IsUnit (Units.mk0 k hk • (1 : A)) := IsUnit.smul (Units.mk0 k hk) isUnit_one\n simpa [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one]\n#align spectrum.zero_eq spectrum.zero_eq\n\n@[simp]\ntheorem scalar_eq [Nontrivial A] (k : 𝕜) : σ (↑ₐ k) = {k} := by\n rw [← add_zero (↑ₐ k)]\n rw [← singleton_add_eq]\n rw [zero_eq]\n rw [Set.singleton_add_singleton]\n rw [add_zero]\n#align spectrum.scalar_eq spectrum.scalar_eq\n\n@[simp]\ntheorem one_eq [Nontrivial A] : σ (1 : A) = {1} :=\n calc\n σ (1 : A) = σ (↑ₐ 1) := by rw [Algebra.algebraMap_eq_smul_one, one_smul]\n _ = {1} := scalar_eq 1\n\n#align spectrum.one_eq spectrum.one_eq\n\n/-- the assumption `(σ a).Nonempty` is necessary and cannot be removed without\nfurther conditions on the algebra `A` and scalar field `𝕜`. -/\ntheorem smul_eq_smul [Nontrivial A] (k : 𝕜) (a : A) (ha : (σ a).Nonempty) :\n σ (k • a) = k • σ a := by\n rcases eq_or_ne k 0 with (rfl | h)\n · simpa [ha, zero_smul_set] using (show {(0 : 𝕜)} = (0 : Set 𝕜) from rfl)\n · ","nextTactic":"exact unit_smul_eq_smul a (Units.mk0 k h)","declUpToTactic":"/-- the assumption `(σ a).Nonempty` is necessary and cannot be removed without\nfurther conditions on the algebra `A` and scalar field `𝕜`. -/\ntheorem smul_eq_smul [Nontrivial A] (k : 𝕜) (a : A) (ha : (σ a).Nonempty) :\n σ (k • a) = k • σ a := by\n rcases eq_or_ne k 0 with (rfl | h)\n · simpa [ha, zero_smul_set] using (show {(0 : 𝕜)} = (0 : Set 𝕜) from rfl)\n · ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.392_0.OiCHPrqZcVJoE6f","decl":"/-- the assumption `(σ a).Nonempty` is necessary and cannot be removed without\nfurther conditions on the algebra `A` and scalar field `𝕜`. -/\ntheorem smul_eq_smul [Nontrivial A] (k : 𝕜) (a : A) (ha : (σ a).Nonempty) :\n σ (k • a) = k • σ a "} +{"state":"𝕜 : Type u\nA : Type v\ninst✝² : Field 𝕜\ninst✝¹ : Ring A\ninst✝ : Algebra 𝕜 A\na b : A\n⊢ σ (a * b) \\ {0} = σ (b * a) \\ {0}","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n rw [neg_neg]\n#align spectrum.singleton_add_eq spectrum.singleton_add_eq\n\ntheorem add_singleton_eq (a : A) (r : R) : σ a + {r} = σ (a + ↑ₐ r) :=\n add_comm {r} (σ a) ▸ add_comm (algebraMap R A r) a ▸ singleton_add_eq a r\n#align spectrum.add_singleton_eq spectrum.add_singleton_eq\n\ntheorem vadd_eq (a : A) (r : R) : r +ᵥ σ a = σ (↑ₐ r + a) :=\n singleton_add.symm.trans <| singleton_add_eq a r\n#align spectrum.vadd_eq spectrum.vadd_eq\n\ntheorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n simp only [mem_neg, mem_iff, map_neg, ← neg_add', IsUnit.neg_iff, sub_neg_eq_add]\n#align spectrum.neg_eq spectrum.neg_eq\n\ntheorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n rw [neg_eq]\n rw [singleton_add_eq]\n rw [sub_eq_add_neg]\n#align spectrum.singleton_sub_eq spectrum.singleton_sub_eq\n\ntheorem sub_singleton_eq (a : A) (r : R) : σ a - {r} = σ (a - ↑ₐ r) := by\n simpa only [neg_sub, neg_eq] using congr_arg Neg.neg (singleton_sub_eq a r)\n#align spectrum.sub_singleton_eq spectrum.sub_singleton_eq\n\nend ScalarRing\n\nsection ScalarField\n\nvariable {𝕜 : Type u} {A : Type v}\n\nvariable [Field 𝕜] [Ring A] [Algebra 𝕜 A]\n\nlocal notation \"σ\" => spectrum 𝕜\n\nlocal notation \"↑ₐ\" => algebraMap 𝕜 A\n\n/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n refine' Set.Subset.antisymm _ (by simp [Algebra.algebraMap_eq_smul_one, mem_iff])\n rw [spectrum]\n rw [Set.compl_subset_comm]\n intro k hk\n rw [Set.mem_compl_singleton_iff] at hk\n have : IsUnit (Units.mk0 k hk • (1 : A)) := IsUnit.smul (Units.mk0 k hk) isUnit_one\n simpa [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one]\n#align spectrum.zero_eq spectrum.zero_eq\n\n@[simp]\ntheorem scalar_eq [Nontrivial A] (k : 𝕜) : σ (↑ₐ k) = {k} := by\n rw [← add_zero (↑ₐ k)]\n rw [← singleton_add_eq]\n rw [zero_eq]\n rw [Set.singleton_add_singleton]\n rw [add_zero]\n#align spectrum.scalar_eq spectrum.scalar_eq\n\n@[simp]\ntheorem one_eq [Nontrivial A] : σ (1 : A) = {1} :=\n calc\n σ (1 : A) = σ (↑ₐ 1) := by rw [Algebra.algebraMap_eq_smul_one, one_smul]\n _ = {1} := scalar_eq 1\n\n#align spectrum.one_eq spectrum.one_eq\n\n/-- the assumption `(σ a).Nonempty` is necessary and cannot be removed without\nfurther conditions on the algebra `A` and scalar field `𝕜`. -/\ntheorem smul_eq_smul [Nontrivial A] (k : 𝕜) (a : A) (ha : (σ a).Nonempty) :\n σ (k • a) = k • σ a := by\n rcases eq_or_ne k 0 with (rfl | h)\n · simpa [ha, zero_smul_set] using (show {(0 : 𝕜)} = (0 : Set 𝕜) from rfl)\n · exact unit_smul_eq_smul a (Units.mk0 k h)\n#align spectrum.smul_eq_smul spectrum.smul_eq_smul\n\ntheorem nonzero_mul_eq_swap_mul (a b : A) : σ (a * b) \\ {0} = σ (b * a) \\ {0} := by\n ","nextTactic":"suffices h : ∀ x y : A, σ (x * y) \\ {0} ⊆ σ (y * x) \\ {0}","declUpToTactic":"theorem nonzero_mul_eq_swap_mul (a b : A) : σ (a * b) \\ {0} = σ (b * a) \\ {0} := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.401_0.OiCHPrqZcVJoE6f","decl":"theorem nonzero_mul_eq_swap_mul (a b : A) : σ (a * b) \\ {0} = σ (b * a) \\ {0} "} +{"state":"𝕜 : Type u\nA : Type v\ninst✝² : Field 𝕜\ninst✝¹ : Ring A\ninst✝ : Algebra 𝕜 A\na b : A\nh : ∀ (x y : A), σ (x * y) \\ {0} ⊆ σ (y * x) \\ {0}\n⊢ σ (a * b) \\ {0} = σ (b * a) \\ {0}","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (��ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n rw [neg_neg]\n#align spectrum.singleton_add_eq spectrum.singleton_add_eq\n\ntheorem add_singleton_eq (a : A) (r : R) : σ a + {r} = σ (a + ↑ₐ r) :=\n add_comm {r} (σ a) ▸ add_comm (algebraMap R A r) a ▸ singleton_add_eq a r\n#align spectrum.add_singleton_eq spectrum.add_singleton_eq\n\ntheorem vadd_eq (a : A) (r : R) : r +ᵥ σ a = σ (↑ₐ r + a) :=\n singleton_add.symm.trans <| singleton_add_eq a r\n#align spectrum.vadd_eq spectrum.vadd_eq\n\ntheorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n simp only [mem_neg, mem_iff, map_neg, ← neg_add', IsUnit.neg_iff, sub_neg_eq_add]\n#align spectrum.neg_eq spectrum.neg_eq\n\ntheorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n rw [neg_eq]\n rw [singleton_add_eq]\n rw [sub_eq_add_neg]\n#align spectrum.singleton_sub_eq spectrum.singleton_sub_eq\n\ntheorem sub_singleton_eq (a : A) (r : R) : σ a - {r} = σ (a - ↑ₐ r) := by\n simpa only [neg_sub, neg_eq] using congr_arg Neg.neg (singleton_sub_eq a r)\n#align spectrum.sub_singleton_eq spectrum.sub_singleton_eq\n\nend ScalarRing\n\nsection ScalarField\n\nvariable {𝕜 : Type u} {A : Type v}\n\nvariable [Field 𝕜] [Ring A] [Algebra 𝕜 A]\n\nlocal notation \"σ\" => spectrum 𝕜\n\nlocal notation \"↑ₐ\" => algebraMap 𝕜 A\n\n/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n refine' Set.Subset.antisymm _ (by simp [Algebra.algebraMap_eq_smul_one, mem_iff])\n rw [spectrum]\n rw [Set.compl_subset_comm]\n intro k hk\n rw [Set.mem_compl_singleton_iff] at hk\n have : IsUnit (Units.mk0 k hk • (1 : A)) := IsUnit.smul (Units.mk0 k hk) isUnit_one\n simpa [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one]\n#align spectrum.zero_eq spectrum.zero_eq\n\n@[simp]\ntheorem scalar_eq [Nontrivial A] (k : 𝕜) : σ (↑ₐ k) = {k} := by\n rw [← add_zero (↑ₐ k)]\n rw [← singleton_add_eq]\n rw [zero_eq]\n rw [Set.singleton_add_singleton]\n rw [add_zero]\n#align spectrum.scalar_eq spectrum.scalar_eq\n\n@[simp]\ntheorem one_eq [Nontrivial A] : σ (1 : A) = {1} :=\n calc\n σ (1 : A) = σ (↑ₐ 1) := by rw [Algebra.algebraMap_eq_smul_one, one_smul]\n _ = {1} := scalar_eq 1\n\n#align spectrum.one_eq spectrum.one_eq\n\n/-- the assumption `(σ a).Nonempty` is necessary and cannot be removed without\nfurther conditions on the algebra `A` and scalar field `𝕜`. -/\ntheorem smul_eq_smul [Nontrivial A] (k : 𝕜) (a : A) (ha : (σ a).Nonempty) :\n σ (k • a) = k • σ a := by\n rcases eq_or_ne k 0 with (rfl | h)\n · simpa [ha, zero_smul_set] using (show {(0 : 𝕜)} = (0 : Set 𝕜) from rfl)\n · exact unit_smul_eq_smul a (Units.mk0 k h)\n#align spectrum.smul_eq_smul spectrum.smul_eq_smul\n\ntheorem nonzero_mul_eq_swap_mul (a b : A) : σ (a * b) \\ {0} = σ (b * a) \\ {0} := by\n suffices h : ∀ x y : A, σ (x * y) \\ {0} ⊆ σ (y * x) \\ {0}\n · ","nextTactic":"exact Set.eq_of_subset_of_subset (h a b) (h b a)","declUpToTactic":"theorem nonzero_mul_eq_swap_mul (a b : A) : σ (a * b) \\ {0} = σ (b * a) \\ {0} := by\n suffices h : ∀ x y : A, σ (x * y) \\ {0} ⊆ σ (y * x) \\ {0}\n · ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.401_0.OiCHPrqZcVJoE6f","decl":"theorem nonzero_mul_eq_swap_mul (a b : A) : σ (a * b) \\ {0} = σ (b * a) \\ {0} "} +{"state":"case h\n𝕜 : Type u\nA : Type v\ninst✝² : Field 𝕜\ninst✝¹ : Ring A\ninst✝ : Algebra 𝕜 A\na b : A\n⊢ ∀ (x y : A), σ (x * y) \\ {0} ⊆ σ (y * x) \\ {0}","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n rw [neg_neg]\n#align spectrum.singleton_add_eq spectrum.singleton_add_eq\n\ntheorem add_singleton_eq (a : A) (r : R) : σ a + {r} = σ (a + ↑ₐ r) :=\n add_comm {r} (σ a) ▸ add_comm (algebraMap R A r) a ▸ singleton_add_eq a r\n#align spectrum.add_singleton_eq spectrum.add_singleton_eq\n\ntheorem vadd_eq (a : A) (r : R) : r +ᵥ σ a = σ (↑ₐ r + a) :=\n singleton_add.symm.trans <| singleton_add_eq a r\n#align spectrum.vadd_eq spectrum.vadd_eq\n\ntheorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n simp only [mem_neg, mem_iff, map_neg, ← neg_add', IsUnit.neg_iff, sub_neg_eq_add]\n#align spectrum.neg_eq spectrum.neg_eq\n\ntheorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n rw [neg_eq]\n rw [singleton_add_eq]\n rw [sub_eq_add_neg]\n#align spectrum.singleton_sub_eq spectrum.singleton_sub_eq\n\ntheorem sub_singleton_eq (a : A) (r : R) : σ a - {r} = σ (a - ↑ₐ r) := by\n simpa only [neg_sub, neg_eq] using congr_arg Neg.neg (singleton_sub_eq a r)\n#align spectrum.sub_singleton_eq spectrum.sub_singleton_eq\n\nend ScalarRing\n\nsection ScalarField\n\nvariable {𝕜 : Type u} {A : Type v}\n\nvariable [Field 𝕜] [Ring A] [Algebra 𝕜 A]\n\nlocal notation \"σ\" => spectrum 𝕜\n\nlocal notation \"↑ₐ\" => algebraMap 𝕜 A\n\n/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n refine' Set.Subset.antisymm _ (by simp [Algebra.algebraMap_eq_smul_one, mem_iff])\n rw [spectrum]\n rw [Set.compl_subset_comm]\n intro k hk\n rw [Set.mem_compl_singleton_iff] at hk\n have : IsUnit (Units.mk0 k hk • (1 : A)) := IsUnit.smul (Units.mk0 k hk) isUnit_one\n simpa [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one]\n#align spectrum.zero_eq spectrum.zero_eq\n\n@[simp]\ntheorem scalar_eq [Nontrivial A] (k : 𝕜) : σ (↑ₐ k) = {k} := by\n rw [← add_zero (↑ₐ k)]\n rw [← singleton_add_eq]\n rw [zero_eq]\n rw [Set.singleton_add_singleton]\n rw [add_zero]\n#align spectrum.scalar_eq spectrum.scalar_eq\n\n@[simp]\ntheorem one_eq [Nontrivial A] : σ (1 : A) = {1} :=\n calc\n σ (1 : A) = σ (↑ₐ 1) := by rw [Algebra.algebraMap_eq_smul_one, one_smul]\n _ = {1} := scalar_eq 1\n\n#align spectrum.one_eq spectrum.one_eq\n\n/-- the assumption `(σ a).Nonempty` is necessary and cannot be removed without\nfurther conditions on the algebra `A` and scalar field `𝕜`. -/\ntheorem smul_eq_smul [Nontrivial A] (k : 𝕜) (a : A) (ha : (σ a).Nonempty) :\n σ (k • a) = k • σ a := by\n rcases eq_or_ne k 0 with (rfl | h)\n · simpa [ha, zero_smul_set] using (show {(0 : 𝕜)} = (0 : Set 𝕜) from rfl)\n · exact unit_smul_eq_smul a (Units.mk0 k h)\n#align spectrum.smul_eq_smul spectrum.smul_eq_smul\n\ntheorem nonzero_mul_eq_swap_mul (a b : A) : σ (a * b) \\ {0} = σ (b * a) \\ {0} := by\n suffices h : ∀ x y : A, σ (x * y) \\ {0} ⊆ σ (y * x) \\ {0}\n · exact Set.eq_of_subset_of_subset (h a b) (h b a)\n · ","nextTactic":"rintro _ _ k ⟨k_mem, k_neq⟩","declUpToTactic":"theorem nonzero_mul_eq_swap_mul (a b : A) : σ (a * b) \\ {0} = σ (b * a) \\ {0} := by\n suffices h : ∀ x y : A, σ (x * y) \\ {0} ⊆ σ (y * x) \\ {0}\n · exact Set.eq_of_subset_of_subset (h a b) (h b a)\n · ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.401_0.OiCHPrqZcVJoE6f","decl":"theorem nonzero_mul_eq_swap_mul (a b : A) : σ (a * b) \\ {0} = σ (b * a) \\ {0} "} +{"state":"case h.intro\n𝕜 : Type u\nA : Type v\ninst✝² : Field 𝕜\ninst✝¹ : Ring A\ninst✝ : Algebra 𝕜 A\na b x✝ y✝ : A\nk : 𝕜\nk_mem : k ∈ σ (x✝ * y✝)\nk_neq : k ∉ {0}\n⊢ k ∈ σ (y✝ * x✝) \\ {0}","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n rw [neg_neg]\n#align spectrum.singleton_add_eq spectrum.singleton_add_eq\n\ntheorem add_singleton_eq (a : A) (r : R) : σ a + {r} = σ (a + ↑ₐ r) :=\n add_comm {r} (σ a) ▸ add_comm (algebraMap R A r) a ▸ singleton_add_eq a r\n#align spectrum.add_singleton_eq spectrum.add_singleton_eq\n\ntheorem vadd_eq (a : A) (r : R) : r +ᵥ σ a = σ (↑ₐ r + a) :=\n singleton_add.symm.trans <| singleton_add_eq a r\n#align spectrum.vadd_eq spectrum.vadd_eq\n\ntheorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n simp only [mem_neg, mem_iff, map_neg, ← neg_add', IsUnit.neg_iff, sub_neg_eq_add]\n#align spectrum.neg_eq spectrum.neg_eq\n\ntheorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n rw [neg_eq]\n rw [singleton_add_eq]\n rw [sub_eq_add_neg]\n#align spectrum.singleton_sub_eq spectrum.singleton_sub_eq\n\ntheorem sub_singleton_eq (a : A) (r : R) : σ a - {r} = σ (a - ↑ₐ r) := by\n simpa only [neg_sub, neg_eq] using congr_arg Neg.neg (singleton_sub_eq a r)\n#align spectrum.sub_singleton_eq spectrum.sub_singleton_eq\n\nend ScalarRing\n\nsection ScalarField\n\nvariable {𝕜 : Type u} {A : Type v}\n\nvariable [Field 𝕜] [Ring A] [Algebra 𝕜 A]\n\nlocal notation \"σ\" => spectrum 𝕜\n\nlocal notation \"↑ₐ\" => algebraMap 𝕜 A\n\n/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n refine' Set.Subset.antisymm _ (by simp [Algebra.algebraMap_eq_smul_one, mem_iff])\n rw [spectrum]\n rw [Set.compl_subset_comm]\n intro k hk\n rw [Set.mem_compl_singleton_iff] at hk\n have : IsUnit (Units.mk0 k hk • (1 : A)) := IsUnit.smul (Units.mk0 k hk) isUnit_one\n simpa [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one]\n#align spectrum.zero_eq spectrum.zero_eq\n\n@[simp]\ntheorem scalar_eq [Nontrivial A] (k : 𝕜) : σ (↑ₐ k) = {k} := by\n rw [← add_zero (↑ₐ k)]\n rw [← singleton_add_eq]\n rw [zero_eq]\n rw [Set.singleton_add_singleton]\n rw [add_zero]\n#align spectrum.scalar_eq spectrum.scalar_eq\n\n@[simp]\ntheorem one_eq [Nontrivial A] : σ (1 : A) = {1} :=\n calc\n σ (1 : A) = σ (↑ₐ 1) := by rw [Algebra.algebraMap_eq_smul_one, one_smul]\n _ = {1} := scalar_eq 1\n\n#align spectrum.one_eq spectrum.one_eq\n\n/-- the assumption `(σ a).Nonempty` is necessary and cannot be removed without\nfurther conditions on the algebra `A` and scalar field `𝕜`. -/\ntheorem smul_eq_smul [Nontrivial A] (k : 𝕜) (a : A) (ha : (σ a).Nonempty) :\n σ (k • a) = k • σ a := by\n rcases eq_or_ne k 0 with (rfl | h)\n · simpa [ha, zero_smul_set] using (show {(0 : 𝕜)} = (0 : Set 𝕜) from rfl)\n · exact unit_smul_eq_smul a (Units.mk0 k h)\n#align spectrum.smul_eq_smul spectrum.smul_eq_smul\n\ntheorem nonzero_mul_eq_swap_mul (a b : A) : σ (a * b) \\ {0} = σ (b * a) \\ {0} := by\n suffices h : ∀ x y : A, σ (x * y) \\ {0} ⊆ σ (y * x) \\ {0}\n · exact Set.eq_of_subset_of_subset (h a b) (h b a)\n · rintro _ _ k ⟨k_mem, k_neq⟩\n ","nextTactic":"change ((Units.mk0 k k_neq) : 𝕜) ∈ _ at k_mem","declUpToTactic":"theorem nonzero_mul_eq_swap_mul (a b : A) : σ (a * b) \\ {0} = σ (b * a) \\ {0} := by\n suffices h : ∀ x y : A, σ (x * y) \\ {0} ⊆ σ (y * x) \\ {0}\n · exact Set.eq_of_subset_of_subset (h a b) (h b a)\n · rintro _ _ k ⟨k_mem, k_neq⟩\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.401_0.OiCHPrqZcVJoE6f","decl":"theorem nonzero_mul_eq_swap_mul (a b : A) : σ (a * b) \\ {0} = σ (b * a) \\ {0} "} +{"state":"case h.intro\n𝕜 : Type u\nA : Type v\ninst✝² : Field 𝕜\ninst✝¹ : Ring A\ninst✝ : Algebra 𝕜 A\na b x✝ y✝ : A\nk : 𝕜\nk_neq : k ∉ {0}\nk_mem : ↑(Units.mk0 k k_neq) ∈ σ (x✝ * y✝)\n⊢ k ∈ σ (y✝ * x✝) \\ {0}","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n rw [neg_neg]\n#align spectrum.singleton_add_eq spectrum.singleton_add_eq\n\ntheorem add_singleton_eq (a : A) (r : R) : σ a + {r} = σ (a + ↑ₐ r) :=\n add_comm {r} (σ a) ▸ add_comm (algebraMap R A r) a ▸ singleton_add_eq a r\n#align spectrum.add_singleton_eq spectrum.add_singleton_eq\n\ntheorem vadd_eq (a : A) (r : R) : r +ᵥ σ a = σ (↑ₐ r + a) :=\n singleton_add.symm.trans <| singleton_add_eq a r\n#align spectrum.vadd_eq spectrum.vadd_eq\n\ntheorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n simp only [mem_neg, mem_iff, map_neg, ← neg_add', IsUnit.neg_iff, sub_neg_eq_add]\n#align spectrum.neg_eq spectrum.neg_eq\n\ntheorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n rw [neg_eq]\n rw [singleton_add_eq]\n rw [sub_eq_add_neg]\n#align spectrum.singleton_sub_eq spectrum.singleton_sub_eq\n\ntheorem sub_singleton_eq (a : A) (r : R) : σ a - {r} = σ (a - ↑ₐ r) := by\n simpa only [neg_sub, neg_eq] using congr_arg Neg.neg (singleton_sub_eq a r)\n#align spectrum.sub_singleton_eq spectrum.sub_singleton_eq\n\nend ScalarRing\n\nsection ScalarField\n\nvariable {𝕜 : Type u} {A : Type v}\n\nvariable [Field 𝕜] [Ring A] [Algebra 𝕜 A]\n\nlocal notation \"σ\" => spectrum 𝕜\n\nlocal notation \"↑ₐ\" => algebraMap 𝕜 A\n\n/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n refine' Set.Subset.antisymm _ (by simp [Algebra.algebraMap_eq_smul_one, mem_iff])\n rw [spectrum]\n rw [Set.compl_subset_comm]\n intro k hk\n rw [Set.mem_compl_singleton_iff] at hk\n have : IsUnit (Units.mk0 k hk • (1 : A)) := IsUnit.smul (Units.mk0 k hk) isUnit_one\n simpa [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one]\n#align spectrum.zero_eq spectrum.zero_eq\n\n@[simp]\ntheorem scalar_eq [Nontrivial A] (k : 𝕜) : σ (↑ₐ k) = {k} := by\n rw [← add_zero (↑ₐ k)]\n rw [← singleton_add_eq]\n rw [zero_eq]\n rw [Set.singleton_add_singleton]\n rw [add_zero]\n#align spectrum.scalar_eq spectrum.scalar_eq\n\n@[simp]\ntheorem one_eq [Nontrivial A] : σ (1 : A) = {1} :=\n calc\n σ (1 : A) = σ (↑ₐ 1) := by rw [Algebra.algebraMap_eq_smul_one, one_smul]\n _ = {1} := scalar_eq 1\n\n#align spectrum.one_eq spectrum.one_eq\n\n/-- the assumption `(σ a).Nonempty` is necessary and cannot be removed without\nfurther conditions on the algebra `A` and scalar field `𝕜`. -/\ntheorem smul_eq_smul [Nontrivial A] (k : 𝕜) (a : A) (ha : (σ a).Nonempty) :\n σ (k • a) = k • σ a := by\n rcases eq_or_ne k 0 with (rfl | h)\n · simpa [ha, zero_smul_set] using (show {(0 : 𝕜)} = (0 : Set 𝕜) from rfl)\n · exact unit_smul_eq_smul a (Units.mk0 k h)\n#align spectrum.smul_eq_smul spectrum.smul_eq_smul\n\ntheorem nonzero_mul_eq_swap_mul (a b : A) : σ (a * b) \\ {0} = σ (b * a) \\ {0} := by\n suffices h : ∀ x y : A, σ (x * y) \\ {0} ⊆ σ (y * x) \\ {0}\n · exact Set.eq_of_subset_of_subset (h a b) (h b a)\n · rintro _ _ k ⟨k_mem, k_neq⟩\n change ((Units.mk0 k k_neq) : 𝕜) ∈ _ at k_mem\n ","nextTactic":"exact ⟨unit_mem_mul_iff_mem_swap_mul.mp k_mem, k_neq⟩","declUpToTactic":"theorem nonzero_mul_eq_swap_mul (a b : A) : σ (a * b) \\ {0} = σ (b * a) \\ {0} := by\n suffices h : ∀ x y : A, σ (x * y) \\ {0} ⊆ σ (y * x) \\ {0}\n · exact Set.eq_of_subset_of_subset (h a b) (h b a)\n · rintro _ _ k ⟨k_mem, k_neq⟩\n change ((Units.mk0 k k_neq) : 𝕜) ∈ _ at k_mem\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.401_0.OiCHPrqZcVJoE6f","decl":"theorem nonzero_mul_eq_swap_mul (a b : A) : σ (a * b) \\ {0} = σ (b * a) \\ {0} "} +{"state":"𝕜 : Type u\nA : Type v\ninst✝² : Field 𝕜\ninst✝¹ : Ring A\ninst✝ : Algebra 𝕜 A\na : Aˣ\n⊢ (σ ↑a)⁻¹ = σ ↑a⁻¹","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ �� (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n rw [neg_neg]\n#align spectrum.singleton_add_eq spectrum.singleton_add_eq\n\ntheorem add_singleton_eq (a : A) (r : R) : σ a + {r} = σ (a + ↑ₐ r) :=\n add_comm {r} (σ a) ▸ add_comm (algebraMap R A r) a ▸ singleton_add_eq a r\n#align spectrum.add_singleton_eq spectrum.add_singleton_eq\n\ntheorem vadd_eq (a : A) (r : R) : r +ᵥ σ a = σ (↑ₐ r + a) :=\n singleton_add.symm.trans <| singleton_add_eq a r\n#align spectrum.vadd_eq spectrum.vadd_eq\n\ntheorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n simp only [mem_neg, mem_iff, map_neg, ← neg_add', IsUnit.neg_iff, sub_neg_eq_add]\n#align spectrum.neg_eq spectrum.neg_eq\n\ntheorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n rw [neg_eq]\n rw [singleton_add_eq]\n rw [sub_eq_add_neg]\n#align spectrum.singleton_sub_eq spectrum.singleton_sub_eq\n\ntheorem sub_singleton_eq (a : A) (r : R) : σ a - {r} = σ (a - ↑ₐ r) := by\n simpa only [neg_sub, neg_eq] using congr_arg Neg.neg (singleton_sub_eq a r)\n#align spectrum.sub_singleton_eq spectrum.sub_singleton_eq\n\nend ScalarRing\n\nsection ScalarField\n\nvariable {𝕜 : Type u} {A : Type v}\n\nvariable [Field 𝕜] [Ring A] [Algebra 𝕜 A]\n\nlocal notation \"σ\" => spectrum 𝕜\n\nlocal notation \"↑ₐ\" => algebraMap 𝕜 A\n\n/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n refine' Set.Subset.antisymm _ (by simp [Algebra.algebraMap_eq_smul_one, mem_iff])\n rw [spectrum]\n rw [Set.compl_subset_comm]\n intro k hk\n rw [Set.mem_compl_singleton_iff] at hk\n have : IsUnit (Units.mk0 k hk • (1 : A)) := IsUnit.smul (Units.mk0 k hk) isUnit_one\n simpa [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one]\n#align spectrum.zero_eq spectrum.zero_eq\n\n@[simp]\ntheorem scalar_eq [Nontrivial A] (k : 𝕜) : σ (↑ₐ k) = {k} := by\n rw [← add_zero (↑ₐ k)]\n rw [← singleton_add_eq]\n rw [zero_eq]\n rw [Set.singleton_add_singleton]\n rw [add_zero]\n#align spectrum.scalar_eq spectrum.scalar_eq\n\n@[simp]\ntheorem one_eq [Nontrivial A] : σ (1 : A) = {1} :=\n calc\n σ (1 : A) = σ (↑ₐ 1) := by rw [Algebra.algebraMap_eq_smul_one, one_smul]\n _ = {1} := scalar_eq 1\n\n#align spectrum.one_eq spectrum.one_eq\n\n/-- the assumption `(σ a).Nonempty` is necessary and cannot be removed without\nfurther conditions on the algebra `A` and scalar field `𝕜`. -/\ntheorem smul_eq_smul [Nontrivial A] (k : 𝕜) (a : A) (ha : (σ a).Nonempty) :\n σ (k • a) = k • σ a := by\n rcases eq_or_ne k 0 with (rfl | h)\n · simpa [ha, zero_smul_set] using (show {(0 : 𝕜)} = (0 : Set 𝕜) from rfl)\n · exact unit_smul_eq_smul a (Units.mk0 k h)\n#align spectrum.smul_eq_smul spectrum.smul_eq_smul\n\ntheorem nonzero_mul_eq_swap_mul (a b : A) : σ (a * b) \\ {0} = σ (b * a) \\ {0} := by\n suffices h : ∀ x y : A, σ (x * y) \\ {0} ⊆ σ (y * x) \\ {0}\n · exact Set.eq_of_subset_of_subset (h a b) (h b a)\n · rintro _ _ k ⟨k_mem, k_neq⟩\n change ((Units.mk0 k k_neq) : 𝕜) ∈ _ at k_mem\n exact ⟨unit_mem_mul_iff_mem_swap_mul.mp k_mem, k_neq⟩\n#align spectrum.nonzero_mul_eq_swap_mul spectrum.nonzero_mul_eq_swap_mul\n\nprotected theorem map_inv (a : Aˣ) : (σ (a : A))⁻¹ = σ (↑a⁻¹ : A) := by\n ","nextTactic":"refine' Set.eq_of_subset_of_subset (fun k hk => _) fun k hk => _","declUpToTactic":"protected theorem map_inv (a : Aˣ) : (σ (a : A))⁻¹ = σ (↑a⁻¹ : A) := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.409_0.OiCHPrqZcVJoE6f","decl":"protected theorem map_inv (a : Aˣ) : (σ (a : A))⁻¹ = σ (↑a⁻¹ : A) "} +{"state":"case refine'_1\n𝕜 : Type u\nA : Type v\ninst✝² : Field 𝕜\ninst✝¹ : Ring A\ninst✝ : Algebra 𝕜 A\na : Aˣ\nk : 𝕜\nhk : k ∈ (σ ↑a)⁻¹\n⊢ k ∈ σ ↑a⁻¹","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n rw [neg_neg]\n#align spectrum.singleton_add_eq spectrum.singleton_add_eq\n\ntheorem add_singleton_eq (a : A) (r : R) : σ a + {r} = σ (a + ↑ₐ r) :=\n add_comm {r} (σ a) ▸ add_comm (algebraMap R A r) a ▸ singleton_add_eq a r\n#align spectrum.add_singleton_eq spectrum.add_singleton_eq\n\ntheorem vadd_eq (a : A) (r : R) : r +ᵥ σ a = σ (↑ₐ r + a) :=\n singleton_add.symm.trans <| singleton_add_eq a r\n#align spectrum.vadd_eq spectrum.vadd_eq\n\ntheorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n simp only [mem_neg, mem_iff, map_neg, ← neg_add', IsUnit.neg_iff, sub_neg_eq_add]\n#align spectrum.neg_eq spectrum.neg_eq\n\ntheorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n rw [neg_eq]\n rw [singleton_add_eq]\n rw [sub_eq_add_neg]\n#align spectrum.singleton_sub_eq spectrum.singleton_sub_eq\n\ntheorem sub_singleton_eq (a : A) (r : R) : σ a - {r} = σ (a - ↑ₐ r) := by\n simpa only [neg_sub, neg_eq] using congr_arg Neg.neg (singleton_sub_eq a r)\n#align spectrum.sub_singleton_eq spectrum.sub_singleton_eq\n\nend ScalarRing\n\nsection ScalarField\n\nvariable {𝕜 : Type u} {A : Type v}\n\nvariable [Field 𝕜] [Ring A] [Algebra 𝕜 A]\n\nlocal notation \"σ\" => spectrum 𝕜\n\nlocal notation \"↑ₐ\" => algebraMap 𝕜 A\n\n/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n refine' Set.Subset.antisymm _ (by simp [Algebra.algebraMap_eq_smul_one, mem_iff])\n rw [spectrum]\n rw [Set.compl_subset_comm]\n intro k hk\n rw [Set.mem_compl_singleton_iff] at hk\n have : IsUnit (Units.mk0 k hk • (1 : A)) := IsUnit.smul (Units.mk0 k hk) isUnit_one\n simpa [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one]\n#align spectrum.zero_eq spectrum.zero_eq\n\n@[simp]\ntheorem scalar_eq [Nontrivial A] (k : 𝕜) : σ (↑ₐ k) = {k} := by\n rw [← add_zero (↑ₐ k)]\n rw [← singleton_add_eq]\n rw [zero_eq]\n rw [Set.singleton_add_singleton]\n rw [add_zero]\n#align spectrum.scalar_eq spectrum.scalar_eq\n\n@[simp]\ntheorem one_eq [Nontrivial A] : σ (1 : A) = {1} :=\n calc\n σ (1 : A) = σ (↑ₐ 1) := by rw [Algebra.algebraMap_eq_smul_one, one_smul]\n _ = {1} := scalar_eq 1\n\n#align spectrum.one_eq spectrum.one_eq\n\n/-- the assumption `(σ a).Nonempty` is necessary and cannot be removed without\nfurther conditions on the algebra `A` and scalar field `𝕜`. -/\ntheorem smul_eq_smul [Nontrivial A] (k : 𝕜) (a : A) (ha : (σ a).Nonempty) :\n σ (k • a) = k • σ a := by\n rcases eq_or_ne k 0 with (rfl | h)\n · simpa [ha, zero_smul_set] using (show {(0 : 𝕜)} = (0 : Set 𝕜) from rfl)\n · exact unit_smul_eq_smul a (Units.mk0 k h)\n#align spectrum.smul_eq_smul spectrum.smul_eq_smul\n\ntheorem nonzero_mul_eq_swap_mul (a b : A) : σ (a * b) \\ {0} = σ (b * a) \\ {0} := by\n suffices h : ∀ x y : A, σ (x * y) \\ {0} ⊆ σ (y * x) \\ {0}\n · exact Set.eq_of_subset_of_subset (h a b) (h b a)\n · rintro _ _ k ⟨k_mem, k_neq⟩\n change ((Units.mk0 k k_neq) : 𝕜) ∈ _ at k_mem\n exact ⟨unit_mem_mul_iff_mem_swap_mul.mp k_mem, k_neq⟩\n#align spectrum.nonzero_mul_eq_swap_mul spectrum.nonzero_mul_eq_swap_mul\n\nprotected theorem map_inv (a : Aˣ) : (σ (a : A))⁻¹ = σ (↑a⁻¹ : A) := by\n refine' Set.eq_of_subset_of_subset (fun k hk => _) fun k hk => _\n · ","nextTactic":"rw [Set.mem_inv] at hk","declUpToTactic":"protected theorem map_inv (a : Aˣ) : (σ (a : A))⁻¹ = σ (↑a⁻¹ : A) := by\n refine' Set.eq_of_subset_of_subset (fun k hk => _) fun k hk => _\n · ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.409_0.OiCHPrqZcVJoE6f","decl":"protected theorem map_inv (a : Aˣ) : (σ (a : A))⁻¹ = σ (↑a⁻¹ : A) "} +{"state":"case refine'_1\n𝕜 : Type u\nA : Type v\ninst✝² : Field 𝕜\ninst✝¹ : Ring A\ninst✝ : Algebra 𝕜 A\na : Aˣ\nk : 𝕜\nhk : k⁻¹ ∈ σ ��a\n⊢ k ∈ σ ↑a⁻¹","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n rw [neg_neg]\n#align spectrum.singleton_add_eq spectrum.singleton_add_eq\n\ntheorem add_singleton_eq (a : A) (r : R) : σ a + {r} = σ (a + ↑ₐ r) :=\n add_comm {r} (σ a) ▸ add_comm (algebraMap R A r) a ▸ singleton_add_eq a r\n#align spectrum.add_singleton_eq spectrum.add_singleton_eq\n\ntheorem vadd_eq (a : A) (r : R) : r +ᵥ σ a = σ (↑ₐ r + a) :=\n singleton_add.symm.trans <| singleton_add_eq a r\n#align spectrum.vadd_eq spectrum.vadd_eq\n\ntheorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n simp only [mem_neg, mem_iff, map_neg, ← neg_add', IsUnit.neg_iff, sub_neg_eq_add]\n#align spectrum.neg_eq spectrum.neg_eq\n\ntheorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n rw [neg_eq]\n rw [singleton_add_eq]\n rw [sub_eq_add_neg]\n#align spectrum.singleton_sub_eq spectrum.singleton_sub_eq\n\ntheorem sub_singleton_eq (a : A) (r : R) : σ a - {r} = σ (a - ↑ₐ r) := by\n simpa only [neg_sub, neg_eq] using congr_arg Neg.neg (singleton_sub_eq a r)\n#align spectrum.sub_singleton_eq spectrum.sub_singleton_eq\n\nend ScalarRing\n\nsection ScalarField\n\nvariable {𝕜 : Type u} {A : Type v}\n\nvariable [Field 𝕜] [Ring A] [Algebra 𝕜 A]\n\nlocal notation \"σ\" => spectrum 𝕜\n\nlocal notation \"↑ₐ\" => algebraMap 𝕜 A\n\n/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n refine' Set.Subset.antisymm _ (by simp [Algebra.algebraMap_eq_smul_one, mem_iff])\n rw [spectrum]\n rw [Set.compl_subset_comm]\n intro k hk\n rw [Set.mem_compl_singleton_iff] at hk\n have : IsUnit (Units.mk0 k hk • (1 : A)) := IsUnit.smul (Units.mk0 k hk) isUnit_one\n simpa [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one]\n#align spectrum.zero_eq spectrum.zero_eq\n\n@[simp]\ntheorem scalar_eq [Nontrivial A] (k : 𝕜) : σ (↑ₐ k) = {k} := by\n rw [← add_zero (↑ₐ k)]\n rw [← singleton_add_eq]\n rw [zero_eq]\n rw [Set.singleton_add_singleton]\n rw [add_zero]\n#align spectrum.scalar_eq spectrum.scalar_eq\n\n@[simp]\ntheorem one_eq [Nontrivial A] : σ (1 : A) = {1} :=\n calc\n σ (1 : A) = σ (↑ₐ 1) := by rw [Algebra.algebraMap_eq_smul_one, one_smul]\n _ = {1} := scalar_eq 1\n\n#align spectrum.one_eq spectrum.one_eq\n\n/-- the assumption `(σ a).Nonempty` is necessary and cannot be removed without\nfurther conditions on the algebra `A` and scalar field `𝕜`. -/\ntheorem smul_eq_smul [Nontrivial A] (k : 𝕜) (a : A) (ha : (σ a).Nonempty) :\n σ (k • a) = k • σ a := by\n rcases eq_or_ne k 0 with (rfl | h)\n · simpa [ha, zero_smul_set] using (show {(0 : 𝕜)} = (0 : Set 𝕜) from rfl)\n · exact unit_smul_eq_smul a (Units.mk0 k h)\n#align spectrum.smul_eq_smul spectrum.smul_eq_smul\n\ntheorem nonzero_mul_eq_swap_mul (a b : A) : σ (a * b) \\ {0} = σ (b * a) \\ {0} := by\n suffices h : ∀ x y : A, σ (x * y) \\ {0} ⊆ σ (y * x) \\ {0}\n · exact Set.eq_of_subset_of_subset (h a b) (h b a)\n · rintro _ _ k ⟨k_mem, k_neq⟩\n change ((Units.mk0 k k_neq) : 𝕜) ∈ _ at k_mem\n exact ⟨unit_mem_mul_iff_mem_swap_mul.mp k_mem, k_neq⟩\n#align spectrum.nonzero_mul_eq_swap_mul spectrum.nonzero_mul_eq_swap_mul\n\nprotected theorem map_inv (a : Aˣ) : (σ (a : A))⁻¹ = σ (↑a⁻¹ : A) := by\n refine' Set.eq_of_subset_of_subset (fun k hk => _) fun k hk => _\n · rw [Set.mem_inv] at hk\n ","nextTactic":"have : k ≠ 0 := by simpa only [inv_inv] using inv_ne_zero (ne_zero_of_mem_of_unit hk)","declUpToTactic":"protected theorem map_inv (a : Aˣ) : (σ (a : A))⁻¹ = σ (↑a⁻¹ : A) := by\n refine' Set.eq_of_subset_of_subset (fun k hk => _) fun k hk => _\n · rw [Set.mem_inv] at hk\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.409_0.OiCHPrqZcVJoE6f","decl":"protected theorem map_inv (a : Aˣ) : (σ (a : A))⁻¹ = σ (↑a⁻¹ : A) "} +{"state":"𝕜 : Type u\nA : Type v\ninst✝² : Field 𝕜\ninst✝¹ : Ring A\ninst✝ : Algebra 𝕜 A\na : Aˣ\nk : 𝕜\nhk : k⁻¹ ∈ σ ↑a\n⊢ k ≠ 0","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n rw [neg_neg]\n#align spectrum.singleton_add_eq spectrum.singleton_add_eq\n\ntheorem add_singleton_eq (a : A) (r : R) : σ a + {r} = σ (a + ↑ₐ r) :=\n add_comm {r} (σ a) ▸ add_comm (algebraMap R A r) a ▸ singleton_add_eq a r\n#align spectrum.add_singleton_eq spectrum.add_singleton_eq\n\ntheorem vadd_eq (a : A) (r : R) : r +ᵥ σ a = σ (↑ₐ r + a) :=\n singleton_add.symm.trans <| singleton_add_eq a r\n#align spectrum.vadd_eq spectrum.vadd_eq\n\ntheorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n simp only [mem_neg, mem_iff, map_neg, ← neg_add', IsUnit.neg_iff, sub_neg_eq_add]\n#align spectrum.neg_eq spectrum.neg_eq\n\ntheorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n rw [neg_eq]\n rw [singleton_add_eq]\n rw [sub_eq_add_neg]\n#align spectrum.singleton_sub_eq spectrum.singleton_sub_eq\n\ntheorem sub_singleton_eq (a : A) (r : R) : σ a - {r} = σ (a - ↑ₐ r) := by\n simpa only [neg_sub, neg_eq] using congr_arg Neg.neg (singleton_sub_eq a r)\n#align spectrum.sub_singleton_eq spectrum.sub_singleton_eq\n\nend ScalarRing\n\nsection ScalarField\n\nvariable {𝕜 : Type u} {A : Type v}\n\nvariable [Field 𝕜] [Ring A] [Algebra 𝕜 A]\n\nlocal notation \"σ\" => spectrum 𝕜\n\nlocal notation \"↑ₐ\" => algebraMap 𝕜 A\n\n/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n refine' Set.Subset.antisymm _ (by simp [Algebra.algebraMap_eq_smul_one, mem_iff])\n rw [spectrum]\n rw [Set.compl_subset_comm]\n intro k hk\n rw [Set.mem_compl_singleton_iff] at hk\n have : IsUnit (Units.mk0 k hk • (1 : A)) := IsUnit.smul (Units.mk0 k hk) isUnit_one\n simpa [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one]\n#align spectrum.zero_eq spectrum.zero_eq\n\n@[simp]\ntheorem scalar_eq [Nontrivial A] (k : 𝕜) : σ (↑ₐ k) = {k} := by\n rw [← add_zero (↑ₐ k)]\n rw [← singleton_add_eq]\n rw [zero_eq]\n rw [Set.singleton_add_singleton]\n rw [add_zero]\n#align spectrum.scalar_eq spectrum.scalar_eq\n\n@[simp]\ntheorem one_eq [Nontrivial A] : σ (1 : A) = {1} :=\n calc\n σ (1 : A) = σ (↑ₐ 1) := by rw [Algebra.algebraMap_eq_smul_one, one_smul]\n _ = {1} := scalar_eq 1\n\n#align spectrum.one_eq spectrum.one_eq\n\n/-- the assumption `(σ a).Nonempty` is necessary and cannot be removed without\nfurther conditions on the algebra `A` and scalar field `𝕜`. -/\ntheorem smul_eq_smul [Nontrivial A] (k : 𝕜) (a : A) (ha : (σ a).Nonempty) :\n σ (k • a) = k • σ a := by\n rcases eq_or_ne k 0 with (rfl | h)\n · simpa [ha, zero_smul_set] using (show {(0 : 𝕜)} = (0 : Set 𝕜) from rfl)\n · exact unit_smul_eq_smul a (Units.mk0 k h)\n#align spectrum.smul_eq_smul spectrum.smul_eq_smul\n\ntheorem nonzero_mul_eq_swap_mul (a b : A) : σ (a * b) \\ {0} = σ (b * a) \\ {0} := by\n suffices h : ∀ x y : A, σ (x * y) \\ {0} ⊆ σ (y * x) \\ {0}\n · exact Set.eq_of_subset_of_subset (h a b) (h b a)\n · rintro _ _ k ⟨k_mem, k_neq⟩\n change ((Units.mk0 k k_neq) : 𝕜) ∈ _ at k_mem\n exact ⟨unit_mem_mul_iff_mem_swap_mul.mp k_mem, k_neq⟩\n#align spectrum.nonzero_mul_eq_swap_mul spectrum.nonzero_mul_eq_swap_mul\n\nprotected theorem map_inv (a : Aˣ) : (σ (a : A))⁻¹ = σ (↑a⁻¹ : A) := by\n refine' Set.eq_of_subset_of_subset (fun k hk => _) fun k hk => _\n · rw [Set.mem_inv] at hk\n have : k ≠ 0 := by ","nextTactic":"simpa only [inv_inv] using inv_ne_zero (ne_zero_of_mem_of_unit hk)","declUpToTactic":"protected theorem map_inv (a : Aˣ) : (σ (a : A))⁻¹ = σ (↑a⁻¹ : A) := by\n refine' Set.eq_of_subset_of_subset (fun k hk => _) fun k hk => _\n · rw [Set.mem_inv] at hk\n have : k ≠ 0 := by ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.409_0.OiCHPrqZcVJoE6f","decl":"protected theorem map_inv (a : Aˣ) : (σ (a : A))⁻¹ = σ (↑a⁻¹ : A) "} +{"state":"case refine'_1\n𝕜 : Type u\nA : Type v\ninst✝² : Field 𝕜\ninst✝¹ : Ring A\ninst✝ : Algebra 𝕜 A\na : Aˣ\nk : 𝕜\nhk : k⁻¹ ∈ σ ↑a\nthis : k ≠ 0\n⊢ k ∈ σ ↑a⁻¹","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n rw [neg_neg]\n#align spectrum.singleton_add_eq spectrum.singleton_add_eq\n\ntheorem add_singleton_eq (a : A) (r : R) : σ a + {r} = σ (a + ↑ₐ r) :=\n add_comm {r} (σ a) ▸ add_comm (algebraMap R A r) a ▸ singleton_add_eq a r\n#align spectrum.add_singleton_eq spectrum.add_singleton_eq\n\ntheorem vadd_eq (a : A) (r : R) : r +ᵥ σ a = σ (↑ₐ r + a) :=\n singleton_add.symm.trans <| singleton_add_eq a r\n#align spectrum.vadd_eq spectrum.vadd_eq\n\ntheorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n simp only [mem_neg, mem_iff, map_neg, ← neg_add', IsUnit.neg_iff, sub_neg_eq_add]\n#align spectrum.neg_eq spectrum.neg_eq\n\ntheorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n rw [neg_eq]\n rw [singleton_add_eq]\n rw [sub_eq_add_neg]\n#align spectrum.singleton_sub_eq spectrum.singleton_sub_eq\n\ntheorem sub_singleton_eq (a : A) (r : R) : σ a - {r} = σ (a - ↑ₐ r) := by\n simpa only [neg_sub, neg_eq] using congr_arg Neg.neg (singleton_sub_eq a r)\n#align spectrum.sub_singleton_eq spectrum.sub_singleton_eq\n\nend ScalarRing\n\nsection ScalarField\n\nvariable {𝕜 : Type u} {A : Type v}\n\nvariable [Field 𝕜] [Ring A] [Algebra 𝕜 A]\n\nlocal notation \"σ\" => spectrum 𝕜\n\nlocal notation \"↑ₐ\" => algebraMap 𝕜 A\n\n/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n refine' Set.Subset.antisymm _ (by simp [Algebra.algebraMap_eq_smul_one, mem_iff])\n rw [spectrum]\n rw [Set.compl_subset_comm]\n intro k hk\n rw [Set.mem_compl_singleton_iff] at hk\n have : IsUnit (Units.mk0 k hk • (1 : A)) := IsUnit.smul (Units.mk0 k hk) isUnit_one\n simpa [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one]\n#align spectrum.zero_eq spectrum.zero_eq\n\n@[simp]\ntheorem scalar_eq [Nontrivial A] (k : 𝕜) : σ (↑ₐ k) = {k} := by\n rw [← add_zero (↑ₐ k)]\n rw [← singleton_add_eq]\n rw [zero_eq]\n rw [Set.singleton_add_singleton]\n rw [add_zero]\n#align spectrum.scalar_eq spectrum.scalar_eq\n\n@[simp]\ntheorem one_eq [Nontrivial A] : σ (1 : A) = {1} :=\n calc\n σ (1 : A) = σ (↑ₐ 1) := by rw [Algebra.algebraMap_eq_smul_one, one_smul]\n _ = {1} := scalar_eq 1\n\n#align spectrum.one_eq spectrum.one_eq\n\n/-- the assumption `(σ a).Nonempty` is necessary and cannot be removed without\nfurther conditions on the algebra `A` and scalar field `𝕜`. -/\ntheorem smul_eq_smul [Nontrivial A] (k : 𝕜) (a : A) (ha : (σ a).Nonempty) :\n σ (k • a) = k • σ a := by\n rcases eq_or_ne k 0 with (rfl | h)\n · simpa [ha, zero_smul_set] using (show {(0 : 𝕜)} = (0 : Set 𝕜) from rfl)\n · exact unit_smul_eq_smul a (Units.mk0 k h)\n#align spectrum.smul_eq_smul spectrum.smul_eq_smul\n\ntheorem nonzero_mul_eq_swap_mul (a b : A) : σ (a * b) \\ {0} = σ (b * a) \\ {0} := by\n suffices h : ∀ x y : A, σ (x * y) \\ {0} ⊆ σ (y * x) \\ {0}\n · exact Set.eq_of_subset_of_subset (h a b) (h b a)\n · rintro _ _ k ⟨k_mem, k_neq⟩\n change ((Units.mk0 k k_neq) : 𝕜) ∈ _ at k_mem\n exact ⟨unit_mem_mul_iff_mem_swap_mul.mp k_mem, k_neq⟩\n#align spectrum.nonzero_mul_eq_swap_mul spectrum.nonzero_mul_eq_swap_mul\n\nprotected theorem map_inv (a : Aˣ) : (σ (a : A))⁻¹ = σ (↑a⁻¹ : A) := by\n refine' Set.eq_of_subset_of_subset (fun k hk => _) fun k hk => _\n · rw [Set.mem_inv] at hk\n have : k ≠ 0 := by simpa only [inv_inv] using inv_ne_zero (ne_zero_of_mem_of_unit hk)\n ","nextTactic":"lift k to 𝕜ˣ using isUnit_iff_ne_zero.mpr this","declUpToTactic":"protected theorem map_inv (a : Aˣ) : (σ (a : A))⁻¹ = σ (↑a⁻¹ : A) := by\n refine' Set.eq_of_subset_of_subset (fun k hk => _) fun k hk => _\n · rw [Set.mem_inv] at hk\n have : k ≠ 0 := by simpa only [inv_inv] using inv_ne_zero (ne_zero_of_mem_of_unit hk)\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.409_0.OiCHPrqZcVJoE6f","decl":"protected theorem map_inv (a : Aˣ) : (σ (a : A))⁻¹ = σ (↑a⁻¹ : A) "} +{"state":"case refine'_1.intro\n𝕜 : Type u\nA : Type v\ninst✝² : Field 𝕜\ninst✝¹ : Ring A\ninst✝ : Algebra 𝕜 A\na : Aˣ\nk : 𝕜ˣ\nhk : (↑k)⁻¹ ∈ σ ↑a\nthis : ↑k ≠ 0\n⊢ ↑k ∈ σ ↑a⁻¹","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a��¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n rw [neg_neg]\n#align spectrum.singleton_add_eq spectrum.singleton_add_eq\n\ntheorem add_singleton_eq (a : A) (r : R) : σ a + {r} = σ (a + ↑ₐ r) :=\n add_comm {r} (σ a) ▸ add_comm (algebraMap R A r) a ▸ singleton_add_eq a r\n#align spectrum.add_singleton_eq spectrum.add_singleton_eq\n\ntheorem vadd_eq (a : A) (r : R) : r +ᵥ σ a = σ (↑ₐ r + a) :=\n singleton_add.symm.trans <| singleton_add_eq a r\n#align spectrum.vadd_eq spectrum.vadd_eq\n\ntheorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n simp only [mem_neg, mem_iff, map_neg, ← neg_add', IsUnit.neg_iff, sub_neg_eq_add]\n#align spectrum.neg_eq spectrum.neg_eq\n\ntheorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n rw [neg_eq]\n rw [singleton_add_eq]\n rw [sub_eq_add_neg]\n#align spectrum.singleton_sub_eq spectrum.singleton_sub_eq\n\ntheorem sub_singleton_eq (a : A) (r : R) : σ a - {r} = σ (a - ↑ₐ r) := by\n simpa only [neg_sub, neg_eq] using congr_arg Neg.neg (singleton_sub_eq a r)\n#align spectrum.sub_singleton_eq spectrum.sub_singleton_eq\n\nend ScalarRing\n\nsection ScalarField\n\nvariable {𝕜 : Type u} {A : Type v}\n\nvariable [Field 𝕜] [Ring A] [Algebra 𝕜 A]\n\nlocal notation \"σ\" => spectrum 𝕜\n\nlocal notation \"↑ₐ\" => algebraMap 𝕜 A\n\n/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n refine' Set.Subset.antisymm _ (by simp [Algebra.algebraMap_eq_smul_one, mem_iff])\n rw [spectrum]\n rw [Set.compl_subset_comm]\n intro k hk\n rw [Set.mem_compl_singleton_iff] at hk\n have : IsUnit (Units.mk0 k hk • (1 : A)) := IsUnit.smul (Units.mk0 k hk) isUnit_one\n simpa [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one]\n#align spectrum.zero_eq spectrum.zero_eq\n\n@[simp]\ntheorem scalar_eq [Nontrivial A] (k : 𝕜) : σ (↑ₐ k) = {k} := by\n rw [← add_zero (↑ₐ k)]\n rw [← singleton_add_eq]\n rw [zero_eq]\n rw [Set.singleton_add_singleton]\n rw [add_zero]\n#align spectrum.scalar_eq spectrum.scalar_eq\n\n@[simp]\ntheorem one_eq [Nontrivial A] : σ (1 : A) = {1} :=\n calc\n σ (1 : A) = σ (↑ₐ 1) := by rw [Algebra.algebraMap_eq_smul_one, one_smul]\n _ = {1} := scalar_eq 1\n\n#align spectrum.one_eq spectrum.one_eq\n\n/-- the assumption `(σ a).Nonempty` is necessary and cannot be removed without\nfurther conditions on the algebra `A` and scalar field `𝕜`. -/\ntheorem smul_eq_smul [Nontrivial A] (k : 𝕜) (a : A) (ha : (σ a).Nonempty) :\n σ (k • a) = k • σ a := by\n rcases eq_or_ne k 0 with (rfl | h)\n · simpa [ha, zero_smul_set] using (show {(0 : 𝕜)} = (0 : Set 𝕜) from rfl)\n · exact unit_smul_eq_smul a (Units.mk0 k h)\n#align spectrum.smul_eq_smul spectrum.smul_eq_smul\n\ntheorem nonzero_mul_eq_swap_mul (a b : A) : σ (a * b) \\ {0} = σ (b * a) \\ {0} := by\n suffices h : ∀ x y : A, σ (x * y) \\ {0} ⊆ σ (y * x) \\ {0}\n · exact Set.eq_of_subset_of_subset (h a b) (h b a)\n · rintro _ _ k ⟨k_mem, k_neq⟩\n change ((Units.mk0 k k_neq) : 𝕜) ∈ _ at k_mem\n exact ⟨unit_mem_mul_iff_mem_swap_mul.mp k_mem, k_neq⟩\n#align spectrum.nonzero_mul_eq_swap_mul spectrum.nonzero_mul_eq_swap_mul\n\nprotected theorem map_inv (a : Aˣ) : (σ (a : A))⁻¹ = σ (↑a⁻¹ : A) := by\n refine' Set.eq_of_subset_of_subset (fun k hk => _) fun k hk => _\n · rw [Set.mem_inv] at hk\n have : k ≠ 0 := by simpa only [inv_inv] using inv_ne_zero (ne_zero_of_mem_of_unit hk)\n lift k to 𝕜ˣ using isUnit_iff_ne_zero.mpr this\n ","nextTactic":"rw [← Units.val_inv_eq_inv_val k] at hk","declUpToTactic":"protected theorem map_inv (a : Aˣ) : (σ (a : A))⁻¹ = σ (↑a⁻¹ : A) := by\n refine' Set.eq_of_subset_of_subset (fun k hk => _) fun k hk => _\n · rw [Set.mem_inv] at hk\n have : k ≠ 0 := by simpa only [inv_inv] using inv_ne_zero (ne_zero_of_mem_of_unit hk)\n lift k to 𝕜ˣ using isUnit_iff_ne_zero.mpr this\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.409_0.OiCHPrqZcVJoE6f","decl":"protected theorem map_inv (a : Aˣ) : (σ (a : A))⁻¹ = σ (↑a⁻¹ : A) "} +{"state":"case refine'_1.intro\n𝕜 : Type u\nA : Type v\ninst✝² : Field 𝕜\ninst✝¹ : Ring A\ninst✝ : Algebra 𝕜 A\na : Aˣ\nk : 𝕜ˣ\nhk : ↑k⁻¹ ∈ σ ↑a\nthis : ↑k ≠ 0\n⊢ ↑k ∈ σ ↑a⁻¹","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n rw [neg_neg]\n#align spectrum.singleton_add_eq spectrum.singleton_add_eq\n\ntheorem add_singleton_eq (a : A) (r : R) : σ a + {r} = σ (a + ↑ₐ r) :=\n add_comm {r} (σ a) ▸ add_comm (algebraMap R A r) a ▸ singleton_add_eq a r\n#align spectrum.add_singleton_eq spectrum.add_singleton_eq\n\ntheorem vadd_eq (a : A) (r : R) : r +ᵥ σ a = σ (↑ₐ r + a) :=\n singleton_add.symm.trans <| singleton_add_eq a r\n#align spectrum.vadd_eq spectrum.vadd_eq\n\ntheorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n simp only [mem_neg, mem_iff, map_neg, ← neg_add', IsUnit.neg_iff, sub_neg_eq_add]\n#align spectrum.neg_eq spectrum.neg_eq\n\ntheorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n rw [neg_eq]\n rw [singleton_add_eq]\n rw [sub_eq_add_neg]\n#align spectrum.singleton_sub_eq spectrum.singleton_sub_eq\n\ntheorem sub_singleton_eq (a : A) (r : R) : σ a - {r} = σ (a - ↑ₐ r) := by\n simpa only [neg_sub, neg_eq] using congr_arg Neg.neg (singleton_sub_eq a r)\n#align spectrum.sub_singleton_eq spectrum.sub_singleton_eq\n\nend ScalarRing\n\nsection ScalarField\n\nvariable {𝕜 : Type u} {A : Type v}\n\nvariable [Field 𝕜] [Ring A] [Algebra 𝕜 A]\n\nlocal notation \"σ\" => spectrum 𝕜\n\nlocal notation \"↑ₐ\" => algebraMap 𝕜 A\n\n/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n refine' Set.Subset.antisymm _ (by simp [Algebra.algebraMap_eq_smul_one, mem_iff])\n rw [spectrum]\n rw [Set.compl_subset_comm]\n intro k hk\n rw [Set.mem_compl_singleton_iff] at hk\n have : IsUnit (Units.mk0 k hk • (1 : A)) := IsUnit.smul (Units.mk0 k hk) isUnit_one\n simpa [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one]\n#align spectrum.zero_eq spectrum.zero_eq\n\n@[simp]\ntheorem scalar_eq [Nontrivial A] (k : 𝕜) : σ (↑ₐ k) = {k} := by\n rw [← add_zero (↑ₐ k)]\n rw [← singleton_add_eq]\n rw [zero_eq]\n rw [Set.singleton_add_singleton]\n rw [add_zero]\n#align spectrum.scalar_eq spectrum.scalar_eq\n\n@[simp]\ntheorem one_eq [Nontrivial A] : σ (1 : A) = {1} :=\n calc\n σ (1 : A) = σ (↑ₐ 1) := by rw [Algebra.algebraMap_eq_smul_one, one_smul]\n _ = {1} := scalar_eq 1\n\n#align spectrum.one_eq spectrum.one_eq\n\n/-- the assumption `(σ a).Nonempty` is necessary and cannot be removed without\nfurther conditions on the algebra `A` and scalar field `𝕜`. -/\ntheorem smul_eq_smul [Nontrivial A] (k : 𝕜) (a : A) (ha : (σ a).Nonempty) :\n σ (k • a) = k • σ a := by\n rcases eq_or_ne k 0 with (rfl | h)\n · simpa [ha, zero_smul_set] using (show {(0 : 𝕜)} = (0 : Set 𝕜) from rfl)\n · exact unit_smul_eq_smul a (Units.mk0 k h)\n#align spectrum.smul_eq_smul spectrum.smul_eq_smul\n\ntheorem nonzero_mul_eq_swap_mul (a b : A) : σ (a * b) \\ {0} = σ (b * a) \\ {0} := by\n suffices h : ∀ x y : A, σ (x * y) \\ {0} ⊆ σ (y * x) \\ {0}\n · exact Set.eq_of_subset_of_subset (h a b) (h b a)\n · rintro _ _ k ⟨k_mem, k_neq⟩\n change ((Units.mk0 k k_neq) : 𝕜) ∈ _ at k_mem\n exact ⟨unit_mem_mul_iff_mem_swap_mul.mp k_mem, k_neq⟩\n#align spectrum.nonzero_mul_eq_swap_mul spectrum.nonzero_mul_eq_swap_mul\n\nprotected theorem map_inv (a : Aˣ) : (σ (a : A))⁻¹ = σ (↑a⁻¹ : A) := by\n refine' Set.eq_of_subset_of_subset (fun k hk => _) fun k hk => _\n · rw [Set.mem_inv] at hk\n have : k ≠ 0 := by simpa only [inv_inv] using inv_ne_zero (ne_zero_of_mem_of_unit hk)\n lift k to 𝕜ˣ using isUnit_iff_ne_zero.mpr this\n rw [← Units.val_inv_eq_inv_val k] at hk\n ","nextTactic":"exact inv_mem_iff.mp hk","declUpToTactic":"protected theorem map_inv (a : Aˣ) : (σ (a : A))⁻¹ = σ (↑a⁻¹ : A) := by\n refine' Set.eq_of_subset_of_subset (fun k hk => _) fun k hk => _\n · rw [Set.mem_inv] at hk\n have : k ≠ 0 := by simpa only [inv_inv] using inv_ne_zero (ne_zero_of_mem_of_unit hk)\n lift k to 𝕜ˣ using isUnit_iff_ne_zero.mpr this\n rw [← Units.val_inv_eq_inv_val k] at hk\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.409_0.OiCHPrqZcVJoE6f","decl":"protected theorem map_inv (a : Aˣ) : (σ (a : A))⁻¹ = σ (↑a⁻¹ : A) "} +{"state":"case refine'_2\n𝕜 : Type u\nA : Type v\ninst✝² : Field 𝕜\ninst✝¹ : Ring A\ninst✝ : Algebra 𝕜 A\na : Aˣ\nk : 𝕜\nhk : k ∈ σ ↑a⁻¹\n⊢ k ∈ (σ ↑a)⁻¹","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n rw [neg_neg]\n#align spectrum.singleton_add_eq spectrum.singleton_add_eq\n\ntheorem add_singleton_eq (a : A) (r : R) : σ a + {r} = σ (a + ↑ₐ r) :=\n add_comm {r} (σ a) ▸ add_comm (algebraMap R A r) a ▸ singleton_add_eq a r\n#align spectrum.add_singleton_eq spectrum.add_singleton_eq\n\ntheorem vadd_eq (a : A) (r : R) : r +ᵥ σ a = σ (↑ₐ r + a) :=\n singleton_add.symm.trans <| singleton_add_eq a r\n#align spectrum.vadd_eq spectrum.vadd_eq\n\ntheorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n simp only [mem_neg, mem_iff, map_neg, ← neg_add', IsUnit.neg_iff, sub_neg_eq_add]\n#align spectrum.neg_eq spectrum.neg_eq\n\ntheorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n rw [neg_eq]\n rw [singleton_add_eq]\n rw [sub_eq_add_neg]\n#align spectrum.singleton_sub_eq spectrum.singleton_sub_eq\n\ntheorem sub_singleton_eq (a : A) (r : R) : σ a - {r} = σ (a - ↑ₐ r) := by\n simpa only [neg_sub, neg_eq] using congr_arg Neg.neg (singleton_sub_eq a r)\n#align spectrum.sub_singleton_eq spectrum.sub_singleton_eq\n\nend ScalarRing\n\nsection ScalarField\n\nvariable {𝕜 : Type u} {A : Type v}\n\nvariable [Field 𝕜] [Ring A] [Algebra 𝕜 A]\n\nlocal notation \"σ\" => spectrum 𝕜\n\nlocal notation \"↑ₐ\" => algebraMap 𝕜 A\n\n/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n refine' Set.Subset.antisymm _ (by simp [Algebra.algebraMap_eq_smul_one, mem_iff])\n rw [spectrum]\n rw [Set.compl_subset_comm]\n intro k hk\n rw [Set.mem_compl_singleton_iff] at hk\n have : IsUnit (Units.mk0 k hk • (1 : A)) := IsUnit.smul (Units.mk0 k hk) isUnit_one\n simpa [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one]\n#align spectrum.zero_eq spectrum.zero_eq\n\n@[simp]\ntheorem scalar_eq [Nontrivial A] (k : 𝕜) : σ (↑ₐ k) = {k} := by\n rw [← add_zero (↑ₐ k)]\n rw [← singleton_add_eq]\n rw [zero_eq]\n rw [Set.singleton_add_singleton]\n rw [add_zero]\n#align spectrum.scalar_eq spectrum.scalar_eq\n\n@[simp]\ntheorem one_eq [Nontrivial A] : σ (1 : A) = {1} :=\n calc\n σ (1 : A) = σ (↑ₐ 1) := by rw [Algebra.algebraMap_eq_smul_one, one_smul]\n _ = {1} := scalar_eq 1\n\n#align spectrum.one_eq spectrum.one_eq\n\n/-- the assumption `(σ a).Nonempty` is necessary and cannot be removed without\nfurther conditions on the algebra `A` and scalar field `𝕜`. -/\ntheorem smul_eq_smul [Nontrivial A] (k : 𝕜) (a : A) (ha : (σ a).Nonempty) :\n σ (k • a) = k • σ a := by\n rcases eq_or_ne k 0 with (rfl | h)\n · simpa [ha, zero_smul_set] using (show {(0 : 𝕜)} = (0 : Set 𝕜) from rfl)\n · exact unit_smul_eq_smul a (Units.mk0 k h)\n#align spectrum.smul_eq_smul spectrum.smul_eq_smul\n\ntheorem nonzero_mul_eq_swap_mul (a b : A) : σ (a * b) \\ {0} = σ (b * a) \\ {0} := by\n suffices h : ∀ x y : A, σ (x * y) \\ {0} ⊆ σ (y * x) \\ {0}\n · exact Set.eq_of_subset_of_subset (h a b) (h b a)\n · rintro _ _ k ⟨k_mem, k_neq⟩\n change ((Units.mk0 k k_neq) : 𝕜) ∈ _ at k_mem\n exact ⟨unit_mem_mul_iff_mem_swap_mul.mp k_mem, k_neq⟩\n#align spectrum.nonzero_mul_eq_swap_mul spectrum.nonzero_mul_eq_swap_mul\n\nprotected theorem map_inv (a : Aˣ) : (σ (a : A))⁻¹ = σ (↑a⁻¹ : A) := by\n refine' Set.eq_of_subset_of_subset (fun k hk => _) fun k hk => _\n · rw [Set.mem_inv] at hk\n have : k ≠ 0 := by simpa only [inv_inv] using inv_ne_zero (ne_zero_of_mem_of_unit hk)\n lift k to 𝕜ˣ using isUnit_iff_ne_zero.mpr this\n rw [← Units.val_inv_eq_inv_val k] at hk\n exact inv_mem_iff.mp hk\n · ","nextTactic":"lift k to 𝕜ˣ using isUnit_iff_ne_zero.mpr (ne_zero_of_mem_of_unit hk)","declUpToTactic":"protected theorem map_inv (a : Aˣ) : (σ (a : A))⁻¹ = σ (↑a⁻¹ : A) := by\n refine' Set.eq_of_subset_of_subset (fun k hk => _) fun k hk => _\n · rw [Set.mem_inv] at hk\n have : k ≠ 0 := by simpa only [inv_inv] using inv_ne_zero (ne_zero_of_mem_of_unit hk)\n lift k to 𝕜ˣ using isUnit_iff_ne_zero.mpr this\n rw [← Units.val_inv_eq_inv_val k] at hk\n exact inv_mem_iff.mp hk\n · ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.409_0.OiCHPrqZcVJoE6f","decl":"protected theorem map_inv (a : Aˣ) : (σ (a : A))⁻¹ = σ (↑a⁻¹ : A) "} +{"state":"case refine'_2.intro\n𝕜 : Type u\nA : Type v\ninst✝² : Field 𝕜\ninst✝¹ : Ring A\ninst✝ : Algebra 𝕜 A\na : Aˣ\nk : 𝕜ˣ\nhk : ↑k ∈ σ ↑a⁻¹\n⊢ ↑k ∈ (σ ↑a)⁻¹","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n rw [neg_neg]\n#align spectrum.singleton_add_eq spectrum.singleton_add_eq\n\ntheorem add_singleton_eq (a : A) (r : R) : σ a + {r} = σ (a + ↑ₐ r) :=\n add_comm {r} (σ a) ▸ add_comm (algebraMap R A r) a ▸ singleton_add_eq a r\n#align spectrum.add_singleton_eq spectrum.add_singleton_eq\n\ntheorem vadd_eq (a : A) (r : R) : r +ᵥ σ a = σ (↑ₐ r + a) :=\n singleton_add.symm.trans <| singleton_add_eq a r\n#align spectrum.vadd_eq spectrum.vadd_eq\n\ntheorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n simp only [mem_neg, mem_iff, map_neg, ← neg_add', IsUnit.neg_iff, sub_neg_eq_add]\n#align spectrum.neg_eq spectrum.neg_eq\n\ntheorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n rw [neg_eq]\n rw [singleton_add_eq]\n rw [sub_eq_add_neg]\n#align spectrum.singleton_sub_eq spectrum.singleton_sub_eq\n\ntheorem sub_singleton_eq (a : A) (r : R) : σ a - {r} = σ (a - ↑ₐ r) := by\n simpa only [neg_sub, neg_eq] using congr_arg Neg.neg (singleton_sub_eq a r)\n#align spectrum.sub_singleton_eq spectrum.sub_singleton_eq\n\nend ScalarRing\n\nsection ScalarField\n\nvariable {𝕜 : Type u} {A : Type v}\n\nvariable [Field 𝕜] [Ring A] [Algebra 𝕜 A]\n\nlocal notation \"σ\" => spectrum 𝕜\n\nlocal notation \"↑ₐ\" => algebraMap 𝕜 A\n\n/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n refine' Set.Subset.antisymm _ (by simp [Algebra.algebraMap_eq_smul_one, mem_iff])\n rw [spectrum]\n rw [Set.compl_subset_comm]\n intro k hk\n rw [Set.mem_compl_singleton_iff] at hk\n have : IsUnit (Units.mk0 k hk • (1 : A)) := IsUnit.smul (Units.mk0 k hk) isUnit_one\n simpa [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one]\n#align spectrum.zero_eq spectrum.zero_eq\n\n@[simp]\ntheorem scalar_eq [Nontrivial A] (k : 𝕜) : σ (↑ₐ k) = {k} := by\n rw [← add_zero (↑ₐ k)]\n rw [← singleton_add_eq]\n rw [zero_eq]\n rw [Set.singleton_add_singleton]\n rw [add_zero]\n#align spectrum.scalar_eq spectrum.scalar_eq\n\n@[simp]\ntheorem one_eq [Nontrivial A] : σ (1 : A) = {1} :=\n calc\n σ (1 : A) = σ (↑ₐ 1) := by rw [Algebra.algebraMap_eq_smul_one, one_smul]\n _ = {1} := scalar_eq 1\n\n#align spectrum.one_eq spectrum.one_eq\n\n/-- the assumption `(σ a).Nonempty` is necessary and cannot be removed without\nfurther conditions on the algebra `A` and scalar field `𝕜`. -/\ntheorem smul_eq_smul [Nontrivial A] (k : 𝕜) (a : A) (ha : (σ a).Nonempty) :\n σ (k • a) = k • σ a := by\n rcases eq_or_ne k 0 with (rfl | h)\n · simpa [ha, zero_smul_set] using (show {(0 : 𝕜)} = (0 : Set 𝕜) from rfl)\n · exact unit_smul_eq_smul a (Units.mk0 k h)\n#align spectrum.smul_eq_smul spectrum.smul_eq_smul\n\ntheorem nonzero_mul_eq_swap_mul (a b : A) : σ (a * b) \\ {0} = σ (b * a) \\ {0} := by\n suffices h : ∀ x y : A, σ (x * y) \\ {0} ⊆ σ (y * x) \\ {0}\n · exact Set.eq_of_subset_of_subset (h a b) (h b a)\n · rintro _ _ k ⟨k_mem, k_neq⟩\n change ((Units.mk0 k k_neq) : 𝕜) ∈ _ at k_mem\n exact ⟨unit_mem_mul_iff_mem_swap_mul.mp k_mem, k_neq⟩\n#align spectrum.nonzero_mul_eq_swap_mul spectrum.nonzero_mul_eq_swap_mul\n\nprotected theorem map_inv (a : Aˣ) : (σ (a : A))⁻¹ = σ (↑a⁻¹ : A) := by\n refine' Set.eq_of_subset_of_subset (fun k hk => _) fun k hk => _\n · rw [Set.mem_inv] at hk\n have : k ≠ 0 := by simpa only [inv_inv] using inv_ne_zero (ne_zero_of_mem_of_unit hk)\n lift k to 𝕜ˣ using isUnit_iff_ne_zero.mpr this\n rw [← Units.val_inv_eq_inv_val k] at hk\n exact inv_mem_iff.mp hk\n · lift k to 𝕜ˣ using isUnit_iff_ne_zero.mpr (ne_zero_of_mem_of_unit hk)\n ","nextTactic":"simpa only [Units.val_inv_eq_inv_val] using inv_mem_iff.mp hk","declUpToTactic":"protected theorem map_inv (a : Aˣ) : (σ (a : A))⁻¹ = σ (↑a⁻¹ : A) := by\n refine' Set.eq_of_subset_of_subset (fun k hk => _) fun k hk => _\n · rw [Set.mem_inv] at hk\n have : k ≠ 0 := by simpa only [inv_inv] using inv_ne_zero (ne_zero_of_mem_of_unit hk)\n lift k to 𝕜ˣ using isUnit_iff_ne_zero.mpr this\n rw [← Units.val_inv_eq_inv_val k] at hk\n exact inv_mem_iff.mp hk\n · lift k to 𝕜ˣ using isUnit_iff_ne_zero.mpr (ne_zero_of_mem_of_unit hk)\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.409_0.OiCHPrqZcVJoE6f","decl":"protected theorem map_inv (a : Aˣ) : (σ (a : A))⁻¹ = σ (↑a⁻¹ : A) "} +{"state":"F : Type u_1\nR : Type u_2\nA : Type u_3\nB : Type u_4\ninst✝⁵ : CommSemiring R\ninst✝⁴ : Ring A\ninst✝³ : Algebra R A\ninst✝² : Ring B\ninst✝¹ : Algebra R B\ninst✝ : AlgHomClass F R A B\nφ : F\na : A\nr : R\nh : r ∈ resolventSet R a\n⊢ r ∈ resolventSet R (φ a)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n rw [neg_neg]\n#align spectrum.singleton_add_eq spectrum.singleton_add_eq\n\ntheorem add_singleton_eq (a : A) (r : R) : σ a + {r} = σ (a + ↑ₐ r) :=\n add_comm {r} (σ a) ▸ add_comm (algebraMap R A r) a ▸ singleton_add_eq a r\n#align spectrum.add_singleton_eq spectrum.add_singleton_eq\n\ntheorem vadd_eq (a : A) (r : R) : r +ᵥ σ a = σ (↑ₐ r + a) :=\n singleton_add.symm.trans <| singleton_add_eq a r\n#align spectrum.vadd_eq spectrum.vadd_eq\n\ntheorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n simp only [mem_neg, mem_iff, map_neg, ← neg_add', IsUnit.neg_iff, sub_neg_eq_add]\n#align spectrum.neg_eq spectrum.neg_eq\n\ntheorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n rw [neg_eq]\n rw [singleton_add_eq]\n rw [sub_eq_add_neg]\n#align spectrum.singleton_sub_eq spectrum.singleton_sub_eq\n\ntheorem sub_singleton_eq (a : A) (r : R) : σ a - {r} = σ (a - ↑ₐ r) := by\n simpa only [neg_sub, neg_eq] using congr_arg Neg.neg (singleton_sub_eq a r)\n#align spectrum.sub_singleton_eq spectrum.sub_singleton_eq\n\nend ScalarRing\n\nsection ScalarField\n\nvariable {𝕜 : Type u} {A : Type v}\n\nvariable [Field 𝕜] [Ring A] [Algebra 𝕜 A]\n\nlocal notation \"σ\" => spectrum 𝕜\n\nlocal notation \"↑ₐ\" => algebraMap 𝕜 A\n\n/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n refine' Set.Subset.antisymm _ (by simp [Algebra.algebraMap_eq_smul_one, mem_iff])\n rw [spectrum]\n rw [Set.compl_subset_comm]\n intro k hk\n rw [Set.mem_compl_singleton_iff] at hk\n have : IsUnit (Units.mk0 k hk • (1 : A)) := IsUnit.smul (Units.mk0 k hk) isUnit_one\n simpa [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one]\n#align spectrum.zero_eq spectrum.zero_eq\n\n@[simp]\ntheorem scalar_eq [Nontrivial A] (k : 𝕜) : σ (↑ₐ k) = {k} := by\n rw [← add_zero (↑ₐ k)]\n rw [← singleton_add_eq]\n rw [zero_eq]\n rw [Set.singleton_add_singleton]\n rw [add_zero]\n#align spectrum.scalar_eq spectrum.scalar_eq\n\n@[simp]\ntheorem one_eq [Nontrivial A] : σ (1 : A) = {1} :=\n calc\n σ (1 : A) = σ (↑ₐ 1) := by rw [Algebra.algebraMap_eq_smul_one, one_smul]\n _ = {1} := scalar_eq 1\n\n#align spectrum.one_eq spectrum.one_eq\n\n/-- the assumption `(σ a).Nonempty` is necessary and cannot be removed without\nfurther conditions on the algebra `A` and scalar field `𝕜`. -/\ntheorem smul_eq_smul [Nontrivial A] (k : 𝕜) (a : A) (ha : (σ a).Nonempty) :\n σ (k • a) = k • σ a := by\n rcases eq_or_ne k 0 with (rfl | h)\n · simpa [ha, zero_smul_set] using (show {(0 : 𝕜)} = (0 : Set 𝕜) from rfl)\n · exact unit_smul_eq_smul a (Units.mk0 k h)\n#align spectrum.smul_eq_smul spectrum.smul_eq_smul\n\ntheorem nonzero_mul_eq_swap_mul (a b : A) : σ (a * b) \\ {0} = σ (b * a) \\ {0} := by\n suffices h : ∀ x y : A, σ (x * y) \\ {0} ⊆ σ (y * x) \\ {0}\n · exact Set.eq_of_subset_of_subset (h a b) (h b a)\n · rintro _ _ k ⟨k_mem, k_neq⟩\n change ((Units.mk0 k k_neq) : 𝕜) ∈ _ at k_mem\n exact ⟨unit_mem_mul_iff_mem_swap_mul.mp k_mem, k_neq⟩\n#align spectrum.nonzero_mul_eq_swap_mul spectrum.nonzero_mul_eq_swap_mul\n\nprotected theorem map_inv (a : Aˣ) : (σ (a : A))⁻¹ = σ (↑a⁻¹ : A) := by\n refine' Set.eq_of_subset_of_subset (fun k hk => _) fun k hk => _\n · rw [Set.mem_inv] at hk\n have : k ≠ 0 := by simpa only [inv_inv] using inv_ne_zero (ne_zero_of_mem_of_unit hk)\n lift k to 𝕜ˣ using isUnit_iff_ne_zero.mpr this\n rw [← Units.val_inv_eq_inv_val k] at hk\n exact inv_mem_iff.mp hk\n · lift k to 𝕜ˣ using isUnit_iff_ne_zero.mpr (ne_zero_of_mem_of_unit hk)\n simpa only [Units.val_inv_eq_inv_val] using inv_mem_iff.mp hk\n#align spectrum.map_inv spectrum.map_inv\n\nend ScalarField\n\nend spectrum\n\nnamespace AlgHom\n\nsection CommSemiring\n\nvariable {F R A B : Type*} [CommSemiring R] [Ring A] [Algebra R A] [Ring B] [Algebra R B]\n\nvariable [AlgHomClass F R A B]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_resolventSet_apply (φ : F) {a : A} {r : R} (h : r ∈ resolventSet R a) :\n r ∈ resolventSet R ((φ : A → B) a) := by\n ","nextTactic":"simpa only [map_sub, AlgHomClass.commutes] using h.map φ","declUpToTactic":"theorem mem_resolventSet_apply (φ : F) {a : A} {r : R} (h : r ∈ resolventSet R a) :\n r ∈ resolventSet R ((φ : A → B) a) := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.436_0.OiCHPrqZcVJoE6f","decl":"theorem mem_resolventSet_apply (φ : F) {a : A} {r : R} (h : r ∈ resolventSet R a) :\n r ∈ resolventSet R ((φ : A → B) a) "} +{"state":"F : Type u_1\nR : Type u_2\nA : Type u_3\nB : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : Ring A\ninst✝⁴ : Algebra R A\ninst✝³ : Ring B\ninst✝² : Algebra R B\ninst✝¹ : AlgHomClass F R A R\ninst✝ : Nontrivial R\nφ : F\na : A\n⊢ φ a ∈ σ a","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n rw [neg_neg]\n#align spectrum.singleton_add_eq spectrum.singleton_add_eq\n\ntheorem add_singleton_eq (a : A) (r : R) : σ a + {r} = σ (a + ↑ₐ r) :=\n add_comm {r} (σ a) ▸ add_comm (algebraMap R A r) a ▸ singleton_add_eq a r\n#align spectrum.add_singleton_eq spectrum.add_singleton_eq\n\ntheorem vadd_eq (a : A) (r : R) : r +ᵥ σ a = σ (↑ₐ r + a) :=\n singleton_add.symm.trans <| singleton_add_eq a r\n#align spectrum.vadd_eq spectrum.vadd_eq\n\ntheorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n simp only [mem_neg, mem_iff, map_neg, ← neg_add', IsUnit.neg_iff, sub_neg_eq_add]\n#align spectrum.neg_eq spectrum.neg_eq\n\ntheorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n rw [neg_eq]\n rw [singleton_add_eq]\n rw [sub_eq_add_neg]\n#align spectrum.singleton_sub_eq spectrum.singleton_sub_eq\n\ntheorem sub_singleton_eq (a : A) (r : R) : σ a - {r} = σ (a - ↑ₐ r) := by\n simpa only [neg_sub, neg_eq] using congr_arg Neg.neg (singleton_sub_eq a r)\n#align spectrum.sub_singleton_eq spectrum.sub_singleton_eq\n\nend ScalarRing\n\nsection ScalarField\n\nvariable {𝕜 : Type u} {A : Type v}\n\nvariable [Field 𝕜] [Ring A] [Algebra 𝕜 A]\n\nlocal notation \"σ\" => spectrum 𝕜\n\nlocal notation \"↑ₐ\" => algebraMap 𝕜 A\n\n/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n refine' Set.Subset.antisymm _ (by simp [Algebra.algebraMap_eq_smul_one, mem_iff])\n rw [spectrum]\n rw [Set.compl_subset_comm]\n intro k hk\n rw [Set.mem_compl_singleton_iff] at hk\n have : IsUnit (Units.mk0 k hk • (1 : A)) := IsUnit.smul (Units.mk0 k hk) isUnit_one\n simpa [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one]\n#align spectrum.zero_eq spectrum.zero_eq\n\n@[simp]\ntheorem scalar_eq [Nontrivial A] (k : 𝕜) : σ (↑ₐ k) = {k} := by\n rw [← add_zero (↑ₐ k)]\n rw [← singleton_add_eq]\n rw [zero_eq]\n rw [Set.singleton_add_singleton]\n rw [add_zero]\n#align spectrum.scalar_eq spectrum.scalar_eq\n\n@[simp]\ntheorem one_eq [Nontrivial A] : σ (1 : A) = {1} :=\n calc\n σ (1 : A) = σ (↑ₐ 1) := by rw [Algebra.algebraMap_eq_smul_one, one_smul]\n _ = {1} := scalar_eq 1\n\n#align spectrum.one_eq spectrum.one_eq\n\n/-- the assumption `(σ a).Nonempty` is necessary and cannot be removed without\nfurther conditions on the algebra `A` and scalar field `𝕜`. -/\ntheorem smul_eq_smul [Nontrivial A] (k : 𝕜) (a : A) (ha : (σ a).Nonempty) :\n σ (k • a) = k • σ a := by\n rcases eq_or_ne k 0 with (rfl | h)\n · simpa [ha, zero_smul_set] using (show {(0 : 𝕜)} = (0 : Set 𝕜) from rfl)\n · exact unit_smul_eq_smul a (Units.mk0 k h)\n#align spectrum.smul_eq_smul spectrum.smul_eq_smul\n\ntheorem nonzero_mul_eq_swap_mul (a b : A) : σ (a * b) \\ {0} = σ (b * a) \\ {0} := by\n suffices h : ∀ x y : A, σ (x * y) \\ {0} ⊆ σ (y * x) \\ {0}\n · exact Set.eq_of_subset_of_subset (h a b) (h b a)\n · rintro _ _ k ⟨k_mem, k_neq⟩\n change ((Units.mk0 k k_neq) : 𝕜) ∈ _ at k_mem\n exact ⟨unit_mem_mul_iff_mem_swap_mul.mp k_mem, k_neq⟩\n#align spectrum.nonzero_mul_eq_swap_mul spectrum.nonzero_mul_eq_swap_mul\n\nprotected theorem map_inv (a : Aˣ) : (σ (a : A))⁻¹ = σ (↑a⁻¹ : A) := by\n refine' Set.eq_of_subset_of_subset (fun k hk => _) fun k hk => _\n · rw [Set.mem_inv] at hk\n have : k ≠ 0 := by simpa only [inv_inv] using inv_ne_zero (ne_zero_of_mem_of_unit hk)\n lift k to 𝕜ˣ using isUnit_iff_ne_zero.mpr this\n rw [← Units.val_inv_eq_inv_val k] at hk\n exact inv_mem_iff.mp hk\n · lift k to 𝕜ˣ using isUnit_iff_ne_zero.mpr (ne_zero_of_mem_of_unit hk)\n simpa only [Units.val_inv_eq_inv_val] using inv_mem_iff.mp hk\n#align spectrum.map_inv spectrum.map_inv\n\nend ScalarField\n\nend spectrum\n\nnamespace AlgHom\n\nsection CommSemiring\n\nvariable {F R A B : Type*} [CommSemiring R] [Ring A] [Algebra R A] [Ring B] [Algebra R B]\n\nvariable [AlgHomClass F R A B]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_resolventSet_apply (φ : F) {a : A} {r : R} (h : r ∈ resolventSet R a) :\n r ∈ resolventSet R ((φ : A → B) a) := by\n simpa only [map_sub, AlgHomClass.commutes] using h.map φ\n#align alg_hom.mem_resolvent_set_apply AlgHom.mem_resolventSet_apply\n\ntheorem spectrum_apply_subset (φ : F) (a : A) : σ ((φ : A → B) a) ⊆ σ a := fun _ =>\n mt (mem_resolventSet_apply φ)\n#align alg_hom.spectrum_apply_subset AlgHom.spectrum_apply_subset\n\nend CommSemiring\n\nsection CommRing\n\nvariable {F R A B : Type*} [CommRing R] [Ring A] [Algebra R A] [Ring B] [Algebra R B]\n\nvariable [AlgHomClass F R A R]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem apply_mem_spectrum [Nontrivial R] (φ : F) (a : A) : φ a ∈ σ a := by\n ","nextTactic":"have h : ↑ₐ (φ a) - a ∈ RingHom.ker (φ : A →+* R) := by\n simp only [RingHom.mem_ker, map_sub, RingHom.coe_coe, AlgHomClass.commutes,\n Algebra.id.map_eq_id, RingHom.id_apply, sub_self]","declUpToTactic":"theorem apply_mem_spectrum [Nontrivial R] (φ : F) (a : A) : φ a ∈ σ a := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.457_0.OiCHPrqZcVJoE6f","decl":"theorem apply_mem_spectrum [Nontrivial R] (φ : F) (a : A) : φ a ∈ σ a "} +{"state":"F : Type u_1\nR : Type u_2\nA : Type u_3\nB : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : Ring A\ninst✝⁴ : Algebra R A\ninst✝³ : Ring B\ninst✝² : Algebra R B\ninst✝¹ : AlgHomClass F R A R\ninst✝ : Nontrivial R\nφ : F\na : A\n⊢ ↑ₐ (φ a) - a ∈ RingHom.ker ↑φ","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n rw [neg_neg]\n#align spectrum.singleton_add_eq spectrum.singleton_add_eq\n\ntheorem add_singleton_eq (a : A) (r : R) : σ a + {r} = σ (a + ↑ₐ r) :=\n add_comm {r} (σ a) ▸ add_comm (algebraMap R A r) a ▸ singleton_add_eq a r\n#align spectrum.add_singleton_eq spectrum.add_singleton_eq\n\ntheorem vadd_eq (a : A) (r : R) : r +ᵥ σ a = σ (↑ₐ r + a) :=\n singleton_add.symm.trans <| singleton_add_eq a r\n#align spectrum.vadd_eq spectrum.vadd_eq\n\ntheorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n simp only [mem_neg, mem_iff, map_neg, ← neg_add', IsUnit.neg_iff, sub_neg_eq_add]\n#align spectrum.neg_eq spectrum.neg_eq\n\ntheorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n rw [neg_eq]\n rw [singleton_add_eq]\n rw [sub_eq_add_neg]\n#align spectrum.singleton_sub_eq spectrum.singleton_sub_eq\n\ntheorem sub_singleton_eq (a : A) (r : R) : σ a - {r} = σ (a - ↑ₐ r) := by\n simpa only [neg_sub, neg_eq] using congr_arg Neg.neg (singleton_sub_eq a r)\n#align spectrum.sub_singleton_eq spectrum.sub_singleton_eq\n\nend ScalarRing\n\nsection ScalarField\n\nvariable {𝕜 : Type u} {A : Type v}\n\nvariable [Field 𝕜] [Ring A] [Algebra 𝕜 A]\n\nlocal notation \"σ\" => spectrum 𝕜\n\nlocal notation \"↑ₐ\" => algebraMap 𝕜 A\n\n/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n refine' Set.Subset.antisymm _ (by simp [Algebra.algebraMap_eq_smul_one, mem_iff])\n rw [spectrum]\n rw [Set.compl_subset_comm]\n intro k hk\n rw [Set.mem_compl_singleton_iff] at hk\n have : IsUnit (Units.mk0 k hk • (1 : A)) := IsUnit.smul (Units.mk0 k hk) isUnit_one\n simpa [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one]\n#align spectrum.zero_eq spectrum.zero_eq\n\n@[simp]\ntheorem scalar_eq [Nontrivial A] (k : 𝕜) : σ (↑ₐ k) = {k} := by\n rw [← add_zero (↑ₐ k)]\n rw [← singleton_add_eq]\n rw [zero_eq]\n rw [Set.singleton_add_singleton]\n rw [add_zero]\n#align spectrum.scalar_eq spectrum.scalar_eq\n\n@[simp]\ntheorem one_eq [Nontrivial A] : σ (1 : A) = {1} :=\n calc\n σ (1 : A) = σ (↑ₐ 1) := by rw [Algebra.algebraMap_eq_smul_one, one_smul]\n _ = {1} := scalar_eq 1\n\n#align spectrum.one_eq spectrum.one_eq\n\n/-- the assumption `(σ a).Nonempty` is necessary and cannot be removed without\nfurther conditions on the algebra `A` and scalar field `𝕜`. -/\ntheorem smul_eq_smul [Nontrivial A] (k : 𝕜) (a : A) (ha : (σ a).Nonempty) :\n σ (k • a) = k • σ a := by\n rcases eq_or_ne k 0 with (rfl | h)\n · simpa [ha, zero_smul_set] using (show {(0 : 𝕜)} = (0 : Set 𝕜) from rfl)\n · exact unit_smul_eq_smul a (Units.mk0 k h)\n#align spectrum.smul_eq_smul spectrum.smul_eq_smul\n\ntheorem nonzero_mul_eq_swap_mul (a b : A) : σ (a * b) \\ {0} = σ (b * a) \\ {0} := by\n suffices h : ∀ x y : A, σ (x * y) \\ {0} ⊆ σ (y * x) \\ {0}\n · exact Set.eq_of_subset_of_subset (h a b) (h b a)\n · rintro _ _ k ⟨k_mem, k_neq⟩\n change ((Units.mk0 k k_neq) : 𝕜) ∈ _ at k_mem\n exact ⟨unit_mem_mul_iff_mem_swap_mul.mp k_mem, k_neq⟩\n#align spectrum.nonzero_mul_eq_swap_mul spectrum.nonzero_mul_eq_swap_mul\n\nprotected theorem map_inv (a : Aˣ) : (σ (a : A))⁻¹ = σ (↑a⁻¹ : A) := by\n refine' Set.eq_of_subset_of_subset (fun k hk => _) fun k hk => _\n · rw [Set.mem_inv] at hk\n have : k ≠ 0 := by simpa only [inv_inv] using inv_ne_zero (ne_zero_of_mem_of_unit hk)\n lift k to 𝕜ˣ using isUnit_iff_ne_zero.mpr this\n rw [← Units.val_inv_eq_inv_val k] at hk\n exact inv_mem_iff.mp hk\n · lift k to 𝕜ˣ using isUnit_iff_ne_zero.mpr (ne_zero_of_mem_of_unit hk)\n simpa only [Units.val_inv_eq_inv_val] using inv_mem_iff.mp hk\n#align spectrum.map_inv spectrum.map_inv\n\nend ScalarField\n\nend spectrum\n\nnamespace AlgHom\n\nsection CommSemiring\n\nvariable {F R A B : Type*} [CommSemiring R] [Ring A] [Algebra R A] [Ring B] [Algebra R B]\n\nvariable [AlgHomClass F R A B]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_resolventSet_apply (φ : F) {a : A} {r : R} (h : r ∈ resolventSet R a) :\n r ∈ resolventSet R ((φ : A → B) a) := by\n simpa only [map_sub, AlgHomClass.commutes] using h.map φ\n#align alg_hom.mem_resolvent_set_apply AlgHom.mem_resolventSet_apply\n\ntheorem spectrum_apply_subset (φ : F) (a : A) : σ ((φ : A → B) a) ⊆ σ a := fun _ =>\n mt (mem_resolventSet_apply φ)\n#align alg_hom.spectrum_apply_subset AlgHom.spectrum_apply_subset\n\nend CommSemiring\n\nsection CommRing\n\nvariable {F R A B : Type*} [CommRing R] [Ring A] [Algebra R A] [Ring B] [Algebra R B]\n\nvariable [AlgHomClass F R A R]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem apply_mem_spectrum [Nontrivial R] (φ : F) (a : A) : φ a ∈ σ a := by\n have h : ↑ₐ (φ a) - a ∈ RingHom.ker (φ : A →+* R) := by\n ","nextTactic":"simp only [RingHom.mem_ker, map_sub, RingHom.coe_coe, AlgHomClass.commutes,\n Algebra.id.map_eq_id, RingHom.id_apply, sub_self]","declUpToTactic":"theorem apply_mem_spectrum [Nontrivial R] (φ : F) (a : A) : φ a ∈ σ a := by\n have h : ↑ₐ (φ a) - a ∈ RingHom.ker (φ : A →+* R) := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.457_0.OiCHPrqZcVJoE6f","decl":"theorem apply_mem_spectrum [Nontrivial R] (φ : F) (a : A) : φ a ∈ σ a "} +{"state":"F : Type u_1\nR : Type u_2\nA : Type u_3\nB : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : Ring A\ninst✝⁴ : Algebra R A\ninst✝³ : Ring B\ninst✝² : Algebra R B\ninst✝¹ : AlgHomClass F R A R\ninst✝ : Nontrivial R\nφ : F\na : A\nh : ↑ₐ (φ a) - a ∈ RingHom.ker ↑φ\n⊢ φ a ∈ σ a","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n rw [neg_neg]\n#align spectrum.singleton_add_eq spectrum.singleton_add_eq\n\ntheorem add_singleton_eq (a : A) (r : R) : σ a + {r} = σ (a + ↑ₐ r) :=\n add_comm {r} (σ a) ▸ add_comm (algebraMap R A r) a ▸ singleton_add_eq a r\n#align spectrum.add_singleton_eq spectrum.add_singleton_eq\n\ntheorem vadd_eq (a : A) (r : R) : r +ᵥ σ a = σ (↑ₐ r + a) :=\n singleton_add.symm.trans <| singleton_add_eq a r\n#align spectrum.vadd_eq spectrum.vadd_eq\n\ntheorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n simp only [mem_neg, mem_iff, map_neg, ← neg_add', IsUnit.neg_iff, sub_neg_eq_add]\n#align spectrum.neg_eq spectrum.neg_eq\n\ntheorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n rw [neg_eq]\n rw [singleton_add_eq]\n rw [sub_eq_add_neg]\n#align spectrum.singleton_sub_eq spectrum.singleton_sub_eq\n\ntheorem sub_singleton_eq (a : A) (r : R) : σ a - {r} = σ (a - ↑ₐ r) := by\n simpa only [neg_sub, neg_eq] using congr_arg Neg.neg (singleton_sub_eq a r)\n#align spectrum.sub_singleton_eq spectrum.sub_singleton_eq\n\nend ScalarRing\n\nsection ScalarField\n\nvariable {𝕜 : Type u} {A : Type v}\n\nvariable [Field 𝕜] [Ring A] [Algebra 𝕜 A]\n\nlocal notation \"σ\" => spectrum 𝕜\n\nlocal notation \"↑ₐ\" => algebraMap 𝕜 A\n\n/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n refine' Set.Subset.antisymm _ (by simp [Algebra.algebraMap_eq_smul_one, mem_iff])\n rw [spectrum]\n rw [Set.compl_subset_comm]\n intro k hk\n rw [Set.mem_compl_singleton_iff] at hk\n have : IsUnit (Units.mk0 k hk • (1 : A)) := IsUnit.smul (Units.mk0 k hk) isUnit_one\n simpa [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one]\n#align spectrum.zero_eq spectrum.zero_eq\n\n@[simp]\ntheorem scalar_eq [Nontrivial A] (k : 𝕜) : σ (↑ₐ k) = {k} := by\n rw [← add_zero (↑ₐ k)]\n rw [← singleton_add_eq]\n rw [zero_eq]\n rw [Set.singleton_add_singleton]\n rw [add_zero]\n#align spectrum.scalar_eq spectrum.scalar_eq\n\n@[simp]\ntheorem one_eq [Nontrivial A] : σ (1 : A) = {1} :=\n calc\n σ (1 : A) = σ (↑ₐ 1) := by rw [Algebra.algebraMap_eq_smul_one, one_smul]\n _ = {1} := scalar_eq 1\n\n#align spectrum.one_eq spectrum.one_eq\n\n/-- the assumption `(σ a).Nonempty` is necessary and cannot be removed without\nfurther conditions on the algebra `A` and scalar field `𝕜`. -/\ntheorem smul_eq_smul [Nontrivial A] (k : 𝕜) (a : A) (ha : (σ a).Nonempty) :\n σ (k • a) = k • σ a := by\n rcases eq_or_ne k 0 with (rfl | h)\n · simpa [ha, zero_smul_set] using (show {(0 : 𝕜)} = (0 : Set 𝕜) from rfl)\n · exact unit_smul_eq_smul a (Units.mk0 k h)\n#align spectrum.smul_eq_smul spectrum.smul_eq_smul\n\ntheorem nonzero_mul_eq_swap_mul (a b : A) : σ (a * b) \\ {0} = σ (b * a) \\ {0} := by\n suffices h : ∀ x y : A, σ (x * y) \\ {0} ⊆ σ (y * x) \\ {0}\n · exact Set.eq_of_subset_of_subset (h a b) (h b a)\n · rintro _ _ k ⟨k_mem, k_neq⟩\n change ((Units.mk0 k k_neq) : 𝕜) ∈ _ at k_mem\n exact ⟨unit_mem_mul_iff_mem_swap_mul.mp k_mem, k_neq⟩\n#align spectrum.nonzero_mul_eq_swap_mul spectrum.nonzero_mul_eq_swap_mul\n\nprotected theorem map_inv (a : Aˣ) : (σ (a : A))⁻¹ = σ (↑a⁻¹ : A) := by\n refine' Set.eq_of_subset_of_subset (fun k hk => _) fun k hk => _\n · rw [Set.mem_inv] at hk\n have : k ≠ 0 := by simpa only [inv_inv] using inv_ne_zero (ne_zero_of_mem_of_unit hk)\n lift k to 𝕜ˣ using isUnit_iff_ne_zero.mpr this\n rw [← Units.val_inv_eq_inv_val k] at hk\n exact inv_mem_iff.mp hk\n · lift k to 𝕜ˣ using isUnit_iff_ne_zero.mpr (ne_zero_of_mem_of_unit hk)\n simpa only [Units.val_inv_eq_inv_val] using inv_mem_iff.mp hk\n#align spectrum.map_inv spectrum.map_inv\n\nend ScalarField\n\nend spectrum\n\nnamespace AlgHom\n\nsection CommSemiring\n\nvariable {F R A B : Type*} [CommSemiring R] [Ring A] [Algebra R A] [Ring B] [Algebra R B]\n\nvariable [AlgHomClass F R A B]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_resolventSet_apply (φ : F) {a : A} {r : R} (h : r ∈ resolventSet R a) :\n r ∈ resolventSet R ((φ : A → B) a) := by\n simpa only [map_sub, AlgHomClass.commutes] using h.map φ\n#align alg_hom.mem_resolvent_set_apply AlgHom.mem_resolventSet_apply\n\ntheorem spectrum_apply_subset (φ : F) (a : A) : σ ((φ : A → B) a) ⊆ σ a := fun _ =>\n mt (mem_resolventSet_apply φ)\n#align alg_hom.spectrum_apply_subset AlgHom.spectrum_apply_subset\n\nend CommSemiring\n\nsection CommRing\n\nvariable {F R A B : Type*} [CommRing R] [Ring A] [Algebra R A] [Ring B] [Algebra R B]\n\nvariable [AlgHomClass F R A R]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem apply_mem_spectrum [Nontrivial R] (φ : F) (a : A) : φ a ∈ σ a := by\n have h : ↑ₐ (φ a) - a ∈ RingHom.ker (φ : A →+* R) := by\n simp only [RingHom.mem_ker, map_sub, RingHom.coe_coe, AlgHomClass.commutes,\n Algebra.id.map_eq_id, RingHom.id_apply, sub_self]\n ","nextTactic":"simp only [spectrum.mem_iff, ← mem_nonunits_iff,\n coe_subset_nonunits (RingHom.ker_ne_top (φ : A →+* R)) h]","declUpToTactic":"theorem apply_mem_spectrum [Nontrivial R] (φ : F) (a : A) : φ a ∈ σ a := by\n have h : ↑ₐ (φ a) - a ∈ RingHom.ker (φ : A →+* R) := by\n simp only [RingHom.mem_ker, map_sub, RingHom.coe_coe, AlgHomClass.commutes,\n Algebra.id.map_eq_id, RingHom.id_apply, sub_self]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.457_0.OiCHPrqZcVJoE6f","decl":"theorem apply_mem_spectrum [Nontrivial R] (φ : F) (a : A) : φ a ∈ σ a "} +{"state":"F : Type u_1\nR : Type u_2\nA : Type u_3\nB : Type u_4\ninst✝⁵ : CommSemiring R\ninst✝⁴ : Ring A\ninst✝³ : Ring B\ninst✝² : Algebra R A\ninst✝¹ : Algebra R B\ninst✝ : AlgEquivClass F R A B\nf : F\na : A\n⊢ spectrum R a ⊆ spectrum R (f a)","srcUpToTactic":"/-\nCopyright (c) 2021 Jireh Loreaux. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Jireh Loreaux\n-/\nimport Mathlib.Algebra.Star.Pointwise\nimport Mathlib.Algebra.Star.Subalgebra\nimport Mathlib.Tactic.NoncommRing\n\n#align_import algebra.algebra.spectrum from \"leanprover-community/mathlib\"@\"58a272265b5e05f258161260dd2c5d247213cbd3\"\n\n/-!\n# Spectrum of an element in an algebra\nThis file develops the basic theory of the spectrum of an element of an algebra.\nThis theory will serve as the foundation for spectral theory in Banach algebras.\n\n## Main definitions\n\n* `resolventSet a : Set R`: the resolvent set of an element `a : A` where\n `A` is an `R`-algebra.\n* `spectrum a : Set R`: the spectrum of an element `a : A` where\n `A` is an `R`-algebra.\n* `resolvent : R → A`: the resolvent function is `fun r ↦ Ring.inverse (↑ₐr - a)`, and hence\n when `r ∈ resolvent R A`, it is actually the inverse of the unit `(↑ₐr - a)`.\n\n## Main statements\n\n* `spectrum.unit_smul_eq_smul` and `spectrum.smul_eq_smul`: units in the scalar ring commute\n (multiplication) with the spectrum, and over a field even `0` commutes with the spectrum.\n* `spectrum.left_add_coset_eq`: elements of the scalar ring commute (addition) with the spectrum.\n* `spectrum.unit_mem_mul_iff_mem_swap_mul` and `spectrum.preimage_units_mul_eq_swap_mul`: the\n units (of `R`) in `σ (a*b)` coincide with those in `σ (b*a)`.\n* `spectrum.scalar_eq`: in a nontrivial algebra over a field, the spectrum of a scalar is\n a singleton.\n\n## Notations\n\n* `σ a` : `spectrum R a` of `a : A`\n-/\n\n\nopen Set\n\nopen scoped Pointwise\n\nuniverse u v\n\nsection Defs\n\nvariable (R : Type u) {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- definition and basic properties\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *resolvent set* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is a unit of the\nalgebra `A`. -/\ndef resolventSet (a : A) : Set R :=\n {r : R | IsUnit (↑ₐ r - a)}\n#align resolvent_set resolventSet\n\n/-- Given a commutative ring `R` and an `R`-algebra `A`, the *spectrum* of `a : A`\nis the `Set R` consisting of those `r : R` for which `r•1 - a` is not a unit of the\nalgebra `A`.\n\nThe spectrum is simply the complement of the resolvent set. -/\ndef spectrum (a : A) : Set R :=\n (resolventSet R a)ᶜ\n#align spectrum spectrum\n\nvariable {R}\n\n/-- Given an `a : A` where `A` is an `R`-algebra, the *resolvent* is\n a map `R → A` which sends `r : R` to `(algebraMap R A r - a)⁻¹` when\n `r ∈ resolvent R A` and `0` when `r ∈ spectrum R A`. -/\nnoncomputable def resolvent (a : A) (r : R) : A :=\n Ring.inverse (↑ₐ r - a)\n#align resolvent resolvent\n\n/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/\n@[simps]\nnoncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ where\n val := ↑ₐ s - r⁻¹ • a\n inv := r • ↑h.unit⁻¹\n val_inv := by rw [mul_smul_comm, ← smul_mul_assoc, smul_sub, smul_inv_smul, h.mul_val_inv]\n inv_val := by rw [smul_mul_assoc, ← mul_smul_comm, smul_sub, smul_inv_smul, h.val_inv_mul]\n#align is_unit.sub_inv_smul IsUnit.subInvSMul\n#align is_unit.coe_sub_inv_smul IsUnit.val_subInvSMul\n#align is_unit.coe_inv_sub_inv_smul IsUnit.val_inv_subInvSMul\n\nend Defs\n\nnamespace spectrum\n\nsection ScalarSemiring\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommSemiring R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_iff {r : R} {a : A} : r ∈ σ a ↔ ¬IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_iff spectrum.mem_iff\n\ntheorem not_mem_iff {r : R} {a : A} : r ∉ σ a ↔ IsUnit (↑ₐ r - a) := by\n apply not_iff_not.mp\n simp [Set.not_not_mem, mem_iff]\n#align spectrum.not_mem_iff spectrum.not_mem_iff\n\nvariable (R)\n\ntheorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a := by\n rw [mem_iff]\n rw [map_zero]\n rw [zero_sub]\n rw [IsUnit.neg_iff]\n#align spectrum.zero_mem_iff spectrum.zero_mem_iff\n\nalias ⟨not_isUnit_of_zero_mem, zero_mem⟩ := spectrum.zero_mem_iff\n\ntheorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a := by\n rw [zero_mem_iff]\n rw [Classical.not_not]\n#align spectrum.zero_not_mem_iff spectrum.zero_not_mem_iff\n\nalias ⟨isUnit_of_zero_not_mem, zero_not_mem⟩ := spectrum.zero_not_mem_iff\n\nlemma subset_singleton_zero_compl {a : A} (ha : IsUnit a) : spectrum R a ⊆ {0}ᶜ :=\n Set.subset_compl_singleton_iff.mpr <| spectrum.zero_not_mem R ha\n\nvariable {R}\n\ntheorem mem_resolventSet_of_left_right_inverse {r : R} {a b c : A} (h₁ : (↑ₐ r - a) * b = 1)\n (h₂ : c * (↑ₐ r - a) = 1) : r ∈ resolventSet R a :=\n Units.isUnit ⟨↑ₐ r - a, b, h₁, by rwa [← left_inv_eq_right_inv h₂ h₁]⟩\n#align spectrum.mem_resolvent_set_of_left_right_inverse spectrum.mem_resolventSet_of_left_right_inverse\n\ntheorem mem_resolventSet_iff {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (↑ₐ r - a) :=\n Iff.rfl\n#align spectrum.mem_resolvent_set_iff spectrum.mem_resolventSet_iff\n\n@[simp]\ntheorem resolventSet_of_subsingleton [Subsingleton A] (a : A) : resolventSet R a = Set.univ := by\n simp_rw [resolventSet, Subsingleton.elim (algebraMap R A _ - a) 1, isUnit_one, Set.setOf_true]\n#align spectrum.resolvent_set_of_subsingleton spectrum.resolventSet_of_subsingleton\n\n@[simp]\ntheorem of_subsingleton [Subsingleton A] (a : A) : spectrum R a = ∅ := by\n rw [spectrum]\n rw [resolventSet_of_subsingleton]\n rw [Set.compl_univ]\n#align spectrum.of_subsingleton spectrum.of_subsingleton\n\ntheorem resolvent_eq {a : A} {r : R} (h : r ∈ resolventSet R a) : resolvent a r = ↑h.unit⁻¹ :=\n Ring.inverse_unit h.unit\n#align spectrum.resolvent_eq spectrum.resolvent_eq\n\ntheorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :\n r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R) := by\n by_cases h : s ∈ spectrum R a\n · rw [mem_iff] at h\n simp only [resolvent, Algebra.algebraMap_eq_smul_one] at *\n rw [smul_assoc]\n rw [← smul_sub]\n have h' : ¬IsUnit (r⁻¹ • (s • (1 : A) - a)) := fun hu =>\n h (by simpa only [smul_inv_smul] using IsUnit.smul r hu)\n simp only [Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ h', smul_zero]\n · simp only [resolvent]\n have h' : IsUnit (r • algebraMap R A (r⁻¹ • s) - a) := by\n simpa [Algebra.algebraMap_eq_smul_one, smul_assoc] using not_mem_iff.mp h\n rw [← h'.val_subInvSMul, ← (not_mem_iff.mp h).unit_spec, Ring.inverse_unit, Ring.inverse_unit,\n h'.val_inv_subInvSMul]\n simp only [Algebra.algebraMap_eq_smul_one, smul_assoc, smul_inv_smul]\n#align spectrum.units_smul_resolvent spectrum.units_smul_resolvent\n\ntheorem units_smul_resolvent_self {r : Rˣ} {a : A} :\n r • resolvent a (r : R) = resolvent (r⁻¹ • a) (1 : R) := by\n simpa only [Units.smul_def, Algebra.id.smul_eq_mul, Units.inv_mul] using\n @units_smul_resolvent _ _ _ _ _ r r a\n#align spectrum.units_smul_resolvent_self spectrum.units_smul_resolvent_self\n\n/-- The resolvent is a unit when the argument is in the resolvent set. -/\ntheorem isUnit_resolvent {r : R} {a : A} : r ∈ resolventSet R a ↔ IsUnit (resolvent a r) :=\n isUnit_ring_inverse.symm\n#align spectrum.is_unit_resolvent spectrum.isUnit_resolvent\n\ntheorem inv_mem_resolventSet {r : Rˣ} {a : Aˣ} (h : (r : R) ∈ resolventSet R (a : A)) :\n (↑r⁻¹ : R) ∈ resolventSet R (↑a⁻¹ : A) := by\n rw [mem_resolventSet_iff] at h ⊢\n rw [Algebra.algebraMap_eq_smul_one] at h ⊢\n rw [← Units.smul_def] at h ⊢\n rw [IsUnit.smul_sub_iff_sub_inv_smul]\n rw [inv_inv]\n rw [IsUnit.sub_iff]\n have h₁ : (a : A) * (r • (↑a⁻¹ : A) - 1) = r • (1 : A) - a := by\n rw [mul_sub]\n rw [mul_smul_comm]\n rw [a.mul_inv]\n rw [mul_one]\n have h₂ : (r • (↑a⁻¹ : A) - 1) * a = r • (1 : A) - a := by\n rw [sub_mul]\n rw [smul_mul_assoc]\n rw [a.inv_mul]\n rw [one_mul]\n have hcomm : Commute (a : A) (r • (↑a⁻¹ : A) - 1) := by rwa [← h₂] at h₁\n exact (hcomm.isUnit_mul_iff.mp (h₁.symm ▸ h)).2\n#align spectrum.inv_mem_resolvent_set spectrum.inv_mem_resolventSet\n\ntheorem inv_mem_iff {r : Rˣ} {a : Aˣ} : (r : R) ∈ σ (a : A) ↔ (↑r⁻¹ : R) ∈ σ (↑a⁻¹ : A) :=\n not_iff_not.2 <| ⟨inv_mem_resolventSet, inv_mem_resolventSet⟩\n#align spectrum.inv_mem_iff spectrum.inv_mem_iff\n\ntheorem zero_mem_resolventSet_of_unit (a : Aˣ) : 0 ∈ resolventSet R (a : A) := by\n simpa only [mem_resolventSet_iff, ← not_mem_iff, zero_not_mem_iff] using a.isUnit\n#align spectrum.zero_mem_resolvent_set_of_unit spectrum.zero_mem_resolventSet_of_unit\n\ntheorem ne_zero_of_mem_of_unit {a : Aˣ} {r : R} (hr : r ∈ σ (a : A)) : r ≠ 0 := fun hn =>\n (hn ▸ hr) (zero_mem_resolventSet_of_unit a)\n#align spectrum.ne_zero_of_mem_of_unit spectrum.ne_zero_of_mem_of_unit\n\ntheorem add_mem_iff {a : A} {r s : R} : r + s ∈ σ a ↔ r ∈ σ (-↑ₐ s + a) := by\n simp only [mem_iff, sub_neg_eq_add, ← sub_sub, map_add]\n#align spectrum.add_mem_iff spectrum.add_mem_iff\n\ntheorem add_mem_add_iff {a : A} {r s : R} : r + s ∈ σ (↑ₐ s + a) ↔ r ∈ σ a := by\n rw [add_mem_iff]\n rw [neg_add_cancel_left]\n#align spectrum.add_mem_add_iff spectrum.add_mem_add_iff\n\ntheorem smul_mem_smul_iff {a : A} {s : R} {r : Rˣ} : r • s ∈ σ (r • a) ↔ s ∈ σ a := by\n simp only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, smul_assoc, ← smul_sub,\n isUnit_smul_iff]\n#align spectrum.smul_mem_smul_iff spectrum.smul_mem_smul_iff\n\ntheorem unit_smul_eq_smul (a : A) (r : Rˣ) : σ (r • a) = r • σ a := by\n ext x\n have x_eq : x = r • r⁻¹ • x := by simp\n nth_rw 1 [x_eq]\n rw [smul_mem_smul_iff]\n constructor\n · exact fun h => ⟨r⁻¹ • x, ⟨h, show r • r⁻¹ • x = x by simp⟩⟩\n · rintro ⟨w, _, (x'_eq : r • w = x)⟩\n simpa [← x'_eq ]\n#align spectrum.unit_smul_eq_smul spectrum.unit_smul_eq_smul\n\n-- `r ∈ σ(a*b) ↔ r ∈ σ(b*a)` for any `r : Rˣ`\ntheorem unit_mem_mul_iff_mem_swap_mul {a b : A} {r : Rˣ} : ↑r ∈ σ (a * b) ↔ ↑r ∈ σ (b * a) := by\n have h₁ : ∀ x y : A, IsUnit (1 - x * y) → IsUnit (1 - y * x) := by\n refine' fun x y h => ⟨⟨1 - y * x, 1 + y * h.unit.inv * x, _, _⟩, rfl⟩\n calc\n (1 - y * x) * (1 + y * (IsUnit.unit h).inv * x) =\n 1 - y * x + y * ((1 - x * y) * h.unit.inv) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.mul_val_inv, mul_one, sub_add_cancel]\n calc\n (1 + y * (IsUnit.unit h).inv * x) * (1 - y * x) =\n 1 - y * x + y * (h.unit.inv * (1 - x * y)) * x := by noncomm_ring\n _ = 1 := by simp only [Units.inv_eq_val_inv, IsUnit.val_inv_mul, mul_one, sub_add_cancel]\n have := Iff.intro (h₁ (r⁻¹ • a) b) (h₁ b (r⁻¹ • a))\n rw [mul_smul_comm r⁻¹ b a] at this\n simpa only [mem_iff, not_iff_not, Algebra.algebraMap_eq_smul_one, ← Units.smul_def,\n IsUnit.smul_sub_iff_sub_inv_smul, smul_mul_assoc]\n#align spectrum.unit_mem_mul_iff_mem_swap_mul spectrum.unit_mem_mul_iff_mem_swap_mul\n\ntheorem preimage_units_mul_eq_swap_mul {a b : A} :\n ((↑) : Rˣ → R) ⁻¹' σ (a * b) = (↑) ⁻¹' σ (b * a) :=\n Set.ext fun _ => unit_mem_mul_iff_mem_swap_mul\n#align spectrum.preimage_units_mul_eq_swap_mul spectrum.preimage_units_mul_eq_swap_mul\n\nsection Star\n\nvariable [InvolutiveStar R] [StarRing A] [StarModule R A]\n\ntheorem star_mem_resolventSet_iff {r : R} {a : A} :\n star r ∈ resolventSet R a ↔ r ∈ resolventSet R (star a) := by\n refine' ⟨fun h => _, fun h => _⟩ <;>\n simpa only [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one, star_sub, star_smul,\n star_star, star_one] using IsUnit.star h\n#align spectrum.star_mem_resolvent_set_iff spectrum.star_mem_resolventSet_iff\n\nprotected theorem map_star (a : A) : σ (star a) = star (σ a) := by\n ext\n simpa only [Set.mem_star, mem_iff, not_iff_not] using star_mem_resolventSet_iff.symm\n#align spectrum.map_star spectrum.map_star\n\nend Star\n\nend ScalarSemiring\n\nsection ScalarRing\n\nvariable {R : Type u} {A : Type v}\n\nvariable [CommRing R] [Ring A] [Algebra R A]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\n-- it would be nice to state this for `subalgebra_class`, but we don't have such a thing yet\ntheorem subset_subalgebra {S : Subalgebra R A} (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.val\n#align spectrum.subset_subalgebra spectrum.subset_subalgebra\n\n-- this is why it would be nice if `subset_subalgebra` was registered for `subalgebra_class`.\ntheorem subset_starSubalgebra [StarRing R] [StarRing A] [StarModule R A] {S : StarSubalgebra R A}\n (a : S) : spectrum R (a : A) ⊆ spectrum R a :=\n compl_subset_compl.2 fun _ => IsUnit.map S.subtype\n#align spectrum.subset_star_subalgebra spectrum.subset_starSubalgebra\n\ntheorem singleton_add_eq (a : A) (r : R) : {r} + σ a = σ (↑ₐ r + a) :=\n ext fun x => by\n rw [singleton_add]\n rw [image_add_left]\n rw [mem_preimage]\n rw [add_comm]\n rw [add_mem_iff]\n rw [map_neg]\n rw [neg_neg]\n#align spectrum.singleton_add_eq spectrum.singleton_add_eq\n\ntheorem add_singleton_eq (a : A) (r : R) : σ a + {r} = σ (a + ↑ₐ r) :=\n add_comm {r} (σ a) ▸ add_comm (algebraMap R A r) a ▸ singleton_add_eq a r\n#align spectrum.add_singleton_eq spectrum.add_singleton_eq\n\ntheorem vadd_eq (a : A) (r : R) : r +ᵥ σ a = σ (↑ₐ r + a) :=\n singleton_add.symm.trans <| singleton_add_eq a r\n#align spectrum.vadd_eq spectrum.vadd_eq\n\ntheorem neg_eq (a : A) : -σ a = σ (-a) :=\n Set.ext fun x => by\n simp only [mem_neg, mem_iff, map_neg, ← neg_add', IsUnit.neg_iff, sub_neg_eq_add]\n#align spectrum.neg_eq spectrum.neg_eq\n\ntheorem singleton_sub_eq (a : A) (r : R) : {r} - σ a = σ (↑ₐ r - a) := by\n rw [sub_eq_add_neg]\n rw [neg_eq]\n rw [singleton_add_eq]\n rw [sub_eq_add_neg]\n#align spectrum.singleton_sub_eq spectrum.singleton_sub_eq\n\ntheorem sub_singleton_eq (a : A) (r : R) : σ a - {r} = σ (a - ↑ₐ r) := by\n simpa only [neg_sub, neg_eq] using congr_arg Neg.neg (singleton_sub_eq a r)\n#align spectrum.sub_singleton_eq spectrum.sub_singleton_eq\n\nend ScalarRing\n\nsection ScalarField\n\nvariable {𝕜 : Type u} {A : Type v}\n\nvariable [Field 𝕜] [Ring A] [Algebra 𝕜 A]\n\nlocal notation \"σ\" => spectrum 𝕜\n\nlocal notation \"↑ₐ\" => algebraMap 𝕜 A\n\n/-- Without the assumption `Nontrivial A`, then `0 : A` would be invertible. -/\n@[simp]\ntheorem zero_eq [Nontrivial A] : σ (0 : A) = {0} := by\n refine' Set.Subset.antisymm _ (by simp [Algebra.algebraMap_eq_smul_one, mem_iff])\n rw [spectrum]\n rw [Set.compl_subset_comm]\n intro k hk\n rw [Set.mem_compl_singleton_iff] at hk\n have : IsUnit (Units.mk0 k hk • (1 : A)) := IsUnit.smul (Units.mk0 k hk) isUnit_one\n simpa [mem_resolventSet_iff, Algebra.algebraMap_eq_smul_one]\n#align spectrum.zero_eq spectrum.zero_eq\n\n@[simp]\ntheorem scalar_eq [Nontrivial A] (k : 𝕜) : σ (↑ₐ k) = {k} := by\n rw [← add_zero (↑ₐ k)]\n rw [← singleton_add_eq]\n rw [zero_eq]\n rw [Set.singleton_add_singleton]\n rw [add_zero]\n#align spectrum.scalar_eq spectrum.scalar_eq\n\n@[simp]\ntheorem one_eq [Nontrivial A] : σ (1 : A) = {1} :=\n calc\n σ (1 : A) = σ (↑ₐ 1) := by rw [Algebra.algebraMap_eq_smul_one, one_smul]\n _ = {1} := scalar_eq 1\n\n#align spectrum.one_eq spectrum.one_eq\n\n/-- the assumption `(σ a).Nonempty` is necessary and cannot be removed without\nfurther conditions on the algebra `A` and scalar field `𝕜`. -/\ntheorem smul_eq_smul [Nontrivial A] (k : 𝕜) (a : A) (ha : (σ a).Nonempty) :\n σ (k • a) = k • σ a := by\n rcases eq_or_ne k 0 with (rfl | h)\n · simpa [ha, zero_smul_set] using (show {(0 : 𝕜)} = (0 : Set 𝕜) from rfl)\n · exact unit_smul_eq_smul a (Units.mk0 k h)\n#align spectrum.smul_eq_smul spectrum.smul_eq_smul\n\ntheorem nonzero_mul_eq_swap_mul (a b : A) : σ (a * b) \\ {0} = σ (b * a) \\ {0} := by\n suffices h : ∀ x y : A, σ (x * y) \\ {0} ⊆ σ (y * x) \\ {0}\n · exact Set.eq_of_subset_of_subset (h a b) (h b a)\n · rintro _ _ k ⟨k_mem, k_neq⟩\n change ((Units.mk0 k k_neq) : 𝕜) ∈ _ at k_mem\n exact ⟨unit_mem_mul_iff_mem_swap_mul.mp k_mem, k_neq⟩\n#align spectrum.nonzero_mul_eq_swap_mul spectrum.nonzero_mul_eq_swap_mul\n\nprotected theorem map_inv (a : Aˣ) : (σ (a : A))⁻¹ = σ (↑a⁻¹ : A) := by\n refine' Set.eq_of_subset_of_subset (fun k hk => _) fun k hk => _\n · rw [Set.mem_inv] at hk\n have : k ≠ 0 := by simpa only [inv_inv] using inv_ne_zero (ne_zero_of_mem_of_unit hk)\n lift k to 𝕜ˣ using isUnit_iff_ne_zero.mpr this\n rw [← Units.val_inv_eq_inv_val k] at hk\n exact inv_mem_iff.mp hk\n · lift k to 𝕜ˣ using isUnit_iff_ne_zero.mpr (ne_zero_of_mem_of_unit hk)\n simpa only [Units.val_inv_eq_inv_val] using inv_mem_iff.mp hk\n#align spectrum.map_inv spectrum.map_inv\n\nend ScalarField\n\nend spectrum\n\nnamespace AlgHom\n\nsection CommSemiring\n\nvariable {F R A B : Type*} [CommSemiring R] [Ring A] [Algebra R A] [Ring B] [Algebra R B]\n\nvariable [AlgHomClass F R A B]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem mem_resolventSet_apply (φ : F) {a : A} {r : R} (h : r ∈ resolventSet R a) :\n r ∈ resolventSet R ((φ : A → B) a) := by\n simpa only [map_sub, AlgHomClass.commutes] using h.map φ\n#align alg_hom.mem_resolvent_set_apply AlgHom.mem_resolventSet_apply\n\ntheorem spectrum_apply_subset (φ : F) (a : A) : σ ((φ : A → B) a) ⊆ σ a := fun _ =>\n mt (mem_resolventSet_apply φ)\n#align alg_hom.spectrum_apply_subset AlgHom.spectrum_apply_subset\n\nend CommSemiring\n\nsection CommRing\n\nvariable {F R A B : Type*} [CommRing R] [Ring A] [Algebra R A] [Ring B] [Algebra R B]\n\nvariable [AlgHomClass F R A R]\n\nlocal notation \"σ\" => spectrum R\n\nlocal notation \"↑ₐ\" => algebraMap R A\n\ntheorem apply_mem_spectrum [Nontrivial R] (φ : F) (a : A) : φ a ∈ σ a := by\n have h : ↑ₐ (φ a) - a ∈ RingHom.ker (φ : A →+* R) := by\n simp only [RingHom.mem_ker, map_sub, RingHom.coe_coe, AlgHomClass.commutes,\n Algebra.id.map_eq_id, RingHom.id_apply, sub_self]\n simp only [spectrum.mem_iff, ← mem_nonunits_iff,\n coe_subset_nonunits (RingHom.ker_ne_top (φ : A →+* R)) h]\n#align alg_hom.apply_mem_spectrum AlgHom.apply_mem_spectrum\n\nend CommRing\n\nend AlgHom\n\n@[simp]\ntheorem AlgEquiv.spectrum_eq {F R A B : Type*} [CommSemiring R] [Ring A] [Ring B] [Algebra R A]\n [Algebra R B] [AlgEquivClass F R A B] (f : F) (a : A) :\n spectrum R (f a) = spectrum R a :=\n Set.Subset.antisymm (AlgHom.spectrum_apply_subset _ _) <| by\n ","nextTactic":"simpa only [AlgEquiv.coe_algHom, AlgEquiv.coe_coe_symm_apply_coe_apply] using\n AlgHom.spectrum_apply_subset (f : A ≃ₐ[R] B).symm (f a)","declUpToTactic":"@[simp]\ntheorem AlgEquiv.spectrum_eq {F R A B : Type*} [CommSemiring R] [Ring A] [Ring B] [Algebra R A]\n [Algebra R B] [AlgEquivClass F R A B] (f : F) (a : A) :\n spectrum R (f a) = spectrum R a :=\n Set.Subset.antisymm (AlgHom.spectrum_apply_subset _ _) <| by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Algebra_Spectrum.469_0.OiCHPrqZcVJoE6f","decl":"@[simp]\ntheorem AlgEquiv.spectrum_eq {F R A B : Type*} [CommSemiring R] [Ring A] [Ring B] [Algebra R A]\n [Algebra R B] [AlgEquivClass F R A B] (f : F) (a : A) :\n spectrum R (f a) = spectrum R a "}