Module docstring
{"# 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 ","#### Semiring structure ","#### Derived instances ","#### Copies of ext lemmas and bundled singles from Finsupp
As MonoidAlgebra is a type synonym, ext will not unfold it to find ext lemmas.
We need bundled version of Finsupp.single with the right types to state these lemmas.
It is good practice to have those, regardless of the ext issue.
","#### Non-unital, non-associative algebra structure ","### Additive monoids ","#### Semiring structure ","#### Derived instances ","It is hard to state the equivalent of DistribMulAction G k[G]
because we've never discussed actions of additive groups. ","#### Copies of ext lemmas and bundled singles from Finsupp
As AddMonoidAlgebra is a type synonym, ext will not unfold it to find ext lemmas.
We need bundled version of Finsupp.single with the right types to state these lemmas.
It is good practice to have those, regardless of the ext issue.
","#### Non-unital, non-associative algebra structure ","#### Algebra structure "}