Monoid algebras #
When the domain of a Finsupp
has a multiplicative or additive structure, we can define
a convolution product. To mathematicians this structure is known as the "monoid algebra",
i.e. the finite formal linear combinations over a given semiring of elements of the monoid.
The "group ring" ℤ[G] or the "group algebra" k[G] are typical uses.
In fact the construction of the "monoid algebra" makes sense when G
is not even a monoid, but
merely a magma, i.e., when G
carries a multiplication which is not required to satisfy any
conditions at all. In this case the construction yields a not-necessarily-unital,
not-necessarily-associative algebra but it is still adjoint to the forgetful functor from such
algebras to magmas, and we prove this as MonoidAlgebra.liftMagma
.
In this file we define MonoidAlgebra k G := G →₀ k
, and AddMonoidAlgebra k G
in the same way, and then define the convolution product on these.
When the domain is additive, this is used to define polynomials:
Polynomial R := AddMonoidAlgebra R ℕ
MvPolynomial σ α := AddMonoidAlgebra R (σ →₀ ℕ)
When the domain is multiplicative, e.g. a group, this will be used to define the group ring.
Notation #
We introduce the notation R[A]
for AddMonoidAlgebra R A
.
Implementation note #
Unfortunately because additive and multiplicative structures both appear in both cases,
it doesn't appear to be possible to make much use of to_additive
, and we just settle for
saying everything twice.
Similarly, I attempted to just define
k[G] := MonoidAlgebra k (Multiplicative G)
, but the definitional equality
Multiplicative G = G
leaks through everywhere, and seems impossible to use.
Multiplicative monoids #
The monoid algebra over a semiring k
generated by the monoid G
.
It is the type of finite formal k
-linear combinations of terms of G
,
endowed with the convolution product.
Equations
- MonoidAlgebra k G = (G →₀ k)
Instances For
Equations
- MonoidAlgebra.inhabited k G = inferInstanceAs (Inhabited (G →₀ k))
Equations
- MonoidAlgebra.addCommMonoid k G = inferInstanceAs (AddCommMonoid (G →₀ k))
Equations
- ⋯ = ⋯
Equations
- MonoidAlgebra.coeFun k G = Finsupp.instCoeFun
Equations
- MonoidAlgebra.single a b = Finsupp.single a b
Instances For
Equations
Instances For
A non-commutative version of MonoidAlgebra.lift
: given an additive homomorphism f : k →+ R
and a homomorphism g : G → R
, returns the additive homomorphism from
MonoidAlgebra k G
such that liftNC f g (single a b) = f b * g a
. If f
is a ring homomorphism
and the range of either f
or g
is in center of R
, then the result is a ring homomorphism. If
R
is a k
-algebra and f = algebraMap k R
, then the result is an algebra homomorphism called
MonoidAlgebra.lift
.
Equations
- MonoidAlgebra.liftNC f g = Finsupp.liftAddHom fun (x : G) => AddMonoidHom.comp (AddMonoidHom.mulRight (g x)) f
Instances For
The product of f g : MonoidAlgebra k G
is the finitely supported function
whose value at a
is the sum of f x * g y
over all pairs x, y
such that x * y = a
. (Think of the group ring of a group.)
Equations
- One or more equations did not get rendered due to their size.
Equations
- MonoidAlgebra.nonUnitalNonAssocSemiring = let __src := Finsupp.instAddCommMonoid; NonUnitalNonAssocSemiring.mk ⋯ ⋯ ⋯ ⋯
Equations
- MonoidAlgebra.nonUnitalSemiring = let __src := MonoidAlgebra.nonUnitalNonAssocSemiring; NonUnitalSemiring.mk ⋯
The unit of the multiplication is single 1 1
, i.e. the function
that is 1
at 1
and zero elsewhere.
Equations
- MonoidAlgebra.one = { one := MonoidAlgebra.single 1 1 }
Equations
- MonoidAlgebra.nonAssocSemiring = let __src := MonoidAlgebra.nonUnitalNonAssocSemiring; NonAssocSemiring.mk ⋯ ⋯ ⋯ ⋯
Semiring structure #
Equations
- MonoidAlgebra.semiring = let __src := MonoidAlgebra.nonUnitalSemiring; let __src_1 := MonoidAlgebra.nonAssocSemiring; Semiring.mk ⋯ ⋯ ⋯ ⋯ npowRec ⋯ ⋯
liftNC
as a RingHom
, for when f x
and g y
commute
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- MonoidAlgebra.nonUnitalCommSemiring = let __src := MonoidAlgebra.nonUnitalSemiring; NonUnitalCommSemiring.mk ⋯
Equations
- ⋯ = ⋯
Derived instances #
Equations
- MonoidAlgebra.commSemiring = let __src := MonoidAlgebra.nonUnitalCommSemiring; let __src_1 := MonoidAlgebra.semiring; CommSemiring.mk ⋯
Equations
- MonoidAlgebra.unique = Finsupp.uniqueOfRight
Equations
- MonoidAlgebra.addCommGroup = Finsupp.instAddCommGroup
Equations
- MonoidAlgebra.nonUnitalNonAssocRing = let __src := MonoidAlgebra.addCommGroup; let __src_1 := MonoidAlgebra.nonUnitalNonAssocSemiring; NonUnitalNonAssocRing.mk ⋯ ⋯ ⋯ ⋯
Equations
- MonoidAlgebra.nonUnitalRing = let __src := MonoidAlgebra.addCommGroup; let __src_1 := MonoidAlgebra.nonUnitalSemiring; NonUnitalRing.mk ⋯
Equations
- MonoidAlgebra.nonAssocRing = let __src := MonoidAlgebra.addCommGroup; let __src_1 := MonoidAlgebra.nonAssocSemiring; NonAssocRing.mk ⋯ ⋯ ⋯ ⋯ ⋯ ⋯
Equations
- MonoidAlgebra.nonUnitalCommRing = let __src := MonoidAlgebra.nonUnitalCommSemiring; let __src_1 := MonoidAlgebra.nonUnitalRing; NonUnitalCommRing.mk ⋯
Equations
- MonoidAlgebra.commRing = let __src := MonoidAlgebra.nonUnitalCommRing; let __src_1 := MonoidAlgebra.ring; CommRing.mk ⋯
Equations
- MonoidAlgebra.smulZeroClass = Finsupp.smulZeroClass
Equations
- MonoidAlgebra.distribSMul = Finsupp.distribSMul G k
Equations
- MonoidAlgebra.distribMulAction = Finsupp.distribMulAction G k
Equations
- MonoidAlgebra.module = Finsupp.module G k
Equations
- ⋯ = ⋯
Equations
- ⋯ = ⋯
Equations
- ⋯ = ⋯
Equations
- ⋯ = ⋯
This is not an instance as it conflicts with MonoidAlgebra.distribMulAction
when G = kˣ
.
Equations
- MonoidAlgebra.comapDistribMulActionSelf = Finsupp.comapDistribMulAction
Instances For
Like Finsupp.mapDomain_zero
, but for the 1
we define in this file
Like Finsupp.mapDomain_add
, but for the convolutive multiplication we define in this file
The embedding of a magma into its magma algebra.
Equations
- MonoidAlgebra.ofMagma k G = { toFun := fun (a : G) => MonoidAlgebra.single a 1, map_mul' := ⋯ }
Instances For
The embedding of a unital magma into its magma algebra.
Equations
- MonoidAlgebra.of k G = let __src := MonoidAlgebra.ofMagma k G; { toOneHom := { toFun := fun (a : G) => MonoidAlgebra.single a 1, map_one' := ⋯ }, map_mul' := ⋯ }
Instances For
Finsupp.single
as a MonoidHom
from the product type into the monoid algebra.
Note the order of the elements of the product are reversed compared to the arguments of
Finsupp.single
.
Equations
- MonoidAlgebra.singleHom = { toOneHom := { toFun := fun (a : k × G) => MonoidAlgebra.single a.2 a.1, map_one' := ⋯ }, map_mul' := ⋯ }
Instances For
Non-unital, non-associative algebra structure #
Equations
- ⋯ = ⋯
Note that if k
is a CommSemiring
then we have SMulCommClass k k k
and so we can take
R = k
in the below. In other words, if the coefficients are commutative amongst themselves, they
also commute with the algebra multiplication.
Equations
- ⋯ = ⋯
Equations
- ⋯ = ⋯
A non_unital k
-algebra homomorphism from MonoidAlgebra k G
is uniquely defined by its
values on the functions single a 1
.
See note [partially-applied ext lemmas].
The functor G ↦ MonoidAlgebra k G
, from the category of magmas to the category of non-unital,
non-associative algebras over k
is adjoint to the forgetful functor in the other direction.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Algebra structure #
Finsupp.single 1
as a RingHom
Equations
- MonoidAlgebra.singleOneRingHom = let __src := Finsupp.singleAddHom 1; { toMonoidHom := { toOneHom := { toFun := __src.toFun, map_one' := ⋯ }, map_mul' := ⋯ }, map_zero' := ⋯, map_add' := ⋯ }
Instances For
If f : G → H
is a multiplicative homomorphism between two monoids, then
Finsupp.mapDomain f
is a ring homomorphism between their monoid algebras.
Equations
- One or more equations did not get rendered due to their size.
Instances For
If two ring homomorphisms from MonoidAlgebra k G
are equal on all single a 1
and single 1 b
, then they are equal.
If two ring homomorphisms from MonoidAlgebra k G
are equal on all single a 1
and single 1 b
, then they are equal.
See note [partially-applied ext lemmas].
The instance Algebra k (MonoidAlgebra A G)
whenever we have Algebra k A
.
In particular this provides the instance Algebra k (MonoidAlgebra k G)
.
Equations
- MonoidAlgebra.algebra = let __src := RingHom.comp MonoidAlgebra.singleOneRingHom (algebraMap k A); Algebra.mk __src ⋯ ⋯
Finsupp.single 1
as an AlgHom
Equations
- MonoidAlgebra.singleOneAlgHom = let __src := MonoidAlgebra.singleOneRingHom; { toRingHom := __src, commutes' := ⋯ }
Instances For
liftNCRingHom
as an AlgHom
, for when f
is an AlgHom
Equations
- MonoidAlgebra.liftNCAlgHom f g h_comm = let __src := MonoidAlgebra.liftNCRingHom (↑f) g h_comm; { toRingHom := __src, commutes' := ⋯ }
Instances For
A k
-algebra homomorphism from MonoidAlgebra k G
is uniquely defined by its
values on the functions single a 1
.
See note [partially-applied ext lemmas].
Any monoid homomorphism G →* A
can be lifted to an algebra homomorphism
MonoidAlgebra k G →ₐ[k] A
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Decomposition of a k
-algebra homomorphism from MonoidAlgebra k G
by
its values on F (single a 1)
.
If f : G → H
is a homomorphism between two magmas, then
Finsupp.mapDomain f
is a non-unital algebra homomorphism between their magma algebras.
Equations
- One or more equations did not get rendered due to their size.
Instances For
If f : G → H
is a multiplicative homomorphism between two monoids, then
Finsupp.mapDomain f
is an algebra homomorphism between their monoid algebras.
Equations
- MonoidAlgebra.mapDomainAlgHom k A f = let __src := MonoidAlgebra.mapDomainRingHom A f; { toRingHom := __src, commutes' := ⋯ }
Instances For
If e : G ≃* H
is a multiplicative equivalence between two monoids, then
MonoidAlgebra.domCongr e
is an algebra equivalence between their monoid algebras.
Equations
- MonoidAlgebra.domCongr k A e = AlgEquiv.ofLinearEquiv (Finsupp.domLCongr ↑e) ⋯ ⋯
Instances For
When V
is a k[G]
-module, multiplication by a group element g
is a k
-linear map.
Equations
- MonoidAlgebra.GroupSMul.linearMap k V g = { toAddHom := { toFun := fun (v : V) => MonoidAlgebra.single g 1 • v, map_add' := ⋯ }, map_smul' := ⋯ }
Instances For
Build a k[G]
-linear map from a k
-linear map and evidence that it is G
-equivariant.
Equations
- MonoidAlgebra.equivariantOfLinearOfComm f h = { toAddHom := { toFun := ⇑f, map_add' := ⋯ }, map_smul' := ⋯ }
Instances For
The opposite of a MonoidAlgebra R I
equivalent as a ring to
the MonoidAlgebra Rᵐᵒᵖ Iᵐᵒᵖ
over the opposite ring, taking elements to their opposite.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A submodule over k
which is stable under scalar multiplication by elements of G
is a
submodule over MonoidAlgebra k G
Equations
- MonoidAlgebra.submoduleOfSMulMem W h = { toAddSubmonoid := { toAddSubsemigroup := { carrier := ↑W, add_mem' := ⋯ }, zero_mem' := ⋯ }, smul_mem' := ⋯ }
Instances For
Additive monoids #
The monoid algebra over a semiring k
generated by the additive monoid G
.
It is the type of finite formal k
-linear combinations of terms of G
,
endowed with the convolution product.
Equations
- AddMonoidAlgebra k G = (G →₀ k)
Instances For
The monoid algebra over a semiring k
generated by the additive monoid G
.
It is the type of finite formal k
-linear combinations of terms of G
,
endowed with the convolution product.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- AddMonoidAlgebra.inhabited k G = inferInstanceAs (Inhabited (G →₀ k))
Equations
- AddMonoidAlgebra.addCommMonoid k G = inferInstanceAs (AddCommMonoid (G →₀ k))
Equations
- ⋯ = ⋯
Equations
- AddMonoidAlgebra.coeFun k G = Finsupp.instCoeFun
Equations
- AddMonoidAlgebra.single a b = Finsupp.single a b
Instances For
Equations
Instances For
A non-commutative version of AddMonoidAlgebra.lift
: given an additive homomorphism
f : k →+ R
and a map g : Multiplicative G → R
, returns the additive
homomorphism from k[G]
such that liftNC f g (single a b) = f b * g a
. If f
is a ring homomorphism and the range of either f
or g
is in center of R
, then the result is a
ring homomorphism. If R
is a k
-algebra and f = algebraMap k R
, then the result is an algebra
homomorphism called AddMonoidAlgebra.lift
.
Equations
- AddMonoidAlgebra.liftNC f g = Finsupp.liftAddHom fun (x : G) => AddMonoidHom.comp (AddMonoidHom.mulRight (g (Multiplicative.ofAdd x))) f
Instances For
The product of f g : k[G]
is the finitely supported function
whose value at a
is the sum of f x * g y
over all pairs x, y
such that x + y = a
. (Think of the product of multivariate
polynomials where α
is the additive monoid of monomial exponents.)
Equations
- One or more equations did not get rendered due to their size.
Equations
- AddMonoidAlgebra.nonUnitalNonAssocSemiring = let __src := Finsupp.instAddCommMonoid; NonUnitalNonAssocSemiring.mk ⋯ ⋯ ⋯ ⋯
The unit of the multiplication is single 1 1
, i.e. the function
that is 1
at 0
and zero elsewhere.
Equations
- AddMonoidAlgebra.one = { one := AddMonoidAlgebra.single 0 1 }
Equations
- AddMonoidAlgebra.nonUnitalSemiring = let __src := AddMonoidAlgebra.nonUnitalNonAssocSemiring; NonUnitalSemiring.mk ⋯
Equations
- AddMonoidAlgebra.nonAssocSemiring = let __src := AddMonoidAlgebra.nonUnitalNonAssocSemiring; NonAssocSemiring.mk ⋯ ⋯ ⋯ ⋯
Semiring structure #
Equations
- AddMonoidAlgebra.smulZeroClass = Finsupp.smulZeroClass
Equations
- AddMonoidAlgebra.semiring = let __src := AddMonoidAlgebra.nonUnitalSemiring; let __src_1 := AddMonoidAlgebra.nonAssocSemiring; Semiring.mk ⋯ ⋯ ⋯ ⋯ npowRec ⋯ ⋯
liftNC
as a RingHom
, for when f
and g
commute
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- AddMonoidAlgebra.nonUnitalCommSemiring = let __src := AddMonoidAlgebra.nonUnitalSemiring; NonUnitalCommSemiring.mk ⋯
Equations
- ⋯ = ⋯
Derived instances #
Equations
- AddMonoidAlgebra.commSemiring = let __src := AddMonoidAlgebra.nonUnitalCommSemiring; let __src_1 := AddMonoidAlgebra.semiring; CommSemiring.mk ⋯
Equations
- AddMonoidAlgebra.unique = Finsupp.uniqueOfRight
Equations
- AddMonoidAlgebra.addCommGroup = Finsupp.instAddCommGroup
Equations
- AddMonoidAlgebra.nonUnitalNonAssocRing = let __src := AddMonoidAlgebra.addCommGroup; let __src_1 := AddMonoidAlgebra.nonUnitalNonAssocSemiring; NonUnitalNonAssocRing.mk ⋯ ⋯ ⋯ ⋯
Equations
- AddMonoidAlgebra.nonUnitalRing = let __src := AddMonoidAlgebra.addCommGroup; let __src_1 := AddMonoidAlgebra.nonUnitalSemiring; NonUnitalRing.mk ⋯
Equations
- AddMonoidAlgebra.nonAssocRing = let __src := AddMonoidAlgebra.addCommGroup; let __src_1 := AddMonoidAlgebra.nonAssocSemiring; NonAssocRing.mk ⋯ ⋯ ⋯ ⋯ ⋯ ⋯
Equations
- AddMonoidAlgebra.nonUnitalCommRing = let __src := AddMonoidAlgebra.nonUnitalCommSemiring; let __src_1 := AddMonoidAlgebra.nonUnitalRing; NonUnitalCommRing.mk ⋯
Equations
- AddMonoidAlgebra.commRing = let __src := AddMonoidAlgebra.nonUnitalCommRing; let __src_1 := AddMonoidAlgebra.ring; CommRing.mk ⋯
Equations
- AddMonoidAlgebra.distribSMul = Finsupp.distribSMul G k
Equations
- AddMonoidAlgebra.distribMulAction = Finsupp.distribMulAction G k
Equations
- ⋯ = ⋯
Equations
- AddMonoidAlgebra.module = Finsupp.module G k
Equations
- ⋯ = ⋯
Equations
- ⋯ = ⋯
Equations
- ⋯ = ⋯
It is hard to state the equivalent of DistribMulAction G k[G]
because we've never discussed actions of additive groups.
Like Finsupp.mapDomain_zero
, but for the 1
we define in this file
Like Finsupp.mapDomain_add
, but for the convolutive multiplication we define in this file
The embedding of an additive magma into its additive magma algebra.
Equations
- AddMonoidAlgebra.ofMagma k G = { toFun := fun (a : Multiplicative G) => AddMonoidAlgebra.single a 1, map_mul' := ⋯ }
Instances For
Embedding of a magma with zero into its magma algebra.
Equations
- AddMonoidAlgebra.of k G = let __src := AddMonoidAlgebra.ofMagma k G; { toOneHom := { toFun := fun (a : Multiplicative G) => AddMonoidAlgebra.single a 1, map_one' := ⋯ }, map_mul' := ⋯ }
Instances For
Embedding of a magma with zero G
, into its magma algebra, having G
as source.
Equations
- AddMonoidAlgebra.of' k G a = AddMonoidAlgebra.single a 1
Instances For
Finsupp.single
as a MonoidHom
from the product type into the additive monoid algebra.
Note the order of the elements of the product are reversed compared to the arguments of
Finsupp.single
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
If f : G → H
is an additive homomorphism between two additive monoids, then
Finsupp.mapDomain f
is a ring homomorphism between their add monoid algebras.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Conversions between AddMonoidAlgebra
and MonoidAlgebra
#
We have not defined k[G] = MonoidAlgebra k (Multiplicative G)
because historically this caused problems;
since the changes that have made nsmul
definitional, this would be possible,
but for now we just construct the ring isomorphisms using RingEquiv.refl _
.
The equivalence between AddMonoidAlgebra
and MonoidAlgebra
in terms of
Multiplicative
Equations
- One or more equations did not get rendered due to their size.
Instances For
The equivalence between MonoidAlgebra
and AddMonoidAlgebra
in terms of Additive
Equations
- One or more equations did not get rendered due to their size.
Instances For
Non-unital, non-associative algebra structure #
Equations
- ⋯ = ⋯
Note that if k
is a CommSemiring
then we have SMulCommClass k k k
and so we can take
R = k
in the below. In other words, if the coefficients are commutative amongst themselves, they
also commute with the algebra multiplication.
Equations
- ⋯ = ⋯
Equations
- ⋯ = ⋯
A non_unital k
-algebra homomorphism from k[G]
is uniquely defined by its
values on the functions single a 1
.
See note [partially-applied ext lemmas].
The functor G ↦ k[G]
, from the category of magmas to the category of
non-unital, non-associative algebras over k
is adjoint to the forgetful functor in the other
direction.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Algebra structure #
Finsupp.single 0
as a RingHom
Equations
- One or more equations did not get rendered due to their size.
Instances For
If two ring homomorphisms from k[G]
are equal on all single a 1
and single 0 b
, then they are equal.
If two ring homomorphisms from k[G]
are equal on all single a 1
and single 0 b
, then they are equal.
See note [partially-applied ext lemmas].
The opposite of an R[I]
is ring equivalent to
the AddMonoidAlgebra Rᵐᵒᵖ I
over the opposite ring, taking elements to their opposite.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The instance Algebra R k[G]
whenever we have Algebra R k
.
In particular this provides the instance Algebra k k[G]
.
Equations
- AddMonoidAlgebra.algebra = let __src := RingHom.comp AddMonoidAlgebra.singleZeroRingHom (algebraMap R k); Algebra.mk __src ⋯ ⋯
Finsupp.single 0
as an AlgHom
Equations
- AddMonoidAlgebra.singleZeroAlgHom = let __src := AddMonoidAlgebra.singleZeroRingHom; { toRingHom := __src, commutes' := ⋯ }
Instances For
liftNCRingHom
as an AlgHom
, for when f
is an AlgHom
Equations
- AddMonoidAlgebra.liftNCAlgHom f g h_comm = let __src := AddMonoidAlgebra.liftNCRingHom (↑f) g h_comm; { toRingHom := __src, commutes' := ⋯ }
Instances For
A k
-algebra homomorphism from k[G]
is uniquely defined by its
values on the functions single a 1
.
See note [partially-applied ext lemmas].
Any monoid homomorphism G →* A
can be lifted to an algebra homomorphism
k[G] →ₐ[k] A
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Decomposition of a k
-algebra homomorphism from MonoidAlgebra k G
by
its values on F (single a 1)
.
If f : G → H
is a homomorphism between two additive magmas, then Finsupp.mapDomain f
is a
non-unital algebra homomorphism between their additive magma algebras.
Equations
- One or more equations did not get rendered due to their size.
Instances For
If f : G → H
is an additive homomorphism between two additive monoids, then
Finsupp.mapDomain f
is an algebra homomorphism between their add monoid algebras.
Equations
- AddMonoidAlgebra.mapDomainAlgHom k A f = let __src := AddMonoidAlgebra.mapDomainRingHom A f; { toRingHom := __src, commutes' := ⋯ }
Instances For
If e : G ≃* H
is a multiplicative equivalence between two monoids, then
AddMonoidAlgebra.domCongr e
is an algebra equivalence between their monoid algebras.
Equations
- AddMonoidAlgebra.domCongr k A e = AlgEquiv.ofLinearEquiv (Finsupp.domLCongr ↑e) ⋯ ⋯
Instances For
The algebra equivalence between AddMonoidAlgebra
and MonoidAlgebra
in terms of
Multiplicative
.
Equations
- AddMonoidAlgebra.toMultiplicativeAlgEquiv k G = let __src := AddMonoidAlgebra.toMultiplicative k G; { toEquiv := __src.toEquiv, map_mul' := ⋯, map_add' := ⋯, commutes' := ⋯ }
Instances For
The algebra equivalence between MonoidAlgebra
and AddMonoidAlgebra
in terms of
Additive
.
Equations
- MonoidAlgebra.toAdditiveAlgEquiv k G = let __src := MonoidAlgebra.toAdditive k G; { toEquiv := __src.toEquiv, map_mul' := ⋯, map_add' := ⋯, commutes' := ⋯ }