Datasets:
Tasks:
Text Generation
Modalities:
Text
Sub-tasks:
language-modeling
Languages:
English
Size:
100K - 1M
License:
/- | |
Copyright (c) 2020 Kenny Lau. All rights reserved. | |
Released under Apache 2.0 license as described in the file LICENSE. | |
Authors: Kenny Lau | |
-/ | |
import algebra.group_ring_action | |
import group_theory.group_action.defs | |
/-! | |
# Equivariant homomorphisms | |
## Main definitions | |
* `mul_action_hom M X Y`, the type of equivariant functions from `X` to `Y`, where `M` is a monoid | |
that acts on the types `X` and `Y`. | |
* `distrib_mul_action_hom M A B`, the type of equivariant additive monoid homomorphisms | |
from `A` to `B`, where `M` is a monoid that acts on the additive monoids `A` and `B`. | |
* `mul_semiring_action_hom M R S`, the type of equivariant ring homomorphisms | |
from `R` to `S`, where `M` is a monoid that acts on the rings `R` and `S`. | |
The above types have corresponding classes: | |
* `smul_hom_class F M X Y` states that `F` is a type of bundled `X β Y` homs | |
preserving scalar multiplication by `M` | |
* `distrib_mul_action_hom_class F M A B` states that `F` is a type of bundled `A β B` homs | |
preserving the additive monoid structure and scalar multiplication by `M` | |
* `mul_semiring_action_hom_class F M R S` states that `F` is a type of bundled `R β S` homs | |
preserving the ring structure and scalar multiplication by `M` | |
## Notations | |
* `X β[M] Y` is `mul_action_hom M X Y`. | |
* `A β+[M] B` is `distrib_mul_action_hom M A B`. | |
* `R β+*[M] S` is `mul_semiring_action_hom M R S`. | |
-/ | |
variables (M' : Type*) | |
variables (X : Type*) [has_smul M' X] | |
variables (Y : Type*) [has_smul M' Y] | |
variables (Z : Type*) [has_smul M' Z] | |
variables (M : Type*) [monoid M] | |
variables (A : Type*) [add_monoid A] [distrib_mul_action M A] | |
variables (A' : Type*) [add_group A'] [distrib_mul_action M A'] | |
variables (B : Type*) [add_monoid B] [distrib_mul_action M B] | |
variables (B' : Type*) [add_group B'] [distrib_mul_action M B'] | |
variables (C : Type*) [add_monoid C] [distrib_mul_action M C] | |
variables (R : Type*) [semiring R] [mul_semiring_action M R] | |
variables (R' : Type*) [ring R'] [mul_semiring_action M R'] | |
variables (S : Type*) [semiring S] [mul_semiring_action M S] | |
variables (S' : Type*) [ring S'] [mul_semiring_action M S'] | |
variables (T : Type*) [semiring T] [mul_semiring_action M T] | |
variables (G : Type*) [group G] (H : subgroup G) | |
set_option old_structure_cmd true | |
/-- Equivariant functions. -/ | |
@[nolint has_nonempty_instance] | |
structure mul_action_hom := | |
(to_fun : X β Y) | |
(map_smul' : β (m : M') (x : X), to_fun (m β’ x) = m β’ to_fun x) | |
notation X ` β[`:25 M:25 `] `:0 Y:0 := mul_action_hom M X Y | |
/-- `smul_hom_class F M X Y` states that `F` is a type of morphisms preserving | |
scalar multiplication by `M`. | |
You should extend this class when you extend `mul_action_hom`. -/ | |
class smul_hom_class (F : Type*) (M X Y : out_param $ Type*) [has_smul M X] [has_smul M Y] | |
extends fun_like F X (Ξ» _, Y) := | |
(map_smul : β (f : F) (c : M) (x : X), f (c β’ x) = c β’ f x) | |
-- `M` becomes a metavariable but it's an `out_param` so it's not a problem. | |
attribute [nolint dangerous_instance] smul_hom_class.to_fun_like | |
export smul_hom_class (map_smul) | |
attribute [simp] map_smul | |
namespace mul_action_hom | |
instance : has_coe_to_fun (X β[M'] Y) (Ξ» _, X β Y) := β¨mul_action_hom.to_funβ© | |
instance : smul_hom_class (X β[M'] Y) M' X Y := | |
{ coe := mul_action_hom.to_fun, | |
coe_injective' := Ξ» f g h, by cases f; cases g; congr', | |
map_smul := mul_action_hom.map_smul' } | |
variables {M M' X Y} | |
protected lemma map_smul (f : X β[M'] Y) (m : M') (x : X) : f (m β’ x) = m β’ f x := map_smul _ _ _ | |
@[ext] theorem ext : β {f g : X β[M'] Y}, (β x, f x = g x) β f = g := fun_like.ext | |
theorem ext_iff {f g : X β[M'] Y} : f = g β β x, f x = g x := fun_like.ext_iff | |
protected lemma congr_fun {f g : X β[M'] Y} (h : f = g) (x : X) : f x = g x := | |
fun_like.congr_fun h _ | |
variables (M M') {X} | |
/-- The identity map as an equivariant map. -/ | |
protected def id : X β[M'] X := | |
β¨id, Ξ» _ _, rflβ© | |
@[simp] lemma id_apply (x : X) : mul_action_hom.id M' x = x := rfl | |
variables {M M' X Y Z} | |
/-- Composition of two equivariant maps. -/ | |
def comp (g : Y β[M'] Z) (f : X β[M'] Y) : X β[M'] Z := | |
β¨g β f, Ξ» m x, calc | |
g (f (m β’ x)) = g (m β’ f x) : by rw f.map_smul | |
... = m β’ g (f x) : g.map_smul _ _β© | |
@[simp] lemma comp_apply (g : Y β[M'] Z) (f : X β[M'] Y) (x : X) : g.comp f x = g (f x) := rfl | |
@[simp] lemma id_comp (f : X β[M'] Y) : (mul_action_hom.id M').comp f = f := | |
ext $ Ξ» x, by rw [comp_apply, id_apply] | |
@[simp] lemma comp_id (f : X β[M'] Y) : f.comp (mul_action_hom.id M') = f := | |
ext $ Ξ» x, by rw [comp_apply, id_apply] | |
variables {A B} | |
/-- The inverse of a bijective equivariant map is equivariant. -/ | |
@[simps] def inverse (f : A β[M] B) (g : B β A) | |
(hβ : function.left_inverse g f) (hβ : function.right_inverse g f) : | |
B β[M] A := | |
{ to_fun := g, | |
map_smul' := Ξ» m x, | |
calc g (m β’ x) = g (m β’ (f (g x))) : by rw hβ | |
... = g (f (m β’ (g x))) : by rw f.map_smul | |
... = m β’ g x : by rw hβ, } | |
end mul_action_hom | |
/-- Equivariant additive monoid homomorphisms. -/ | |
structure distrib_mul_action_hom extends A β[M] B, A β+ B. | |
/-- Reinterpret an equivariant additive monoid homomorphism as an additive monoid homomorphism. -/ | |
add_decl_doc distrib_mul_action_hom.to_add_monoid_hom | |
/-- Reinterpret an equivariant additive monoid homomorphism as an equivariant function. -/ | |
add_decl_doc distrib_mul_action_hom.to_mul_action_hom | |
notation A ` β+[`:25 M:25 `] `:0 B:0 := distrib_mul_action_hom M A B | |
/-- `distrib_mul_action_hom_class F M A B` states that `F` is a type of morphisms preserving | |
the additive monoid structure and scalar multiplication by `M`. | |
You should extend this class when you extend `distrib_mul_action_hom`. -/ | |
class distrib_mul_action_hom_class (F : Type*) (M A B : out_param $ Type*) | |
[monoid M] [add_monoid A] [add_monoid B] [distrib_mul_action M A] [distrib_mul_action M B] | |
extends smul_hom_class F M A B, add_monoid_hom_class F A B | |
-- `M` becomes a metavariable but it's an `out_param` so it's not a problem. | |
attribute [nolint dangerous_instance] distrib_mul_action_hom_class.to_add_monoid_hom_class | |
namespace distrib_mul_action_hom | |
instance has_coe : has_coe (A β+[M] B) (A β+ B) := | |
β¨to_add_monoid_homβ© | |
instance has_coe' : has_coe (A β+[M] B) (A β[M] B) := | |
β¨to_mul_action_homβ© | |
instance : has_coe_to_fun (A β+[M] B) (Ξ» _, A β B) := β¨to_funβ© | |
instance : distrib_mul_action_hom_class (A β+[M] B) M A B := | |
{ coe := distrib_mul_action_hom.to_fun, | |
coe_injective' := Ξ» f g h, by cases f; cases g; congr', | |
map_smul := distrib_mul_action_hom.map_smul', | |
map_zero := distrib_mul_action_hom.map_zero', | |
map_add := distrib_mul_action_hom.map_add' } | |
variables {M A B} | |
@[simp] lemma to_fun_eq_coe (f : A β+[M] B) : f.to_fun = βf := rfl | |
@[norm_cast] lemma coe_fn_coe (f : A β+[M] B) : ((f : A β+ B) : A β B) = f := rfl | |
@[norm_cast] lemma coe_fn_coe' (f : A β+[M] B) : ((f : A β[M] B) : A β B) = f := rfl | |
@[ext] theorem ext : β {f g : A β+[M] B}, (β x, f x = g x) β f = g := fun_like.ext | |
theorem ext_iff {f g : A β+[M] B} : f = g β β x, f x = g x := fun_like.ext_iff | |
protected lemma congr_fun {f g : A β+[M] B} (h : f = g) (x : A) : f x = g x := | |
fun_like.congr_fun h _ | |
lemma to_mul_action_hom_injective {f g : A β+[M] B} | |
(h : (f : A β[M] B) = (g : A β[M] B)) : f = g := | |
by { ext a, exact mul_action_hom.congr_fun h a, } | |
lemma to_add_monoid_hom_injective {f g : A β+[M] B} | |
(h : (f : A β+ B) = (g : A β+ B)) : f = g := | |
by { ext a, exact add_monoid_hom.congr_fun h a, } | |
protected lemma map_zero (f : A β+[M] B) : f 0 = 0 := map_zero _ | |
protected lemma map_add (f : A β+[M] B) (x y : A) : f (x + y) = f x + f y := map_add _ _ _ | |
protected lemma map_neg (f : A' β+[M] B') (x : A') : f (-x) = -f x := map_neg _ _ | |
protected lemma map_sub (f : A' β+[M] B') (x y : A') : f (x - y) = f x - f y := map_sub _ _ _ | |
protected lemma map_smul (f : A β+[M] B) (m : M) (x : A) : f (m β’ x) = m β’ f x := map_smul _ _ _ | |
variables (M) {A} | |
/-- The identity map as an equivariant additive monoid homomorphism. -/ | |
protected def id : A β+[M] A := | |
β¨id, Ξ» _ _, rfl, rfl, Ξ» _ _, rflβ© | |
@[simp] lemma id_apply (x : A) : distrib_mul_action_hom.id M x = x := rfl | |
variables {M A B C} | |
instance : has_zero (A β+[M] B) := | |
β¨{ map_smul' := by simp, | |
.. (0 : A β+ B) }β© | |
instance : has_one (A β+[M] A) := β¨distrib_mul_action_hom.id Mβ© | |
@[simp] lemma coe_zero : ((0 : A β+[M] B) : A β B) = 0 := rfl | |
@[simp] lemma coe_one : ((1 : A β+[M] A) : A β A) = id := rfl | |
lemma zero_apply (a : A) : (0 : A β+[M] B) a = 0 := rfl | |
lemma one_apply (a : A) : (1 : A β+[M] A) a = a := rfl | |
instance : inhabited (A β+[M] B) := β¨0β© | |
/-- Composition of two equivariant additive monoid homomorphisms. -/ | |
def comp (g : B β+[M] C) (f : A β+[M] B) : A β+[M] C := | |
{ .. mul_action_hom.comp (g : B β[M] C) (f : A β[M] B), | |
.. add_monoid_hom.comp (g : B β+ C) (f : A β+ B), } | |
@[simp] lemma comp_apply (g : B β+[M] C) (f : A β+[M] B) (x : A) : g.comp f x = g (f x) := rfl | |
@[simp] lemma id_comp (f : A β+[M] B) : (distrib_mul_action_hom.id M).comp f = f := | |
ext $ Ξ» x, by rw [comp_apply, id_apply] | |
@[simp] lemma comp_id (f : A β+[M] B) : f.comp (distrib_mul_action_hom.id M) = f := | |
ext $ Ξ» x, by rw [comp_apply, id_apply] | |
/-- The inverse of a bijective `distrib_mul_action_hom` is a `distrib_mul_action_hom`. -/ | |
@[simps] def inverse (f : A β+[M] B) (g : B β A) | |
(hβ : function.left_inverse g f) (hβ : function.right_inverse g f) : | |
B β+[M] A := | |
{ to_fun := g, | |
.. (f : A β+ B).inverse g hβ hβ, | |
.. (f : A β[M] B).inverse g hβ hβ } | |
section semiring | |
variables {R M'} [add_monoid M'] [distrib_mul_action R M'] | |
@[ext] lemma ext_ring | |
{f g : R β+[R] M'} (h : f 1 = g 1) : f = g := | |
by { ext x, rw [β mul_one x, β smul_eq_mul R, f.map_smul, g.map_smul, h], } | |
lemma ext_ring_iff {f g : R β+[R] M'} : f = g β f 1 = g 1 := | |
β¨Ξ» h, h βΈ rfl, ext_ringβ© | |
end semiring | |
end distrib_mul_action_hom | |
/-- Equivariant ring homomorphisms. -/ | |
@[nolint has_nonempty_instance] | |
structure mul_semiring_action_hom extends R β+[M] S, R β+* S. | |
/-- Reinterpret an equivariant ring homomorphism as a ring homomorphism. -/ | |
add_decl_doc mul_semiring_action_hom.to_ring_hom | |
/-- Reinterpret an equivariant ring homomorphism as an equivariant additive monoid homomorphism. -/ | |
add_decl_doc mul_semiring_action_hom.to_distrib_mul_action_hom | |
notation R ` β+*[`:25 M:25 `] `:0 S:0 := mul_semiring_action_hom M R S | |
/-- `mul_semiring_action_hom_class F M R S` states that `F` is a type of morphisms preserving | |
the ring structure and scalar multiplication by `M`. | |
You should extend this class when you extend `mul_semiring_action_hom`. -/ | |
class mul_semiring_action_hom_class (F : Type*) (M R S : out_param $ Type*) | |
[monoid M] [semiring R] [semiring S] [distrib_mul_action M R] [distrib_mul_action M S] | |
extends distrib_mul_action_hom_class F M R S, ring_hom_class F R S | |
-- `M` becomes a metavariable but it's an `out_param` so it's not a problem. | |
attribute [nolint dangerous_instance] mul_semiring_action_hom_class.to_ring_hom_class | |
namespace mul_semiring_action_hom | |
instance has_coe : has_coe (R β+*[M] S) (R β+* S) := | |
β¨to_ring_homβ© | |
instance has_coe' : has_coe (R β+*[M] S) (R β+[M] S) := | |
β¨to_distrib_mul_action_homβ© | |
instance : has_coe_to_fun (R β+*[M] S) (Ξ» _, R β S) := β¨Ξ» c, c.to_funβ© | |
instance : mul_semiring_action_hom_class (R β+*[M] S) M R S := | |
{ coe := mul_semiring_action_hom.to_fun, | |
coe_injective' := Ξ» f g h, by cases f; cases g; congr', | |
map_smul := mul_semiring_action_hom.map_smul', | |
map_zero := mul_semiring_action_hom.map_zero', | |
map_add := mul_semiring_action_hom.map_add', | |
map_one := mul_semiring_action_hom.map_one', | |
map_mul := mul_semiring_action_hom.map_mul' } | |
variables {M R S} | |
@[norm_cast] lemma coe_fn_coe (f : R β+*[M] S) : ((f : R β+* S) : R β S) = f := rfl | |
@[norm_cast] lemma coe_fn_coe' (f : R β+*[M] S) : ((f : R β+[M] S) : R β S) = f := rfl | |
@[ext] theorem ext : β {f g : R β+*[M] S}, (β x, f x = g x) β f = g := fun_like.ext | |
theorem ext_iff {f g : R β+*[M] S} : f = g β β x, f x = g x := fun_like.ext_iff | |
protected lemma map_zero (f : R β+*[M] S) : f 0 = 0 := map_zero _ | |
protected lemma map_add (f : R β+*[M] S) (x y : R) : f (x + y) = f x + f y := map_add _ _ _ | |
protected lemma map_neg (f : R' β+*[M] S') (x : R') : f (-x) = -f x := map_neg _ _ | |
protected lemma map_sub (f : R' β+*[M] S') (x y : R') : f (x - y) = f x - f y := map_sub _ _ _ | |
protected lemma map_one (f : R β+*[M] S) : f 1 = 1 := map_one _ | |
protected lemma map_mul (f : R β+*[M] S) (x y : R) : f (x * y) = f x * f y := map_mul _ _ _ | |
protected lemma map_smul (f : R β+*[M] S) (m : M) (x : R) : f (m β’ x) = m β’ f x := map_smul _ _ _ | |
variables (M) {R} | |
/-- The identity map as an equivariant ring homomorphism. -/ | |
protected def id : R β+*[M] R := | |
β¨id, Ξ» _ _, rfl, rfl, Ξ» _ _, rfl, rfl, Ξ» _ _, rflβ© | |
@[simp] lemma id_apply (x : R) : mul_semiring_action_hom.id M x = x := rfl | |
variables {M R S T} | |
/-- Composition of two equivariant additive monoid homomorphisms. -/ | |
def comp (g : S β+*[M] T) (f : R β+*[M] S) : R β+*[M] T := | |
{ .. distrib_mul_action_hom.comp (g : S β+[M] T) (f : R β+[M] S), | |
.. ring_hom.comp (g : S β+* T) (f : R β+* S), } | |
@[simp] lemma comp_apply (g : S β+*[M] T) (f : R β+*[M] S) (x : R) : g.comp f x = g (f x) := rfl | |
@[simp] lemma id_comp (f : R β+*[M] S) : (mul_semiring_action_hom.id M).comp f = f := | |
ext $ Ξ» x, by rw [comp_apply, id_apply] | |
@[simp] lemma comp_id (f : R β+*[M] S) : f.comp (mul_semiring_action_hom.id M) = f := | |
ext $ Ξ» x, by rw [comp_apply, id_apply] | |
end mul_semiring_action_hom | |
section | |
variables (M) {R'} (U : subring R') [is_invariant_subring M U] | |
/-- The canonical inclusion from an invariant subring. -/ | |
def is_invariant_subring.subtype_hom : U β+*[M] R' := | |
{ map_smul' := Ξ» m s, rfl, ..U.subtype } | |
@[simp] theorem is_invariant_subring.coe_subtype_hom : | |
(is_invariant_subring.subtype_hom M U : U β R') = coe := rfl | |
@[simp] theorem is_invariant_subring.coe_subtype_hom' : | |
(is_invariant_subring.subtype_hom M U : U β+* R') = U.subtype := rfl | |
end | |