File size: 83,047 Bytes
11f4234 | 1 2 3 4 5 6 7 8 9 10 | {"completion":"by\n simp only [isQuasiregular_iff', ← isUnit_map_iff (PreQuasiregular.toPi κ), Pi.isUnit_iff]\n congr!","context_contains_namespace":false,"context_suffix":"end quasiregular","dependency_ids":["import:Mathlib.Algebra.Algebra.Spectrum.Quasispectrum","import:Mathlib.Algebra.Algebra.Pi","import:Mathlib.Algebra.Algebra.Prod","import:Mathlib.Algebra.Group.Pi.Units"],"family_id":"isquasiregular_pi_iff","file_id":"mathlib/Mathlib/Algebra/Algebra/Spectrum/Pi.lean","imports":["public import Mathlib.Algebra.Algebra.Spectrum.Quasispectrum","public import Mathlib.Algebra.Algebra.Pi","public import Mathlib.Algebra.Algebra.Prod","public import Mathlib.Algebra.Group.Pi.Units"],"local_context":"/-\nCopyright (c) 2025 Frédéric Dupuis. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Frédéric Dupuis\n-/\n/-!\n# Spectrum and quasispectrum of products\n\nThis file contains results regarding the spectra and quasispectra of (indexed) products of\nelements of a (non-unital) ring. The main result is that the (quasi)spectrum of a product is the\nunion of the (quasi)spectra.\n\n## Main declarations\n\n+ `Pi.spectrum_eq`: `spectrum R a = ⋃ i, spectrum R (a i)` for `a : ∀ i, κ i`\n+ `Prod.spectrum_eq`: `spectrum R ⟨a, b⟩ = spectrum R a ∪ spectrum R b`\n+ `Pi.quasispectrum_eq`: `quasispectrum R a = ⋃ i, quasispectrum R (a i)` for `a : ∀ i, κ i`\n+ `Prod.quasispectrum_eq`: `quasispectrum R ⟨a, b⟩ = quasispectrum R a ∪ quasispectrum R b`\n\n## TODO\n\n+ Apply these results to block matrices.\n\n-/\n\n@[expose] public section\n\nvariable {ι A B R : Type*} {κ : ι → Type*}\n\nsection quasiregular\n\nvariable (κ) in\n/-- The equivalence between pre-quasiregular elements of an indexed product and the indexed product\nof pre-quasiregular elements. -/\ndef PreQuasiregular.toPi [∀ i, NonUnitalSemiring (κ i)] :\n PreQuasiregular (∀ i, κ i) ≃* ∀ i, PreQuasiregular (κ i) where\n toFun := fun x i => .mk <| x.val i\n invFun := fun x => .mk <| fun i => (x i).val\n map_mul' _ _ := rfl\n\nvariable (A B) in\n/-- The equivalence between pre-quasiregular elements of a product and the product of\npre-quasiregular elements. -/\ndef PreQuasiregular.toProd [NonUnitalSemiring A] [NonUnitalSemiring B] :\n PreQuasiregular (A × B) ≃* PreQuasiregular A × PreQuasiregular B where\n toFun := fun p => ⟨.mk p.val.1, .mk p.val.2⟩\n invFun := fun ⟨a, b⟩ => .mk ⟨a.val, b.val⟩\n map_mul' _ _ := rfl","module_header":true,"namespace":"","prompt":"Return exactly one Lean proof body beginning with `by`. Do not emit prose, fences, declarations, sorry, admit, by?, or warnings.\n\nImports:\npublic import Mathlib.Algebra.Algebra.Spectrum.Quasispectrum\npublic import Mathlib.Algebra.Algebra.Pi\npublic import Mathlib.Algebra.Algebra.Prod\npublic import Mathlib.Algebra.Group.Pi.Units\n\nNamespace:\n(root)\n\nLocal context:\n/-\nCopyright (c) 2025 Frédéric Dupuis. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Frédéric Dupuis\n-/\n/-!\n# Spectrum and quasispectrum of products\n\nThis file contains results regarding the spectra and quasispectra of (indexed) products of\nelements of a (non-unital) ring. The main result is that the (quasi)spectrum of a product is the\nunion of the (quasi)spectra.\n\n## Main declarations\n\n+ `Pi.spectrum_eq`: `spectrum R a = ⋃ i, spectrum R (a i)` for `a : ∀ i, κ i`\n+ `Prod.spectrum_eq`: `spectrum R ⟨a, b⟩ = spectrum R a ∪ spectrum R b`\n+ `Pi.quasispectrum_eq`: `quasispectrum R a = ⋃ i, quasispectrum R (a i)` for `a : ∀ i, κ i`\n+ `Prod.quasispectrum_eq`: `quasispectrum R ⟨a, b⟩ = quasispectrum R a ∪ quasispectrum R b`\n\n## TODO\n\n+ Apply these results to block matrices.\n\n-/\n\n@[expose] public section\n\nvariable {ι A B R : Type*} {κ : ι → Type*}\n\nsection quasiregular\n\nvariable (κ) in\n/-- The equivalence between pre-quasiregular elements of an indexed product and the indexed product\nof pre-quasiregular elements. -/\ndef PreQuasiregular.toPi [∀ i, NonUnitalSemiring (κ i)] :\n PreQuasiregular (∀ i, κ i) ≃* ∀ i, PreQuasiregular (κ i) where\n toFun := fun x i => .mk <| x.val i\n invFun := fun x => .mk <| fun i => (x i).val\n map_mul' _ _ := rfl\n\nvariable (A B) in\n/-- The equivalence between pre-quasiregular elements of a product and the product of\npre-quasiregular elements. -/\ndef PreQuasiregular.toProd [NonUnitalSemiring A] [NonUnitalSemiring B] :\n PreQuasiregular (A × B) ≃* PreQuasiregular A × PreQuasiregular B where\n toFun := fun p => ⟨.mk p.val.1, .mk p.val.2⟩\n invFun := fun ⟨a, b⟩ => .mk ⟨a.val, b.val⟩\n map_mul' _ _ := rfl\n\nTarget:\nlemma isQuasiregular_pi_iff [∀ i, NonUnitalSemiring (κ i)] (x : ∀ i, κ i) :\n IsQuasiregular x ↔ ∀ i, IsQuasiregular (x i) :=\n\nProof body:\n","proof_body":"by\n simp only [isQuasiregular_iff', ← isUnit_map_iff (PreQuasiregular.toPi κ), Pi.isUnit_iff]\n congr!","provenance":{"declaration_index":0,"environment_hash":"08dda26699fe1025520aeb9450ff1df6b58e8ef0aa8100ae158997e8a703b831","lean_toolchain":"leanprover/lean4:v4.32.0-rc1","license":"Apache-2.0","original_import_scope":"module-specific","source_revision":"360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56","source_sha256":"0d65cd408ba3ccaf81729c961d8511b6d67a96ec0a7074d049183ed008f4c88f","source_uri":"https://github.com/leanprover-community/mathlib4/blob/360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56/Mathlib/Algebra/Algebra/Spectrum/Pi.lean"},"sample_id":"4024a4dcd540f6620a8b7e2ac2034ecad1d4afdd6c9e862f185cba25d72fc1bc","schema_version":1,"split":"validation","theorem_statement":"lemma isQuasiregular_pi_iff [∀ i, NonUnitalSemiring (κ i)] (x : ∀ i, κ i) :\n IsQuasiregular x ↔ ∀ i, IsQuasiregular (x i) :="}
{"completion":"by\n simp only [isQuasiregular_iff', ← isUnit_map_iff (PreQuasiregular.toProd A B), Prod.isUnit_iff]\n congr!","context_contains_namespace":false,"context_suffix":"end quasiregular","dependency_ids":["import:Mathlib.Algebra.Algebra.Spectrum.Quasispectrum","import:Mathlib.Algebra.Algebra.Pi","import:Mathlib.Algebra.Algebra.Prod","import:Mathlib.Algebra.Group.Pi.Units"],"family_id":"isquasiregular_prod_iff","file_id":"mathlib/Mathlib/Algebra/Algebra/Spectrum/Pi.lean","imports":["public import Mathlib.Algebra.Algebra.Spectrum.Quasispectrum","public import Mathlib.Algebra.Algebra.Pi","public import Mathlib.Algebra.Algebra.Prod","public import Mathlib.Algebra.Group.Pi.Units"],"local_context":"/-\nCopyright (c) 2025 Frédéric Dupuis. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Frédéric Dupuis\n-/\n/-!\n# Spectrum and quasispectrum of products\n\nThis file contains results regarding the spectra and quasispectra of (indexed) products of\nelements of a (non-unital) ring. The main result is that the (quasi)spectrum of a product is the\nunion of the (quasi)spectra.\n\n## Main declarations\n\n+ `Pi.spectrum_eq`: `spectrum R a = ⋃ i, spectrum R (a i)` for `a : ∀ i, κ i`\n+ `Prod.spectrum_eq`: `spectrum R ⟨a, b⟩ = spectrum R a ∪ spectrum R b`\n+ `Pi.quasispectrum_eq`: `quasispectrum R a = ⋃ i, quasispectrum R (a i)` for `a : ∀ i, κ i`\n+ `Prod.quasispectrum_eq`: `quasispectrum R ⟨a, b⟩ = quasispectrum R a ∪ quasispectrum R b`\n\n## TODO\n\n+ Apply these results to block matrices.\n\n-/\n\n@[expose] public section\n\nvariable {ι A B R : Type*} {κ : ι → Type*}\n\nsection quasiregular\n\nvariable (κ) in\n/-- The equivalence between pre-quasiregular elements of an indexed product and the indexed product\nof pre-quasiregular elements. -/\ndef PreQuasiregular.toPi [∀ i, NonUnitalSemiring (κ i)] :\n PreQuasiregular (∀ i, κ i) ≃* ∀ i, PreQuasiregular (κ i) where\n toFun := fun x i => .mk <| x.val i\n invFun := fun x => .mk <| fun i => (x i).val\n map_mul' _ _ := rfl\n\nvariable (A B) in\n/-- The equivalence between pre-quasiregular elements of a product and the product of\npre-quasiregular elements. -/\ndef PreQuasiregular.toProd [NonUnitalSemiring A] [NonUnitalSemiring B] :\n PreQuasiregular (A × B) ≃* PreQuasiregular A × PreQuasiregular B where\n toFun := fun p => ⟨.mk p.val.1, .mk p.val.2⟩\n invFun := fun ⟨a, b⟩ => .mk ⟨a.val, b.val⟩\n map_mul' _ _ := rfl\n\nlemma isQuasiregular_pi_iff [∀ i, NonUnitalSemiring (κ i)] (x : ∀ i, κ i) :\n IsQuasiregular x ↔ ∀ i, IsQuasiregular (x i) := by\n simp only [isQuasiregular_iff', ← isUnit_map_iff (PreQuasiregular.toPi κ), Pi.isUnit_iff]\n congr!","module_header":true,"namespace":"","prompt":"Return exactly one Lean proof body beginning with `by`. Do not emit prose, fences, declarations, sorry, admit, by?, or warnings.\n\nImports:\npublic import Mathlib.Algebra.Algebra.Spectrum.Quasispectrum\npublic import Mathlib.Algebra.Algebra.Pi\npublic import Mathlib.Algebra.Algebra.Prod\npublic import Mathlib.Algebra.Group.Pi.Units\n\nNamespace:\n(root)\n\nLocal context:\n/-\nCopyright (c) 2025 Frédéric Dupuis. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Frédéric Dupuis\n-/\n/-!\n# Spectrum and quasispectrum of products\n\nThis file contains results regarding the spectra and quasispectra of (indexed) products of\nelements of a (non-unital) ring. The main result is that the (quasi)spectrum of a product is the\nunion of the (quasi)spectra.\n\n## Main declarations\n\n+ `Pi.spectrum_eq`: `spectrum R a = ⋃ i, spectrum R (a i)` for `a : ∀ i, κ i`\n+ `Prod.spectrum_eq`: `spectrum R ⟨a, b⟩ = spectrum R a ∪ spectrum R b`\n+ `Pi.quasispectrum_eq`: `quasispectrum R a = ⋃ i, quasispectrum R (a i)` for `a : ∀ i, κ i`\n+ `Prod.quasispectrum_eq`: `quasispectrum R ⟨a, b⟩ = quasispectrum R a ∪ quasispectrum R b`\n\n## TODO\n\n+ Apply these results to block matrices.\n\n-/\n\n@[expose] public section\n\nvariable {ι A B R : Type*} {κ : ι → Type*}\n\nsection quasiregular\n\nvariable (κ) in\n/-- The equivalence between pre-quasiregular elements of an indexed product and the indexed product\nof pre-quasiregular elements. -/\ndef PreQuasiregular.toPi [∀ i, NonUnitalSemiring (κ i)] :\n PreQuasiregular (∀ i, κ i) ≃* ∀ i, PreQuasiregular (κ i) where\n toFun := fun x i => .mk <| x.val i\n invFun := fun x => .mk <| fun i => (x i).val\n map_mul' _ _ := rfl\n\nvariable (A B) in\n/-- The equivalence between pre-quasiregular elements of a product and the product of\npre-quasiregular elements. -/\ndef PreQuasiregular.toProd [NonUnitalSemiring A] [NonUnitalSemiring B] :\n PreQuasiregular (A × B) ≃* PreQuasiregular A × PreQuasiregular B where\n toFun := fun p => ⟨.mk p.val.1, .mk p.val.2⟩\n invFun := fun ⟨a, b⟩ => .mk ⟨a.val, b.val⟩\n map_mul' _ _ := rfl\n\nlemma isQuasiregular_pi_iff [∀ i, NonUnitalSemiring (κ i)] (x : ∀ i, κ i) :\n IsQuasiregular x ↔ ∀ i, IsQuasiregular (x i) := by\n simp only [isQuasiregular_iff', ← isUnit_map_iff (PreQuasiregular.toPi κ), Pi.isUnit_iff]\n congr!\n\nTarget:\nlemma isQuasiregular_prod_iff [NonUnitalSemiring A] [NonUnitalSemiring B] (a : A) (b : B) :\n IsQuasiregular (⟨a, b⟩ : A × B) ↔ IsQuasiregular a ∧ IsQuasiregular b :=\n\nProof body:\n","proof_body":"by\n simp only [isQuasiregular_iff', ← isUnit_map_iff (PreQuasiregular.toProd A B), Prod.isUnit_iff]\n congr!","provenance":{"declaration_index":1,"environment_hash":"08dda26699fe1025520aeb9450ff1df6b58e8ef0aa8100ae158997e8a703b831","lean_toolchain":"leanprover/lean4:v4.32.0-rc1","license":"Apache-2.0","original_import_scope":"module-specific","source_revision":"360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56","source_sha256":"0d65cd408ba3ccaf81729c961d8511b6d67a96ec0a7074d049183ed008f4c88f","source_uri":"https://github.com/leanprover-community/mathlib4/blob/360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56/Mathlib/Algebra/Algebra/Spectrum/Pi.lean"},"sample_id":"61d7949ded691c61064e5f5f7f7aef53bfd78684169bf75dc611ea98f02c35e4","schema_version":1,"split":"validation","theorem_statement":"lemma isQuasiregular_prod_iff [NonUnitalSemiring A] [NonUnitalSemiring B] (a : A) (b : B) :\n IsQuasiregular (⟨a, b⟩ : A × B) ↔ IsQuasiregular a ∧ IsQuasiregular b :="}
{"completion":"by\n apply compl_injective\n simp_rw [spectrum, Set.compl_iUnion, compl_compl, resolventSet, Set.iInter_setOf,\n Pi.isUnit_iff, sub_apply, algebraMap_apply]","context_contains_namespace":false,"context_suffix":"end spectrum","dependency_ids":["import:Mathlib.Algebra.Algebra.Spectrum.Quasispectrum","import:Mathlib.Algebra.Algebra.Pi","import:Mathlib.Algebra.Algebra.Prod","import:Mathlib.Algebra.Group.Pi.Units"],"family_id":"pi","file_id":"mathlib/Mathlib/Algebra/Algebra/Spectrum/Pi.lean","imports":["public import Mathlib.Algebra.Algebra.Spectrum.Quasispectrum","public import Mathlib.Algebra.Algebra.Pi","public import Mathlib.Algebra.Algebra.Prod","public import Mathlib.Algebra.Group.Pi.Units"],"local_context":"/-\nCopyright (c) 2025 Frédéric Dupuis. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Frédéric Dupuis\n-/\n/-!\n# Spectrum and quasispectrum of products\n\nThis file contains results regarding the spectra and quasispectra of (indexed) products of\nelements of a (non-unital) ring. The main result is that the (quasi)spectrum of a product is the\nunion of the (quasi)spectra.\n\n## Main declarations\n\n+ `Pi.spectrum_eq`: `spectrum R a = ⋃ i, spectrum R (a i)` for `a : ∀ i, κ i`\n+ `Prod.spectrum_eq`: `spectrum R ⟨a, b⟩ = spectrum R a ∪ spectrum R b`\n+ `Pi.quasispectrum_eq`: `quasispectrum R a = ⋃ i, quasispectrum R (a i)` for `a : ∀ i, κ i`\n+ `Prod.quasispectrum_eq`: `quasispectrum R ⟨a, b⟩ = quasispectrum R a ∪ quasispectrum R b`\n\n## TODO\n\n+ Apply these results to block matrices.\n\n-/\n\n@[expose] public section\n\nvariable {ι A B R : Type*} {κ : ι → Type*}\n\nsection quasiregular\n\nvariable (κ) in\n/-- The equivalence between pre-quasiregular elements of an indexed product and the indexed product\nof pre-quasiregular elements. -/\ndef PreQuasiregular.toPi [∀ i, NonUnitalSemiring (κ i)] :\n PreQuasiregular (∀ i, κ i) ≃* ∀ i, PreQuasiregular (κ i) where\n toFun := fun x i => .mk <| x.val i\n invFun := fun x => .mk <| fun i => (x i).val\n map_mul' _ _ := rfl\n\nvariable (A B) in\n/-- The equivalence between pre-quasiregular elements of a product and the product of\npre-quasiregular elements. -/\ndef PreQuasiregular.toProd [NonUnitalSemiring A] [NonUnitalSemiring B] :\n PreQuasiregular (A × B) ≃* PreQuasiregular A × PreQuasiregular B where\n toFun := fun p => ⟨.mk p.val.1, .mk p.val.2⟩\n invFun := fun ⟨a, b⟩ => .mk ⟨a.val, b.val⟩\n map_mul' _ _ := rfl\n\nlemma isQuasiregular_pi_iff [∀ i, NonUnitalSemiring (κ i)] (x : ∀ i, κ i) :\n IsQuasiregular x ↔ ∀ i, IsQuasiregular (x i) := by\n simp only [isQuasiregular_iff', ← isUnit_map_iff (PreQuasiregular.toPi κ), Pi.isUnit_iff]\n congr!\n\nlemma isQuasiregular_prod_iff [NonUnitalSemiring A] [NonUnitalSemiring B] (a : A) (b : B) :\n IsQuasiregular (⟨a, b⟩ : A × B) ↔ IsQuasiregular a ∧ IsQuasiregular b := by\n simp only [isQuasiregular_iff', ← isUnit_map_iff (PreQuasiregular.toProd A B), Prod.isUnit_iff]\n congr!\n\nlemma quasispectrum.mem_iff_of_isUnit [CommSemiring R] [NonUnitalRing A]\n [Module R A] {a : A} {r : R} (hr : IsUnit r) :\n r ∈ quasispectrum R a ↔ ¬ IsQuasiregular (-(hr.unit⁻¹ • a)) :=\n ⟨fun h => h hr, fun h _ => h⟩\n\nend quasiregular\n\nsection spectrum","module_header":true,"namespace":"","prompt":"Return exactly one Lean proof body beginning with `by`. Do not emit prose, fences, declarations, sorry, admit, by?, or warnings.\n\nImports:\npublic import Mathlib.Algebra.Algebra.Spectrum.Quasispectrum\npublic import Mathlib.Algebra.Algebra.Pi\npublic import Mathlib.Algebra.Algebra.Prod\npublic import Mathlib.Algebra.Group.Pi.Units\n\nNamespace:\n(root)\n\nLocal context:\n/-\nCopyright (c) 2025 Frédéric Dupuis. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Frédéric Dupuis\n-/\n/-!\n# Spectrum and quasispectrum of products\n\nThis file contains results regarding the spectra and quasispectra of (indexed) products of\nelements of a (non-unital) ring. The main result is that the (quasi)spectrum of a product is the\nunion of the (quasi)spectra.\n\n## Main declarations\n\n+ `Pi.spectrum_eq`: `spectrum R a = ⋃ i, spectrum R (a i)` for `a : ∀ i, κ i`\n+ `Prod.spectrum_eq`: `spectrum R ⟨a, b⟩ = spectrum R a ∪ spectrum R b`\n+ `Pi.quasispectrum_eq`: `quasispectrum R a = ⋃ i, quasispectrum R (a i)` for `a : ∀ i, κ i`\n+ `Prod.quasispectrum_eq`: `quasispectrum R ⟨a, b⟩ = quasispectrum R a ∪ quasispectrum R b`\n\n## TODO\n\n+ Apply these results to block matrices.\n\n-/\n\n@[expose] public section\n\nvariable {ι A B R : Type*} {κ : ι → Type*}\n\nsection quasiregular\n\nvariable (κ) in\n/-- The equivalence between pre-quasiregular elements of an indexed product and the indexed product\nof pre-quasiregular elements. -/\ndef PreQuasiregular.toPi [∀ i, NonUnitalSemiring (κ i)] :\n PreQuasiregular (∀ i, κ i) ≃* ∀ i, PreQuasiregular (κ i) where\n toFun := fun x i => .mk <| x.val i\n invFun := fun x => .mk <| fun i => (x i).val\n map_mul' _ _ := rfl\n\nvariable (A B) in\n/-- The equivalence between pre-quasiregular elements of a product and the product of\npre-quasiregular elements. -/\ndef PreQuasiregular.toProd [NonUnitalSemiring A] [NonUnitalSemiring B] :\n PreQuasiregular (A × B) ≃* PreQuasiregular A × PreQuasiregular B where\n toFun := fun p => ⟨.mk p.val.1, .mk p.val.2⟩\n invFun := fun ⟨a, b⟩ => .mk ⟨a.val, b.val⟩\n map_mul' _ _ := rfl\n\nlemma isQuasiregular_pi_iff [∀ i, NonUnitalSemiring (κ i)] (x : ∀ i, κ i) :\n IsQuasiregular x ↔ ∀ i, IsQuasiregular (x i) := by\n simp only [isQuasiregular_iff', ← isUnit_map_iff (PreQuasiregular.toPi κ), Pi.isUnit_iff]\n congr!\n\nlemma isQuasiregular_prod_iff [NonUnitalSemiring A] [NonUnitalSemiring B] (a : A) (b : B) :\n IsQuasiregular (⟨a, b⟩ : A × B) ↔ IsQuasiregular a ∧ IsQuasiregular b := by\n simp only [isQuasiregular_iff', ← isUnit_map_iff (PreQuasiregular.toProd A B), Prod.isUnit_iff]\n congr!\n\nlemma quasispectrum.mem_iff_of_isUnit [CommSemiring R] [NonUnitalRing A]\n [Module R A] {a : A} {r : R} (hr : IsUnit r) :\n r ∈ quasispectrum R a ↔ ¬ IsQuasiregular (-(hr.unit⁻¹ • a)) :=\n ⟨fun h => h hr, fun h _ => h⟩\n\nend quasiregular\n\nsection spectrum\n\nTarget:\nlemma Pi.spectrum_eq [CommSemiring R] [∀ i, Ring (κ i)] [∀ i, Algebra R (κ i)]\n (a : ∀ i, κ i) : spectrum R a = ⋃ i, spectrum R (a i) :=\n\nProof body:\n","proof_body":"by\n apply compl_injective\n simp_rw [spectrum, Set.compl_iUnion, compl_compl, resolventSet, Set.iInter_setOf,\n Pi.isUnit_iff, sub_apply, algebraMap_apply]","provenance":{"declaration_index":3,"environment_hash":"08dda26699fe1025520aeb9450ff1df6b58e8ef0aa8100ae158997e8a703b831","lean_toolchain":"leanprover/lean4:v4.32.0-rc1","license":"Apache-2.0","original_import_scope":"module-specific","source_revision":"360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56","source_sha256":"0d65cd408ba3ccaf81729c961d8511b6d67a96ec0a7074d049183ed008f4c88f","source_uri":"https://github.com/leanprover-community/mathlib4/blob/360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56/Mathlib/Algebra/Algebra/Spectrum/Pi.lean"},"sample_id":"bfee226e057d62c552cf41ddbea5b350d21ef5193441f05a0e7ff513e6424579","schema_version":1,"split":"validation","theorem_statement":"lemma Pi.spectrum_eq [CommSemiring R] [∀ i, Ring (κ i)] [∀ i, Algebra R (κ i)]\n (a : ∀ i, κ i) : spectrum R a = ⋃ i, spectrum R (a i) :="}
{"completion":"by\n apply compl_injective\n simp_rw [spectrum, Set.compl_union, compl_compl, resolventSet, ← Set.setOf_and,\n Prod.isUnit_iff, algebraMap_apply, mk_sub_mk]","context_contains_namespace":false,"context_suffix":"end spectrum","dependency_ids":["import:Mathlib.Algebra.Algebra.Spectrum.Quasispectrum","import:Mathlib.Algebra.Algebra.Pi","import:Mathlib.Algebra.Algebra.Prod","import:Mathlib.Algebra.Group.Pi.Units"],"family_id":"prod","file_id":"mathlib/Mathlib/Algebra/Algebra/Spectrum/Pi.lean","imports":["public import Mathlib.Algebra.Algebra.Spectrum.Quasispectrum","public import Mathlib.Algebra.Algebra.Pi","public import Mathlib.Algebra.Algebra.Prod","public import Mathlib.Algebra.Group.Pi.Units"],"local_context":"/-\nCopyright (c) 2025 Frédéric Dupuis. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Frédéric Dupuis\n-/\n/-!\n# Spectrum and quasispectrum of products\n\nThis file contains results regarding the spectra and quasispectra of (indexed) products of\nelements of a (non-unital) ring. The main result is that the (quasi)spectrum of a product is the\nunion of the (quasi)spectra.\n\n## Main declarations\n\n+ `Pi.spectrum_eq`: `spectrum R a = ⋃ i, spectrum R (a i)` for `a : ∀ i, κ i`\n+ `Prod.spectrum_eq`: `spectrum R ⟨a, b⟩ = spectrum R a ∪ spectrum R b`\n+ `Pi.quasispectrum_eq`: `quasispectrum R a = ⋃ i, quasispectrum R (a i)` for `a : ∀ i, κ i`\n+ `Prod.quasispectrum_eq`: `quasispectrum R ⟨a, b⟩ = quasispectrum R a ∪ quasispectrum R b`\n\n## TODO\n\n+ Apply these results to block matrices.\n\n-/\n\n@[expose] public section\n\nvariable {ι A B R : Type*} {κ : ι → Type*}\n\nsection quasiregular\n\nvariable (κ) in\n/-- The equivalence between pre-quasiregular elements of an indexed product and the indexed product\nof pre-quasiregular elements. -/\ndef PreQuasiregular.toPi [∀ i, NonUnitalSemiring (κ i)] :\n PreQuasiregular (∀ i, κ i) ≃* ∀ i, PreQuasiregular (κ i) where\n toFun := fun x i => .mk <| x.val i\n invFun := fun x => .mk <| fun i => (x i).val\n map_mul' _ _ := rfl\n\nvariable (A B) in\n/-- The equivalence between pre-quasiregular elements of a product and the product of\npre-quasiregular elements. -/\ndef PreQuasiregular.toProd [NonUnitalSemiring A] [NonUnitalSemiring B] :\n PreQuasiregular (A × B) ≃* PreQuasiregular A × PreQuasiregular B where\n toFun := fun p => ⟨.mk p.val.1, .mk p.val.2⟩\n invFun := fun ⟨a, b⟩ => .mk ⟨a.val, b.val⟩\n map_mul' _ _ := rfl\n\nlemma isQuasiregular_pi_iff [∀ i, NonUnitalSemiring (κ i)] (x : ∀ i, κ i) :\n IsQuasiregular x ↔ ∀ i, IsQuasiregular (x i) := by\n simp only [isQuasiregular_iff', ← isUnit_map_iff (PreQuasiregular.toPi κ), Pi.isUnit_iff]\n congr!\n\nlemma isQuasiregular_prod_iff [NonUnitalSemiring A] [NonUnitalSemiring B] (a : A) (b : B) :\n IsQuasiregular (⟨a, b⟩ : A × B) ↔ IsQuasiregular a ∧ IsQuasiregular b := by\n simp only [isQuasiregular_iff', ← isUnit_map_iff (PreQuasiregular.toProd A B), Prod.isUnit_iff]\n congr!\n\nlemma quasispectrum.mem_iff_of_isUnit [CommSemiring R] [NonUnitalRing A]\n [Module R A] {a : A} {r : R} (hr : IsUnit r) :\n r ∈ quasispectrum R a ↔ ¬ IsQuasiregular (-(hr.unit⁻¹ • a)) :=\n ⟨fun h => h hr, fun h _ => h⟩\n\nend quasiregular\n\nsection spectrum\n\nlemma Pi.spectrum_eq [CommSemiring R] [∀ i, Ring (κ i)] [∀ i, Algebra R (κ i)]\n (a : ∀ i, κ i) : spectrum R a = ⋃ i, spectrum R (a i) := by\n apply compl_injective\n simp_rw [spectrum, Set.compl_iUnion, compl_compl, resolventSet, Set.iInter_setOf,\n Pi.isUnit_iff, sub_apply, algebraMap_apply]","module_header":true,"namespace":"","prompt":"Return exactly one Lean proof body beginning with `by`. Do not emit prose, fences, declarations, sorry, admit, by?, or warnings.\n\nImports:\npublic import Mathlib.Algebra.Algebra.Spectrum.Quasispectrum\npublic import Mathlib.Algebra.Algebra.Pi\npublic import Mathlib.Algebra.Algebra.Prod\npublic import Mathlib.Algebra.Group.Pi.Units\n\nNamespace:\n(root)\n\nLocal context:\n/-\nCopyright (c) 2025 Frédéric Dupuis. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Frédéric Dupuis\n-/\n/-!\n# Spectrum and quasispectrum of products\n\nThis file contains results regarding the spectra and quasispectra of (indexed) products of\nelements of a (non-unital) ring. The main result is that the (quasi)spectrum of a product is the\nunion of the (quasi)spectra.\n\n## Main declarations\n\n+ `Pi.spectrum_eq`: `spectrum R a = ⋃ i, spectrum R (a i)` for `a : ∀ i, κ i`\n+ `Prod.spectrum_eq`: `spectrum R ⟨a, b⟩ = spectrum R a ∪ spectrum R b`\n+ `Pi.quasispectrum_eq`: `quasispectrum R a = ⋃ i, quasispectrum R (a i)` for `a : ∀ i, κ i`\n+ `Prod.quasispectrum_eq`: `quasispectrum R ⟨a, b⟩ = quasispectrum R a ∪ quasispectrum R b`\n\n## TODO\n\n+ Apply these results to block matrices.\n\n-/\n\n@[expose] public section\n\nvariable {ι A B R : Type*} {κ : ι → Type*}\n\nsection quasiregular\n\nvariable (κ) in\n/-- The equivalence between pre-quasiregular elements of an indexed product and the indexed product\nof pre-quasiregular elements. -/\ndef PreQuasiregular.toPi [∀ i, NonUnitalSemiring (κ i)] :\n PreQuasiregular (∀ i, κ i) ≃* ∀ i, PreQuasiregular (κ i) where\n toFun := fun x i => .mk <| x.val i\n invFun := fun x => .mk <| fun i => (x i).val\n map_mul' _ _ := rfl\n\nvariable (A B) in\n/-- The equivalence between pre-quasiregular elements of a product and the product of\npre-quasiregular elements. -/\ndef PreQuasiregular.toProd [NonUnitalSemiring A] [NonUnitalSemiring B] :\n PreQuasiregular (A × B) ≃* PreQuasiregular A × PreQuasiregular B where\n toFun := fun p => ⟨.mk p.val.1, .mk p.val.2⟩\n invFun := fun ⟨a, b⟩ => .mk ⟨a.val, b.val⟩\n map_mul' _ _ := rfl\n\nlemma isQuasiregular_pi_iff [∀ i, NonUnitalSemiring (κ i)] (x : ∀ i, κ i) :\n IsQuasiregular x ↔ ∀ i, IsQuasiregular (x i) := by\n simp only [isQuasiregular_iff', ← isUnit_map_iff (PreQuasiregular.toPi κ), Pi.isUnit_iff]\n congr!\n\nlemma isQuasiregular_prod_iff [NonUnitalSemiring A] [NonUnitalSemiring B] (a : A) (b : B) :\n IsQuasiregular (⟨a, b⟩ : A × B) ↔ IsQuasiregular a ∧ IsQuasiregular b := by\n simp only [isQuasiregular_iff', ← isUnit_map_iff (PreQuasiregular.toProd A B), Prod.isUnit_iff]\n congr!\n\nlemma quasispectrum.mem_iff_of_isUnit [CommSemiring R] [NonUnitalRing A]\n [Module R A] {a : A} {r : R} (hr : IsUnit r) :\n r ∈ quasispectrum R a ↔ ¬ IsQuasiregular (-(hr.unit⁻¹ • a)) :=\n ⟨fun h => h hr, fun h _ => h⟩\n\nend quasiregular\n\nsection spectrum\n\nlemma Pi.spectrum_eq [CommSemiring R] [∀ i, Ring (κ i)] [∀ i, Algebra R (κ i)]\n (a : ∀ i, κ i) : spectrum R a = ⋃ i, spectrum R (a i) := by\n apply compl_injective\n simp_rw [spectrum, Set.compl_iUnion, compl_compl, resolventSet, Set.iInter_setOf,\n Pi.isUnit_iff, sub_apply, algebraMap_apply]\n\nTarget:\nlemma Prod.spectrum_eq [CommSemiring R] [Ring A] [Ring B] [Algebra R A] [Algebra R B]\n (a : A) (b : B) : spectrum R (⟨a, b⟩ : A × B) = spectrum R a ∪ spectrum R b :=\n\nProof body:\n","proof_body":"by\n apply compl_injective\n simp_rw [spectrum, Set.compl_union, compl_compl, resolventSet, ← Set.setOf_and,\n Prod.isUnit_iff, algebraMap_apply, mk_sub_mk]","provenance":{"declaration_index":4,"environment_hash":"08dda26699fe1025520aeb9450ff1df6b58e8ef0aa8100ae158997e8a703b831","lean_toolchain":"leanprover/lean4:v4.32.0-rc1","license":"Apache-2.0","original_import_scope":"module-specific","source_revision":"360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56","source_sha256":"0d65cd408ba3ccaf81729c961d8511b6d67a96ec0a7074d049183ed008f4c88f","source_uri":"https://github.com/leanprover-community/mathlib4/blob/360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56/Mathlib/Algebra/Algebra/Spectrum/Pi.lean"},"sample_id":"4437f79f0831fed1db68e57eb2c705b73f9c07100caaf60fb856e078d7bd6ebf","schema_version":1,"split":"validation","theorem_statement":"lemma Prod.spectrum_eq [CommSemiring R] [Ring A] [Ring B] [Algebra R A] [Algebra R B]\n (a : A) (b : B) : spectrum R (⟨a, b⟩ : A × B) = spectrum R a ∪ spectrum R b :="}
{"completion":"by\n ext r\n simp only [quasispectrum, Set.mem_setOf_eq, Set.mem_iUnion]\n by_cases hr : IsUnit r\n · lift r to Rˣ using hr with r' hr'\n simp [isQuasiregular_pi_iff]\n · simp [hr]","context_contains_namespace":false,"context_suffix":"end spectrum","dependency_ids":["import:Mathlib.Algebra.Algebra.Spectrum.Quasispectrum","import:Mathlib.Algebra.Algebra.Pi","import:Mathlib.Algebra.Algebra.Prod","import:Mathlib.Algebra.Group.Pi.Units"],"family_id":"pi","file_id":"mathlib/Mathlib/Algebra/Algebra/Spectrum/Pi.lean","imports":["public import Mathlib.Algebra.Algebra.Spectrum.Quasispectrum","public import Mathlib.Algebra.Algebra.Pi","public import Mathlib.Algebra.Algebra.Prod","public import Mathlib.Algebra.Group.Pi.Units"],"local_context":"/-\nCopyright (c) 2025 Frédéric Dupuis. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Frédéric Dupuis\n-/\n/-!\n# Spectrum and quasispectrum of products\n\nThis file contains results regarding the spectra and quasispectra of (indexed) products of\nelements of a (non-unital) ring. The main result is that the (quasi)spectrum of a product is the\nunion of the (quasi)spectra.\n\n## Main declarations\n\n+ `Pi.spectrum_eq`: `spectrum R a = ⋃ i, spectrum R (a i)` for `a : ∀ i, κ i`\n+ `Prod.spectrum_eq`: `spectrum R ⟨a, b⟩ = spectrum R a ∪ spectrum R b`\n+ `Pi.quasispectrum_eq`: `quasispectrum R a = ⋃ i, quasispectrum R (a i)` for `a : ∀ i, κ i`\n+ `Prod.quasispectrum_eq`: `quasispectrum R ⟨a, b⟩ = quasispectrum R a ∪ quasispectrum R b`\n\n## TODO\n\n+ Apply these results to block matrices.\n\n-/\n\n@[expose] public section\n\nvariable {ι A B R : Type*} {κ : ι → Type*}\n\nsection quasiregular\n\nvariable (κ) in\n/-- The equivalence between pre-quasiregular elements of an indexed product and the indexed product\nof pre-quasiregular elements. -/\ndef PreQuasiregular.toPi [∀ i, NonUnitalSemiring (κ i)] :\n PreQuasiregular (∀ i, κ i) ≃* ∀ i, PreQuasiregular (κ i) where\n toFun := fun x i => .mk <| x.val i\n invFun := fun x => .mk <| fun i => (x i).val\n map_mul' _ _ := rfl\n\nvariable (A B) in\n/-- The equivalence between pre-quasiregular elements of a product and the product of\npre-quasiregular elements. -/\ndef PreQuasiregular.toProd [NonUnitalSemiring A] [NonUnitalSemiring B] :\n PreQuasiregular (A × B) ≃* PreQuasiregular A × PreQuasiregular B where\n toFun := fun p => ⟨.mk p.val.1, .mk p.val.2⟩\n invFun := fun ⟨a, b⟩ => .mk ⟨a.val, b.val⟩\n map_mul' _ _ := rfl\n\nlemma isQuasiregular_pi_iff [∀ i, NonUnitalSemiring (κ i)] (x : ∀ i, κ i) :\n IsQuasiregular x ↔ ∀ i, IsQuasiregular (x i) := by\n simp only [isQuasiregular_iff', ← isUnit_map_iff (PreQuasiregular.toPi κ), Pi.isUnit_iff]\n congr!\n\nlemma isQuasiregular_prod_iff [NonUnitalSemiring A] [NonUnitalSemiring B] (a : A) (b : B) :\n IsQuasiregular (⟨a, b⟩ : A × B) ↔ IsQuasiregular a ∧ IsQuasiregular b := by\n simp only [isQuasiregular_iff', ← isUnit_map_iff (PreQuasiregular.toProd A B), Prod.isUnit_iff]\n congr!\n\nlemma quasispectrum.mem_iff_of_isUnit [CommSemiring R] [NonUnitalRing A]\n [Module R A] {a : A} {r : R} (hr : IsUnit r) :\n r ∈ quasispectrum R a ↔ ¬ IsQuasiregular (-(hr.unit⁻¹ • a)) :=\n ⟨fun h => h hr, fun h _ => h⟩\n\nend quasiregular\n\nsection spectrum\n\nlemma Pi.spectrum_eq [CommSemiring R] [∀ i, Ring (κ i)] [∀ i, Algebra R (κ i)]\n (a : ∀ i, κ i) : spectrum R a = ⋃ i, spectrum R (a i) := by\n apply compl_injective\n simp_rw [spectrum, Set.compl_iUnion, compl_compl, resolventSet, Set.iInter_setOf,\n Pi.isUnit_iff, sub_apply, algebraMap_apply]\n\nlemma Prod.spectrum_eq [CommSemiring R] [Ring A] [Ring B] [Algebra R A] [Algebra R B]\n (a : A) (b : B) : spectrum R (⟨a, b⟩ : A × B) = spectrum R a ∪ spectrum R b := by\n apply compl_injective\n simp_rw [spectrum, Set.compl_union, compl_compl, resolventSet, ← Set.setOf_and,\n Prod.isUnit_iff, algebraMap_apply, mk_sub_mk]","module_header":true,"namespace":"","prompt":"Return exactly one Lean proof body beginning with `by`. Do not emit prose, fences, declarations, sorry, admit, by?, or warnings.\n\nImports:\npublic import Mathlib.Algebra.Algebra.Spectrum.Quasispectrum\npublic import Mathlib.Algebra.Algebra.Pi\npublic import Mathlib.Algebra.Algebra.Prod\npublic import Mathlib.Algebra.Group.Pi.Units\n\nNamespace:\n(root)\n\nLocal context:\n/-\nCopyright (c) 2025 Frédéric Dupuis. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Frédéric Dupuis\n-/\n/-!\n# Spectrum and quasispectrum of products\n\nThis file contains results regarding the spectra and quasispectra of (indexed) products of\nelements of a (non-unital) ring. The main result is that the (quasi)spectrum of a product is the\nunion of the (quasi)spectra.\n\n## Main declarations\n\n+ `Pi.spectrum_eq`: `spectrum R a = ⋃ i, spectrum R (a i)` for `a : ∀ i, κ i`\n+ `Prod.spectrum_eq`: `spectrum R ⟨a, b⟩ = spectrum R a ∪ spectrum R b`\n+ `Pi.quasispectrum_eq`: `quasispectrum R a = ⋃ i, quasispectrum R (a i)` for `a : ∀ i, κ i`\n+ `Prod.quasispectrum_eq`: `quasispectrum R ⟨a, b⟩ = quasispectrum R a ∪ quasispectrum R b`\n\n## TODO\n\n+ Apply these results to block matrices.\n\n-/\n\n@[expose] public section\n\nvariable {ι A B R : Type*} {κ : ι → Type*}\n\nsection quasiregular\n\nvariable (κ) in\n/-- The equivalence between pre-quasiregular elements of an indexed product and the indexed product\nof pre-quasiregular elements. -/\ndef PreQuasiregular.toPi [∀ i, NonUnitalSemiring (κ i)] :\n PreQuasiregular (∀ i, κ i) ≃* ∀ i, PreQuasiregular (κ i) where\n toFun := fun x i => .mk <| x.val i\n invFun := fun x => .mk <| fun i => (x i).val\n map_mul' _ _ := rfl\n\nvariable (A B) in\n/-- The equivalence between pre-quasiregular elements of a product and the product of\npre-quasiregular elements. -/\ndef PreQuasiregular.toProd [NonUnitalSemiring A] [NonUnitalSemiring B] :\n PreQuasiregular (A × B) ≃* PreQuasiregular A × PreQuasiregular B where\n toFun := fun p => ⟨.mk p.val.1, .mk p.val.2⟩\n invFun := fun ⟨a, b⟩ => .mk ⟨a.val, b.val⟩\n map_mul' _ _ := rfl\n\nlemma isQuasiregular_pi_iff [∀ i, NonUnitalSemiring (κ i)] (x : ∀ i, κ i) :\n IsQuasiregular x ↔ ∀ i, IsQuasiregular (x i) := by\n simp only [isQuasiregular_iff', ← isUnit_map_iff (PreQuasiregular.toPi κ), Pi.isUnit_iff]\n congr!\n\nlemma isQuasiregular_prod_iff [NonUnitalSemiring A] [NonUnitalSemiring B] (a : A) (b : B) :\n IsQuasiregular (⟨a, b⟩ : A × B) ↔ IsQuasiregular a ∧ IsQuasiregular b := by\n simp only [isQuasiregular_iff', ← isUnit_map_iff (PreQuasiregular.toProd A B), Prod.isUnit_iff]\n congr!\n\nlemma quasispectrum.mem_iff_of_isUnit [CommSemiring R] [NonUnitalRing A]\n [Module R A] {a : A} {r : R} (hr : IsUnit r) :\n r ∈ quasispectrum R a ↔ ¬ IsQuasiregular (-(hr.unit⁻¹ • a)) :=\n ⟨fun h => h hr, fun h _ => h⟩\n\nend quasiregular\n\nsection spectrum\n\nlemma Pi.spectrum_eq [CommSemiring R] [∀ i, Ring (κ i)] [∀ i, Algebra R (κ i)]\n (a : ∀ i, κ i) : spectrum R a = ⋃ i, spectrum R (a i) := by\n apply compl_injective\n simp_rw [spectrum, Set.compl_iUnion, compl_compl, resolventSet, Set.iInter_setOf,\n Pi.isUnit_iff, sub_apply, algebraMap_apply]\n\nlemma Prod.spectrum_eq [CommSemiring R] [Ring A] [Ring B] [Algebra R A] [Algebra R B]\n (a : A) (b : B) : spectrum R (⟨a, b⟩ : A × B) = spectrum R a ∪ spectrum R b := by\n apply compl_injective\n simp_rw [spectrum, Set.compl_union, compl_compl, resolventSet, ← Set.setOf_and,\n Prod.isUnit_iff, algebraMap_apply, mk_sub_mk]\n\nTarget:\nlemma Pi.quasispectrum_eq [Nonempty ι] [CommSemiring R] [∀ i, NonUnitalRing (κ i)]\n [∀ i, Module R (κ i)] (a : ∀ i, κ i) :\n quasispectrum R a = ⋃ i, quasispectrum R (a i) :=\n\nProof body:\n","proof_body":"by\n ext r\n simp only [quasispectrum, Set.mem_setOf_eq, Set.mem_iUnion]\n by_cases hr : IsUnit r\n · lift r to Rˣ using hr with r' hr'\n simp [isQuasiregular_pi_iff]\n · simp [hr]","provenance":{"declaration_index":5,"environment_hash":"08dda26699fe1025520aeb9450ff1df6b58e8ef0aa8100ae158997e8a703b831","lean_toolchain":"leanprover/lean4:v4.32.0-rc1","license":"Apache-2.0","original_import_scope":"module-specific","source_revision":"360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56","source_sha256":"0d65cd408ba3ccaf81729c961d8511b6d67a96ec0a7074d049183ed008f4c88f","source_uri":"https://github.com/leanprover-community/mathlib4/blob/360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56/Mathlib/Algebra/Algebra/Spectrum/Pi.lean"},"sample_id":"919deb7237f6b3557e2cec7139da36e4fd10b803914962db235f3290255c1da9","schema_version":1,"split":"validation","theorem_statement":"lemma Pi.quasispectrum_eq [Nonempty ι] [CommSemiring R] [∀ i, NonUnitalRing (κ i)]\n [∀ i, Module R (κ i)] (a : ∀ i, κ i) :\n quasispectrum R a = ⋃ i, quasispectrum R (a i) :="}
{"completion":"by\n apply compl_injective\n ext r\n simp only [quasispectrum, Set.mem_compl_iff, Set.mem_setOf_eq, not_forall, not_not, Set.mem_union]\n by_cases hr : IsUnit r\n · lift r to Rˣ using hr with r' hr'\n simp [isQuasiregular_prod_iff]\n · simp [hr]","context_contains_namespace":false,"context_suffix":"end spectrum","dependency_ids":["import:Mathlib.Algebra.Algebra.Spectrum.Quasispectrum","import:Mathlib.Algebra.Algebra.Pi","import:Mathlib.Algebra.Algebra.Prod","import:Mathlib.Algebra.Group.Pi.Units"],"family_id":"prod","file_id":"mathlib/Mathlib/Algebra/Algebra/Spectrum/Pi.lean","imports":["public import Mathlib.Algebra.Algebra.Spectrum.Quasispectrum","public import Mathlib.Algebra.Algebra.Pi","public import Mathlib.Algebra.Algebra.Prod","public import Mathlib.Algebra.Group.Pi.Units"],"local_context":"/-\nCopyright (c) 2025 Frédéric Dupuis. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Frédéric Dupuis\n-/\n/-!\n# Spectrum and quasispectrum of products\n\nThis file contains results regarding the spectra and quasispectra of (indexed) products of\nelements of a (non-unital) ring. The main result is that the (quasi)spectrum of a product is the\nunion of the (quasi)spectra.\n\n## Main declarations\n\n+ `Pi.spectrum_eq`: `spectrum R a = ⋃ i, spectrum R (a i)` for `a : ∀ i, κ i`\n+ `Prod.spectrum_eq`: `spectrum R ⟨a, b⟩ = spectrum R a ∪ spectrum R b`\n+ `Pi.quasispectrum_eq`: `quasispectrum R a = ⋃ i, quasispectrum R (a i)` for `a : ∀ i, κ i`\n+ `Prod.quasispectrum_eq`: `quasispectrum R ⟨a, b⟩ = quasispectrum R a ∪ quasispectrum R b`\n\n## TODO\n\n+ Apply these results to block matrices.\n\n-/\n\n@[expose] public section\n\nvariable {ι A B R : Type*} {κ : ι → Type*}\n\nsection quasiregular\n\nvariable (κ) in\n/-- The equivalence between pre-quasiregular elements of an indexed product and the indexed product\nof pre-quasiregular elements. -/\ndef PreQuasiregular.toPi [∀ i, NonUnitalSemiring (κ i)] :\n PreQuasiregular (∀ i, κ i) ≃* ∀ i, PreQuasiregular (κ i) where\n toFun := fun x i => .mk <| x.val i\n invFun := fun x => .mk <| fun i => (x i).val\n map_mul' _ _ := rfl\n\nvariable (A B) in\n/-- The equivalence between pre-quasiregular elements of a product and the product of\npre-quasiregular elements. -/\ndef PreQuasiregular.toProd [NonUnitalSemiring A] [NonUnitalSemiring B] :\n PreQuasiregular (A × B) ≃* PreQuasiregular A × PreQuasiregular B where\n toFun := fun p => ⟨.mk p.val.1, .mk p.val.2⟩\n invFun := fun ⟨a, b⟩ => .mk ⟨a.val, b.val⟩\n map_mul' _ _ := rfl\n\nlemma isQuasiregular_pi_iff [∀ i, NonUnitalSemiring (κ i)] (x : ∀ i, κ i) :\n IsQuasiregular x ↔ ∀ i, IsQuasiregular (x i) := by\n simp only [isQuasiregular_iff', ← isUnit_map_iff (PreQuasiregular.toPi κ), Pi.isUnit_iff]\n congr!\n\nlemma isQuasiregular_prod_iff [NonUnitalSemiring A] [NonUnitalSemiring B] (a : A) (b : B) :\n IsQuasiregular (⟨a, b⟩ : A × B) ↔ IsQuasiregular a ∧ IsQuasiregular b := by\n simp only [isQuasiregular_iff', ← isUnit_map_iff (PreQuasiregular.toProd A B), Prod.isUnit_iff]\n congr!\n\nlemma quasispectrum.mem_iff_of_isUnit [CommSemiring R] [NonUnitalRing A]\n [Module R A] {a : A} {r : R} (hr : IsUnit r) :\n r ∈ quasispectrum R a ↔ ¬ IsQuasiregular (-(hr.unit⁻¹ • a)) :=\n ⟨fun h => h hr, fun h _ => h⟩\n\nend quasiregular\n\nsection spectrum\n\nlemma Pi.spectrum_eq [CommSemiring R] [∀ i, Ring (κ i)] [∀ i, Algebra R (κ i)]\n (a : ∀ i, κ i) : spectrum R a = ⋃ i, spectrum R (a i) := by\n apply compl_injective\n simp_rw [spectrum, Set.compl_iUnion, compl_compl, resolventSet, Set.iInter_setOf,\n Pi.isUnit_iff, sub_apply, algebraMap_apply]\n\nlemma Prod.spectrum_eq [CommSemiring R] [Ring A] [Ring B] [Algebra R A] [Algebra R B]\n (a : A) (b : B) : spectrum R (⟨a, b⟩ : A × B) = spectrum R a ∪ spectrum R b := by\n apply compl_injective\n simp_rw [spectrum, Set.compl_union, compl_compl, resolventSet, ← Set.setOf_and,\n Prod.isUnit_iff, algebraMap_apply, mk_sub_mk]\n\nlemma Pi.quasispectrum_eq [Nonempty ι] [CommSemiring R] [∀ i, NonUnitalRing (κ i)]\n [∀ i, Module R (κ i)] (a : ∀ i, κ i) :\n quasispectrum R a = ⋃ i, quasispectrum R (a i) := by\n ext r\n simp only [quasispectrum, Set.mem_setOf_eq, Set.mem_iUnion]\n by_cases hr : IsUnit r\n · lift r to Rˣ using hr with r' hr'\n simp [isQuasiregular_pi_iff]\n · simp [hr]","module_header":true,"namespace":"","prompt":"Return exactly one Lean proof body beginning with `by`. Do not emit prose, fences, declarations, sorry, admit, by?, or warnings.\n\nImports:\npublic import Mathlib.Algebra.Algebra.Spectrum.Quasispectrum\npublic import Mathlib.Algebra.Algebra.Pi\npublic import Mathlib.Algebra.Algebra.Prod\npublic import Mathlib.Algebra.Group.Pi.Units\n\nNamespace:\n(root)\n\nLocal context:\n/-\nCopyright (c) 2025 Frédéric Dupuis. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Frédéric Dupuis\n-/\n/-!\n# Spectrum and quasispectrum of products\n\nThis file contains results regarding the spectra and quasispectra of (indexed) products of\nelements of a (non-unital) ring. The main result is that the (quasi)spectrum of a product is the\nunion of the (quasi)spectra.\n\n## Main declarations\n\n+ `Pi.spectrum_eq`: `spectrum R a = ⋃ i, spectrum R (a i)` for `a : ∀ i, κ i`\n+ `Prod.spectrum_eq`: `spectrum R ⟨a, b⟩ = spectrum R a ∪ spectrum R b`\n+ `Pi.quasispectrum_eq`: `quasispectrum R a = ⋃ i, quasispectrum R (a i)` for `a : ∀ i, κ i`\n+ `Prod.quasispectrum_eq`: `quasispectrum R ⟨a, b⟩ = quasispectrum R a ∪ quasispectrum R b`\n\n## TODO\n\n+ Apply these results to block matrices.\n\n-/\n\n@[expose] public section\n\nvariable {ι A B R : Type*} {κ : ι → Type*}\n\nsection quasiregular\n\nvariable (κ) in\n/-- The equivalence between pre-quasiregular elements of an indexed product and the indexed product\nof pre-quasiregular elements. -/\ndef PreQuasiregular.toPi [∀ i, NonUnitalSemiring (κ i)] :\n PreQuasiregular (∀ i, κ i) ≃* ∀ i, PreQuasiregular (κ i) where\n toFun := fun x i => .mk <| x.val i\n invFun := fun x => .mk <| fun i => (x i).val\n map_mul' _ _ := rfl\n\nvariable (A B) in\n/-- The equivalence between pre-quasiregular elements of a product and the product of\npre-quasiregular elements. -/\ndef PreQuasiregular.toProd [NonUnitalSemiring A] [NonUnitalSemiring B] :\n PreQuasiregular (A × B) ≃* PreQuasiregular A × PreQuasiregular B where\n toFun := fun p => ⟨.mk p.val.1, .mk p.val.2⟩\n invFun := fun ⟨a, b⟩ => .mk ⟨a.val, b.val⟩\n map_mul' _ _ := rfl\n\nlemma isQuasiregular_pi_iff [∀ i, NonUnitalSemiring (κ i)] (x : ∀ i, κ i) :\n IsQuasiregular x ↔ ∀ i, IsQuasiregular (x i) := by\n simp only [isQuasiregular_iff', ← isUnit_map_iff (PreQuasiregular.toPi κ), Pi.isUnit_iff]\n congr!\n\nlemma isQuasiregular_prod_iff [NonUnitalSemiring A] [NonUnitalSemiring B] (a : A) (b : B) :\n IsQuasiregular (⟨a, b⟩ : A × B) ↔ IsQuasiregular a ∧ IsQuasiregular b := by\n simp only [isQuasiregular_iff', ← isUnit_map_iff (PreQuasiregular.toProd A B), Prod.isUnit_iff]\n congr!\n\nlemma quasispectrum.mem_iff_of_isUnit [CommSemiring R] [NonUnitalRing A]\n [Module R A] {a : A} {r : R} (hr : IsUnit r) :\n r ∈ quasispectrum R a ↔ ¬ IsQuasiregular (-(hr.unit⁻¹ • a)) :=\n ⟨fun h => h hr, fun h _ => h⟩\n\nend quasiregular\n\nsection spectrum\n\nlemma Pi.spectrum_eq [CommSemiring R] [∀ i, Ring (κ i)] [∀ i, Algebra R (κ i)]\n (a : ∀ i, κ i) : spectrum R a = ⋃ i, spectrum R (a i) := by\n apply compl_injective\n simp_rw [spectrum, Set.compl_iUnion, compl_compl, resolventSet, Set.iInter_setOf,\n Pi.isUnit_iff, sub_apply, algebraMap_apply]\n\nlemma Prod.spectrum_eq [CommSemiring R] [Ring A] [Ring B] [Algebra R A] [Algebra R B]\n (a : A) (b : B) : spectrum R (⟨a, b⟩ : A × B) = spectrum R a ∪ spectrum R b := by\n apply compl_injective\n simp_rw [spectrum, Set.compl_union, compl_compl, resolventSet, ← Set.setOf_and,\n Prod.isUnit_iff, algebraMap_apply, mk_sub_mk]\n\nlemma Pi.quasispectrum_eq [Nonempty ι] [CommSemiring R] [∀ i, NonUnitalRing (κ i)]\n [∀ i, Module R (κ i)] (a : ∀ i, κ i) :\n quasispectrum R a = ⋃ i, quasispectrum R (a i) := by\n ext r\n simp only [quasispectrum, Set.mem_setOf_eq, Set.mem_iUnion]\n by_cases hr : IsUnit r\n · lift r to Rˣ using hr with r' hr'\n simp [isQuasiregular_pi_iff]\n · simp [hr]\n\nTarget:\nlemma Prod.quasispectrum_eq [CommSemiring R] [NonUnitalRing A] [NonUnitalRing B]\n [Module R A] [Module R B] (a : A) (b : B) :\n quasispectrum R (⟨a, b⟩ : A × B) = quasispectrum R a ∪ quasispectrum R b :=\n\nProof body:\n","proof_body":"by\n apply compl_injective\n ext r\n simp only [quasispectrum, Set.mem_compl_iff, Set.mem_setOf_eq, not_forall, not_not, Set.mem_union]\n by_cases hr : IsUnit r\n · lift r to Rˣ using hr with r' hr'\n simp [isQuasiregular_prod_iff]\n · simp [hr]","provenance":{"declaration_index":6,"environment_hash":"08dda26699fe1025520aeb9450ff1df6b58e8ef0aa8100ae158997e8a703b831","lean_toolchain":"leanprover/lean4:v4.32.0-rc1","license":"Apache-2.0","original_import_scope":"module-specific","source_revision":"360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56","source_sha256":"0d65cd408ba3ccaf81729c961d8511b6d67a96ec0a7074d049183ed008f4c88f","source_uri":"https://github.com/leanprover-community/mathlib4/blob/360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56/Mathlib/Algebra/Algebra/Spectrum/Pi.lean"},"sample_id":"400b378bc830b056c88b2825fa673b3207daaf0827ad62b8040c13bb2173ff40","schema_version":1,"split":"validation","theorem_statement":"lemma Prod.quasispectrum_eq [CommSemiring R] [NonUnitalRing A] [NonUnitalRing B]\n [Module R A] [Module R B] (a : A) (b : B) :\n quasispectrum R (⟨a, b⟩ : A × B) = quasispectrum R a ∪ quasispectrum R b :="}
{"completion":"by ext; rfl","context_contains_namespace":true,"context_suffix":"end AlgHom","dependency_ids":["import:Mathlib.Algebra.Algebra.Equiv","import:Mathlib.Algebra.Algebra.Hom","import:Mathlib.Algebra.Module.Prod"],"family_id":"fst_prod","file_id":"mathlib/Mathlib/Algebra/Algebra/Prod.lean","imports":["public import Mathlib.Algebra.Algebra.Equiv","public import Mathlib.Algebra.Algebra.Hom","public import Mathlib.Algebra.Module.Prod"],"local_context":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\n/-!\n# The R-algebra structure on products of R-algebras\n\nThe R-algebra structure on `(i : I) → A i` when each `A i` is an R-algebra.\n\n## Main definitions\n\n* `Prod.algebra`\n* `AlgHom.fst`\n* `AlgHom.snd`\n* `AlgHom.prod`\n* `AlgEquiv.prodUnique` and `AlgEquiv.uniqueProd`\n-/\n\n@[expose] public section\n\n\nvariable {R A B C : Type*}\nvariable [CommSemiring R]\nvariable [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] [Semiring C] [Algebra R C]\n\nnamespace Prod\n\nvariable (R A B)\n\nopen Algebra\n\ninstance algebra : Algebra R (A × B) where\n algebraMap := RingHom.prod (algebraMap R A) (algebraMap R B)\n commutes' := by\n rintro r ⟨a, b⟩\n dsimp\n rw [commutes r a, commutes r b]\n smul_def' := by\n rintro r ⟨a, b⟩\n dsimp\n rw [Algebra.smul_def r a, Algebra.smul_def r b]\n\nvariable {R A B}\n\n@[simp]\ntheorem algebraMap_apply (r : R) : algebraMap R (A × B) r = (algebraMap R A r, algebraMap R B r) :=\n rfl\n\nend Prod\n\nnamespace AlgHom\n\nvariable (R A B)\n\n/-- First projection as `AlgHom`. -/\ndef fst : A × B →ₐ[R] A :=\n { RingHom.fst A B with commutes' := fun _r => rfl }\n\n/-- Second projection as `AlgHom`. -/\ndef snd : A × B →ₐ[R] B :=\n { RingHom.snd A B with commutes' := fun _r => rfl }\n\nvariable {A B}\n\n@[simp]\ntheorem fst_apply (a) : fst R A B a = a.1 := rfl\n\n@[simp]\ntheorem snd_apply (a) : snd R A B a = a.2 := rfl\n\nvariable {R}\n\n/-- The `Function.prod` of two morphisms is a morphism. -/\n@[simps!]\ndef prod (f : A →ₐ[R] B) (g : A →ₐ[R] C) : A →ₐ[R] B × C :=\n { f.toRingHom.prod g.toRingHom with\n commutes' := fun r => by\n simp only [toRingHom_eq_coe, RingHom.toFun_eq_coe, RingHom.prod_apply, coe_toRingHom,\n commutes, Prod.algebraMap_apply] }\n\ntheorem coe_prod (f : A →ₐ[R] B) (g : A →ₐ[R] C) : ⇑(f.prod g) = Function.prod f g :=\n rfl\n\n@[simp]","module_header":true,"namespace":"AlgHom","prompt":"Return exactly one Lean proof body beginning with `by`. Do not emit prose, fences, declarations, sorry, admit, by?, or warnings.\n\nImports:\npublic import Mathlib.Algebra.Algebra.Equiv\npublic import Mathlib.Algebra.Algebra.Hom\npublic import Mathlib.Algebra.Module.Prod\n\nNamespace:\nAlgHom\n\nLocal context:\n/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\n/-!\n# The R-algebra structure on products of R-algebras\n\nThe R-algebra structure on `(i : I) → A i` when each `A i` is an R-algebra.\n\n## Main definitions\n\n* `Prod.algebra`\n* `AlgHom.fst`\n* `AlgHom.snd`\n* `AlgHom.prod`\n* `AlgEquiv.prodUnique` and `AlgEquiv.uniqueProd`\n-/\n\n@[expose] public section\n\n\nvariable {R A B C : Type*}\nvariable [CommSemiring R]\nvariable [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] [Semiring C] [Algebra R C]\n\nnamespace Prod\n\nvariable (R A B)\n\nopen Algebra\n\ninstance algebra : Algebra R (A × B) where\n algebraMap := RingHom.prod (algebraMap R A) (algebraMap R B)\n commutes' := by\n rintro r ⟨a, b⟩\n dsimp\n rw [commutes r a, commutes r b]\n smul_def' := by\n rintro r ⟨a, b⟩\n dsimp\n rw [Algebra.smul_def r a, Algebra.smul_def r b]\n\nvariable {R A B}\n\n@[simp]\ntheorem algebraMap_apply (r : R) : algebraMap R (A × B) r = (algebraMap R A r, algebraMap R B r) :=\n rfl\n\nend Prod\n\nnamespace AlgHom\n\nvariable (R A B)\n\n/-- First projection as `AlgHom`. -/\ndef fst : A × B →ₐ[R] A :=\n { RingHom.fst A B with commutes' := fun _r => rfl }\n\n/-- Second projection as `AlgHom`. -/\ndef snd : A × B →ₐ[R] B :=\n { RingHom.snd A B with commutes' := fun _r => rfl }\n\nvariable {A B}\n\n@[simp]\ntheorem fst_apply (a) : fst R A B a = a.1 := rfl\n\n@[simp]\ntheorem snd_apply (a) : snd R A B a = a.2 := rfl\n\nvariable {R}\n\n/-- The `Function.prod` of two morphisms is a morphism. -/\n@[simps!]\ndef prod (f : A →ₐ[R] B) (g : A →ₐ[R] C) : A →ₐ[R] B × C :=\n { f.toRingHom.prod g.toRingHom with\n commutes' := fun r => by\n simp only [toRingHom_eq_coe, RingHom.toFun_eq_coe, RingHom.prod_apply, coe_toRingHom,\n commutes, Prod.algebraMap_apply] }\n\ntheorem coe_prod (f : A →ₐ[R] B) (g : A →ₐ[R] C) : ⇑(f.prod g) = Function.prod f g :=\n rfl\n\n@[simp]\n\nTarget:\ntheorem fst_prod (f : A →ₐ[R] B) (g : A →ₐ[R] C) : (fst R B C).comp (prod f g) = f :=\n\nProof body:\n","proof_body":"by ext; rfl","provenance":{"declaration_index":4,"environment_hash":"08dda26699fe1025520aeb9450ff1df6b58e8ef0aa8100ae158997e8a703b831","lean_toolchain":"leanprover/lean4:v4.32.0-rc1","license":"Apache-2.0","original_import_scope":"module-specific","source_revision":"360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56","source_sha256":"b6134f22a0e156e48f481972775e2d71b8277abd8965b433c4b00b89d0f5061b","source_uri":"https://github.com/leanprover-community/mathlib4/blob/360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56/Mathlib/Algebra/Algebra/Prod.lean"},"sample_id":"920ed1863115de5c18fdbca61d160068dd409915ea6c39b91c25eaa01238c167","schema_version":1,"split":"validation","theorem_statement":"theorem fst_prod (f : A →ₐ[R] B) (g : A →ₐ[R] C) : (fst R B C).comp (prod f g) = f :="}
{"completion":"by ext; rfl","context_contains_namespace":true,"context_suffix":"end AlgHom","dependency_ids":["import:Mathlib.Algebra.Algebra.Equiv","import:Mathlib.Algebra.Algebra.Hom","import:Mathlib.Algebra.Module.Prod"],"family_id":"snd_prod","file_id":"mathlib/Mathlib/Algebra/Algebra/Prod.lean","imports":["public import Mathlib.Algebra.Algebra.Equiv","public import Mathlib.Algebra.Algebra.Hom","public import Mathlib.Algebra.Module.Prod"],"local_context":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\n/-!\n# The R-algebra structure on products of R-algebras\n\nThe R-algebra structure on `(i : I) → A i` when each `A i` is an R-algebra.\n\n## Main definitions\n\n* `Prod.algebra`\n* `AlgHom.fst`\n* `AlgHom.snd`\n* `AlgHom.prod`\n* `AlgEquiv.prodUnique` and `AlgEquiv.uniqueProd`\n-/\n\n@[expose] public section\n\n\nvariable {R A B C : Type*}\nvariable [CommSemiring R]\nvariable [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] [Semiring C] [Algebra R C]\n\nnamespace Prod\n\nvariable (R A B)\n\nopen Algebra\n\ninstance algebra : Algebra R (A × B) where\n algebraMap := RingHom.prod (algebraMap R A) (algebraMap R B)\n commutes' := by\n rintro r ⟨a, b⟩\n dsimp\n rw [commutes r a, commutes r b]\n smul_def' := by\n rintro r ⟨a, b⟩\n dsimp\n rw [Algebra.smul_def r a, Algebra.smul_def r b]\n\nvariable {R A B}\n\n@[simp]\ntheorem algebraMap_apply (r : R) : algebraMap R (A × B) r = (algebraMap R A r, algebraMap R B r) :=\n rfl\n\nend Prod\n\nnamespace AlgHom\n\nvariable (R A B)\n\n/-- First projection as `AlgHom`. -/\ndef fst : A × B →ₐ[R] A :=\n { RingHom.fst A B with commutes' := fun _r => rfl }\n\n/-- Second projection as `AlgHom`. -/\ndef snd : A × B →ₐ[R] B :=\n { RingHom.snd A B with commutes' := fun _r => rfl }\n\nvariable {A B}\n\n@[simp]\ntheorem fst_apply (a) : fst R A B a = a.1 := rfl\n\n@[simp]\ntheorem snd_apply (a) : snd R A B a = a.2 := rfl\n\nvariable {R}\n\n/-- The `Function.prod` of two morphisms is a morphism. -/\n@[simps!]\ndef prod (f : A →ₐ[R] B) (g : A →ₐ[R] C) : A →ₐ[R] B × C :=\n { f.toRingHom.prod g.toRingHom with\n commutes' := fun r => by\n simp only [toRingHom_eq_coe, RingHom.toFun_eq_coe, RingHom.prod_apply, coe_toRingHom,\n commutes, Prod.algebraMap_apply] }\n\ntheorem coe_prod (f : A →ₐ[R] B) (g : A →ₐ[R] C) : ⇑(f.prod g) = Function.prod f g :=\n rfl\n\n@[simp]\ntheorem fst_prod (f : A →ₐ[R] B) (g : A →ₐ[R] C) : (fst R B C).comp (prod f g) = f := by ext; rfl\n\n@[simp]","module_header":true,"namespace":"AlgHom","prompt":"Return exactly one Lean proof body beginning with `by`. Do not emit prose, fences, declarations, sorry, admit, by?, or warnings.\n\nImports:\npublic import Mathlib.Algebra.Algebra.Equiv\npublic import Mathlib.Algebra.Algebra.Hom\npublic import Mathlib.Algebra.Module.Prod\n\nNamespace:\nAlgHom\n\nLocal context:\n/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\n/-!\n# The R-algebra structure on products of R-algebras\n\nThe R-algebra structure on `(i : I) → A i` when each `A i` is an R-algebra.\n\n## Main definitions\n\n* `Prod.algebra`\n* `AlgHom.fst`\n* `AlgHom.snd`\n* `AlgHom.prod`\n* `AlgEquiv.prodUnique` and `AlgEquiv.uniqueProd`\n-/\n\n@[expose] public section\n\n\nvariable {R A B C : Type*}\nvariable [CommSemiring R]\nvariable [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] [Semiring C] [Algebra R C]\n\nnamespace Prod\n\nvariable (R A B)\n\nopen Algebra\n\ninstance algebra : Algebra R (A × B) where\n algebraMap := RingHom.prod (algebraMap R A) (algebraMap R B)\n commutes' := by\n rintro r ⟨a, b⟩\n dsimp\n rw [commutes r a, commutes r b]\n smul_def' := by\n rintro r ⟨a, b⟩\n dsimp\n rw [Algebra.smul_def r a, Algebra.smul_def r b]\n\nvariable {R A B}\n\n@[simp]\ntheorem algebraMap_apply (r : R) : algebraMap R (A × B) r = (algebraMap R A r, algebraMap R B r) :=\n rfl\n\nend Prod\n\nnamespace AlgHom\n\nvariable (R A B)\n\n/-- First projection as `AlgHom`. -/\ndef fst : A × B →ₐ[R] A :=\n { RingHom.fst A B with commutes' := fun _r => rfl }\n\n/-- Second projection as `AlgHom`. -/\ndef snd : A × B →ₐ[R] B :=\n { RingHom.snd A B with commutes' := fun _r => rfl }\n\nvariable {A B}\n\n@[simp]\ntheorem fst_apply (a) : fst R A B a = a.1 := rfl\n\n@[simp]\ntheorem snd_apply (a) : snd R A B a = a.2 := rfl\n\nvariable {R}\n\n/-- The `Function.prod` of two morphisms is a morphism. -/\n@[simps!]\ndef prod (f : A →ₐ[R] B) (g : A →ₐ[R] C) : A →ₐ[R] B × C :=\n { f.toRingHom.prod g.toRingHom with\n commutes' := fun r => by\n simp only [toRingHom_eq_coe, RingHom.toFun_eq_coe, RingHom.prod_apply, coe_toRingHom,\n commutes, Prod.algebraMap_apply] }\n\ntheorem coe_prod (f : A →ₐ[R] B) (g : A →ₐ[R] C) : ⇑(f.prod g) = Function.prod f g :=\n rfl\n\n@[simp]\ntheorem fst_prod (f : A →ₐ[R] B) (g : A →ₐ[R] C) : (fst R B C).comp (prod f g) = f := by ext; rfl\n\n@[simp]\n\nTarget:\ntheorem snd_prod (f : A →ₐ[R] B) (g : A →ₐ[R] C) : (snd R B C).comp (prod f g) = g :=\n\nProof body:\n","proof_body":"by ext; rfl","provenance":{"declaration_index":5,"environment_hash":"08dda26699fe1025520aeb9450ff1df6b58e8ef0aa8100ae158997e8a703b831","lean_toolchain":"leanprover/lean4:v4.32.0-rc1","license":"Apache-2.0","original_import_scope":"module-specific","source_revision":"360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56","source_sha256":"b6134f22a0e156e48f481972775e2d71b8277abd8965b433c4b00b89d0f5061b","source_uri":"https://github.com/leanprover-community/mathlib4/blob/360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56/Mathlib/Algebra/Algebra/Prod.lean"},"sample_id":"84dddb62d48013cc8ea28dcef48771d278e0205dd0db71debdf4070e9dcfe32a","schema_version":1,"split":"validation","theorem_statement":"theorem snd_prod (f : A →ₐ[R] B) (g : A →ₐ[R] C) : (snd R B C).comp (prod f g) = g :="}
{"completion":"by\n ext\n simp","context_contains_namespace":true,"context_suffix":"end symm\nend Semiring\nend AlgEquiv","dependency_ids":["import:Mathlib.Algebra.Algebra.Hom","import:Mathlib.Algebra.Ring.Action.Group"],"family_id":"comp_symm","file_id":"mathlib/Mathlib/Algebra/Algebra/Equiv.lean","imports":["public import Mathlib.Algebra.Algebra.Hom","public import Mathlib.Algebra.Ring.Action.Group"],"local_context":"/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\n/-!\n# Isomorphisms of `R`-algebras\n\nThis file defines bundled isomorphisms of `R`-algebras.\n\n## Main definitions\n\n* `AlgEquiv R A B`: the type of `R`-algebra isomorphisms between `A` and `B`.\n\n## Notation\n\n* `A ≃ₐ[R] B` : `R`-algebra equivalence from `A` to `B`.\n-/\n\n@[expose] public section\n\nuniverse u v w u₁ v₁ u₂ u₃\n\n/-- An equivalence of algebras (denoted as `A ≃ₐ[R] B`)\nis an equivalence of rings commuting with the actions of scalars. -/\nstructure AlgEquiv (R : Type u) (A : Type v) (B : Type w) [CommSemiring R] [Semiring A] [Semiring B]\n [Algebra R A] [Algebra R B] extends A ≃ B, A ≃* B, A ≃+ B, A ≃+* B where\n /-- An equivalence of algebras commutes with the action of scalars. -/\n protected commutes' : ∀ r : R, toFun (algebraMap R A r) = algebraMap R B r\n\nattribute [nolint docBlame] AlgEquiv.toRingEquiv\nattribute [nolint docBlame] AlgEquiv.toEquiv\nattribute [nolint docBlame] AlgEquiv.toAddEquiv\nattribute [nolint docBlame] AlgEquiv.toMulEquiv\n\n@[inherit_doc]\nnotation:50 A \" ≃ₐ[\" R \"] \" A' => AlgEquiv R A A'\n\n/-- `AlgEquivClass F R A B` states that `F` is a type of algebra structure preserving\n equivalences. You should extend this class when you extend `AlgEquiv`. -/\nclass AlgEquivClass (F : Type*) (R A B : outParam Type*) [CommSemiring R] [Semiring A]\n [Semiring B] [Algebra R A] [Algebra R B] [EquivLike F A B] : Prop\n extends RingEquivClass F A B where\n /-- An equivalence of algebras commutes with the action of scalars. -/\n commutes : ∀ (f : F) (r : R), f (algebraMap R A r) = algebraMap R B r\n\nnamespace AlgEquivClass\n\n-- See note [lower instance priority]\ninstance (priority := 100) toAlgHomClass (F R A B : Type*) [CommSemiring R] [Semiring A]\n [Semiring B] [Algebra R A] [Algebra R B] [EquivLike F A B] [h : AlgEquivClass F R A B] :\n AlgHomClass F R A B :=\n { h with }\n\ninstance (priority := 100) toLinearEquivClass (F R A B : Type*) [CommSemiring R]\n [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]\n [EquivLike F A B] [h : AlgEquivClass F R A B] : LinearEquivClass F R A B :=\n { h with map_smulₛₗ := fun f => map_smulₛₗ f }\n\n/-- Turn an element of a type `F` satisfying `AlgEquivClass F R A B` into an actual `AlgEquiv`.\nThis is declared as the default coercion from `F` to `A ≃ₐ[R] B`. -/\n@[coe]\ndef toAlgEquiv {F R A B : Type*} [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A]\n [Algebra R B] [EquivLike F A B] [AlgEquivClass F R A B] (f : F) : A ≃ₐ[R] B :=\n { (f : A ≃ B), (RingEquivClass.toRingEquiv f : A ≃+* B) with commutes' := commutes f }\n\nend AlgEquivClass\n\nnamespace AlgEquiv\n\nuniverse uR uA₁ uA₂ uA₃ uA₁' uA₂' uA₃'\nvariable {R : Type uR}\nvariable {A₁ : Type uA₁} {A₂ : Type uA₂} {A₃ : Type uA₃}\nvariable {A₁' : Type uA₁'} {A₂' : Type uA₂'} {A₃' : Type uA₃'}\n\nsection Semiring\n\nvariable [CommSemiring R] [Semiring A₁] [Semiring A₂] [Semiring A₃]\nvariable [Semiring A₁'] [Semiring A₂'] [Semiring A₃']\nvariable [Algebra R A₁] [Algebra R A₂] [Algebra R A₃]\nvariable [Algebra R A₁'] [Algebra R A₂'] [Algebra R A₃']\nvariable (e : A₁ ≃ₐ[R] A₂)\n\nsection coe\n\ninstance : EquivLike (A₁ ≃ₐ[R] A₂) A₁ A₂ where\n coe f := f.toFun\n inv f := f.invFun\n left_inv f := f.left_inv\n right_inv f := f.right_inv\n coe_injective' f g h₁ h₂ := by\n obtain ⟨⟨f, _⟩, _⟩ := f\n obtain ⟨⟨g, _⟩, _⟩ := g\n congr\n\n/-- Helper instance since the coercion is not always found. -/\ninstance : FunLike (A₁ ≃ₐ[R] A₂) A₁ A₂ where\n coe := DFunLike.coe\n coe_injective := DFunLike.coe_injective\n\ninstance : AlgEquivClass (A₁ ≃ₐ[R] A₂) R A₁ A₂ where\n map_add f := f.map_add'\n map_mul f := f.map_mul'\n commutes f := f.commutes'\n\n@[ext]\ntheorem ext {f g : A₁ ≃ₐ[R] A₂} (h : ∀ a, f a = g a) : f = g :=\n DFunLike.ext f g h\n\nprotected theorem congr_arg {f : A₁ ≃ₐ[R] A₂} {x x' : A₁} : x = x' → f x = f x' :=\n DFunLike.congr_arg f\n\nprotected theorem congr_fun {f g : A₁ ≃ₐ[R] A₂} (h : f = g) (x : A₁) : f x = g x :=\n DFunLike.congr_fun h x\n\n@[simp]\ntheorem coe_mk {toEquiv map_mul map_add commutes} :\n ⇑(⟨toEquiv, map_mul, map_add, commutes⟩ : A₁ ≃ₐ[R] A₂) = toEquiv :=\n rfl\n\n@[simp]\ntheorem mk_coe (e : A₁ ≃ₐ[R] A₂) (e' h₁ h₂ h₃ h₄ h₅) :\n (⟨⟨e, e', h₁, h₂⟩, h₃, h₄, h₅⟩ : A₁ ≃ₐ[R] A₂) = e :=\n ext fun _ => rfl\n\n@[simp]\ntheorem toEquiv_eq_coe : e.toEquiv = e :=\n rfl\n\n@[simp]\nprotected theorem coe_coe {F : Type*} [EquivLike F A₁ A₂] [AlgEquivClass F R A₁ A₂] (f : F) :\n ⇑(AlgEquivClass.toAlgEquiv f) = f :=\n rfl\n\ntheorem coe_fun_injective : @Function.Injective (A₁ ≃ₐ[R] A₂) (A₁ → A₂) fun e => (e : A₁ → A₂) :=\n DFunLike.coe_injective\n\n/-- Forgetting the multiplicative structures, an equivalence of algebras is a linear equivalence. -/\n@[coe, simps! apply] def toLinearEquiv (e : A₁ ≃ₐ[R] A₂) : A₁ ≃ₗ[R] A₂ where\n toAddEquiv := e.toAddEquiv\n map_smul' := map_smulₛₗ e\n\ninstance : CoeOut (A₁ ≃ₐ[R] A₂) (A₁ ≃ₗ[R] A₂) where coe := toLinearEquiv\ninstance : CoeOut (A₁ ≃ₐ[R] A₂) (A₁ ≃+* A₂) where coe := toRingEquiv\n\n@[simp]\ntheorem coe_toEquiv : ((e : A₁ ≃ A₂) : A₁ → A₂) = e :=\n rfl\n\n@[deprecated \"Now a syntactic equality\" (since := \"2026-04-09\"), nolint synTaut]\ntheorem toRingEquiv_eq_coe : e.toRingEquiv = e :=\n rfl\n\n@[simp]\nlemma toRingEquiv_toRingHom : ((e : A₁ ≃+* A₂) : A₁ →+* A₂) = e :=\n rfl\n\n@[simp]\ntheorem coe_ringEquiv : ((e : A₁ ≃+* A₂) : A₁ → A₂) = e :=\n rfl\n\ntheorem coe_ringEquiv' : (e.toRingEquiv : A₁ → A₂) = e :=\n rfl\n\ntheorem coe_ringEquiv_injective : Function.Injective ((↑) : (A₁ ≃ₐ[R] A₂) → A₁ ≃+* A₂) :=\n fun _ _ h => ext <| RingEquiv.congr_fun h\n\n/-- Interpret an algebra equivalence as an algebra homomorphism.\n\nThis definition is included for symmetry with the other `to*Hom` projections.\nThe `simp` normal form is to use the coercion of the `AlgHomClass.coeTC` instance. -/\n@[coe]\ndef toAlgHom : A₁ →ₐ[R] A₂ :=\n { e with\n map_one' := map_one e\n map_zero' := map_zero e }\n\ninstance : CoeOut (A₁ ≃ₐ[R] A₂) (A₁ →ₐ[R] A₂) where coe := AlgEquiv.toAlgHom\n\n@[deprecated \"Now a syntactic equality\" (since := \"2026-04-29\"), nolint synTaut]\ntheorem toAlgHom_eq_coe : e.toAlgHom = e :=\n rfl\n\ntheorem toAlgHom_apply (x : A₁) : e.toAlgHom x = e x :=\n rfl\n\n@[simp, norm_cast]\ntheorem coe_algHom : DFunLike.coe e.toAlgHom = DFunLike.coe e :=\n rfl\n\ntheorem coe_algHom_injective : Function.Injective ((↑) : (A₁ ≃ₐ[R] A₂) → A₁ →ₐ[R] A₂) :=\n fun _ _ h => ext <| AlgHom.congr_fun h\n\n@[simp, norm_cast]\nlemma toAlgHom_toRingHom : ((e : A₁ →ₐ[R] A₂) : A₁ →+* A₂) = e :=\n rfl\n\n/-- The two paths coercion can take to a `RingHom` are equivalent -/\ntheorem coe_ringHom_commutes : ((e : A₁ →ₐ[R] A₂) : A₁ →+* A₂) = ((e : A₁ ≃+* A₂) : A₁ →+* A₂) :=\n rfl\n\n@[simp]\ntheorem commutes : ∀ r : R, e (algebraMap R A₁ r) = algebraMap R A₂ r :=\n e.commutes'\n\nend coe\n\nsection bijective\n\nprotected theorem bijective : Function.Bijective e :=\n EquivLike.bijective e\n\nprotected theorem injective : Function.Injective e :=\n EquivLike.injective e\n\nprotected theorem surjective : Function.Surjective e :=\n EquivLike.surjective e\n\nend bijective\n\nsection refl\n\n/-- Algebra equivalences are reflexive. -/\n@[refl]\ndef refl : A₁ ≃ₐ[R] A₁ :=\n { (.refl _ : A₁ ≃+* A₁) with commutes' := fun _ => rfl }\n\ninstance : Inhabited (A₁ ≃ₐ[R] A₁) :=\n ⟨refl⟩\n\n@[simp, norm_cast] lemma refl_toAlgHom : (refl : A₁ ≃ₐ[R] A₁) = AlgHom.id R A₁ := rfl\n@[simp, norm_cast] lemma refl_toRingHom : (refl : A₁ ≃ₐ[R] A₁) = RingHom.id A₁ := rfl\n\n@[simp]\ntheorem coe_refl : ⇑(refl : A₁ ≃ₐ[R] A₁) = id :=\n rfl\n\nend refl\n\nsection symm\n\n/-- Algebra equivalences are symmetric. -/\n@[symm]\ndef symm (e : A₁ ≃ₐ[R] A₂) : A₂ ≃ₐ[R] A₁ :=\n { e.toRingEquiv.symm with\n commutes' := fun r => by\n rw [← e.toRingEquiv.symm_apply_apply (algebraMap R A₁ r)]\n congr\n simp }\n\ntheorem invFun_eq_symm {e : A₁ ≃ₐ[R] A₂} : e.invFun = e.symm :=\n rfl\n\n@[simp]\ntheorem coe_apply_coe_coe_symm_apply {F : Type*} [EquivLike F A₁ A₂] [AlgEquivClass F R A₁ A₂]\n (f : F) (x : A₂) :\n f ((AlgEquivClass.toAlgEquiv f).symm x) = x :=\n EquivLike.right_inv f x\n\n@[simp]\ntheorem coe_coe_symm_apply_coe_apply {F : Type*} [EquivLike F A₁ A₂] [AlgEquivClass F R A₁ A₂]\n (f : F) (x : A₁) :\n (AlgEquivClass.toAlgEquiv f).symm (f x) = x :=\n EquivLike.left_inv f x\n\n/-- `simp` normal form of `invFun_eq_symm` -/\n@[simp]\ntheorem symm_toEquiv_eq_symm {e : A₁ ≃ₐ[R] A₂} : (e : A₁ ≃ A₂).symm = e.symm :=\n rfl\n\n@[simp]\ntheorem symm_symm (e : A₁ ≃ₐ[R] A₂) : e.symm.symm = e := rfl\n\ntheorem symm_bijective : Function.Bijective (symm : (A₁ ≃ₐ[R] A₂) → A₂ ≃ₐ[R] A₁) :=\n Function.bijective_iff_has_inverse.mpr ⟨_, symm_symm, symm_symm⟩\n\n@[simp]\ntheorem mk_coe' (e : A₁ ≃ₐ[R] A₂) (f h₁ h₂ h₃ h₄ h₅) :\n (⟨⟨f, e, h₁, h₂⟩, h₃, h₄, h₅⟩ : A₂ ≃ₐ[R] A₁) = e.symm :=\n symm_bijective.injective <| ext fun _ => rfl\n\n@[simp]\ntheorem symm_mk (e : A₁ ≃ A₂) (h₁ h₂ h₃) : dsimp%\n (mk e h₁ h₂ h₃ : A₁ ≃ₐ[R] A₂).symm =\n { (mk e h₁ h₂ h₃ : A₁ ≃ₐ[R] A₂).symm with\n toEquiv := e.symm } :=\n rfl\n\n@[simp]\ntheorem refl_symm : (AlgEquiv.refl : A₁ ≃ₐ[R] A₁).symm = AlgEquiv.refl :=\n rfl\n\ntheorem toRingEquiv_symm : (e : A₁ ≃+* A₂).symm = e.symm :=\n rfl\n\n@[simp]\ntheorem symm_toRingEquiv : (e.symm : A₂ ≃+* A₁) = (e : A₁ ≃+* A₂).symm :=\n rfl\n\n@[simp]\ntheorem symm_toAddEquiv : (e.symm : A₂ ≃+ A₁) = (e : A₁ ≃+ A₂).symm :=\n rfl\n\n@[simp]\ntheorem symm_toMulEquiv : (e.symm : A₂ ≃* A₁) = (e : A₁ ≃* A₂).symm :=\n rfl\n\n@[simp]\ntheorem apply_symm_apply (e : A₁ ≃ₐ[R] A₂) : ∀ x, e (e.symm x) = x :=\n e.toEquiv.apply_symm_apply\n\n@[simp]\ntheorem symm_apply_apply (e : A₁ ≃ₐ[R] A₂) : ∀ x, e.symm (e x) = x :=\n e.toEquiv.symm_apply_apply\n\ntheorem symm_apply_eq (e : A₁ ≃ₐ[R] A₂) {x y} : e.symm x = y ↔ x = e y :=\n e.toEquiv.symm_apply_eq\n\ntheorem eq_symm_apply (e : A₁ ≃ₐ[R] A₂) {x y} : y = e.symm x ↔ e y = x :=\n e.toEquiv.eq_symm_apply\n\n@[simp]","module_header":true,"namespace":"AlgEquiv","prompt":"Return exactly one Lean proof body beginning with `by`. Do not emit prose, fences, declarations, sorry, admit, by?, or warnings.\n\nImports:\npublic import Mathlib.Algebra.Algebra.Hom\npublic import Mathlib.Algebra.Ring.Action.Group\n\nNamespace:\nAlgEquiv\n\nLocal context:\n/-\nCopyright (c) 2018 Kenny Lau. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Kenny Lau, Yury Kudryashov\n-/\n/-!\n# Isomorphisms of `R`-algebras\n\nThis file defines bundled isomorphisms of `R`-algebras.\n\n## Main definitions\n\n* `AlgEquiv R A B`: the type of `R`-algebra isomorphisms between `A` and `B`.\n\n## Notation\n\n* `A ≃ₐ[R] B` : `R`-algebra equivalence from `A` to `B`.\n-/\n\n@[expose] public section\n\nuniverse u v w u₁ v₁ u₂ u₃\n\n/-- An equivalence of algebras (denoted as `A ≃ₐ[R] B`)\nis an equivalence of rings commuting with the actions of scalars. -/\nstructure AlgEquiv (R : Type u) (A : Type v) (B : Type w) [CommSemiring R] [Semiring A] [Semiring B]\n [Algebra R A] [Algebra R B] extends A ≃ B, A ≃* B, A ≃+ B, A ≃+* B where\n /-- An equivalence of algebras commutes with the action of scalars. -/\n protected commutes' : ∀ r : R, toFun (algebraMap R A r) = algebraMap R B r\n\nattribute [nolint docBlame] AlgEquiv.toRingEquiv\nattribute [nolint docBlame] AlgEquiv.toEquiv\nattribute [nolint docBlame] AlgEquiv.toAddEquiv\nattribute [nolint docBlame] AlgEquiv.toMulEquiv\n\n@[inherit_doc]\nnotation:50 A \" ≃ₐ[\" R \"] \" A' => AlgEquiv R A A'\n\n/-- `AlgEquivClass F R A B` states that `F` is a type of algebra structure preserving\n equivalences. You should extend this class when you extend `AlgEquiv`. -/\nclass AlgEquivClass (F : Type*) (R A B : outParam Type*) [CommSemiring R] [Semiring A]\n [Semiring B] [Algebra R A] [Algebra R B] [EquivLike F A B] : Prop\n extends RingEquivClass F A B where\n /-- An equivalence of algebras commutes with the action of scalars. -/\n commutes : ∀ (f : F) (r : R), f (algebraMap R A r) = algebraMap R B r\n\nnamespace AlgEquivClass\n\n-- See note [lower instance priority]\ninstance (priority := 100) toAlgHomClass (F R A B : Type*) [CommSemiring R] [Semiring A]\n [Semiring B] [Algebra R A] [Algebra R B] [EquivLike F A B] [h : AlgEquivClass F R A B] :\n AlgHomClass F R A B :=\n { h with }\n\ninstance (priority := 100) toLinearEquivClass (F R A B : Type*) [CommSemiring R]\n [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]\n [EquivLike F A B] [h : AlgEquivClass F R A B] : LinearEquivClass F R A B :=\n { h with map_smulₛₗ := fun f => map_smulₛₗ f }\n\n/-- Turn an element of a type `F` satisfying `AlgEquivClass F R A B` into an actual `AlgEquiv`.\nThis is declared as the default coercion from `F` to `A ≃ₐ[R] B`. -/\n@[coe]\ndef toAlgEquiv {F R A B : Type*} [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A]\n [Algebra R B] [EquivLike F A B] [AlgEquivClass F R A B] (f : F) : A ≃ₐ[R] B :=\n { (f : A ≃ B), (RingEquivClass.toRingEquiv f : A ≃+* B) with commutes' := commutes f }\n\nend AlgEquivClass\n\nnamespace AlgEquiv\n\nuniverse uR uA₁ uA₂ uA₃ uA₁' uA₂' uA₃'\nvariable {R : Type uR}\nvariable {A₁ : Type uA₁} {A₂ : Type uA₂} {A₃ : Type uA₃}\nvariable {A₁' : Type uA₁'} {A₂' : Type uA₂'} {A₃' : Type uA₃'}\n\nsection Semiring\n\nvariable [CommSemiring R] [Semiring A₁] [Semiring A₂] [Semiring A₃]\nvariable [Semiring A₁'] [Semiring A₂'] [Semiring A₃']\nvariable [Algebra R A₁] [Algebra R A₂] [Algebra R A₃]\nvariable [Algebra R A₁'] [Algebra R A₂'] [Algebra R A₃']\nvariable (e : A₁ ≃ₐ[R] A₂)\n\nsection coe\n\ninstance : EquivLike (A₁ ≃ₐ[R] A₂) A₁ A₂ where\n coe f := f.toFun\n inv f := f.invFun\n left_inv f := f.left_inv\n right_inv f := f.right_inv\n coe_injective' f g h₁ h₂ := by\n obtain ⟨⟨f, _⟩, _⟩ := f\n obtain ⟨⟨g, _⟩, _⟩ := g\n congr\n\n/-- Helper instance since the coercion is not always found. -/\ninstance : FunLike (A₁ ≃ₐ[R] A₂) A₁ A₂ where\n coe := DFunLike.coe\n coe_injective := DFunLike.coe_injective\n\ninstance : AlgEquivClass (A₁ ≃ₐ[R] A₂) R A₁ A₂ where\n map_add f := f.map_add'\n map_mul f := f.map_mul'\n commutes f := f.commutes'\n\n@[ext]\ntheorem ext {f g : A₁ ≃ₐ[R] A₂} (h : ∀ a, f a = g a) : f = g :=\n DFunLike.ext f g h\n\nprotected theorem congr_arg {f : A₁ ≃ₐ[R] A₂} {x x' : A₁} : x = x' → f x = f x' :=\n DFunLike.congr_arg f\n\nprotected theorem congr_fun {f g : A₁ ≃ₐ[R] A₂} (h : f = g) (x : A₁) : f x = g x :=\n DFunLike.congr_fun h x\n\n@[simp]\ntheorem coe_mk {toEquiv map_mul map_add commutes} :\n ⇑(⟨toEquiv, map_mul, map_add, commutes⟩ : A₁ ≃ₐ[R] A₂) = toEquiv :=\n rfl\n\n@[simp]\ntheorem mk_coe (e : A₁ ≃ₐ[R] A₂) (e' h₁ h₂ h₃ h₄ h₅) :\n (⟨⟨e, e', h₁, h₂⟩, h₃, h₄, h₅⟩ : A₁ ≃ₐ[R] A₂) = e :=\n ext fun _ => rfl\n\n@[simp]\ntheorem toEquiv_eq_coe : e.toEquiv = e :=\n rfl\n\n@[simp]\nprotected theorem coe_coe {F : Type*} [EquivLike F A₁ A₂] [AlgEquivClass F R A₁ A₂] (f : F) :\n ⇑(AlgEquivClass.toAlgEquiv f) = f :=\n rfl\n\ntheorem coe_fun_injective : @Function.Injective (A₁ ≃ₐ[R] A₂) (A₁ → A₂) fun e => (e : A₁ → A₂) :=\n DFunLike.coe_injective\n\n/-- Forgetting the multiplicative structures, an equivalence of algebras is a linear equivalence. -/\n@[coe, simps! apply] def toLinearEquiv (e : A₁ ≃ₐ[R] A₂) : A₁ ≃ₗ[R] A₂ where\n toAddEquiv := e.toAddEquiv\n map_smul' := map_smulₛₗ e\n\ninstance : CoeOut (A₁ ≃ₐ[R] A₂) (A₁ ≃ₗ[R] A₂) where coe := toLinearEquiv\ninstance : CoeOut (A₁ ≃ₐ[R] A₂) (A₁ ≃+* A₂) where coe := toRingEquiv\n\n@[simp]\ntheorem coe_toEquiv : ((e : A₁ ≃ A₂) : A₁ → A₂) = e :=\n rfl\n\n@[deprecated \"Now a syntactic equality\" (since := \"2026-04-09\"), nolint synTaut]\ntheorem toRingEquiv_eq_coe : e.toRingEquiv = e :=\n rfl\n\n@[simp]\nlemma toRingEquiv_toRingHom : ((e : A₁ ≃+* A₂) : A₁ →+* A₂) = e :=\n rfl\n\n@[simp]\ntheorem coe_ringEquiv : ((e : A₁ ≃+* A₂) : A₁ → A₂) = e :=\n rfl\n\ntheorem coe_ringEquiv' : (e.toRingEquiv : A₁ → A₂) = e :=\n rfl\n\ntheorem coe_ringEquiv_injective : Function.Injective ((↑) : (A₁ ≃ₐ[R] A₂) → A₁ ≃+* A₂) :=\n fun _ _ h => ext <| RingEquiv.congr_fun h\n\n/-- Interpret an algebra equivalence as an algebra homomorphism.\n\nThis definition is included for symmetry with the other `to*Hom` projections.\nThe `simp` normal form is to use the coercion of the `AlgHomClass.coeTC` instance. -/\n@[coe]\ndef toAlgHom : A₁ →ₐ[R] A₂ :=\n { e with\n map_one' := map_one e\n map_zero' := map_zero e }\n\ninstance : CoeOut (A₁ ≃ₐ[R] A₂) (A₁ →ₐ[R] A₂) where coe := AlgEquiv.toAlgHom\n\n@[deprecated \"Now a syntactic equality\" (since := \"2026-04-29\"), nolint synTaut]\ntheorem toAlgHom_eq_coe : e.toAlgHom = e :=\n rfl\n\ntheorem toAlgHom_apply (x : A₁) : e.toAlgHom x = e x :=\n rfl\n\n@[simp, norm_cast]\ntheorem coe_algHom : DFunLike.coe e.toAlgHom = DFunLike.coe e :=\n rfl\n\ntheorem coe_algHom_injective : Function.Injective ((↑) : (A₁ ≃ₐ[R] A₂) → A₁ →ₐ[R] A₂) :=\n fun _ _ h => ext <| AlgHom.congr_fun h\n\n@[simp, norm_cast]\nlemma toAlgHom_toRingHom : ((e : A₁ →ₐ[R] A₂) : A₁ →+* A₂) = e :=\n rfl\n\n/-- The two paths coercion can take to a `RingHom` are equivalent -/\ntheorem coe_ringHom_commutes : ((e : A₁ →ₐ[R] A₂) : A₁ →+* A₂) = ((e : A₁ ≃+* A₂) : A₁ →+* A₂) :=\n rfl\n\n@[simp]\ntheorem commutes : ∀ r : R, e (algebraMap R A₁ r) = algebraMap R A₂ r :=\n e.commutes'\n\nend coe\n\nsection bijective\n\nprotected theorem bijective : Function.Bijective e :=\n EquivLike.bijective e\n\nprotected theorem injective : Function.Injective e :=\n EquivLike.injective e\n\nprotected theorem surjective : Function.Surjective e :=\n EquivLike.surjective e\n\nend bijective\n\nsection refl\n\n/-- Algebra equivalences are reflexive. -/\n@[refl]\ndef refl : A₁ ≃ₐ[R] A₁ :=\n { (.refl _ : A₁ ≃+* A₁) with commutes' := fun _ => rfl }\n\ninstance : Inhabited (A₁ ≃ₐ[R] A₁) :=\n ⟨refl⟩\n\n@[simp, norm_cast] lemma refl_toAlgHom : (refl : A₁ ≃ₐ[R] A₁) = AlgHom.id R A₁ := rfl\n@[simp, norm_cast] lemma refl_toRingHom : (refl : A₁ ≃ₐ[R] A₁) = RingHom.id A₁ := rfl\n\n@[simp]\ntheorem coe_refl : ⇑(refl : A₁ ≃ₐ[R] A₁) = id :=\n rfl\n\nend refl\n\nsection symm\n\n/-- Algebra equivalences are symmetric. -/\n@[symm]\ndef symm (e : A₁ ≃ₐ[R] A₂) : A₂ ≃ₐ[R] A₁ :=\n { e.toRingEquiv.symm with\n commutes' := fun r => by\n rw [← e.toRingEquiv.symm_apply_apply (algebraMap R A₁ r)]\n congr\n simp }\n\ntheorem invFun_eq_symm {e : A₁ ≃ₐ[R] A₂} : e.invFun = e.symm :=\n rfl\n\n@[simp]\ntheorem coe_apply_coe_coe_symm_apply {F : Type*} [EquivLike F A₁ A₂] [AlgEquivClass F R A₁ A₂]\n (f : F) (x : A₂) :\n f ((AlgEquivClass.toAlgEquiv f).symm x) = x :=\n EquivLike.right_inv f x\n\n@[simp]\ntheorem coe_coe_symm_apply_coe_apply {F : Type*} [EquivLike F A₁ A₂] [AlgEquivClass F R A₁ A₂]\n (f : F) (x : A₁) :\n (AlgEquivClass.toAlgEquiv f).symm (f x) = x :=\n EquivLike.left_inv f x\n\n/-- `simp` normal form of `invFun_eq_symm` -/\n@[simp]\ntheorem symm_toEquiv_eq_symm {e : A₁ ≃ₐ[R] A₂} : (e : A₁ ≃ A₂).symm = e.symm :=\n rfl\n\n@[simp]\ntheorem symm_symm (e : A₁ ≃ₐ[R] A₂) : e.symm.symm = e := rfl\n\ntheorem symm_bijective : Function.Bijective (symm : (A₁ ≃ₐ[R] A₂) → A₂ ≃ₐ[R] A₁) :=\n Function.bijective_iff_has_inverse.mpr ⟨_, symm_symm, symm_symm⟩\n\n@[simp]\ntheorem mk_coe' (e : A₁ ≃ₐ[R] A₂) (f h₁ h₂ h₃ h₄ h₅) :\n (⟨⟨f, e, h₁, h₂⟩, h₃, h₄, h₅⟩ : A₂ ≃ₐ[R] A₁) = e.symm :=\n symm_bijective.injective <| ext fun _ => rfl\n\n@[simp]\ntheorem symm_mk (e : A₁ ≃ A₂) (h₁ h₂ h₃) : dsimp%\n (mk e h₁ h₂ h₃ : A₁ ≃ₐ[R] A₂).symm =\n { (mk e h₁ h₂ h₃ : A₁ ≃ₐ[R] A₂).symm with\n toEquiv := e.symm } :=\n rfl\n\n@[simp]\ntheorem refl_symm : (AlgEquiv.refl : A₁ ≃ₐ[R] A₁).symm = AlgEquiv.refl :=\n rfl\n\ntheorem toRingEquiv_symm : (e : A₁ ≃+* A₂).symm = e.symm :=\n rfl\n\n@[simp]\ntheorem symm_toRingEquiv : (e.symm : A₂ ≃+* A₁) = (e : A₁ ≃+* A₂).symm :=\n rfl\n\n@[simp]\ntheorem symm_toAddEquiv : (e.symm : A₂ ≃+ A₁) = (e : A₁ ≃+ A₂).symm :=\n rfl\n\n@[simp]\ntheorem symm_toMulEquiv : (e.symm : A₂ ≃* A₁) = (e : A₁ ≃* A₂).symm :=\n rfl\n\n@[simp]\ntheorem apply_symm_apply (e : A₁ ≃ₐ[R] A₂) : ∀ x, e (e.symm x) = x :=\n e.toEquiv.apply_symm_apply\n\n@[simp]\ntheorem symm_apply_apply (e : A₁ ≃ₐ[R] A₂) : ∀ x, e.symm (e x) = x :=\n e.toEquiv.symm_apply_apply\n\ntheorem symm_apply_eq (e : A₁ ≃ₐ[R] A₂) {x y} : e.symm x = y ↔ x = e y :=\n e.toEquiv.symm_apply_eq\n\ntheorem eq_symm_apply (e : A₁ ≃ₐ[R] A₂) {x y} : y = e.symm x ↔ e y = x :=\n e.toEquiv.eq_symm_apply\n\n@[simp]\n\nTarget:\ntheorem comp_symm (e : A₁ ≃ₐ[R] A₂) : AlgHom.comp (e : A₁ →ₐ[R] A₂) ↑e.symm = AlgHom.id R A₂ :=\n\nProof body:\n","proof_body":"by\n ext\n simp","provenance":{"declaration_index":36,"environment_hash":"08dda26699fe1025520aeb9450ff1df6b58e8ef0aa8100ae158997e8a703b831","lean_toolchain":"leanprover/lean4:v4.32.0-rc1","license":"Apache-2.0","original_import_scope":"module-specific","source_revision":"360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56","source_sha256":"ee3938ce814a12e6c16e7460bd2a3e54209e7b6ef86054be23fcccd3e5d371cd","source_uri":"https://github.com/leanprover-community/mathlib4/blob/360da6fa66c1273b76b6b2d8c5666fd5ac2e3b56/Mathlib/Algebra/Algebra/Equiv.lean"},"sample_id":"992af0ea9bf758a47adf3baed96659c5a69f608e7efcd2432a55d736af568aaa","schema_version":1,"split":"validation","theorem_statement":"theorem comp_symm (e : A₁ ≃ₐ[R] A₂) : AlgHom.comp (e : A₁ →ₐ[R] A₂) ↑e.symm = AlgHom.id R A₂ :="}
|