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 and AddMonoidAlgebra R M as one-field structures around
M →₀ R, and then define the convolution product on these.
When the domain is additive, this is used to define polynomials:
Polynomial R := AddMonoidAlgebra R ℕ
MvPolynomial σ R := 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[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 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.
- ofCoeff :: (
The coefficients
M →₀ Rof an element of the additive monoid algebraR[M].- )
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.
- ofCoeff :: (
The coefficients
M →₀ Rof an element of the monoid algebraR[M].- )
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.
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
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.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Unexpander for MonoidAlgebra.
Equations
- One or more equations did not get rendered due to their size.
Instances For
MonoidAlgebra.coeff as an equiv.
Equations
- MonoidAlgebra.coeffEquiv = { toFun := MonoidAlgebra.coeff, invFun := MonoidAlgebra.ofCoeff, left_inv := ⋯, right_inv := ⋯ }
Instances For
AddMonoidAlgebra.coeff as an equiv.
Equations
- AddMonoidAlgebra.coeffEquiv = { toFun := AddMonoidAlgebra.coeff, invFun := AddMonoidAlgebra.ofCoeff, left_inv := ⋯, right_inv := ⋯ }
Instances For
Alias of the forward direction of MonoidAlgebra.coeff_inj.
Alias of the forward direction of AddMonoidAlgebra.coeff_inj.
Equations
- MonoidAlgebra.instInhabited = { default := MonoidAlgebra.coeffEquiv.symm.1 default }
Equations
- AddMonoidAlgebra.instInhabited = { default := AddMonoidAlgebra.coeffEquiv.symm.1 default }
Equations
- MonoidAlgebra.instUnique = { default := MonoidAlgebra.coeffEquiv.symm default, uniq := ⋯ }
Equations
- AddMonoidAlgebra.instUnique = { default := AddMonoidAlgebra.coeffEquiv.symm default, uniq := ⋯ }
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
- MonoidAlgebra.instAddCommMonoid = { toAddMonoid := MonoidAlgebra.instAddMonoid, add_comm := ⋯ }
Equations
- AddMonoidAlgebra.instAddCommMonoid = { toAddMonoid := AddMonoidAlgebra.instAddMonoid, add_comm := ⋯ }
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].
Equations
Instances For
AddMonoidAlgebra.single m r for m : M, r : R is the element rm : R[M].
Equations
Instances For
MonoidAlgebra.single m r is injective in m if r ≠ 0. For injectivity in r, see
MonoidAlgebra.single_injective.
AddMonoidAlgebra.single m r is injective in m if r ≠ 0. For injectivity in r, see
AddMonoidAlgebra.single_injective.
Remove a term from an element of the monoid algebra.
Equations
Instances For
Remove a term from an element of the additive monoid algebra.
Equations
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.
Equations
- MonoidAlgebra.update m r x = MonoidAlgebra.ofCoeff (x.coeff.update m r)
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.
Equations
- AddMonoidAlgebra.update m r x = AddMonoidAlgebra.ofCoeff (x.coeff.update m r)
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.
Equations
- MonoidAlgebra.smulZeroClass = { smul := fun (a : A) (a_1 : MonoidAlgebra R M) => MonoidAlgebra.coeffEquiv.2 (a • MonoidAlgebra.coeffEquiv.toFun a_1), smul_zero := ⋯ }
Equations
- AddMonoidAlgebra.smulZeroClass = { smul := fun (a : A) (a_1 : AddMonoidAlgebra R M) => AddMonoidAlgebra.coeffEquiv.2 (a • AddMonoidAlgebra.coeffEquiv.toFun a_1), smul_zero := ⋯ }
Alias of MonoidAlgebra.coeff_smul_apply.
Equations
- MonoidAlgebra.distribSMul = { toSMulZeroClass := MonoidAlgebra.smulZeroClass, smul_add := ⋯ }
Equations
- AddMonoidAlgebra.distribSMul = { toSMulZeroClass := AddMonoidAlgebra.smulZeroClass, smul_add := ⋯ }
MonoidAlgebra.single as an AddMonoidHom.
TODO: Rename to singleAddMonoidHom.
Equations
- MonoidAlgebra.singleAddHom m = { toFun := MonoidAlgebra.single m, map_zero' := ⋯, map_add' := ⋯ }
Instances For
AddMonoidAlgebra.single as an AddMonoidHom.
TODO: Rename to singleAddMonoidHom.
Equations
- AddMonoidAlgebra.singleAddHom m = { toFun := AddMonoidAlgebra.single m, map_zero' := ⋯, map_add' := ⋯ }
Instances For
If two additive homomorphisms from R[M] are equal on each single r m,
then they are equal.
If two additive homomorphisms from R[M] are equal on each single r m,
then they are equal.
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'.
Alias of MonoidAlgebra.sum_coeff_single.
Alias of AddMonoidAlgebra.sum_coeff_single.
The unit of the multiplication is single 1 1,
i.e. the function that is 1 at 1 and 0 elsewhere.
Equations
- MonoidAlgebra.one = { one := MonoidAlgebra.single 1 1 }
The unit of the multiplication is single 1 1,
i.e. the function that is 1 at 1 and 0 elsewhere.
Equations
- AddMonoidAlgebra.zero = { one := AddMonoidAlgebra.single 0 1 }
Alias of AddMonoidAlgebra.coeff_one_zero.
The multiplication in a monoid algebra.
We make it irreducible so that Lean doesn't unfold it when trying to unify two different things.
Equations
Instances For
The multiplication in an additive monoid algebra.
We make it irreducible so that Lean doesn't unfold it when trying to unify two different things.
Equations
Instances For
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.
Equations
- MonoidAlgebra.instMul = { mul := MonoidAlgebra.mul' }
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.
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.
Alias of MonoidAlgebra.coeff_mul.
Alias of AddMonoidAlgebra.coeff_mul.
Alias of MonoidAlgebra.coeff_mul_antidiag.
Alias of AddMonoidAlgebra.coeff_mul_antidiag.
The embedding of a magma into its magma algebra.
Equations
- MonoidAlgebra.ofMagma R M = { toFun := fun (a : M) => MonoidAlgebra.single a 1, map_mul' := ⋯ }
Instances For
Equations
- MonoidAlgebra.nonUnitalSemiring = { toNonUnitalNonAssocSemiring := MonoidAlgebra.nonUnitalNonAssocSemiring, mul_assoc := ⋯ }
Equations
- AddMonoidAlgebra.nonUnitalSemiring = { toNonUnitalNonAssocSemiring := AddMonoidAlgebra.nonUnitalNonAssocSemiring, mul_assoc := ⋯ }
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.
Alias of MonoidAlgebra.coeff_mul_single_one.
Alias of MonoidAlgebra.coeff_single_one_mul.
The embedding of a unital magma into its magma algebra.
Equations
- MonoidAlgebra.of R M = { toFun := (MonoidAlgebra.ofMagma R M).toFun, map_one' := ⋯, map_mul' := ⋯ }
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.
Equations
- MonoidAlgebra.singleHom = { toFun := fun (a : R × M) => MonoidAlgebra.single a.2 a.1, map_one' := ⋯, map_mul' := ⋯ }
Instances For
MonoidAlgebra.single 1 as a RingHom
Equations
- MonoidAlgebra.singleOneRingHom = { toFun := (↑(MonoidAlgebra.singleAddHom 1)).toFun, map_one' := ⋯, map_mul' := ⋯, map_zero' := ⋯, map_add' := ⋯ }
Instances For
AddMonoidAlgebra.single 1 as a RingHom
Equations
- AddMonoidAlgebra.singleZeroRingHom = { toFun := (↑(AddMonoidAlgebra.singleAddHom 0)).toFun, map_one' := ⋯, map_mul' := ⋯, map_zero' := ⋯, map_add' := ⋯ }
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].
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.
The trivial monoid algebra is the base ring.
Equations
- MonoidAlgebra.uniqueRingEquiv M = { toEquiv := (MonoidAlgebra.coeffAddEquiv.trans (Finsupp.uniqueAddEquiv 1)).toEquiv, map_mul' := ⋯, map_add' := ⋯ }
Instances For
The trivial additive monoid algebra is the base ring.
Equations
- AddMonoidAlgebra.uniqueRingEquiv M = { toEquiv := (AddMonoidAlgebra.coeffAddEquiv.trans (Finsupp.uniqueAddEquiv 0)).toEquiv, map_mul' := ⋯, map_add' := ⋯ }
Instances For
Alias of MonoidAlgebra.coeff_uniqueRingEquiv_symm.
A product monoid algebra is a nested monoid algebra.
Equations
- MonoidAlgebra.curryRingEquiv = { toEquiv := MonoidAlgebra.curryAddEquiv.toEquiv, map_mul' := ⋯, map_add' := ⋯ }
Instances For
An additive product monoid algebra is a nested additive monoid algebra.
Equations
- AddMonoidAlgebra.curryRingEquiv = { toEquiv := AddMonoidAlgebra.curryAddEquiv.toEquiv, map_mul' := ⋯, map_add' := ⋯ }
Instances For
Alias of MonoidAlgebra.coeff_mul_single_apply.
Alias of MonoidAlgebra.coeff_single_mul_apply.
Alias of MonoidAlgebra.coeff_mul_apply_left.
Alias of MonoidAlgebra.coeff_mul_apply_right.
Equations
- MonoidAlgebra.nonUnitalCommSemiring = { toNonUnitalSemiring := MonoidAlgebra.nonUnitalSemiring, mul_comm := ⋯ }
Equations
- AddMonoidAlgebra.nonUnitalCommSemiring = { toNonUnitalSemiring := AddMonoidAlgebra.nonUnitalSemiring, mul_comm := ⋯ }
Equations
- MonoidAlgebra.commSemiring = { toSemiring := MonoidAlgebra.semiring, mul_comm := ⋯ }
Equations
- AddMonoidAlgebra.commSemiring = { toSemiring := AddMonoidAlgebra.semiring, mul_comm := ⋯ }
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
- MonoidAlgebra.nonUnitalRing = { toNonUnitalNonAssocRing := MonoidAlgebra.nonUnitalNonAssocRing, mul_assoc := ⋯ }
Equations
- AddMonoidAlgebra.nonUnitalRing = { toNonUnitalNonAssocRing := AddMonoidAlgebra.nonUnitalNonAssocRing, mul_assoc := ⋯ }
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
- MonoidAlgebra.nonUnitalCommRing = { toNonUnitalRing := MonoidAlgebra.nonUnitalRing, mul_comm := ⋯ }
Equations
- AddMonoidAlgebra.nonUnitalCommRing = { toNonUnitalRing := AddMonoidAlgebra.nonUnitalRing, mul_comm := ⋯ }
Equations
- MonoidAlgebra.commRing = { toRing := MonoidAlgebra.ring, mul_comm := ⋯ }
Equations
- AddMonoidAlgebra.commRing = { toRing := AddMonoidAlgebra.ring, mul_comm := ⋯ }
Additive monoids #
The embedding of an additive magma into its additive magma algebra.
Equations
- AddMonoidAlgebra.ofMagma R M = { toFun := fun (a : Multiplicative M) => AddMonoidAlgebra.single (Multiplicative.toAdd a) 1, map_mul' := ⋯ }
Instances For
Embedding of a magma with zero into its magma algebra.
Equations
- AddMonoidAlgebra.of R M = { toFun := (AddMonoidAlgebra.ofMagma R M).toFun, map_one' := ⋯, map_mul' := ⋯ }
Instances For
Embedding of a magma with zero M, into its magma algebra, having M as source.
Equations
- AddMonoidAlgebra.of' R M m = AddMonoidAlgebra.single m 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 : R × Multiplicative M) => AddMonoidAlgebra.single (Multiplicative.toAdd a.2) a.1, map_one' := ⋯, map_mul' := ⋯ }
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].