Documentation

Mathlib.Algebra.Polynomial.Module.Basic

Polynomial module #

In this file, we define the polynomial module for an R-module M, i.e. the R[X]-module M[X].

This is defined as a type alias PolynomialModule R M := ℕ →₀ M, since there might be different module structures on ℕ →₀ M of interest. See the docstring of PolynomialModule for details.

structure PolynomialModule (R : Type u_1) (M : Type u_2) [CommRing R] [AddCommGroup M] [Module R M] :
Type u_2

The R[X]-module M[X] for an R-module M. This is isomorphic (as an R-module) to M[X] when M is a ring.

We require all the module instances Module S (PolynomialModule R M) to factor through R except Module R[X] (PolynomialModule R M). In this constraint, we have the following instances for example :

This is also the reason why R is included in the alias, or else there will be two different instances of Module R[X] (PolynomialModule R[X]).

See https://leanprover.zulipchat.com/#narrow/stream/144837-PR-reviews/topic/.2315065.20polynomial.20modules for the full discussion.

  • ofCoeff :: (
    • coeff : →₀ M

      The coefficients ℕ →₀ M of an element of the additive monoid algebra M[X].

  • )
Instances For
    theorem PolynomialModule.coeff_ofCoeff {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (x : →₀ M) :
    { coeff := x }.coeff = x
    theorem PolynomialModule.ofCoeff_coeff {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (x : PolynomialModule R M) :
    { coeff := x.coeff } = x

    PolynomialModule.coeff as an equiv.

    Equations
    Instances For
      @[simp]
      theorem PolynomialModule.coeffEquiv_apply (R : Type u_2) {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (self : PolynomialModule R M) :
      (coeffEquiv R) self = self.coeff
      @[simp]
      theorem PolynomialModule.coeffEquiv_symm_apply (R : Type u_2) {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (coeff : →₀ M) :
      (coeffEquiv R).symm coeff = { coeff := coeff }
      theorem PolynomialModule.forall {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] {P : PolynomialModule R MProp} :
      (∀ (p : PolynomialModule R M), P p) ∀ (q : →₀ M), P { coeff := q }
      theorem PolynomialModule.exists {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] {P : PolynomialModule R MProp} :
      (∃ (p : PolynomialModule R M), P p) ∃ (q : →₀ M), P { coeff := q }
      @[simp]
      theorem PolynomialModule.coeff_inj {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] {x y : PolynomialModule R M} :
      x.coeff = y.coeff x = y
      theorem PolynomialModule.ofCoeff_inj {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] {x y : →₀ M} :
      { coeff := x } = { coeff := y } x = y
      theorem PolynomialModule.ext {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] {x y : PolynomialModule R M} :
      x.coeff = y.coeffx = y

      Alias of the forward direction of PolynomialModule.coeff_inj.

      theorem PolynomialModule.ext_iff {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] {x y : PolynomialModule R M} :
      x = y x.coeff = y.coeff
      @[implicit_reducible]
      Equations
      @[implicit_reducible]
      Equations
      @[implicit_reducible]
      noncomputable instance PolynomialModule.instAddCommGroup {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] :
      Equations
      • One or more equations did not get rendered due to their size.
      @[simp]
      theorem PolynomialModule.coeffAddEquiv_apply {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (self : PolynomialModule R M) :
      @[simp]
      theorem PolynomialModule.coeffAddEquiv_symm_apply {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (coeff : →₀ M) :
      coeffAddEquiv.symm coeff = { coeff := coeff }
      @[simp]
      theorem PolynomialModule.coeff_zero {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] :
      coeff 0 = 0
      @[simp]
      theorem PolynomialModule.ofCoeff_zero {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] :
      { coeff := 0 } = 0
      @[simp]
      theorem PolynomialModule.coeff_eq_zero {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] {x : PolynomialModule R M} :
      x.coeff = 0 x = 0
      @[simp]
      theorem PolynomialModule.ofCoeff_eq_zero {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] {x : →₀ M} :
      { coeff := x } = 0 x = 0
      @[simp]
      theorem PolynomialModule.coeff_add {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (x y : PolynomialModule R M) :
      (x + y).coeff = x.coeff + y.coeff
      @[simp]
      theorem PolynomialModule.ofCoeff_add {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (x y : →₀ M) :
      { coeff := x + y } = { coeff := x } + { coeff := y }
      @[simp]
      theorem PolynomialModule.coeff_sum {ι : Type u_1} {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (s : Finset ι) (f : ιPolynomialModule R M) :
      (∑ is, f i).coeff = is, (f i).coeff
      @[simp]
      theorem PolynomialModule.ofCoeff_sum {ι : Type u_1} {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (s : Finset ι) (f : ι →₀ M) :
      { coeff := is, f i } = is, { coeff := f i }
      @[simp]
      theorem PolynomialModule.coeff_finsuppSum {ι : Type u_1} {R : Type u_2} {M : Type u_3} {N : Type u_4} [CommRing R] [AddCommGroup M] [Module R M] [AddCommMonoid N] (f : ι →₀ N) (g : ιNPolynomialModule R M) :
      (f.sum g).coeff = f.sum fun (i : ι) (n : N) => (g i n).coeff
      @[simp]
      theorem PolynomialModule.ofCoeff_finsuppSum {ι : Type u_1} {R : Type u_2} {M : Type u_3} {N : Type u_4} [CommRing R] [AddCommGroup M] [Module R M] [AddCommMonoid N] (f : ι →₀ N) (g : ιN →₀ M) :
      { coeff := f.sum g } = f.sum fun (i : ι) (n : N) => { coeff := g i n }
      noncomputable def PolynomialModule.single (R : Type u_2) {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (n : ) (m : M) :

      MonoidAlgebra.single n m for m : M, r : R is the element rm : PolynomialModule R M.

      Equations
      Instances For
        @[simp]
        theorem PolynomialModule.coeff_single {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (n : ) (m : M) :
        @[simp]
        theorem PolynomialModule.ofCoeff_single {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (n : ) (m : M) :
        { coeff := Finsupp.single n m } = single R n m
        @[deprecated PolynomialModule.coeff_single (since := "2026-06-18")]
        theorem PolynomialModule.single_apply {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (n : ) (m : M) :

        Alias of PolynomialModule.coeff_single.

        @[simp]
        theorem PolynomialModule.single_zero {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (n : ) :
        single R n 0 = 0
        @[simp]
        theorem PolynomialModule.single_add {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (n : ) (m₁ m₂ : M) :
        single R n (m₁ + m₂) = single R n m₁ + single R n m₂
        @[implicit_reducible]
        noncomputable instance PolynomialModule.instModule {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] {S : Type u_5} [CommSemiring S] [Module S M] :

        This is required to have the IsScalarTower S R M instance to avoid diamonds.

        Equations
        instance PolynomialModule.instIsScalarTower {R : Type u_2} [CommRing R] {S : Type u_5} [CommSemiring S] [Algebra S R] (M : Type u) [AddCommGroup M] [Module R M] [Module S M] [IsScalarTower S R M] :
        @[simp]
        theorem PolynomialModule.coeffLinearEquiv_symm_apply (R : Type u_2) {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (S : Type u_5) [CommSemiring S] [Module S M] (a✝ : →₀ M) :
        (coeffLinearEquiv R S).symm a✝ = { coeff := a✝ }
        @[simp]
        theorem PolynomialModule.coeffLinearEquiv_apply (R : Type u_2) {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (S : Type u_5) [CommSemiring S] [Module S M] (a✝ : PolynomialModule R M) :
        (coeffLinearEquiv R S) a✝ = a✝.coeff
        noncomputable def PolynomialModule.lsingle (R : Type u_2) {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (i : ) :

        PolynomialModule.single as a linear map.

        Equations
        Instances For
          theorem PolynomialModule.lsingle_apply {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (i : ) (m : M) (n : ) :
          ((lsingle R i) m).coeff n = if i = n then m else 0
          theorem PolynomialModule.single_smul {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (i : ) (r : R) (m : M) :
          single R i (r m) = r single R i m
          theorem PolynomialModule.induction_linear {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] {p : PolynomialModule R MProp} (x : PolynomialModule R M) (zero : p 0) (add : ∀ (x y : PolynomialModule R M), p xp yp (x + y)) (single : ∀ (n : ) (m : M), p (single R n m)) :
          p x
          @[implicit_reducible]
          noncomputable instance PolynomialModule.polynomialModule {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] :
          Equations
          • One or more equations did not get rendered due to their size.
          @[simp]
          theorem PolynomialModule.monomial_smul_single {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (i : ) (r : R) (j : ) (m : M) :
          (Polynomial.monomial i) r single R j m = single R (i + j) (r m)
          @[simp]
          theorem PolynomialModule.monomial_smul_lsingle {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (i : ) (r : R) (j : ) (m : M) :
          (Polynomial.monomial i) r (lsingle R j) m = (lsingle R (i + j)) (r m)
          @[simp]
          theorem PolynomialModule.monomial_smul_apply {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (i : ) (r : R) (g : PolynomialModule R M) (n : ) :
          ((Polynomial.monomial i) r g).coeff n = if i n then r g.coeff (n - i) else 0
          @[simp]
          theorem PolynomialModule.smul_single_apply {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (i : ) (f : Polynomial R) (m : M) (n : ) :
          (f single R i m).coeff n = if i n then f.coeff (n - i) m else 0
          theorem PolynomialModule.smul_apply {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (f : Polynomial R) (g : PolynomialModule R M) (n : ) :
          (f g).coeff n = xFinset.antidiagonal n, f.coeff x.1 g.coeff x.2

          PolynomialModule R R is isomorphic to R[X] as an R[X] module.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            noncomputable def PolynomialModule.equivPolynomial {R : Type u_2} [CommRing R] {S : Type u_6} [CommRing S] [Algebra R S] :

            PolynomialModule R S is isomorphic to S[X] as an R module.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              @[simp]
              theorem PolynomialModule.equivPolynomial_single {R : Type u_2} [CommRing R] {S : Type u_6} [CommRing S] [Algebra R S] (n : ) (x : S) :
              @[simp]
              theorem PolynomialModule.hom_ext {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] {M' : Type u_7} [AddCommGroup M'] [Module R M'] {f g : PolynomialModule R M →ₗ[R] M'} (h : ∀ (a : ), f ∘ₗ lsingle R a = g ∘ₗ lsingle R a) :
              f = g

              Two R-linear maps from PolynomialModule R M which are equal after pre-composition with every lsingle R a are equal.

              theorem PolynomialModule.hom_ext_iff {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] {M' : Type u_7} [AddCommGroup M'] [Module R M'] {f g : PolynomialModule R M →ₗ[R] M'} :
              f = g ∀ (a : ), f ∘ₗ lsingle R a = g ∘ₗ lsingle R a
              noncomputable def PolynomialModule.map {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (R' : Type u_6) {M' : Type u_7} [CommRing R'] [AddCommGroup M'] [Module R' M'] [Module R M'] (f : M →ₗ[R] M') :

              The image of a polynomial under a linear map.

              Equations
              Instances For
                @[simp]
                theorem PolynomialModule.map_single {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (R' : Type u_6) {M' : Type u_7} [CommRing R'] [AddCommGroup M'] [Module R' M'] [Module R M'] (f : M →ₗ[R] M') (i : ) (m : M) :
                (map R' f) (single R i m) = single R' i (f m)
                @[simp]
                theorem PolynomialModule.map_lsingle {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (R' : Type u_6) {M' : Type u_7} [CommRing R'] [AddCommGroup M'] [Module R' M'] [Module R M'] (f : M →ₗ[R] M') (i : ) (m : M) :
                (map R' f) ((lsingle R i) m) = (lsingle R' i) (f m)
                theorem PolynomialModule.map_smul {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (R' : Type u_6) {M' : Type u_7} [CommRing R'] [AddCommGroup M'] [Module R' M'] [Module R M'] [Algebra R R'] [IsScalarTower R R' M'] (f : M →ₗ[R] M') (p : Polynomial R) (q : PolynomialModule R M) :
                (map R' f) (p q) = Polynomial.map (algebraMap R R') p (map R' f) q
                def PolynomialModule.eval {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (r : R) :

                Evaluate a polynomial p : PolynomialModule R M at r : R.

                Equations
                Instances For
                  theorem PolynomialModule.eval_apply {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (r : R) (p : PolynomialModule R M) :
                  (eval r) p = p.coeff.sum fun (i : ) (m : M) => r ^ i m
                  @[simp]
                  theorem PolynomialModule.eval_single {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (r : R) (i : ) (m : M) :
                  (eval r) (single R i m) = r ^ i m
                  @[simp]
                  theorem PolynomialModule.eval_lsingle {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (r : R) (i : ) (m : M) :
                  (eval r) ((lsingle R i) m) = r ^ i m
                  @[simp]
                  theorem PolynomialModule.eval_smul {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (p : Polynomial R) (q : PolynomialModule R M) (r : R) :
                  (eval r) (p q) = Polynomial.eval r p (eval r) q
                  @[simp]
                  theorem PolynomialModule.eval_map {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (R' : Type u_6) {M' : Type u_7} [CommRing R'] [AddCommGroup M'] [Module R' M'] [Module R M'] [Algebra R R'] [IsScalarTower R R' M'] (f : M →ₗ[R] M') (q : PolynomialModule R M) (r : R) :
                  (eval ((algebraMap R R') r)) ((map R' f) q) = f ((eval r) q)
                  @[simp]
                  theorem PolynomialModule.eval_map' {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (f : M →ₗ[R] M) (q : PolynomialModule R M) (r : R) :
                  (eval r) ((map R f) q) = f ((eval r) q)
                  @[simp]
                  theorem PolynomialModule.aeval_equivPolynomial {R : Type u_2} [CommRing R] {S : Type u_8} [CommRing S] [Algebra S R] (f : PolynomialModule S S) (x : R) :
                  noncomputable def PolynomialModule.comp {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (p : Polynomial R) :

                  comp p q is the composition of p : R[X] and q : M[X] as q(p(x)).

                  Equations
                  Instances For
                    @[simp]
                    theorem PolynomialModule.comp_apply {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (p : Polynomial R) (x : PolynomialModule R M) :
                    (comp p) x = (eval p) ((map (Polynomial R) (lsingle R 0)) x)
                    theorem PolynomialModule.comp_single {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (p : Polynomial R) (i : ) (m : M) :
                    (comp p) (single R i m) = p ^ i single R 0 m
                    theorem PolynomialModule.comp_eval {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (p : Polynomial R) (q : PolynomialModule R M) (r : R) :
                    (eval r) ((comp p) q) = (eval (Polynomial.eval r p)) q
                    theorem PolynomialModule.comp_smul {R : Type u_2} {M : Type u_3} [CommRing R] [AddCommGroup M] [Module R M] (p p' : Polynomial R) (q : PolynomialModule R M) :
                    (comp p) (p' q) = p'.comp p (comp p) q