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[A]
for AddMonoidAlgebra R A
.
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
- MonoidAlgebra R M = (M →₀ R)
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
- AddMonoidAlgebra R M = (M →₀ R)
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
Equations
Equations
Equations
- MonoidAlgebra.unique = inferInstanceAs (Unique (M →₀ R))
Equations
- AddMonoidAlgebra.unique = inferInstanceAs (Unique (M →₀ R))
Equations
Equations
Equations
- MonoidAlgebra.instCoeFun = inferInstanceAs (CoeFun (M →₀ R) fun (x : M →₀ R) => M → R)
Equations
- AddMonoidAlgebra.instCoeFun = inferInstanceAs (CoeFun (M →₀ R) fun (x : M →₀ R) => M → R)
A copy of Finsupp.ext
for MonoidAlgebra
.
A copy of Finsupp.ext
for AddMonoidAlgebra
.
MonoidAlgebra.single m r
for m : M
, r : R
is the element rm : MonoidAlgebra R M
.
Equations
- MonoidAlgebra.single m r = Finsupp.single m r
Instances For
AddMonoidAlgebra.single m r
for m : M
, r : R
is the element rm : R[M]
.
Equations
- AddMonoidAlgebra.single m r = Finsupp.single 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
Equations
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 MonoidAlgebra R M
are equal on each single r m
,
then they are equal.
We formulate this using equality of AddMonoidHom
s 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 AddMonoidHom
s 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.
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 }
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
- x.mul' y = Finsupp.sum x fun (m₁ : M) (r₁ : R) => Finsupp.sum y fun (m₂ : M) (r₂ : R) => MonoidAlgebra.single (m₁ * m₂) (r₁ * r₂)
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.instMul = { mul := fun (f g : AddMonoidAlgebra R M) => MonoidAlgebra.mul' f g }
The product of x y : MonoidAlgebra 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.)
Equations
- MonoidAlgebra.instMul = { mul := MonoidAlgebra.mul' }
Equations
- MonoidAlgebra.nonUnitalNonAssocSemiring = { toAddCommMonoid := MonoidAlgebra.addCommMonoid, toMul := MonoidAlgebra.instMul, left_distrib := ⋯, right_distrib := ⋯, zero_mul := ⋯, mul_zero := ⋯ }
Equations
- One or more equations did not get rendered due to their size.
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.
The embedding of a unital magma into its magma algebra.
Equations
- MonoidAlgebra.of R M = { toFun := fun (m : M) => MonoidAlgebra.single m 1, 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.single 1, map_one' := ⋯, map_mul' := ⋯, map_zero' := ⋯, map_add' := ⋯ }
Instances For
AddMonoidAlgebra.single 1
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 MonoidAlgebra 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 MonoidAlgebra 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.
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
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
- 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 a 1, map_mul' := ⋯ }
Instances For
Embedding of a magma with zero into its magma algebra.
Equations
- AddMonoidAlgebra.of R M = { toFun := fun (a : Multiplicative M) => AddMonoidAlgebra.single a 1, 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
Algebra structure #
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].