Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 67e19cd

Browse files
Oliver Nashurkud
andcommitted
feat(src/ring_theory/algebra): define equivalence of algebras (#2625)
Co-authored-by: Yury G. Kudryashov <urkud@urkud.name>
1 parent fc8c4b9 commit 67e19cd

File tree

1 file changed

+90
-2
lines changed

1 file changed

+90
-2
lines changed

src/ring_theory/algebra.lean

Lines changed: 90 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,19 @@ Authors: Kenny Lau, Yury Kudryashov
66
import data.matrix.basic
77
import linear_algebra.tensor_product
88
import algebra.commute
9+
import data.equiv.ring
910

1011
/-!
1112
# Algebra over Commutative Semiring (under category)
1213
1314
In this file we define algebra over commutative (semi)rings, algebra homomorphisms `alg_hom`,
14-
and `subalgebra`s. We also define usual operations on `alg_hom`s (`id`, `comp`) and subalgebras
15-
(`map`, `comap`).
15+
algebra equivalences `alg_equiv`, and `subalgebra`s. We also define usual operations on `alg_hom`s
16+
(`id`, `comp`) and subalgebras (`map`, `comap`).
1617
1718
## Notations
1819
1920
* `A →ₐ[R] B` : `R`-algebra homomorphism from `A` to `B`.
21+
* `A ≃ₐ[R] B` : `R`-algebra equivalence from `A` to `B`.
2022
-/
2123
noncomputable theory
2224

@@ -335,6 +337,92 @@ ext $ λ x, show φ₁.to_linear_map x = φ₂.to_linear_map x, by rw H
335337

336338
end alg_hom
337339

340+
set_option old_structure_cmd true
341+
/-- An equivalence of algebras is an equivalence of rings commuting with the actions of scalars. -/
342+
structure alg_equiv (R : Type u) (A : Type v) (B : Type w)
343+
[comm_semiring R] [semiring A] [semiring B] [algebra R A] [algebra R B]
344+
extends A ≃ B, A ≃* B, A ≃+ B, A ≃+* B :=
345+
(commutes' : ∀ r : R, to_fun (algebra_map R A r) = algebra_map R B r)
346+
347+
attribute [nolint doc_blame] alg_equiv.to_ring_equiv
348+
attribute [nolint doc_blame] alg_equiv.to_equiv
349+
attribute [nolint doc_blame] alg_equiv.to_add_equiv
350+
attribute [nolint doc_blame] alg_equiv.to_mul_equiv
351+
352+
notation A ` ≃ₐ[`:50 R `] ` A' := alg_equiv R A A'
353+
354+
namespace alg_equiv
355+
356+
variables {R : Type u} {A₁ : Type v} {A₂ : Type w} {A₃ : Type u₁}
357+
variables [comm_semiring R] [semiring A₁] [semiring A₂] [semiring A₃]
358+
variables [algebra R A₁] [algebra R A₂] [algebra R A₃]
359+
360+
instance : has_coe_to_fun (A₁ ≃ₐ[R] A₂) := ⟨_, alg_equiv.to_fun⟩
361+
362+
instance has_coe_to_ring_equiv : has_coe (A₁ ≃ₐ[R] A₂) (A₁ ≃+* A₂) := ⟨alg_equiv.to_ring_equiv⟩
363+
364+
@[simp, norm_cast] lemma coe_ring_equiv (e : A₁ ≃ₐ[R] A₂) : ((e : A₁ ≃+* A₂) : A₁ → A₂) = e := rfl
365+
366+
@[simp] lemma map_add (e : A₁ ≃ₐ[R] A₂) : ∀ x y, e (x + y) = e x + e y := e.to_add_equiv.map_add
367+
368+
@[simp] lemma map_zero (e : A₁ ≃ₐ[R] A₂) : e 0 = 0 := e.to_add_equiv.map_zero
369+
370+
@[simp] lemma map_mul (e : A₁ ≃ₐ[R] A₂) : ∀ x y, e (x * y) = (e x) * (e y) := e.to_mul_equiv.map_mul
371+
372+
@[simp] lemma map_one (e : A₁ ≃ₐ[R] A₂) : e 1 = 1 := e.to_mul_equiv.map_one
373+
374+
@[simp] lemma commutes (e : A₁ ≃ₐ[R] A₂) : ∀ (r : R), e (algebra_map R A₁ r) = algebra_map R A₂ r :=
375+
e.commutes'
376+
377+
@[simp] lemma map_neg {A₁ : Type v} {A₂ : Type w}
378+
[ring A₁] [ring A₂] [algebra R A₁] [algebra R A₂] (e : A₁ ≃ₐ[R] A₂) :
379+
∀ x, e (-x) = -(e x) := e.to_add_equiv.map_neg
380+
381+
@[simp] lemma map_sub {A₁ : Type v} {A₂ : Type w}
382+
[ring A₁] [ring A₂] [algebra R A₁] [algebra R A₂] (e : A₁ ≃ₐ[R] A₂) :
383+
∀ x y, e (x - y) = e x - e y := e.to_add_equiv.map_sub
384+
385+
instance has_coe_to_alg_hom : has_coe (A₁ ≃ₐ[R] A₂) (A₁ →ₐ[R] A₂) :=
386+
⟨λ e, { map_one' := e.map_one, map_zero' := e.map_zero, ..e }⟩
387+
388+
@[simp, norm_cast] lemma coe_to_alg_equiv (e : A₁ ≃ₐ[R] A₂) : ((e : A₁ →ₐ[R] A₂) : A₁ → A₂) = e :=
389+
rfl
390+
391+
lemma injective (e : A₁ ≃ₐ[R] A₂) : function.injective e := e.to_equiv.injective
392+
393+
lemma surjective (e : A₁ ≃ₐ[R] A₂) : function.surjective e := e.to_equiv.surjective
394+
395+
lemma bijective (e : A₁ ≃ₐ[R] A₂) : function.bijective e := e.to_equiv.bijective
396+
397+
instance : has_one (A₁ ≃ₐ[R] A₁) := ⟨{commutes' := λ r, rfl, ..(1 : A₁ ≃+* A₁)}⟩
398+
399+
instance : inhabited (A₁ ≃ₐ[R] A₁) := ⟨1
400+
401+
/-- Algebra equivalences are reflexive. -/
402+
@[refl]
403+
def refl : A₁ ≃ₐ[R] A₁ := 1
404+
405+
/-- Algebra equivalences are symmetric. -/
406+
@[symm]
407+
def symm (e : A₁ ≃ₐ[R] A₂) : A₂ ≃ₐ[R] A₁ :=
408+
{ commutes' := λ r, by { rw ←e.to_ring_equiv.symm_apply_apply (algebra_map R A₁ r), congr,
409+
change _ = e _, rw e.commutes, },
410+
..e.to_ring_equiv.symm, }
411+
412+
/-- Algebra equivalences are transitive. -/
413+
@[trans]
414+
def trans (e₁ : A₁ ≃ₐ[R] A₂) (e₂ : A₂ ≃ₐ[R] A₃) : A₁ ≃ₐ[R] A₃ :=
415+
{ commutes' := λ r, show e₂.to_fun (e₁.to_fun _) = _, by rw [e₁.commutes', e₂.commutes'],
416+
..(e₁.to_ring_equiv.trans e₂.to_ring_equiv), }
417+
418+
@[simp] lemma apply_symm_apply (e : A₁ ≃ₐ[R] A₂) : ∀ x, e (e.symm x) = x :=
419+
e.to_equiv.apply_symm_apply
420+
421+
@[simp] lemma symm_apply_apply (e : A₁ ≃ₐ[R] A₂) : ∀ x, e.symm (e x) = x :=
422+
e.to_equiv.symm_apply_apply
423+
424+
end alg_equiv
425+
338426
namespace algebra
339427

340428
variables (R : Type u) (S : Type v) (A : Type w)

0 commit comments

Comments
 (0)