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 a monoid M.
The "group ring" ℤ[G] or the "group algebra" k[G] are typical uses.
In fact the construction of the "monoid algebra" makes sense when M is not even a monoid, but
merely a magma, i.e., when M 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 R M := M →₀ R, and AddMonoidAlgebra R M
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 (σ →₀ ℕ)
Note: Polynomial R is currently a wrapper around AddMonoidAlgebra R ℕ and not defeq to it.
There is ongoing work to make it defeq.
See https://github.com/leanprover-community/mathlib4/pull/25273
When the domain is multiplicative, e.g. a group, this will be used to define the group ring.
Notation #
We introduce the notation R[M] for both MonoidAlgebra R M and AddMonoidAlgebra R M.
The notations are scoped to their respective namespaces, and which one R[M] resolves to therefore
depends on which of the two namespaces is open.
TODO #
Use coeff/ofCoeff more widely. See
https://github.com/leanprover-community/mathlib4/pull/36746
https://github.com/leanprover-community/mathlib4/pull/25273
The monoid algebra over a semiring R generated by the monoid M.
It is the type of finite formal R-linear combinations of terms of M,
endowed with the convolution product.
Instances For
The additive monoid algebra over a semiring R generated by the additive monoid M.
It is the type of finite formal R-linear combinations of terms of M,
endowed with the convolution product.
Instances For
The additive monoid algebra over a semiring R generated by the additive monoid M.
It is the type of finite formal R-linear combinations of terms of M,
endowed with the convolution product.
Instances For
Unexpander for AddMonoidAlgebra.
Instances For
The monoid algebra over a semiring R generated by the monoid M.
It is the type of finite formal R-linear combinations of terms of M,
endowed with the convolution product.
Instances For
Unexpander for MonoidAlgebra.
Instances For
Construct an element of the monoid algebra R[M] from its coefficients M →₀ R.
Instances For
Construct an element of the additive monoid algebra R[M] from its coefficients M →₀ R.
Instances For
The coefficients M →₀ R of an element of the monoid algebra R[M].
Instances For
The coefficients M →₀ R of an element of the additive monoid algebra R[M].
Instances For
MonoidAlgebra.coeff as an equiv.
Instances For
AddMonoidAlgebra.coeff as an equiv.
Instances For
A copy of Finsupp.ext for MonoidAlgebra.
A copy of Finsupp.ext for AddMonoidAlgebra.
MonoidAlgebra.coeff as an AddEquiv.
Instances For
AddMonoidAlgebra.coeff as an AddEquiv.
Instances For
MonoidAlgebra.single m r for m : M, r : R is the element rm : R[M].
Instances For
AddMonoidAlgebra.single m r for m : M, r : R is the element rm : R[M].
Instances For
Remove a term from an element of the monoid algebra.
Instances For
Remove a term from an element of the additive monoid algebra.
Instances For
Replace the m-th coefficient of an element x of the monoid algebra by a given value r : R.
If r = 0, this is equal to x.erase m.
Instances For
Replace the m-th coefficient of an element x of the monoid algebra by a given value r : R.
If r = 0, this is equal to x.erase m.
Instances For
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.
MonoidAlgebra.single as an AddMonoidHom.
TODO: Rename to singleAddMonoidHom.
Instances For
AddMonoidAlgebra.single as an AddMonoidHom.
TODO: Rename to singleAddMonoidHom.
Instances For
If two additive homomorphisms from R[M] are equal on each single r m,
then they are equal.
We formulate this using equality of AddMonoidHoms so that ext tactic can apply a type-specific
extensionality lemma after this one. E.g., if the fiber M is ℕ or ℤ, then it suffices to
verify f (single a 1) = g (single a 1).
TODO: Rename to addMonoidHom_ext'.
If two additive homomorphisms from R[M] are equal on each single r m, then they are equal.
We formulate this using equality of AddMonoidHoms so that ext tactic can apply a type-specific
extensionality lemma after this one. E.g., if the fiber M is ℕ or ℤ, then it suffices to
verify f (single a 1) = g (single a 1).
TODO: Rename to addMonoidHom_ext'.
The unit of the multiplication is single 1 1,
i.e. the function that is 1 at 1 and 0 elsewhere.
The unit of the multiplication is single 1 1,
i.e. the function that is 1 at 1 and 0 elsewhere.
The multiplication in a monoid algebra.
We make it irreducible so that Lean doesn't unfold it when trying to unify two different things.
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.)
The product of x y : R[M] is the finitely supported function whose value at m
is the sum of x m₁ * y m₂ over all pairs m₁, m₂ such that m₁ * m₂ = m.
(Think of the group ring of a group.)
The embedding of a magma into its magma algebra.
Instances For
The embedding of a unital magma into its magma algebra.
Instances For
MonoidAlgebra.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
MonoidAlgebra.single.
Instances For
MonoidAlgebra.single 1 as a RingHom
Instances For
AddMonoidAlgebra.single 1 as a RingHom
Instances For
If two ring homomorphisms from R[M] are equal on all single m 1 and
single 1 r, then they are equal.
If two ring homomorphisms from R[M] are equal on all single m 1 and single 0 r,
then they are equal.
If two ring homomorphisms from R[M] are equal on all single m 1
and single 1 r, then they are equal.
See note [partially-applied ext lemmas].
Additive monoids #
The embedding of an additive magma into its additive magma algebra.
Instances For
Embedding of a magma with zero into its magma algebra.
Instances For
Embedding of a magma with zero M, into its magma algebra, having M as source.
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.
Instances For
If two ring homomorphisms from R[M] are equal on all single m 1
and single 0 r, then they are equal.
See note [partially-applied ext lemmas].