Commit 2024-04-05 00:53 8b50609c
View on Github →feat: MulActionHom in the semilinear style (#6057)
Generalize MulActionHom
so that it allows two different monoids acting, related by a morphism. This is inspired by the treatment of (semi)linear maps in mathlib, and allows to refactor them.
Let M
, N
, X
, Y
be types, with SMul M X
and SMul N Y
, and let φ : M → N
be a map.
MulActionHom φ X Y
, the type of equivariant functions fromX
toY
, consists of functionsf : X → Y
such thatf (m • x) = (φ m) • (f x)
for allm : M
andx : X
. Assume that we haveMonoid M
,Monoid N
and thatφ : M →* N
. ForA
,B
by types withAddMonoid A
andAddMonoid B
, endowed withDistribMulAction M A
andDistribMulAction M B
:DistribMulActionHom φ A B
is the type of equivariant additive monoid homomorphisms fromA
toB
. Similarly, whenR
andS
are types withSemiring R
,Semiring S
,MulSemiringAction M R
andMulSemiringAction N S
SMulSemiringHom φ R S
is the type of equivariant ring homomorphisms fromR
toS
. The above types have corresponding classes:MulActionHomClass F φ X Y
states thatF
is a type of bundledX → Y
homs which areφ
-equivariantDistribMulActionHomClass F φ A B
states thatF
is a type of bundledA → B
homs preserving the additive monoid structure andφ
-equivariantSMulSemiringHomClass F φ R S
states thatF
is a type of bundledR → S
homs preserving the ring structure andφ
-equivariant
Notation
We introduce the following notation to code equivariant maps
(the subscript index ₑ
is for equivariant) :
X →ₑ[φ] Y
isMulActionHom φ X Y
.A →ₑ+[φ] B
isDistribMulActionHom φ A B
.R →ₑ+*[φ] S
isMulSemiringActionHom φ R S
. WhenM = N
andφ = MonoidHom.id M
, we provide the backward compatible notation :X →[M] Y
isMulActionHom (@id M) X Y
A →+[M] B
isDistribMulActionHom (MonoidHom.id M) A B
R →+*[M] S
isMulSemiringActionHom (MonoidHom.id M) R S
This more general definition is propagated all over mathlib, in particular toLinearMap
. The treatment of composition of equivariant maps is inspired by that of semilinear maps. We provide classesCompTriple
andMonoidHom.CompTriple
of “composable triples`, and various instances for them.