|
|
|
|
SSL Equiv.lean
Sprache: Lean
|
|
/-
Copyright (c) 2018 Kenny Lau. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kenny Lau, Yury Kudryashov
-/
module
public import Mathlib.Algebra.Algebra.Hom
public import Mathlib.Algebra.Ring.Action.Group
/-!
# Isomorphisms of `R`-algebras
This file defines bundled isomorphisms of `R`-algebras.
## Main definitions
* `AlgEquiv R A B`: the type of `R`-algebra isomorphisms between `A` and `B`.
## Notation
* `A ≃ₐ[R] B` : `R`-algebra equivalence from `A` to `B`.
-/
@[expose] public section
universe u v w u₁ v₁ u₂ u₃
/-- An equivalence of algebras (denoted as `A ≃ₐ[R] B`)
is an equivalence of rings commuting with the actions of scalars. -/
structure AlgEquiv (R : Type u) (A : Type v) (B : Type w) [CommSemiring R] [Semiring A] [Semiring B]
[Algebra R A] [Algebra R B] extends A ≃ B, A ≃* B, A ≃+ B, A ≃+* B where
/-- An equivalence of algebras commutes with the action of scalars. -/
protected commutes' : ∀ r : R, toFun (algebraMap R A r) = algebraMap R B r
attribute [nolint docBlame] AlgEquiv.toRingEquiv
attribute [nolint docBlame] AlgEquiv.toEquiv
attribute [nolint docBlame] AlgEquiv.toAddEquiv
attribute [nolint docBlame] AlgEquiv.toMulEquiv
@[inherit_doc]
notation:50 A " ≃ₐ[" R "] " A' => AlgEquiv R A A'
/-- `AlgEquivClass F R A B` states that `F` is a type of algebra structure preserving
equivalences. You should extend this class when you extend `AlgEquiv`. -/
class AlgEquivClass (F : Type*) (R A B : outParam Type*) [CommSemiring R] [Semiring A]
[Semiring B] [Algebra R A] [Algebra R B] [EquivLike F A B] : Prop
extends RingEquivClass F A B where
/-- An equivalence of algebras commutes with the action of scalars. -/
commutes : ∀ (f : F) (r : R), f (algebraMap R A r) = algebraMap R B r
namespace AlgEquivClass
-- See note [lower instance priority]
instance (priority := 100) toAlgHomClass (F R A B : Type*) [CommSemiring R] [Semiring A]
[Semiring B] [Algebra R A] [Algebra R B] [EquivLike F A B] [h : AlgEquivClass F R A B] :
AlgHomClass F R A B :=
{ h with }
instance (priority := 100) toLinearEquivClass (F R A B : Type*) [CommSemiring R]
[Semiring A] [Semiring B] [Algebra R A] [Algebra R B]
[EquivLike F A B] [h : AlgEquivClass F R A B] : LinearEquivClass F R A B :=
{ h with map_smulₛₗ := fun f => map_smulₛₗ f }
/-- Turn an element of a type `F` satisfying `AlgEquivClass F R A B` into an actual `AlgEquiv`.
This is declared as the default coercion from `F` to `A ≃ₐ[R] B`. -/
@[coe]
def _root_.AlgEquiv.ofClass {F R A B : Type*} [CommSemiring R]
[Semiring A] [Semiring B] [Algebra R A] [Algebra R B] [EquivLike F A B] [AlgEquivClass F R A B]
(f : F) : A ≃ₐ[R] B :=
{ (f : A ≃ B), (RingEquivClass.toRingEquiv f : A ≃+* B) with commutes' := commutes f }
@[deprecated (since := "2026-09-08")] alias toAlgEquiv := AlgEquiv.ofClass
end AlgEquivClass
namespace AlgEquiv
universe uR uA₁ uA₂ uA₃ uA₁' uA₂' uA₃'
variable {R : Type uR}
variable {A₁ : Type uA₁} {A₂ : Type uA₂} {A₃ : Type uA₃}
variable {A₁' : Type uA₁'} {A₂' : Type uA₂'} {A₃' : Type uA₃'}
section Semiring
variable [CommSemiring R] [Semiring A₁] [Semiring A₂] [Semiring A₃]
variable [Semiring A₁'] [Semiring A₂'] [Semiring A₃']
variable [Algebra R A₁] [Algebra R A₂] [Algebra R A₃]
variable [Algebra R A₁'] [Algebra R A₂'] [Algebra R A₃']
variable (e : A₁ ≃ₐ[R] A₂)
section coe
@[macro_inline]
instance : EquivLike (A₁ ≃ₐ[R] A₂) A₁ A₂ where
coe f := f.toFun
inv f := f.invFun
left_inv f := f.left_inv
right_inv f := f.right_inv
coe_injective' f g h₁ h₂ := by
obtain ⟨⟨f, _⟩, _⟩ := f
obtain ⟨⟨g, _⟩, _⟩ := g
congr
/-- Helper instance since the coercion is not always found. -/
@[macro_inline]
instance : FunLike (A₁ ≃ₐ[R] A₂) A₁ A₂ where
coe := DFunLike.coe
coe_injective := DFunLike.coe_injective
instance : AlgEquivClass (A₁ ≃ₐ[R] A₂) R A₁ A₂ where
map_add f := f.map_add'
map_mul f := f.map_mul'
commutes f := f.commutes'
@[ext]
theorem ext {f g : A₁ ≃ₐ[R] A₂} (h : ∀ a, f a = g a) : f = g :=
DFunLike.ext f g h
protected theorem congr_arg {f : A₁ ≃ₐ[R] A₂} {x x' : A₁} : x = x' → f x = f x' :=
DFunLike.congr_arg f
protected theorem congr_fun {f g : A₁ ≃ₐ[R] A₂} (h : f = g) (x : A₁) : f x = g x :=
congr($h x)
@[simp]
theorem coe_mk {toEquiv map_mul map_add commutes} :
⇑(⟨toEquiv, map_mul, map_add, commutes⟩ : A₁ ≃ₐ[R] A₂) = toEquiv :=
rfl
@[simp]
theorem mk_coe (e : A₁ ≃ₐ[R] A₂) (e' h₁ h₂ h₃ h₄ h₅) :
(⟨⟨e, e', h₁, h₂⟩, h₃, h₄, h₅⟩ : A₁ ≃ₐ[R] A₂) = e :=
ext fun _ => rfl
@[simp]
theorem toEquiv_eq_coe : e.toEquiv = e :=
rfl
@[simp]
protected theorem coe_ofClass {F : Type*} [EquivLike F A₁ A₂] [AlgEquivClass F R A₁ A₂] (f : F) :
⇑(ofClass f) = f :=
rfl
@[deprecated (since := "2026-09-08")] protected alias coe_coe := AlgEquiv.coe_ofClass
theorem coe_fun_injective : @Function.Injective (A₁ ≃ₐ[R] A₂) (A₁ → A₂) fun e => (e : A₁ → A₂) :=
DFunLike.coe_injective
/-- Forgetting the multiplicative structures, an equivalence of algebras is a linear equivalence. -/
@[coe, simps! apply] def toLinearEquiv (e : A₁ ≃ₐ[R] A₂) : A₁ ≃ₗ[R] A₂ where
toAddEquiv := e.toAddEquiv
map_smul' := map_smulₛₗ e
instance : CoeOut (A₁ ≃ₐ[R] A₂) (A₁ ≃ₗ[R] A₂) where coe := toLinearEquiv
instance : CoeOut (A₁ ≃ₐ[R] A₂) (A₁ ≃+* A₂) where coe := toRingEquiv
@[simp]
theorem coe_toEquiv : ((e : A₁ ≃ A₂) : A₁ → A₂) = e :=
rfl
@[simp]
lemma toRingEquiv_toRingHom : ((e : A₁ ≃+* A₂) : A₁ →+* A₂) = e :=
rfl
theorem coe_toRingEquiv : ((e : A₁ ≃+* A₂) : A₁ → A₂) = e := rfl
@[deprecated (since := "2026-05-05")] alias coe_ringEquiv := coe_toRingEquiv
@[deprecated (since := "2026-05-05")] alias coe_ringEquiv' := coe_toRingEquiv
theorem toRingEquiv_injective : Function.Injective ((↑) : (A₁ ≃ₐ[R] A₂) → A₁ ≃+* A₂) :=
fun _ _ h => ext <| RingEquiv.congr_fun h
@[deprecated toRingEquiv_injective (since := "2026-05-05")]
alias coe_ringEquiv_injective := toRingEquiv_injective
/-- Interpret an algebra equivalence as an algebra homomorphism.
This definition is included for symmetry with the other `to*Hom` projections.
The `simp` normal form is to use the coercion of the `AlgHomClass.coeTC` instance. -/
@[coe]
def toAlgHom : A₁ →ₐ[R] A₂ :=
{ e with
map_one' := map_one e
map_zero' := map_zero e }
instance : CoeOut (A₁ ≃ₐ[R] A₂) (A₁ →ₐ[R] A₂) where coe := AlgEquiv.toAlgHom
theorem toAlgHom_apply (x : A₁) : e.toAlgHom x = e x :=
rfl
@[simp, norm_cast]
theorem coe_toAlgHom : DFunLike.coe e.toAlgHom = e := rfl
theorem coe_toAlgHom_injective : Function.Injective ((↑) : (A₁ ≃ₐ[R] A₂) → A₁ →ₐ[R] A₂) :=
fun _ _ h => ext <| AlgHom.congr_fun h
@[deprecated (since := "2026-05-05")] alias coe_algHom := coe_toAlgHom
@[deprecated (since := "2026-05-05")] alias coe_algHom_injective := coe_toAlgHom_injective
@[simp, norm_cast]
lemma toAlgHom_toRingHom : ((e : A₁ →ₐ[R] A₂) : A₁ →+* A₂) = e :=
rfl
/-- The two paths coercion can take to a `RingHom` are equivalent -/
theorem toRingHom_toAlgHom : ((e : A₁ →ₐ[R] A₂) : A₁ →+* A₂) = ((e : A₁ ≃+* A₂) : A₁ →+* A₂) :=
rfl
@[deprecated (since := "2026-05-05")] alias coe_ringHom_commutes := toRingHom_toAlgHom
@[simp]
theorem commutes : ∀ r : R, e (algebraMap R A₁ r) = algebraMap R A₂ r :=
e.commutes'
end coe
section bijective
protected theorem bijective : Function.Bijective e :=
EquivLike.bijective e
protected theorem injective : Function.Injective e :=
EquivLike.injective e
protected theorem surjective : Function.Surjective e :=
EquivLike.surjective e
end bijective
section refl
/-- Algebra equivalences are reflexive. -/
@[refl]
def refl : A₁ ≃ₐ[R] A₁ :=
{ (.refl _ : A₁ ≃+* A₁) with commutes' := fun _ => rfl }
instance : Inhabited (A₁ ≃ₐ[R] A₁) :=
⟨refl⟩
@[simp, norm_cast] lemma refl_toAlgHom : (refl : A₁ ≃ₐ[R] A₁) = AlgHom.id R A₁ := rfl
@[simp, norm_cast] lemma refl_toRingHom : (refl : A₁ ≃ₐ[R] A₁) = RingHom.id A₁ := rfl
@[simp]
theorem coe_refl : ⇑(refl : A₁ ≃ₐ[R] A₁) = id :=
rfl
end refl
section symm
/-- Algebra equivalences are symmetric. -/
@[symm]
def symm (e : A₁ ≃ₐ[R] A₂) : A₂ ≃ₐ[R] A₁ :=
{ e.toRingEquiv.symm with
commutes' := fun r => by
rw [← e.toRingEquiv.symm_apply_apply (algebraMap R A₁ r)]
congr
simp }
theorem invFun_eq_symm {e : A₁ ≃ₐ[R] A₂} : e.invFun = e.symm :=
rfl
@[simp]
theorem apply_ofClass_symm_apply {F : Type*} [EquivLike F A₁ A₂] [AlgEquivClass F R A₁ A₂]
(f : F) (x : A₂) :
f ((ofClass f).symm x) = x :=
EquivLike.right_inv f x
@[simp]
theorem ofClass_symm_apply_apply {F : Type*} [EquivLike F A₁ A₂] [AlgEquivClass F R A₁ A₂]
(f : F) (x : A₁) :
(ofClass f).symm (f x) = x :=
EquivLike.left_inv f x
@[deprecated (since := "2026-09-08")]
alias coe_apply_coe_coe_symm_apply := apply_ofClass_symm_apply
@[deprecated (since := "2026-09-08")]
alias coe_coe_symm_apply_coe_apply := ofClass_symm_apply_apply
/-- `simp` normal form of `invFun_eq_symm` -/
@[simp]
theorem symm_toEquiv_eq_symm {e : A₁ ≃ₐ[R] A₂} : (e : A₁ ≃ A₂).symm = e.symm :=
rfl
@[simp]
theorem symm_symm (e : A₁ ≃ₐ[R] A₂) : e.symm.symm = e := rfl
theorem symm_bijective : Function.Bijective (symm : (A₁ ≃ₐ[R] A₂) → A₂ ≃ₐ[R] A₁) :=
Function.bijective_iff_has_inverse.mpr ⟨_, symm_symm, symm_symm⟩
@[simp]
theorem mk_coe' (e : A₁ ≃ₐ[R] A₂) (f h₁ h₂ h₃ h₄ h₅) :
(⟨⟨f, e, h₁, h₂⟩, h₃, h₄, h₅⟩ : A₂ ≃ₐ[R] A₁) = e.symm :=
symm_bijective.injective <| ext fun _ => rfl
@[simp]
theorem symm_mk (e : A₁ ≃ A₂) (h₁ h₂ h₃) : dsimp%
(mk e h₁ h₂ h₃ : A₁ ≃ₐ[R] A₂).symm =
{ (mk e h₁ h₂ h₃ : A₁ ≃ₐ[R] A₂).symm with
toEquiv := e.symm } :=
rfl
@[simp]
theorem refl_symm : (AlgEquiv.refl : A₁ ≃ₐ[R] A₁).symm = AlgEquiv.refl :=
rfl
theorem toRingEquiv_symm : (e : A₁ ≃+* A₂).symm = e.symm :=
rfl
@[simp]
theorem symm_toRingEquiv : (e.symm : A₂ ≃+* A₁) = (e : A₁ ≃+* A₂).symm :=
rfl
@[simp]
theorem symm_toAddEquiv : (e.symm : A₂ ≃+ A₁) = (e : A₁ ≃+ A₂).symm :=
rfl
@[simp]
theorem symm_toMulEquiv : (e.symm : A₂ ≃* A₁) = (e : A₁ ≃* A₂).symm :=
rfl
@[simp]
theorem apply_symm_apply (e : A₁ ≃ₐ[R] A₂) : ∀ x, e (e.symm x) = x :=
e.toEquiv.apply_symm_apply
@[simp]
theorem symm_apply_apply (e : A₁ ≃ₐ[R] A₂) : ∀ x, e.symm (e x) = x :=
e.toEquiv.symm_apply_apply
theorem symm_apply_eq (e : A₁ ≃ₐ[R] A₂) {x y} : e.symm x = y ↔ x = e y :=
e.toEquiv.symm_apply_eq
theorem eq_symm_apply (e : A₁ ≃ₐ[R] A₂) {x y} : y = e.symm x ↔ e y = x :=
e.toEquiv.eq_symm_apply
@[simp]
theorem comp_symm (e : A₁ ≃ₐ[R] A₂) : AlgHom.comp (e : A₁ →ₐ[R] A₂) ↑e.symm = AlgHom.id R A₂ := by
ext
simp
@[simp]
theorem symm_comp (e : A₁ ≃ₐ[R] A₂) : AlgHom.comp ↑e.symm (e : A₁ →ₐ[R] A₂) = AlgHom.id R A₁ := by
ext
simp
theorem leftInverse_symm (e : A₁ ≃ₐ[R] A₂) : Function.LeftInverse e.symm e :=
e.left_inv
theorem rightInverse_symm (e : A₁ ≃ₐ[R] A₂) : Function.RightInverse e.symm e :=
e.right_inv
lemma image_symm_eq_preimage (e : A₁ ≃ₐ[R] A₂) (s : Set A₂) : e.symm '' s = e ⁻¹' s :=
e.toLinearEquiv.image_symm_eq_preimage _
end symm
section simps
/-- See Note [custom simps projection] -/
def Simps.apply (e : A₁ ≃ₐ[R] A₂) : A₁ → A₂ :=
e
/-- See Note [custom simps projection] -/
def Simps.toEquiv (e : A₁ ≃ₐ[R] A₂) : A₁ ≃ A₂ :=
e
/-- See Note [custom simps projection] -/
def Simps.symm_apply (e : A₁ ≃ₐ[R] A₂) : A₂ → A₁ :=
e.symm
initialize_simps_projections AlgEquiv (toFun → apply, invFun → symm_apply)
end simps
section trans
/-- Algebra equivalences are transitive. -/
@[trans]
def trans (e₁ : A₁ ≃ₐ[R] A₂) (e₂ : A₂ ≃ₐ[R] A₃) : A₁ ≃ₐ[R] A₃ :=
{ e₁.toRingEquiv.trans e₂.toRingEquiv with
commutes' := fun r => show e₂.toFun (e₁.toFun _) = _ by rw [e₁.commutes', e₂.commutes'] }
@[simp]
theorem coe_trans (e₁ : A₁ ≃ₐ[R] A₂) (e₂ : A₂ ≃ₐ[R] A₃) : ⇑(e₁.trans e₂) = e₂ ∘ e₁ :=
rfl
@[simp]
theorem trans_apply (e₁ : A₁ ≃ₐ[R] A₂) (e₂ : A₂ ≃ₐ[R] A₃) (x : A₁) : (e₁.trans e₂) x = e₂ (e₁ x) :=
rfl
@[simp]
theorem symm_trans_apply (e₁ : A₁ ≃ₐ[R] A₂) (e₂ : A₂ ≃ₐ[R] A₃) (x : A₃) :
(e₁.trans e₂).symm x = e₁.symm (e₂.symm x) :=
rfl
@[simp] lemma self_trans_symm (e : A₁ ≃ₐ[R] A₂) : e.trans e.symm = refl := by ext; simp
@[simp] lemma symm_trans_self (e : A₁ ≃ₐ[R] A₂) : e.symm.trans e = refl := by ext; simp
@[simp, norm_cast]
lemma toRingHom_trans (e₁ : A₁ ≃ₐ[R] A₂) (e₂ : A₂ ≃ₐ[R] A₃) :
(e₁.trans e₂ : A₁ →+* A₃) = .comp e₂ (e₁ : A₁ →+* A₂) := rfl
end trans
/-- `Equiv.cast (congrArg _ h)` as an algebra equiv.
Note that unlike `Equiv.cast`, this takes an equality of indices rather than an equality of types,
to avoid having to deal with an equality of the algebraic structure itself. -/
@[simps!]
protected def cast
{ι : Type*} {A : ι → Type*} [∀ i, Semiring (A i)] [∀ i, Algebra R (A i)] {i j : ι} (h : i = j) :
A i ≃ₐ[R] A j where
__ := RingEquiv.cast h
commutes' _ := by cases h; rfl
/-- If `A₁` is equivalent to `A₁'` and `A₂` is equivalent to `A₂'`, then the type of maps
`A₁ →ₐ[R] A₂` is equivalent to the type of maps `A₁' →ₐ[R] A₂'`. -/
@[simps apply]
def arrowCongr (e₁ : A₁ ≃ₐ[R] A₁') (e₂ : A₂ ≃ₐ[R] A₂') : (A₁ →ₐ[R] A₂) ≃ (A₁' →ₐ[R] A₂') where
toFun f := (e₂.toAlgHom.comp f).comp e₁.symm.toAlgHom
invFun f := (e₂.symm.toAlgHom.comp f).comp e₁.toAlgHom
left_inv f := by
simp only [AlgHom.comp_assoc, symm_comp]
simp only [← AlgHom.comp_assoc, symm_comp, AlgHom.id_comp, AlgHom.comp_id]
right_inv f := by
simp only [AlgHom.comp_assoc, comp_symm]
simp only [← AlgHom.comp_assoc, comp_symm, AlgHom.id_comp, AlgHom.comp_id]
theorem arrowCongr_comp (e₁ : A₁ ≃ₐ[R] A₁') (e₂ : A₂ ≃ₐ[R] A₂')
(e₃ : A₃ ≃ₐ[R] A₃') (f : A₁ →ₐ[R] A₂) (g : A₂ →ₐ[R] A₃) :
arrowCongr e₁ e₃ (g.comp f) = (arrowCongr e₂ e₃ g).comp (arrowCongr e₁ e₂ f) := by
ext
simp
@[simp]
theorem arrowCongr_refl : arrowCongr AlgEquiv.refl AlgEquiv.refl = Equiv.refl (A₁ →ₐ[R] A₂) :=
rfl
@[simp]
theorem arrowCongr_trans (e₁ : A₁ ≃ₐ[R] A₂) (e₁' : A₁' ≃ₐ[R] A₂')
(e₂ : A₂ ≃ₐ[R] A₃) (e₂' : A₂' ≃ₐ[R] A₃') :
arrowCongr (e₁.trans e₂) (e₁'.trans e₂') = (arrowCongr e₁ e₁').trans (arrowCongr e₂ e₂') :=
rfl
@[simp]
theorem arrowCongr_symm (e₁ : A₁ ≃ₐ[R] A₁') (e₂ : A₂ ≃ₐ[R] A₂') :
(arrowCongr e₁ e₂).symm = arrowCongr e₁.symm e₂.symm :=
rfl
/-- If `A₁` is equivalent to `A₂` and `A₁'` is equivalent to `A₂'`, then the type of maps
`A₁ ≃ₐ[R] A₁'` is equivalent to the type of maps `A₂ ≃ₐ[R] A₂'`.
This is the `AlgEquiv` version of `AlgEquiv.arrowCongr`. -/
@[simps apply]
def equivCongr (e : A₁ ≃ₐ[R] A₂) (e' : A₁' ≃ₐ[R] A₂') : (A₁ ≃ₐ[R] A₁') ≃ A₂ ≃ₐ[R] A₂' where
toFun ψ := e.symm.trans (ψ.trans e')
invFun ψ := e.trans (ψ.trans e'.symm)
left_inv ψ := by
ext
simp_rw [trans_apply, symm_apply_apply]
right_inv ψ := by
ext
simp_rw [trans_apply, apply_symm_apply]
@[simp]
theorem equivCongr_refl : equivCongr AlgEquiv.refl AlgEquiv.refl = Equiv.refl (A₁ ≃ₐ[R] A₁') :=
rfl
@[simp]
theorem equivCongr_symm (e : A₁ ≃ₐ[R] A₂) (e' : A₁' ≃ₐ[R] A₂') :
(equivCongr e e').symm = equivCongr e.symm e'.symm :=
rfl
@[simp]
theorem equivCongr_trans (e₁₂ : A₁ ≃ₐ[R] A₂) (e₁₂' : A₁' ≃ₐ[R] A₂')
(e₂₃ : A₂ ≃ₐ[R] A₃) (e₂₃' : A₂' ≃ₐ[R] A₃') :
(equivCongr e₁₂ e₁₂').trans (equivCongr e₂₃ e₂₃') =
equivCongr (e₁₂.trans e₂₃) (e₁₂'.trans e₂₃') :=
rfl
/-- If an algebra morphism has an inverse, it is an algebra isomorphism. -/
@[simps]
def ofAlgHom (f : A₁ →ₐ[R] A₂) (g : A₂ →ₐ[R] A₁) (h₁ : f.comp g = AlgHom.id R A₂)
(h₂ : g.comp f = AlgHom.id R A₁) : A₁ ≃ₐ[R] A₂ :=
{ f with
toFun := f
invFun := g
left_inv := AlgHom.ext_iff.1 h₂
right_inv := AlgHom.ext_iff.1 h₁ }
theorem toAlgHom_ofAlgHom (f : A₁ →ₐ[R] A₂) (g : A₂ →ₐ[R] A₁) (h₁ h₂) :
↑(ofAlgHom f g h₁ h₂) = f :=
rfl
@[simp]
theorem ofAlgHom_toAlgHom (f : A₁ ≃ₐ[R] A₂) (g : A₂ →ₐ[R] A₁) (h₁ h₂) :
ofAlgHom (↑f) g h₁ h₂ = f :=
ext fun _ => rfl
@[deprecated (since := "2026-05-05")] alias coe_algHom_ofAlgHom := toAlgHom_ofAlgHom
@[deprecated (since := "2026-05-05")] alias ofAlgHom_coe_algHom := ofAlgHom_toAlgHom
theorem ofAlgHom_symm (f : A₁ →ₐ[R] A₂) (g : A₂ →ₐ[R] A₁) (h₁ h₂) :
(ofAlgHom f g h₁ h₂).symm = ofAlgHom g f h₂ h₁ :=
rfl
@[simp]
theorem toLinearEquiv_refl : (AlgEquiv.refl : A₁ ≃ₐ[R] A₁).toLinearEquiv = LinearEquiv.refl R A₁ :=
rfl
@[simp]
theorem toLinearEquiv_symm (e : A₁ ≃ₐ[R] A₂) : e.symm.toLinearEquiv = e.toLinearEquiv.symm :=
rfl
@[simp]
theorem coe_toLinearEquiv (e : A₁ ≃ₐ[R] A₂) : ⇑e.toLinearEquiv = e := rfl
@[simp]
theorem coe_symm_toLinearEquiv (e : A₁ ≃ₐ[R] A₂) : ⇑e.toLinearEquiv.symm = e.symm := rfl
@[simp]
theorem toLinearEquiv_trans (e₁ : A₁ ≃ₐ[R] A₂) (e₂ : A₂ ≃ₐ[R] A₃) :
(e₁.trans e₂).toLinearEquiv = e₁.toLinearEquiv.trans e₂.toLinearEquiv :=
rfl
theorem toLinearEquiv_injective : Function.Injective (toLinearEquiv : _ → A₁ ≃ₗ[R] A₂) :=
fun _ _ h => ext <| LinearEquiv.congr_fun h
/-- Interpret an algebra equivalence as a linear map. -/
abbrev toLinearMap : A₁ →ₗ[R] A₂ :=
e.toLinearEquiv
@[simp]
lemma toAlgHom_toLinearMap : e.toAlgHom.toLinearMap = e.toLinearEquiv.toLinearMap := rfl
theorem toLinearMap_ofAlgHom (f : A₁ →ₐ[R] A₂) (g : A₂ →ₐ[R] A₁) (h₁ h₂) :
(ofAlgHom f g h₁ h₂).toLinearMap = f.toLinearMap :=
LinearMap.ext fun _ => rfl
theorem toLinearEquiv_toLinearMap : e.toLinearEquiv.toLinearMap = e.toLinearMap :=
rfl
@[simp]
theorem toLinearMap_apply (x : A₁) : e.toLinearMap x = e x :=
rfl
theorem toLinearMap_injective : Function.Injective (toLinearMap : _ → A₁ →ₗ[R] A₂) := fun _ _ h =>
ext <| LinearMap.congr_fun h
@[simp]
theorem trans_toLinearMap (f : A₁ ≃ₐ[R] A₂) (g : A₂ ≃ₐ[R] A₃) :
(f.trans g).toLinearMap = g.toLinearMap.comp f.toLinearMap :=
rfl
@[simp] theorem linearEquivConj_mulLeft (f : A₁ ≃ₐ[R] A₂) (x : A₁) :
f.toLinearEquiv.conj (.mulLeft R x) = .mulLeft R (f x) := by
ext; simp
@[simp] theorem linearEquivConj_mulRight (f : A₁ ≃ₐ[R] A₂) (x : A₁) :
f.toLinearEquiv.conj (.mulRight R x) = .mulRight R (f x) := by
ext; simp
@[simp] theorem linearEquivConj_mulLeftRight (f : A₁ ≃ₐ[R] A₂) (x : A₁ × A₁) :
f.toLinearEquiv.conj (.mulLeftRight R x) = .mulLeftRight R (Prod.map f f x) := by
cases x; ext; simp
/-- Promotes a bijective algebra homomorphism to an algebra equivalence. -/
noncomputable def ofBijective (f : A₁ →ₐ[R] A₂) (hf : Function.Bijective f) : A₁ ≃ₐ[R] A₂ :=
{ RingEquiv.ofBijective (f : A₁ →+* A₂) hf, f with }
@[simp]
lemma coe_ofBijective (f : A₁ →ₐ[R] A₂) (hf : Function.Bijective f) :
(ofBijective f hf : A₁ → A₂) = f := rfl
lemma ofBijective_apply (f : A₁ →ₐ[R] A₂) (hf : Function.Bijective f) (a : A₁) :
(ofBijective f hf) a = f a := rfl
@[simp]
lemma toLinearMap_ofBijective (f : A₁ →ₐ[R] A₂) (hf : Function.Bijective f) :
(ofBijective f hf).toLinearMap = f := rfl
@[simp]
lemma toAlgHom_ofBijective (f : A₁ →ₐ[R] A₂) (hf : Function.Bijective f) :
(ofBijective f hf).toAlgHom = f := rfl
lemma ofBijective_apply_symm_apply (f : A₁ →ₐ[R] A₂) (hf : Function.Bijective f) (x : A₂) :
f ((ofBijective f hf).symm x) = x :=
(ofBijective f hf).apply_symm_apply x
@[simp]
lemma ofBijective_symm_apply_apply (f : A₁ →ₐ[R] A₂) (hf : Function.Bijective f) (x : A₁) :
(ofBijective f hf).symm (f x) = x :=
(ofBijective f hf).symm_apply_apply x
section OfLinearEquiv
variable (l : A₁ ≃ₗ[R] A₂) (map_one : l 1 = 1) (map_mul : ∀ x y : A₁, l (x * y) = l x * l y)
/--
Upgrade a linear equivalence to an algebra equivalence,
given that it distributes over multiplication and the identity
-/
@[simps apply]
def ofLinearEquiv : A₁ ≃ₐ[R] A₂ :=
{ l with
toFun := l
invFun := l.symm
map_mul' := map_mul
commutes' := (AlgHom.ofLinearMap l map_one map_mul : A₁ →ₐ[R] A₂).commutes }
/-- Auxiliary definition to avoid looping in `dsimp` with `AlgEquiv.ofLinearEquiv_symm`. -/
protected def ofLinearEquiv_symm.aux := (ofLinearEquiv l map_one map_mul).symm
@[simp]
theorem ofLinearEquiv_symm :
(ofLinearEquiv l map_one map_mul).symm =
ofLinearEquiv l.symm
(_root_.map_one <| ofLinearEquiv_symm.aux l map_one map_mul)
(_root_.map_mul <| ofLinearEquiv_symm.aux l map_one map_mul) :=
rfl
@[simp]
theorem ofLinearEquiv_toLinearEquiv (map_mul) (map_one) :
ofLinearEquiv e.toLinearEquiv map_mul map_one = e :=
rfl
@[simp]
theorem toLinearEquiv_ofLinearEquiv : toLinearEquiv (ofLinearEquiv l map_one map_mul) = l :=
rfl
end OfLinearEquiv
section OfRingEquiv
/-- Promotes a linear `RingEquiv` to an `AlgEquiv`. -/
@[simps apply symm_apply toEquiv]
def ofRingEquiv {f : A₁ ≃+* A₂} (hf : ∀ x, f (algebraMap R A₁ x) = algebraMap R A₂ x) :
A₁ ≃ₐ[R] A₂ :=
{ f with
toFun := f
invFun := f.symm
commutes' := hf }
end OfRingEquiv
@[simps -isSimp one mul, stacks 09HR]
instance aut : Group (A₁ ≃ₐ[R] A₁) where
mul ϕ ψ := ψ.trans ϕ
mul_assoc _ _ _ := rfl
one := refl
one_mul _ := ext fun _ => rfl
mul_one _ := ext fun _ => rfl
inv := symm
inv_mul_cancel ϕ := ext <| symm_apply_apply ϕ
@[simp]
theorem one_apply (x : A₁) : (1 : A₁ ≃ₐ[R] A₁) x = x :=
rfl
@[simp]
theorem mul_apply (e₁ e₂ : A₁ ≃ₐ[R] A₁) (x : A₁) : (e₁ * e₂) x = e₁ (e₂ x) :=
rfl
lemma aut_inv (ϕ : A₁ ≃ₐ[R] A₁) : ϕ⁻¹ = ϕ.symm := rfl
@[simp] lemma coe_inv (ϕ : A₁ ≃ₐ[R] A₁) : ⇑ϕ⁻¹ = ⇑ϕ.symm := rfl
@[simp] theorem coe_pow (e : A₁ ≃ₐ[R] A₁) (n : ℕ) : ⇑(e ^ n) = e^[n] :=
n.rec (by ext; simp) fun _ ih ↦ by ext; simp [pow_succ, ih]
/-- An algebra isomorphism induces a group isomorphism between automorphism groups.
This is a more bundled version of `AlgEquiv.equivCongr`. -/
@[simps apply]
def autCongr (ϕ : A₁ ≃ₐ[R] A₂) : (A₁ ≃ₐ[R] A₁) ≃* A₂ ≃ₐ[R] A₂ where
__ := equivCongr ϕ ϕ
toFun ψ := ϕ.symm.trans (ψ.trans ϕ)
invFun ψ := ϕ.trans (ψ.trans ϕ.symm)
map_mul' ψ χ := by
ext
simp only [mul_apply, trans_apply, symm_apply_apply]
@[simp]
theorem autCongr_refl : autCongr AlgEquiv.refl = MulEquiv.refl (A₁ ≃ₐ[R] A₁) := rfl
@[simp]
theorem autCongr_symm (ϕ : A₁ ≃ₐ[R] A₂) : (autCongr ϕ).symm = autCongr ϕ.symm :=
rfl
@[simp]
theorem autCongr_trans (ϕ : A₁ ≃ₐ[R] A₂) (ψ : A₂ ≃ₐ[R] A₃) :
(autCongr ϕ).trans (autCongr ψ) = autCongr (ϕ.trans ψ) :=
rfl
/-- The tautological action by `A₁ ≃ₐ[R] A₁` on `A₁`.
This generalizes `Function.End.applyMulAction`. -/
instance applyMulSemiringAction : MulSemiringAction (A₁ ≃ₐ[R] A₁) A₁ where
smul := (· ·)
smul_zero := map_zero
smul_add := map_add
smul_one := map_one
smul_mul := map_mul
one_smul _ := rfl
mul_smul _ _ _ := rfl
@[simp]
protected theorem smul_def (f : A₁ ≃ₐ[R] A₁) (a : A₁) : f • a = f a :=
rfl
instance apply_faithfulSMul : FaithfulSMul (A₁ ≃ₐ[R] A₁) A₁ :=
⟨AlgEquiv.ext⟩
instance apply_smulCommClass {S} [SMul S R] [SMul S A₁] [IsScalarTower S R A₁] :
SMulCommClass S (A₁ ≃ₐ[R] A₁) A₁ where
smul_comm r e a := (e.toLinearEquiv.map_smul_of_tower r a).symm
instance apply_smulCommClass' {S} [SMul S R] [SMul S A₁] [IsScalarTower S R A₁] :
SMulCommClass (A₁ ≃ₐ[R] A₁) S A₁ :=
SMulCommClass.symm _ _ _
instance : MulDistribMulAction (A₁ ≃ₐ[R] A₁) A₁ˣ where
smul := fun f => Units.map f
one_smul := fun x => by ext; rfl
mul_smul := fun x y z => by ext; rfl
smul_mul := fun x y z => by ext; exact map_mul x _ _
smul_one := fun x => by ext; exact map_one x
@[simp]
theorem smul_units_def (f : A₁ ≃ₐ[R] A₁) (x : A₁ˣ) :
f • x = Units.map f x := rfl
@[simp]
lemma _root_.MulSemiringAction.toRingEquiv_algEquiv (σ : A₁ ≃ₐ[R] A₁) :
MulSemiringAction.toRingEquiv _ A₁ σ = σ := rfl
@[simp]
theorem algebraMap_eq_apply (e : A₁ ≃ₐ[R] A₂) {y : R} {x : A₁} :
algebraMap R A₂ y = e x ↔ algebraMap R A₁ y = x :=
⟨fun h => by simpa using e.symm.toAlgHom.algebraMap_eq_apply h, fun h =>
e.toAlgHom.algebraMap_eq_apply h⟩
/-- `AlgEquiv.toAlgHom` as a `MonoidHom`. -/
@[simps] def toAlgHomHom (R A) [CommSemiring R] [Semiring A] [Algebra R A] :
(A ≃ₐ[R] A) →* A →ₐ[R] A where
toFun := AlgEquiv.toAlgHom
map_one' := rfl
map_mul' _ _ := rfl
/-- `AlgEquiv.toLinearMap` as a `MonoidHom`. -/
@[simps!]
def toLinearMapHom (R A) [CommSemiring R] [Semiring A] [Algebra R A] :
(A ≃ₐ[R] A) →* Module.End R A :=
AlgHom.toEnd.comp (toAlgHomHom R A)
lemma pow_toLinearMap (σ : A₁ ≃ₐ[R] A₁) (n : ℕ) :
(σ ^ n).toLinearMap = σ.toLinearMap ^ n :=
(AlgEquiv.toLinearMapHom R A₁).map_pow σ n
@[simp]
lemma one_toLinearMap :
(1 : A₁ ≃ₐ[R] A₁).toLinearMap = 1 := rfl
/-- The units group of `S →ₐ[R] S` is `S ≃ₐ[R] S`.
See `LinearMap.GeneralLinearGroup.generalLinearEquiv` for the linear map version. -/
@[simps]
def algHomUnitsEquiv (R S : Type*) [CommSemiring R] [Semiring S] [Algebra R S] :
(S →ₐ[R] S)ˣ ≃* (S ≃ₐ[R] S) where
toFun := fun f ↦
{ (f : S →ₐ[R] S) with
invFun := ↑(f⁻¹)
left_inv := (fun x ↦ show (↑(f⁻¹ * f) : S →ₐ[R] S) x = x by rw [inv_mul_cancel]; rfl)
right_inv := (fun x ↦ show (↑(f * f⁻¹) : S →ₐ[R] S) x = x by rw [mul_inv_cancel]; rfl) }
invFun := fun f ↦ ⟨f, f.symm, f.comp_symm, f.symm_comp⟩
map_mul' := fun _ _ ↦ rfl
/-- See also `Finite.algHom` -/
instance _root_.Finite.algEquiv [Finite (A₁ →ₐ[R] A₂)] : Finite (A₁ ≃ₐ[R] A₂) :=
Finite.of_injective _ AlgEquiv.coe_toAlgHom_injective
-- TODO Morally this is just `isLocalHom_equiv`: can we obviate the need for this instance?
instance : IsLocalHom e.toAlgHom := by
have : IsLocalHom e.toRingEquiv := inferInstance
exact ⟨this.map_nonunit⟩
end Semiring
end AlgEquiv
namespace RingEquiv
variable {R S : Type*}
/-- Reinterpret a `RingEquiv` as an `ℕ`-algebra isomorphism. -/
@[simps! -isSimp apply]
def toNatAlgEquiv [Semiring R] [Semiring S] (f : R ≃+* S) : R ≃ₐ[ℕ] S where
toEquiv := f
__ := f.toRingHom.toNatAlgHom
@[simp]
lemma coe_toNatAlgEquiv [Semiring R] [Semiring S] (f : R ≃+* S) :
⇑f.toNatAlgEquiv = ⇑f := rfl
lemma toAlgHom_toNatAlgEquiv [Semiring R] [Semiring S] (f : R ≃+* S) :
f.toNatAlgEquiv.toAlgHom = (f : R →+* S).toNatAlgHom := rfl
@[simp]
lemma symm_toNatAlgEquiv [Semiring R] [Semiring S] (f : R ≃+* S) :
f.toNatAlgEquiv.symm = f.symm.toNatAlgEquiv := rfl
variable (R) (S) in
/-- The equivalence between `RingEquiv` and `ℕ`-algebra isomorphisms. -/
@[simps apply symm_apply]
def equivNatAlgEquiv [Semiring R] [Semiring S] : (R ≃+* S) ≃ (R ≃ₐ[ℕ] S) where
toFun := toNatAlgEquiv
invFun := AlgEquiv.toRingEquiv
lemma toNatAlgEquiv_injective [Semiring R] [Semiring S] :
Function.Injective (RingEquiv.toNatAlgEquiv : (R ≃+* S) → _) :=
(equivNatAlgEquiv R S).injective
/-- Reinterpret a `RingEquiv` as a `ℤ`-algebra isomorphism. -/
@[simps! -isSimp apply]
def toIntAlgEquiv [Ring R] [Ring S] (f : R ≃+* S) : R ≃ₐ[ℤ] S where
toEquiv := f
__ := f.toRingHom.toIntAlgHom
@[simp]
lemma coe_toIntAlgEquiv [Ring R] [Ring S] (f : R ≃+* S) :
⇑f.toIntAlgEquiv = ⇑f := rfl
lemma toAlgHom_toIntAlgEquiv [Ring R] [Ring S] (f : R ≃+* S) :
f.toIntAlgEquiv.toAlgHom = (f : R →+* S).toIntAlgHom := rfl
@[simp]
lemma symm_toIntAlgEquiv [Ring R] [Ring S] (f : R ≃+* S) :
f.toIntAlgEquiv.symm = f.symm.toIntAlgEquiv := rfl
variable (R) (S) in
/-- The equivalence between `RingEquiv` and `ℤ`-algebra isomorphisms. -/
@[simps apply symm_apply]
def equivIntAlgEquiv [Ring R] [Ring S] : (R ≃+* S) ≃ (R ≃ₐ[ℤ] S) where
toFun := toIntAlgEquiv
invFun := AlgEquiv.toRingEquiv
lemma toIntAlgEquiv_injective [Ring R] [Ring S] :
Function.Injective (RingEquiv.toIntAlgEquiv : (R ≃+* S) → _) :=
(equivIntAlgEquiv R S).injective
end RingEquiv
namespace MulSemiringAction
variable {G : Type*} (R A : Type*) [CommSemiring R] [Semiring A] [Algebra R A]
section
variable [Group G] [MulSemiringAction G A] [SMulCommClass G R A]
/-- Each element of the group defines an algebra equivalence.
This is a stronger version of `MulSemiringAction.toRingEquiv` and
`DistribMulAction.toLinearEquiv`. -/
@[simps! apply symm_apply toEquiv]
def toAlgEquiv (g : G) : A ≃ₐ[R] A :=
{ MulSemiringAction.toRingEquiv _ _ g, MulSemiringAction.toAlgHom R A g with }
theorem toAlgEquiv_injective [FaithfulSMul G A] :
Function.Injective (MulSemiringAction.toAlgEquiv R A : G → A ≃ₐ[R] A) := fun _ _ h =>
eq_of_smul_eq_smul fun r => AlgEquiv.ext_iff.1 h r
variable (G)
/-- Each element of the group defines an algebra equivalence.
This is a stronger version of `MulSemiringAction.toRingAut` and
`DistribMulAction.toModuleEnd`. -/
@[simps]
def toAlgAut : G →* A ≃ₐ[R] A where
toFun := toAlgEquiv R A
map_one' := AlgEquiv.ext <| one_smul _
map_mul' g h := AlgEquiv.ext <| mul_smul g h
end
end MulSemiringAction
section
variable {R S T : Type*} [CommSemiring R] [Semiring S] [Semiring T] [Algebra R S] [Algebra R T]
instance [Subsingleton S] [Subsingleton T] : Unique (S ≃ₐ[R] T) where
default := AlgEquiv.ofAlgHom default default
(AlgHom.ext fun _ ↦ Subsingleton.elim _ _)
(AlgHom.ext fun _ ↦ Subsingleton.elim _ _)
uniq _ := AlgEquiv.ext fun _ ↦ Subsingleton.elim _ _
@[simp]
lemma AlgEquiv.default_apply [Subsingleton S] [Subsingleton T] (x : S) :
(default : S ≃ₐ[R] T) x = 0 :=
rfl
end
/-- The algebra equivalence between `ULift A` and `A`. -/
@[simps! apply, simps! -isSimp symm_apply, pp_with_univ]
def ULift.algEquiv {R : Type u} {A : Type v} [CommSemiring R] [Semiring A] [Algebra R A] :
ULift.{w} A ≃ₐ[R] A where
__ := ULift.ringEquiv
commutes' _ := rfl
@[simp]
lemma ULift.down_algEquiv_symm_apply {R A : Type*} [CommSemiring R] [Semiring A] [Algebra R A]
(a : A) :
(ULift.algEquiv (R := R).symm a).down = a :=
rfl
section
variable {R S T : Type*} [CommSemiring R] [Semiring S]
[Semiring T] [Algebra R S] [Algebra R T]
attribute [local instance] ULift.algebra' in
/-- `ULift` is functorial for algebra homomorphisms. -/
@[pp_with_univ]
def AlgHom.ulift (f : S →ₐ[R] T) :
ULift.{u₁} S →ₐ[ULift.{u₂} R] ULift.{u₃} T where
__ := AlgHom.comp ULift.algEquiv.symm.toAlgHom (f.comp ULift.algEquiv.toAlgHom)
commutes' _ := by simp
@[simp]
lemma AlgHom.down_ulift_apply (f : S →ₐ[R] T) (x : ULift S) :
(f.ulift x).down = f x.down :=
rfl
lemma AlgHom.ulift_apply (f : S →ₐ[R] T) (x : ULift S) :
f.ulift x = ⟨f x.down⟩ :=
rfl
end
/-- If an `R`-algebra `A` is isomorphic to `R` as `R`-module, then the canonical map `R → A` is an
equivalence of `R`-algebras.
Note that if `e : R ≃ₗ[R] A` is the linear equivalence, then this is not the same as the equivalence
of algebras provided here unless `e 1 = 1`. -/
@[simps] def LinearEquiv.algEquivOfRing
{R A : Type*} [CommSemiring R] [CommSemiring A] [Algebra R A]
(e : R ≃ₗ[R] A) : R ≃ₐ[R] A where
__ := Algebra.ofId R A
invFun x := e.symm (e 1 * x)
left_inv x := calc
e.symm (e 1 * (algebraMap R A) x)
= e.symm (x • e 1) := by rw [Algebra.smul_def, mul_comm]
_ = x := by rw [map_smul, e.symm_apply_apply, smul_eq_mul, mul_one]
right_inv x := calc
(algebraMap R A) (e.symm (e 1 * x))
= (algebraMap R A) (e.symm (e 1 * x)) * e (e.symm 1 • 1) := by
rw [smul_eq_mul, mul_one, e.apply_symm_apply, mul_one]
_ = x := by rw [map_smul, Algebra.smul_def, mul_left_comm, ← Algebra.smul_def _ (e 1),
← map_smul, smul_eq_mul, mul_one, e.apply_symm_apply, ← mul_assoc, ← Algebra.smul_def,
← map_smul, smul_eq_mul, mul_one, e.apply_symm_apply, one_mul]
namespace LinearEquiv
variable {R S M₁ M₂ : Type*} [CommSemiring R] [AddCommMonoid M₁] [Module R M₁]
[AddCommMonoid M₂] [Module R M₂] [Semiring S] [Module S M₁] [Module S M₂]
[SMulCommClass S R M₁] [SMulCommClass S R M₂] [SMul R S] [IsScalarTower R S M₁]
[IsScalarTower R S M₂]
variable (R) in
/-- A linear equivalence of two modules induces an equivalence of algebras of their
endomorphisms. -/
@[simps!] def conjAlgEquiv (e : M₁ ≃ₗ[S] M₂) : Module.End S M₁ ≃ₐ[R] Module.End S M₂ where
__ := e.conjRingEquiv
commutes' _ := by ext; change e.restrictScalars R _ = _; simp
theorem conjAlgEquiv_apply (e : M₁ ≃ₗ[S] M₂) (f : Module.End S M₁) :
e.conjAlgEquiv R f = e.toLinearMap ∘ₗ f ∘ₗ e.symm.toLinearMap := rfl
theorem symm_conjAlgEquiv (e : M₁ ≃ₗ[S] M₂) : (e.conjAlgEquiv R).symm = e.symm.conjAlgEquiv R := rfl
end LinearEquiv
¤ Dauer der Verarbeitung: 0.32 Sekunden
¤
*© Formatika GbR, Deutschland
|
|
2026-11-24
|
|
|
|
|