Documentation

Mathlib.Algebra.MonoidAlgebra.Defs

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.

def MonoidAlgebra (R : Type u_8) (M : Type u_9) [Semiring R] :
Type (max u_8 u_9)

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
Instances For
    def AddMonoidAlgebra (R : Type u_8) (M : Type u_9) [Semiring R] :
    Type (max u_8 u_9)

    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
    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
              instance MonoidAlgebra.instCoeFun {M : Type u_2} {R : Type u_6} [Semiring R] :
              CoeFun (MonoidAlgebra R M) fun (x : MonoidAlgebra R M) => MR
              Equations
              instance AddMonoidAlgebra.instCoeFun {M : Type u_2} {R : Type u_6} [Semiring R] :
              CoeFun (AddMonoidAlgebra R M) fun (x : AddMonoidAlgebra R M) => MR
              Equations
              theorem MonoidAlgebra.ext {M : Type u_2} {R : Type u_6} [Semiring R] f g : MonoidAlgebra R M (hfg : ∀ (m : M), f m = g m) :
              f = g

              A copy of Finsupp.ext for MonoidAlgebra.

              theorem AddMonoidAlgebra.ext {M : Type u_2} {R : Type u_6} [Semiring R] f g : AddMonoidAlgebra R M (hfg : ∀ (m : M), f m = g m) :
              f = g

              A copy of Finsupp.ext for AddMonoidAlgebra.

              theorem MonoidAlgebra.ext_iff {M : Type u_2} {R : Type u_6} [Semiring R] {f g : MonoidAlgebra R M} :
              f = g ∀ (m : M), f m = g m
              theorem AddMonoidAlgebra.ext_iff {M : Type u_2} {R : Type u_6} [Semiring R] {f g : AddMonoidAlgebra R M} :
              f = g ∀ (m : M), f m = g m
              @[reducible, inline]
              abbrev MonoidAlgebra.single {M : Type u_2} {R : Type u_6} [Semiring R] (m : M) (r : R) :

              MonoidAlgebra.single m r for m : M, r : R is the element rm : R[M].

              Equations
              Instances For
                @[reducible, inline]
                abbrev AddMonoidAlgebra.single {M : Type u_2} {R : Type u_6} [Semiring R] (m : M) (r : R) :

                AddMonoidAlgebra.single m r for m : M, r : R is the element rm : R[M].

                Equations
                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.

                  @[simp]
                  theorem MonoidAlgebra.smul_apply {M : Type u_2} {R : Type u_6} [Semiring R] {A : Type u_8} [SMulZeroClass A R] (a : A) (x : MonoidAlgebra R M) (m : M) :
                  (a x) m = a x m
                  @[simp]
                  theorem AddMonoidAlgebra.coeff_smul {M : Type u_2} {R : Type u_6} [Semiring R] {A : Type u_8} [SMulZeroClass A R] (a : A) (x : AddMonoidAlgebra R M) (m : M) :
                  (a x) m = a x m
                  @[simp]
                  theorem MonoidAlgebra.smul_single {M : Type u_2} {R : Type u_6} [Semiring R] {A : Type u_8} [SMulZeroClass A R] (a : A) (m : M) (r : R) :
                  a single m r = single m (a r)
                  @[simp]
                  theorem AddMonoidAlgebra.smul_single {M : Type u_2} {R : Type u_6} [Semiring R] {A : Type u_8} [SMulZeroClass A R] (a : A) (m : M) (r : R) :
                  a single m r = single m (a r)
                  theorem MonoidAlgebra.smul_single' {M : Type u_2} {R : Type u_6} [Semiring R] (r' : R) (m : M) (r : R) :
                  r' single m r = single m (r' * r)
                  theorem AddMonoidAlgebra.smul_single' {M : Type u_2} {R : Type u_6} [Semiring R] (r' : R) (m : M) (r : R) :
                  r' single m r = single m (r' * r)
                  instance MonoidAlgebra.isScalarTower {M : Type u_2} {N : Type u_3} {O : Type u_4} {R : Type u_6} [Semiring R] [SMulZeroClass N R] [SMulZeroClass O R] [SMul N O] [IsScalarTower N O R] :
                  instance AddMonoidAlgebra.isScalarTower {M : Type u_2} {N : Type u_3} {O : Type u_4} {R : Type u_6} [Semiring R] [SMulZeroClass N R] [SMulZeroClass O R] [SMul N O] [IsScalarTower N O R] :
                  instance MonoidAlgebra.smulCommClass {M : Type u_2} {N : Type u_3} {O : Type u_4} {R : Type u_6} [Semiring R] [SMulZeroClass N R] [SMulZeroClass O R] [SMulCommClass N O R] :
                  instance AddMonoidAlgebra.smulCommClass {M : Type u_2} {N : Type u_3} {O : Type u_4} {R : Type u_6} [Semiring R] [SMulZeroClass N R] [SMulZeroClass O R] [SMulCommClass N O R] :
                  @[simp]
                  theorem MonoidAlgebra.coe_add {G : Type u_1} {R : Type u_6} [Semiring R] (f g : MonoidAlgebra R G) :
                  ⇑(f + g) = f + g
                  @[simp]
                  theorem AddMonoidAlgebra.coe_add {G : Type u_1} {R : Type u_6} [Semiring R] (f g : AddMonoidAlgebra R G) :
                  ⇑(f + g) = f + g
                  theorem MonoidAlgebra.single_zero {M : Type u_2} {R : Type u_6} [Semiring R] (m : M) :
                  single m 0 = 0
                  theorem AddMonoidAlgebra.single_zero {M : Type u_2} {R : Type u_6} [Semiring R] (m : M) :
                  single m 0 = 0
                  theorem MonoidAlgebra.single_add {M : Type u_2} {R : Type u_6} [Semiring R] (m : M) (r₁ r₂ : R) :
                  single m (r₁ + r₂) = single m r₁ + single m r₂
                  theorem AddMonoidAlgebra.single_add {M : Type u_2} {R : Type u_6} [Semiring R] (m : M) (r₁ r₂ : R) :
                  single m (r₁ + r₂) = single m r₁ + single m r₂
                  def MonoidAlgebra.singleAddHom {M : Type u_2} {R : Type u_6} [Semiring R] (m : M) :

                  MonoidAlgebra.single as an AddMonoidHom.

                  TODO: Rename to singleAddMonoidHom.

                  Equations
                  Instances For
                    def AddMonoidAlgebra.singleAddHom {M : Type u_2} {R : Type u_6} [Semiring R] (m : M) :

                    AddMonoidAlgebra.single as an AddMonoidHom.

                    TODO: Rename to singleAddMonoidHom.

                    Equations
                    Instances For
                      @[simp]
                      theorem MonoidAlgebra.singleAddHom_apply {M : Type u_2} {R : Type u_6} [Semiring R] (m : M) (r : R) :
                      @[simp]
                      theorem AddMonoidAlgebra.singleAddHom_apply {M : Type u_2} {R : Type u_6} [Semiring R] (m : M) (r : R) :
                      theorem MonoidAlgebra.addHom_ext' {M : Type u_2} {R : Type u_6} [Semiring R] {N : Type u_8} [AddZeroClass N] f g : MonoidAlgebra R M →+ N (hfg : ∀ (m : M), f.comp (singleAddHom m) = g.comp (singleAddHom m)) :
                      f = g

                      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'.

                      theorem AddMonoidAlgebra.addHom_ext' {M : Type u_2} {R : Type u_6} [Semiring R] {N : Type u_8} [AddZeroClass N] f g : AddMonoidAlgebra R M →+ N (hfg : ∀ (m : M), f.comp (singleAddHom m) = g.comp (singleAddHom m)) :
                      f = g

                      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'.

                      theorem AddMonoidAlgebra.addHom_ext'_iff {M : Type u_2} {R : Type u_6} [Semiring R] {N : Type u_8} [AddZeroClass N] {f g : AddMonoidAlgebra R M →+ N} :
                      f = g ∀ (m : M), f.comp (singleAddHom m) = g.comp (singleAddHom m)
                      theorem MonoidAlgebra.addHom_ext'_iff {M : Type u_2} {R : Type u_6} [Semiring R] {N : Type u_8} [AddZeroClass N] {f g : MonoidAlgebra R M →+ N} :
                      f = g ∀ (m : M), f.comp (singleAddHom m) = g.comp (singleAddHom m)
                      theorem MonoidAlgebra.sum_single_index {M : Type u_2} {N : Type u_3} {R : Type u_6} [Semiring R] [AddCommMonoid N] {m : M} {r : R} {h : MRN} (h_zero : h m 0 = 0) :
                      Finsupp.sum (single m r) h = h m r
                      theorem AddMonoidAlgebra.sum_single_index {M : Type u_2} {N : Type u_3} {R : Type u_6} [Semiring R] [AddCommMonoid N] {m : M} {r : R} {h : MRN} (h_zero : h m 0 = 0) :
                      Finsupp.sum (single m r) h = h m r
                      @[simp]
                      theorem MonoidAlgebra.sum_single {M : Type u_2} {R : Type u_6} [Semiring R] (x : MonoidAlgebra R M) :
                      @[simp]
                      theorem AddMonoidAlgebra.sum_single {M : Type u_2} {R : Type u_6} [Semiring R] (x : AddMonoidAlgebra R M) :
                      theorem MonoidAlgebra.single_apply {M : Type u_2} {R : Type u_6} [Semiring R] {a a' : M} {b : R} [Decidable (a = a')] :
                      (single a b) a' = if a = a' then b else 0
                      theorem AddMonoidAlgebra.single_apply {M : Type u_2} {R : Type u_6} [Semiring R] {a a' : M} {b : R} [Decidable (a = a')] :
                      (single a b) a' = if a = a' then b else 0
                      @[simp]
                      theorem MonoidAlgebra.single_eq_zero {M : Type u_2} {R : Type u_6} [Semiring R] {r : R} {m : M} :
                      single m r = 0 r = 0
                      @[simp]
                      theorem AddMonoidAlgebra.single_eq_zero {M : Type u_2} {R : Type u_6} [Semiring R] {r : R} {m : M} :
                      single m r = 0 r = 0
                      theorem MonoidAlgebra.single_ne_zero {M : Type u_2} {R : Type u_6} [Semiring R] {r : R} {m : M} :
                      single m r 0 r 0
                      theorem AddMonoidAlgebra.single_ne_zero {M : Type u_2} {R : Type u_6} [Semiring R] {r : R} {m : M} :
                      single m r 0 r 0
                      theorem MonoidAlgebra.induction_linear {M : Type u_2} {R : Type u_6} [Semiring R] {p : MonoidAlgebra R MProp} (x : MonoidAlgebra R M) (zero : p 0) (add : ∀ (x y : MonoidAlgebra R M), p xp yp (x + y)) (single : ∀ (m : M) (r : R), p (single m r)) :
                      p x
                      theorem AddMonoidAlgebra.induction_linear {M : Type u_2} {R : Type u_6} [Semiring R] {p : AddMonoidAlgebra R MProp} (x : AddMonoidAlgebra R M) (zero : p 0) (add : ∀ (x y : AddMonoidAlgebra R M), p xp yp (x + y)) (single : ∀ (m : M) (r : R), p (single m r)) :
                      p x
                      instance MonoidAlgebra.one {M : Type u_2} {R : Type u_6} [Semiring R] [One M] :

                      The unit of the multiplication is single 1 1, i.e. the function that is 1 at 1 and 0 elsewhere.

                      Equations
                      instance AddMonoidAlgebra.zero {M : Type u_2} {R : Type u_6} [Semiring R] [Zero M] :

                      The unit of the multiplication is single 1 1, i.e. the function that is 1 at 1 and 0 elsewhere.

                      Equations
                      theorem MonoidAlgebra.one_def {M : Type u_2} {R : Type u_6} [Semiring R] [One M] :
                      1 = single 1 1
                      theorem AddMonoidAlgebra.one_def {M : Type u_2} {R : Type u_6} [Semiring R] [Zero M] :
                      1 = single 0 1
                      @[irreducible]
                      def MonoidAlgebra.mul' {M : Type u_2} {R : Type u_6} [Semiring R] [Mul M] (x y : MonoidAlgebra R M) :

                      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
                        instance AddMonoidAlgebra.instMul {M : Type u_2} {R : Type u_6} [Semiring R] [Add M] :

                        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
                        instance MonoidAlgebra.instMul {M : Type u_2} {R : Type u_6} [Semiring R] [Mul M] :

                        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.)

                        Equations
                        theorem MonoidAlgebra.mul_def {M : Type u_2} {R : Type u_6} [Semiring R] [Mul M] (x y : MonoidAlgebra R M) :
                        x * y = Finsupp.sum x fun (m₁ : M) (r₁ : R) => Finsupp.sum y fun (m₂ : M) (r₂ : R) => single (m₁ * m₂) (r₁ * r₂)
                        theorem AddMonoidAlgebra.mul_def {M : Type u_2} {R : Type u_6} [Semiring R] [Add M] (x y : AddMonoidAlgebra R M) :
                        x * y = Finsupp.sum x fun (m₁ : M) (r₁ : R) => Finsupp.sum y fun (m₂ : M) (r₂ : R) => single (m₁ + m₂) (r₁ * r₂)
                        Equations
                        Equations
                        • One or more equations did not get rendered due to their size.
                        theorem MonoidAlgebra.mul_apply {M : Type u_2} {R : Type u_6} [Semiring R] [Mul M] [DecidableEq M] (x y : MonoidAlgebra R M) (m : M) :
                        (x * y) m = Finsupp.sum x fun (m₁ : M) (r₁ : R) => Finsupp.sum y fun (m₂ : M) (r₂ : R) => if m₁ * m₂ = m then r₁ * r₂ else 0
                        theorem AddMonoidAlgebra.mul_apply {M : Type u_2} {R : Type u_6} [Semiring R] [Add M] [DecidableEq M] (x y : AddMonoidAlgebra R M) (m : M) :
                        (x * y) m = Finsupp.sum x fun (m₁ : M) (r₁ : R) => Finsupp.sum y fun (m₂ : M) (r₂ : R) => if m₁ + m₂ = m then r₁ * r₂ else 0
                        theorem MonoidAlgebra.mul_apply_antidiagonal {M : Type u_2} {R : Type u_6} [Semiring R] [Mul M] (x y : MonoidAlgebra R M) (m : M) (s : Finset (M × M)) (hs : ∀ {p : M × M}, p s p.1 * p.2 = m) :
                        (x * y) m = ps, x p.1 * y p.2
                        theorem AddMonoidAlgebra.mul_apply_antidiagonal {M : Type u_2} {R : Type u_6} [Semiring R] [Add M] (x y : AddMonoidAlgebra R M) (m : M) (s : Finset (M × M)) (hs : ∀ {p : M × M}, p s p.1 + p.2 = m) :
                        (x * y) m = ps, x p.1 * y p.2
                        @[simp]
                        theorem MonoidAlgebra.single_mul_single {M : Type u_2} {R : Type u_6} [Semiring R] [Mul M] (m₁ m₂ : M) (r₁ r₂ : R) :
                        single m₁ r₁ * single m₂ r₂ = single (m₁ * m₂) (r₁ * r₂)
                        @[simp]
                        theorem AddMonoidAlgebra.single_mul_single {M : Type u_2} {R : Type u_6} [Semiring R] [Add M] (m₁ m₂ : M) (r₁ r₂ : R) :
                        single m₁ r₁ * single m₂ r₂ = single (m₁ + m₂) (r₁ * r₂)
                        @[simp]
                        theorem MonoidAlgebra.single_commute_single {M : Type u_2} {R : Type u_6} [Semiring R] {r₁ r₂ : R} {m₁ m₂ : M} [Mul M] (hm : Commute m₁ m₂) (hr : Commute r₁ r₂) :
                        Commute (single m₁ r₁) (single m₂ r₂)
                        @[simp]
                        theorem AddMonoidAlgebra.single_commute_single {M : Type u_2} {R : Type u_6} [Semiring R] {r₁ r₂ : R} {m₁ m₂ : M} [Add M] (hm : AddCommute m₁ m₂) (hr : Commute r₁ r₂) :
                        Commute (single m₁ r₁) (single m₂ r₂)
                        @[simp]
                        theorem MonoidAlgebra.single_commute {M : Type u_2} {R : Type u_6} [Semiring R] {r : R} {m : M} [Mul M] (hm : ∀ (m' : M), Commute m m') (hr : ∀ (r' : R), Commute r r') (x : MonoidAlgebra R M) :
                        Commute (single m r) x
                        @[simp]
                        theorem AddMonoidAlgebra.single_commute {M : Type u_2} {R : Type u_6} [Semiring R] {r : R} {m : M} [Add M] (hm : ∀ (m' : M), AddCommute m m') (hr : ∀ (r' : R), Commute r r') (x : AddMonoidAlgebra R M) :
                        Commute (single m r) x
                        theorem MonoidAlgebra.mul_single_apply_aux {M : Type u_2} {R : Type u_6} [Semiring R] {x : MonoidAlgebra R M} {r : R} {m m₁ m₂ : M} [Mul M] (H : m'x.support, m' * m = m₁ m' = m₂) :
                        (x * single m r) m₁ = x m₂ * r
                        theorem AddMonoidAlgebra.mul_single_apply_aux {M : Type u_2} {R : Type u_6} [Semiring R] {x : AddMonoidAlgebra R M} {r : R} {m m₁ m₂ : M} [Add M] (H : m'x.support, m' + m = m₁ m' = m₂) :
                        (x * single m r) m₁ = x m₂ * r
                        theorem MonoidAlgebra.single_mul_apply_aux {M : Type u_2} {R : Type u_6} [Semiring R] {x : MonoidAlgebra R M} {r : R} {m m₁ m₂ : M} [Mul M] (H : m'x.support, m * m' = m₁ m' = m₂) :
                        (single m r * x) m₁ = r * x m₂
                        theorem AddMonoidAlgebra.single_mul_apply_aux {M : Type u_2} {R : Type u_6} [Semiring R] {x : AddMonoidAlgebra R M} {r : R} {m m₁ m₂ : M} [Add M] (H : m'x.support, m + m' = m₁ m' = m₂) :
                        (single m r * x) m₁ = r * x m₂
                        @[simp]
                        theorem MonoidAlgebra.mul_single_apply_of_not_exists_mul {M : Type u_2} {R : Type u_6} [Semiring R] {m m' : M} [Mul M] (r : R) (x : MonoidAlgebra R M) (h : ¬∃ (d : M), m' = d * m) :
                        (x * single m r) m' = 0
                        @[simp]
                        theorem AddMonoidAlgebra.mul_single_apply_of_not_exists_add {M : Type u_2} {R : Type u_6} [Semiring R] {m m' : M} [Add M] (r : R) (x : AddMonoidAlgebra R M) (h : ¬∃ (d : M), m' = d + m) :
                        (x * single m r) m' = 0
                        @[simp]
                        theorem MonoidAlgebra.single_mul_apply_of_not_exists_mul {M : Type u_2} {R : Type u_6} [Semiring R] {m m' : M} [Mul M] (r : R) (x : MonoidAlgebra R M) (h : ¬∃ (d : M), m' = m * d) :
                        (single m r * x) m' = 0
                        @[simp]
                        theorem AddMonoidAlgebra.single_mul_apply_of_not_exists_add {M : Type u_2} {R : Type u_6} [Semiring R] {m m' : M} [Add M] (r : R) (x : AddMonoidAlgebra R M) (h : ¬∃ (d : M), m' = m + d) :
                        (single m r * x) m' = 0
                        def MonoidAlgebra.ofMagma (R : Type u_8) (M : Type u_9) [Semiring R] [Mul M] :

                        The embedding of a magma into its magma algebra.

                        Equations
                        Instances For
                          @[simp]
                          theorem MonoidAlgebra.ofMagma_apply (R : Type u_8) (M : Type u_9) [Semiring R] [Mul M] (a : M) :
                          (ofMagma R M) a = single a 1
                          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.
                          theorem MonoidAlgebra.natCast_def {M : Type u_2} {R : Type u_6} [Semiring R] [MulOneClass M] (n : ) :
                          n = single 1 n
                          theorem AddMonoidAlgebra.natCast_def {M : Type u_2} {R : Type u_6} [Semiring R] [AddZeroClass M] (n : ) :
                          n = single 0 n
                          theorem MonoidAlgebra.mul_single_one_apply {M : Type u_2} {R : Type u_6} [Semiring R] [MulOneClass M] (x : MonoidAlgebra R M) (r : R) (m : M) :
                          (x * single 1 r) m = x m * r
                          theorem AddMonoidAlgebra.mul_single_zero_apply {M : Type u_2} {R : Type u_6} [Semiring R] [AddZeroClass M] (x : AddMonoidAlgebra R M) (r : R) (m : M) :
                          (x * single 0 r) m = x m * r
                          theorem MonoidAlgebra.single_one_mul_apply {M : Type u_2} {R : Type u_6} [Semiring R] [MulOneClass M] (x : MonoidAlgebra R M) (r : R) (m : M) :
                          (single 1 r * x) m = r * x m
                          theorem AddMonoidAlgebra.single_zero_mul_apply {M : Type u_2} {R : Type u_6} [Semiring R] [AddZeroClass M] (x : AddMonoidAlgebra R M) (r : R) (m : M) :
                          (single 0 r * x) m = r * x m
                          def MonoidAlgebra.of (R : Type u_8) (M : Type u_9) [Semiring R] [MulOneClass M] :

                          The embedding of a unital magma into its magma algebra.

                          Equations
                          Instances For
                            @[simp]
                            theorem MonoidAlgebra.of_apply (R : Type u_8) (M : Type u_9) [Semiring R] [MulOneClass M] (m : M) :
                            (of R M) m = single m 1
                            theorem MonoidAlgebra.of_commute {M : Type u_2} {R : Type u_6} [Semiring R] {m : M} [MulOneClass M] (h : ∀ (m' : M), Commute m m') (f : MonoidAlgebra R M) :
                            Commute ((of R M) m) f
                            def MonoidAlgebra.singleHom {M : Type u_2} {R : Type u_6} [Semiring R] [MulOneClass M] :

                            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
                            Instances For
                              @[simp]
                              theorem MonoidAlgebra.singleHom_apply {M : Type u_2} {R : Type u_6} [Semiring R] [MulOneClass M] (a : R × M) :
                              singleHom a = single a.2 a.1

                              MonoidAlgebra.single 1 as a RingHom

                              Equations
                              Instances For

                                AddMonoidAlgebra.single 1 as a RingHom

                                Equations
                                Instances For
                                  @[simp]
                                  theorem MonoidAlgebra.singleOneRingHom_apply {M : Type u_2} {R : Type u_6} [Semiring R] [MulOneClass M] (r : R) :
                                  @[simp]
                                  theorem MonoidAlgebra.ringHom_ext {M : Type u_2} {R : Type u_6} {S : Type u_7} [Semiring R] [MulOneClass M] [Semiring S] {f g : MonoidAlgebra R M →+* S} (h₁ : ∀ (r : R), f (single 1 r) = g (single 1 r)) (h_of : ∀ (m : M), f (single m 1) = g (single m 1)) :
                                  f = g

                                  If two ring homomorphisms from R[M] are equal on all single m 1 and single 1 r, then they are equal.

                                  theorem AddMonoidAlgebra.ringHom_ext {M : Type u_2} {R : Type u_6} {S : Type u_7} [Semiring R] [AddZeroClass M] [Semiring S] {f g : AddMonoidAlgebra R M →+* S} (h₁ : ∀ (r : R), f (single 0 r) = g (single 0 r)) (h_of : ∀ (m : M), f (single m 1) = g (single m 1)) :
                                  f = g

                                  If two ring homomorphisms from R[M] are equal on all single m 1 and single 0 r, then they are equal.

                                  theorem MonoidAlgebra.ringHom_ext' {M : Type u_2} {R : Type u_6} {S : Type u_7} [Semiring R] [MulOneClass M] [Semiring S] {f g : MonoidAlgebra R M →+* S} (h₁ : f.comp singleOneRingHom = g.comp singleOneRingHom) (h_of : (↑f).comp (of R M) = (↑g).comp (of R M)) :
                                  f = g

                                  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].

                                  theorem MonoidAlgebra.ringHom_ext'_iff {M : Type u_2} {R : Type u_6} {S : Type u_7} [Semiring R] [MulOneClass M] [Semiring S] {f g : MonoidAlgebra R M →+* S} :
                                  f = g f.comp singleOneRingHom = g.comp singleOneRingHom (↑f).comp (of R M) = (↑g).comp (of R M)
                                  instance MonoidAlgebra.semiring {M : Type u_2} {R : Type u_6} [Semiring R] [Monoid M] :
                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  instance AddMonoidAlgebra.semiring {M : Type u_2} {R : Type u_6} [Semiring R] [AddMonoid M] :
                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  @[simp]
                                  theorem MonoidAlgebra.single_pow {M : Type u_2} {R : Type u_6} [Semiring R] [Monoid M] (m : M) (r : R) (n : ) :
                                  single m r ^ n = single (m ^ n) (r ^ n)
                                  @[simp]
                                  theorem AddMonoidAlgebra.single_pow {M : Type u_2} {R : Type u_6} [Semiring R] [AddMonoid M] (m : M) (r : R) (n : ) :
                                  single m r ^ n = single (n m) (r ^ n)
                                  theorem MonoidAlgebra.induction_on {M : Type u_2} {R : Type u_6} [Semiring R] [Monoid M] {p : MonoidAlgebra R MProp} (x : MonoidAlgebra R M) (hM : ∀ (m : M), p ((of R M) m)) (hadd : ∀ (x y : MonoidAlgebra R M), p xp yp (x + y)) (hsmul : ∀ (r : R) (x : MonoidAlgebra R M), p xp (r x)) :
                                  p x
                                  @[simp]
                                  theorem MonoidAlgebra.mul_single_apply {G : Type u_1} {R : Type u_6} [Semiring R] [Group G] (x : MonoidAlgebra R G) (r : R) (g h : G) :
                                  (x * single g r) h = x (h * g⁻¹) * r
                                  @[simp]
                                  theorem AddMonoidAlgebra.mul_single_apply {G : Type u_1} {R : Type u_6} [Semiring R] [AddGroup G] (x : AddMonoidAlgebra R G) (r : R) (g h : G) :
                                  (x * single g r) h = x (h + -g) * r
                                  @[simp]
                                  theorem MonoidAlgebra.single_mul_apply {G : Type u_1} {R : Type u_6} [Semiring R] [Group G] (x : MonoidAlgebra R G) (r : R) (g h : G) :
                                  (single g r * x) h = r * x (g⁻¹ * h)
                                  @[simp]
                                  theorem AddMonoidAlgebra.single_mul_apply {G : Type u_1} {R : Type u_6} [Semiring R] [AddGroup G] (x : AddMonoidAlgebra R G) (r : R) (g h : G) :
                                  (single g r * x) h = r * x (-g + h)
                                  theorem MonoidAlgebra.mul_apply_left {G : Type u_1} {R : Type u_6} [Semiring R] [Group G] (x y : MonoidAlgebra R G) (g : G) :
                                  (x * y) g = Finsupp.sum x fun (h : G) (r : R) => r * y (h⁻¹ * g)
                                  theorem AddMonoidAlgebra.mul_apply_left {G : Type u_1} {R : Type u_6} [Semiring R] [AddGroup G] (x y : AddMonoidAlgebra R G) (g : G) :
                                  (x * y) g = Finsupp.sum x fun (h : G) (r : R) => r * y (-h + g)
                                  theorem MonoidAlgebra.mul_apply_right {G : Type u_1} {R : Type u_6} [Semiring R] [Group G] (x y : MonoidAlgebra R G) (g : G) :
                                  (x * y) g = Finsupp.sum y fun (h : G) (r : R) => x (g * h⁻¹) * r
                                  theorem AddMonoidAlgebra.mul_apply_right {G : Type u_1} {R : Type u_6} [Semiring R] [AddGroup G] (x y : AddMonoidAlgebra R G) (g : G) :
                                  (x * y) g = Finsupp.sum y fun (h : G) (r : R) => x (g + -h) * r
                                  theorem MonoidAlgebra.single_one_comm {M : Type u_2} {R : Type u_6} [CommSemiring R] [MulOneClass M] (r : R) (f : MonoidAlgebra R M) :
                                  single 1 r * f = f * single 1 r
                                  theorem AddMonoidAlgebra.single_zero_comm {M : Type u_2} {R : Type u_6} [CommSemiring R] [AddZeroClass M] (r : R) (f : AddMonoidAlgebra R M) :
                                  single 0 r * f = f * single 0 r
                                  Equations
                                  theorem MonoidAlgebra.prod_single {M : Type u_2} {ι : Type u_5} {R : Type u_6} [CommSemiring R] [CommMonoid M] (s : Finset ι) (m : ιM) (r : ιR) :
                                  is, single (m i) (r i) = single (∏ is, m i) (∏ is, r i)
                                  theorem AddMonoidAlgebra.prod_single {M : Type u_2} {ι : Type u_5} {R : Type u_6} [CommSemiring R] [AddCommMonoid M] (s : Finset ι) (m : ιM) (r : ιR) :
                                  is, single (m i) (r i) = single (∑ is, m i) (∏ is, r i)
                                  @[simp]
                                  theorem MonoidAlgebra.neg_apply {M : Type u_2} {R : Type u_6} [Ring R] (m : M) (x : MonoidAlgebra R M) :
                                  (-x) m = -x m
                                  @[simp]
                                  theorem AddMonoidAlgebra.neg_apply {M : Type u_2} {R : Type u_6} [Ring R] (m : M) (x : AddMonoidAlgebra R M) :
                                  (-x) m = -x m
                                  theorem MonoidAlgebra.single_neg {M : Type u_2} {R : Type u_6} [Ring R] (m : M) (r : R) :
                                  single m (-r) = -single m r
                                  theorem AddMonoidAlgebra.single_neg {M : Type u_2} {R : Type u_6} [Ring R] (m : M) (r : R) :
                                  single m (-r) = -single m r
                                  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.
                                  instance MonoidAlgebra.nonUnitalRing {M : Type u_2} {R : Type u_6} [Ring R] [Semigroup M] :
                                  Equations
                                  Equations
                                  instance MonoidAlgebra.nonAssocRing {M : Type u_2} {R : Type u_6} [Ring R] [MulOneClass M] :
                                  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.
                                  theorem MonoidAlgebra.intCast_def {M : Type u_2} {R : Type u_6} [Ring R] [MulOneClass M] (z : ) :
                                  z = single 1 z
                                  theorem AddMonoidAlgebra.intCast_def {M : Type u_2} {R : Type u_6} [Ring R] [AddZeroClass M] (z : ) :
                                  z = single 0 z
                                  instance MonoidAlgebra.ring {M : Type u_2} {R : Type u_6} [Ring R] [Monoid M] :
                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  instance AddMonoidAlgebra.ring {M : Type u_2} {R : Type u_6} [Ring R] [AddMonoid M] :
                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  instance MonoidAlgebra.commRing {M : Type u_2} {R : Type u_6} [CommRing R] [CommMonoid M] :
                                  Equations
                                  Equations

                                  Additive monoids #

                                  The embedding of an additive magma into its additive magma algebra.

                                  Equations
                                  Instances For
                                    @[simp]
                                    theorem AddMonoidAlgebra.ofMagma_apply (R : Type u_8) (M : Type u_9) [Semiring R] [Add M] (a : Multiplicative M) :
                                    (ofMagma R M) a = single a 1

                                    Embedding of a magma with zero into its magma algebra.

                                    Equations
                                    Instances For
                                      def AddMonoidAlgebra.of' (R : Type u_8) (M : Type u_9) [Semiring R] :

                                      Embedding of a magma with zero M, into its magma algebra, having M as source.

                                      Equations
                                      Instances For
                                        @[simp]
                                        theorem AddMonoidAlgebra.of_apply {M : Type u_2} {R : Type u_6} [Semiring R] [AddZeroClass M] (a : Multiplicative M) :
                                        @[simp]
                                        theorem AddMonoidAlgebra.of'_apply {M : Type u_2} {R : Type u_6} [Semiring R] (a : M) :
                                        of' R M a = single a 1
                                        theorem AddMonoidAlgebra.of'_eq_of {M : Type u_2} {R : Type u_6} [Semiring R] [AddZeroClass M] (a : M) :
                                        of' R M a = (of R M) (Multiplicative.ofAdd a)
                                        theorem AddMonoidAlgebra.of'_commute {M : Type u_2} {R : Type u_6} [Semiring R] [AddZeroClass M] {a : M} (h : ∀ (a' : M), AddCommute a a') (f : AddMonoidAlgebra R M) :
                                        Commute (of' R M a) f

                                        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
                                        Instances For
                                          theorem AddMonoidAlgebra.induction_on {M : Type u_2} {R : Type u_6} [Semiring R] [AddMonoid M] {p : AddMonoidAlgebra R MProp} (x : AddMonoidAlgebra R M) (hM : ∀ (m : M), p ((of R M) (Multiplicative.ofAdd m))) (hadd : ∀ (x y : AddMonoidAlgebra R M), p xp yp (x + y)) (hsmul : ∀ (r : R) (x : AddMonoidAlgebra R M), p xp (r x)) :
                                          p x

                                          Algebra structure #

                                          theorem AddMonoidAlgebra.ringHom_ext' {M : Type u_2} {R : Type u_6} {S : Type u_7} [Semiring R] [Semiring S] [AddMonoid M] {f g : AddMonoidAlgebra R M →+* S} (h₁ : f.comp singleZeroRingHom = g.comp singleZeroRingHom) (h_of : (↑f).comp (of R M) = (↑g).comp (of R M)) :
                                          f = g

                                          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].

                                          theorem AddMonoidAlgebra.ringHom_ext'_iff {M : Type u_2} {R : Type u_6} {S : Type u_7} [Semiring R] [Semiring S] [AddMonoid M] {f g : AddMonoidAlgebra R M →+* S} :
                                          f = g f.comp singleZeroRingHom = g.comp singleZeroRingHom (↑f).comp (of R M) = (↑g).comp (of R M)