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
- MonoidAlgebra.coeFun k G = inferInstanceAs (CoeFun (G →₀ k) fun (x : G →₀ k) => G → k)
MonoidAlgebra.single a r
for a : M
, r : R
is the element ar : R[M]
.
Equations
- MonoidAlgebra.single a b = Finsupp.single a b
Instances For
The multiplication in a monoid algebra. We make it irreducible so that Lean doesn't unfold it trying to unify two things that are different.
Equations
- f.mul' g = Finsupp.sum f fun (a₁ : G) (b₁ : k) => Finsupp.sum g fun (a₂ : G) (b₂ : k) => MonoidAlgebra.single (a₁ * a₂) (b₁ * b₂)
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
- MonoidAlgebra.instMul = { mul := MonoidAlgebra.mul' }
Equations
- MonoidAlgebra.nonUnitalNonAssocSemiring = { toAddCommMonoid := Finsupp.instAddCommMonoid, toMul := MonoidAlgebra.instMul, left_distrib := ⋯, right_distrib := ⋯, zero_mul := ⋯, mul_zero := ⋯ }
Equations
- MonoidAlgebra.nonUnitalSemiring = { toNonUnitalNonAssocSemiring := MonoidAlgebra.nonUnitalNonAssocSemiring, mul_assoc := ⋯ }
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
- One or more equations did not get rendered due to their size.
Basic scalar multiplication instances #
This section collects instances needed for the algebraic structure of Polynomial
,
which is defined in terms of MonoidAlgebra
.
Further results on scalar multiplication can be found in
Mathlib/Algebra/MonoidAlgebra/Module.lean
.
Equations
Semiring structure #
Equations
- One or more equations did not get rendered due to their size.
Equations
- MonoidAlgebra.nonUnitalCommSemiring = { toNonUnitalSemiring := MonoidAlgebra.nonUnitalSemiring, mul_comm := ⋯ }
Derived instances #
Equations
- One or more equations did not get rendered due to their size.
Equations
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Copies of ext
lemmas and bundled single
s 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.
A copy of Finsupp.ext
for MonoidAlgebra
.
A copy of Finsupp.singleAddHom
for MonoidAlgebra
.
Equations
Instances For
A copy of Finsupp.addHom_ext'
for MonoidAlgebra
.
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 = { 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 = { toFun := fun (a : k × G) => MonoidAlgebra.single a.2 a.1, map_one' := ⋯, map_mul' := ⋯ }
Instances For
Finsupp.single 1
as a RingHom
Equations
- MonoidAlgebra.singleOneRingHom = { toFun := MonoidAlgebra.single 1, map_one' := ⋯, map_mul' := ⋯, map_zero' := ⋯, map_add' := ⋯ }
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].
Additive monoids #
The monoid algebra over a semiring k
generated by the additive monoid G
, denoted by k[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
, denoted by k[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
Unexpander for AddMonoidAlgebra
.
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
- AddMonoidAlgebra.coeFun k G = inferInstanceAs (CoeFun (G →₀ k) fun (x : G →₀ k) => G → k)
MonoidAlgebra.single a r
for a : M
, r : R
is the element ar : R[M]
.
Equations
- AddMonoidAlgebra.single a b = Finsupp.single a b
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
- AddMonoidAlgebra.hasMul = { mul := fun (f g : AddMonoidAlgebra k G) => MonoidAlgebra.mul' f g }
Equations
- One or more equations did not get rendered due to their size.
The unit of the multiplication is single 0 1
, i.e. the function
that is 1
at 0
and zero elsewhere.
Equations
- AddMonoidAlgebra.one = { one := AddMonoidAlgebra.single 0 1 }
Equations
- AddMonoidAlgebra.nonUnitalSemiring = { toNonUnitalNonAssocSemiring := AddMonoidAlgebra.nonUnitalNonAssocSemiring, mul_assoc := ⋯ }
Equations
- One or more equations did not get rendered due to their size.
Basic scalar multiplication instances #
The SMul
section for MonoidAlgebra
collects instances needed
for the algebraic structure of Polynomial
, which is defined in terms
of MonoidAlgebra
. This section mirrors the MonoidAlgebra
section.
Further results on scalar multiplication can be found in
Mathlib/Algebra/MonoidAlgebra/Module.lean
.
Equations
Semiring structure #
Equations
- One or more equations did not get rendered due to their size.
Equations
- AddMonoidAlgebra.nonUnitalCommSemiring = { toNonUnitalSemiring := AddMonoidAlgebra.nonUnitalSemiring, mul_comm := ⋯ }
Derived instances #
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Copies of ext
lemmas and bundled single
s 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.
A copy of Finsupp.ext
for AddMonoidAlgebra
.
A copy of Finsupp.singleAddHom
for AddMonoidAlgebra
.
Equations
Instances For
A copy of Finsupp.addHom_ext'
for AddMonoidAlgebra
.
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 = { 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
- AddMonoidAlgebra.singleHom = { toFun := fun (a : k × Multiplicative G) => AddMonoidAlgebra.single (Multiplicative.toAdd a.2) a.1, map_one' := ⋯, map_mul' := ⋯ }
Instances For
Copy of Finsupp.smul_single'
that avoids the AddMonoidAlgebra = Finsupp
defeq abuse.
Algebra structure #
Finsupp.single 0
as a RingHom
Equations
- AddMonoidAlgebra.singleZeroRingHom = { toFun := AddMonoidAlgebra.single 0, map_one' := ⋯, map_mul' := ⋯, map_zero' := ⋯, map_add' := ⋯ }
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].