The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V09. Commutative algebra I: ideals, polynomials, factorization

Mathlib.Algebra.SkewPolynomial.Basic

138 declarations and 6 deprecated aliases. Mathlib docs · Source

Univariate skew polynomials

Given a ring R and an endomorphism φ on R the skew polynomials over R are polynomials $$\sum_{i= 0}^n a_iX^n, n\geq 0, a_i\in R$$ where the addition is the usual addition of polynomials $$\sum_{i= 0}^n a_iX^n + \sum_{i= 0}^n b_iX^n= \sum_{i= 0}^n (a_i + b_i)X^n.$$ The multiplication, however, is determined by $$Xa = \varphi (a)X$$ by extending it to all polynomials in the obvious way.

Skew polynomials are represented as SkewMonoidAlgebra R (Multiplicative ℕ), where R is usually at least a Semiring. In this file, we define SkewPolynomial and provide basic instances.

Note: To register the endomorphism φ see notation below.

Notation

The endomorphism φ is implemented using some action of Multiplicative ℕ on R. From this action, φ is an abbrev denoting $(\text{ofAdd } 1) \cdot a := \varphi(a)$.

Users that want to work with a specific map φ should introduce an action of Multiplicative ℕ on R. Specifying that this action is a MulSemiringAction amounts to saying that φ is an endomorphism.

Furthermore, with this notation φ^[n](a) = (ofAdd n) • a, see φ_iterate_apply.

Main definitions

  • SkewPolynomial.monomial n a is the skew polynomial a X ^ n. Note that SkewPolynomial.monomial n is defined as an R-linear map.
  • SkewPolynomial.C a is the constant skew polynomial a. Note that C is defined as an additive homomorphism.
  • SkewPolynomial.CRingHom a is the constant skew polynomial a, as a ring homomorphism. This requires to assume [MulSemiringAction (Multiplicative ℕ) R].
  • SkewPolynomial.X is the skew polynomial X, i.e., SkewPolynomial.monomial 1 1.
  • p.sum f is ∑ n ∈ p.support, f n (p.coeff n), i.e., one sums the values of functions applied to coefficients of the polynomial p.
  • SkewPolynomial.coeff p n is the coefficient of X ^ n in p.
  • SkewPolynomial.erase p n is the skew polynomial p in which one removes the monomial in degree n.
  • SkewPolynomial.update p n a is the skew polynomial obtained by replacing the coefficient of degree n by a given value a : R. If a = 0, this is equal to p.erase n If p.natDegree < n and a ≠ 0, this increases the degree of p to n.

Implementation notes

The implementation uses Multiplicative ℕ instead of ℕ, since Mathlib does not contain an additive version of SkewMonoidAlgebra.

This decision was made because we use the type class MulSemiringAction to specify the properties the action needs to respect for associativity. There is no version of this in Mathlib that uses an acting AddMonoid M and so we need to use Multiplicative ℕ for the action.

For associativity to hold, there should be an instance of MulSemiringAction (Multiplicative ℕ) R present in the context. For example, in the context of $\mathbb{F}_q$-linear polynomials, this can be the $q$-th Frobenius endomorphism - so $\varphi(a) = a^q$.

References

The definition is inspired by Chapter 3 of [Papikian2023].

Tags

Skew Polynomials, Twisted Polynomials.

Note that [ore33] proposes a more general definition of skew polynomial ring, where the multiplication is determined by $Xa = \varphi (a)X + δ (a)$, where φ is as above and δ is a derivation.

abbrev SkewPolynomial E1 #

(R : Type u_1) → [AddCommMonoid R] → Type (max u_1 0)

The skew polynomials over R is the type of univariate polynomials over R endowed with a skewed convolution product.

theorem SkewPolynomial.zero_def E0 #

∀ {R : Type u_1} [inst : Semiring R], 0 = 0

def SkewPolynomial.support E1 #

{R : Type u_1} → [inst : Semiring R] → SkewPolynomial R → Finset ℕ

The set of all n such that X^n has a non-zero coefficient.

theorem SkewPolynomial.support_eq_skewMonoidAlgebra_support E1 #

∀ {R : Type u_1} [inst : Semiring R] (p : SkewPolynomial R),
  p.support = Finset.map Multiplicative.toAdd.toEmbedding (SkewMonoidAlgebra.support p)

Though SkewPolynomial.support is not definitionally equal to SkewMonoidAlgebra.support we can relate them using the following lemma.

theorem SkewPolynomial.support_zero E0 #

∀ {R : Type u_1} [inst : Semiring R], SkewPolynomial.support 0 = ∅

theorem SkewPolynomial.support_eq_empty E0 #

∀ {R : Type u_1} [inst : Semiring R] {p : SkewPolynomial R}, p.support = ∅ ↔ p = 0

theorem SkewPolynomial.card_support_eq_zero E1 #

∀ {R : Type u_1} [inst : Semiring R] {p : SkewPolynomial R}, p.support.card = 0 ↔ p = 0

theorem SkewPolynomial.support_add E1 #

∀ {R : Type u_1} [inst : Semiring R] {p q : SkewPolynomial R}, (p + q).support ⊆ p.support ∪ q.support

def SkewPolynomial.coeff E1 #

{R : Type u_1} → [inst : Semiring R] → SkewPolynomial R → ℕ → R

coeff p n is the coefficient of X ^ n in p.

theorem SkewPolynomial.mem_support_iff E0 #

∀ {R : Type u_1} {n : ℕ} [inst : Semiring R] {p : SkewPolynomial R}, n ∈ p.support ↔ p.coeff n ≠ 0

theorem SkewPolynomial.notMem_support_iff E0 #

∀ {R : Type u_1} {n : ℕ} [inst : Semiring R] {p : SkewPolynomial R}, n ∉ p.support ↔ p.coeff n = 0

def SkewPolynomial.sum E1 #

{R : Type u_1} → [inst : Semiring R] → {S : Type u_3} → [AddCommMonoid S] → SkewPolynomial R → (ℕ → R → S) → S

p.sum f is ∑ n ∈ p.support, f n (p.coeff n), i.e., one sums the values of functions applied to coefficients of the polynomial p.

theorem SkewPolynomial.sum_def' E1 #

∀ {R : Type u_1} [inst : Semiring R] {S : Type u_3} [inst_1 : AddCommMonoid S] (p : SkewPolynomial R) (f : ℕ → R → S),
  p.sum f = p.coeff.sum fun n r ↦ f (Multiplicative.toAdd n) r

For a skew polynomial p, p.sum f can be written in terms of Finsupp.sum.

theorem SkewPolynomial.sum_def E0 #

∀ {R : Type u_1} [inst : Semiring R] {S : Type u_3} [inst_1 : AddCommMonoid S] (p : SkewPolynomial R) (f : ℕ → R → S),
  p.sum f = ∑ n ∈ p.support, f n (p.coeff n)

theorem SkewPolynomial.sum_sum_index E1 #

∀ {R : Type u_1} [inst : Semiring R] {R' : Type u_3} {P : Type u_4} [inst_1 : AddCommMonoid P] [inst_2 : Semiring R']
  {f : SkewPolynomial R} {g : ℕ → R → SkewPolynomial R'} {h : ℕ → R' → P},
  (∀ (a : ℕ), h a 0 = 0) →
    (∀ (a : ℕ) (b₁ b₂ : R'), h a (b₁ + b₂) = h a b₁ + h a b₂) → (f.sum g).sum h = f.sum fun a b ↦ (g a b).sum h

theorem SkewPolynomial.sum_zero E0 #

∀ {R : Type u_1} [inst : Semiring R] {N : Type u_3} [inst_1 : AddCommMonoid N] {f : SkewPolynomial R},
  (f.sum fun x x_1 ↦ 0) = 0

def SkewPolynomial.monomial E1 #

{R : Type u_1} → ℕ → [inst : Semiring R] → R →ₗ[R] SkewPolynomial R

monomial s a is the monomial a * X ^ s.

theorem SkewPolynomial.monomial_zero_right E1 #

∀ {R : Type u_1} (n : ℕ) [inst : Semiring R], (SkewPolynomial.monomial n) 0 = 0

theorem SkewPolynomial.monomial_zero_one E1 #

∀ {R : Type u_1} [inst : Semiring R], (SkewPolynomial.monomial 0) 1 = 1

theorem SkewPolynomial.monomial_def E0 #

∀ {R : Type u_1} (n : ℕ) [inst : Semiring R] (a : R),
  (SkewPolynomial.monomial n) a = SkewMonoidAlgebra.single (Multiplicative.ofAdd n) a

theorem SkewPolynomial.monomial_add E1 #

∀ {R : Type u_1} (n : ℕ) [inst : Semiring R] (r s : R),
  (SkewPolynomial.monomial n) (r + s) = (SkewPolynomial.monomial n) r + (SkewPolynomial.monomial n) s

theorem SkewPolynomial.smul_monomial E1 #

∀ {R : Type u_1} (n : ℕ) [inst : Semiring R] {S : Type u_3} [inst_1 : Semiring S] [inst_2 : Module S R] (a : S) (b : R),
  a • (SkewPolynomial.monomial n) b = (SkewPolynomial.monomial n) (a • b)

theorem SkewPolynomial.sum_monomial E0 #

∀ {R : Type u_1} [inst : Semiring R] (f : SkewPolynomial R), (f.sum fun a ↦ ⇑(SkewPolynomial.monomial a)) = f

theorem SkewPolynomial.sum_monomial_index E0 #

∀ {R : Type u_1} [inst : Semiring R] {N : Type u_3} [inst_1 : AddCommMonoid N] {n : ℕ} {b : R} {h : ℕ → R → N},
  h n 0 = 0 → ((SkewPolynomial.monomial n) b).sum h = h n b

theorem SkewPolynomial.monomial_injective E1 #

∀ {R : Type u_1} (n : ℕ) [inst : Semiring R], Function.Injective ⇑(SkewPolynomial.monomial n)

theorem SkewPolynomial.monomial_eq_zero_iff E0 #

∀ {R : Type u_1} (n : ℕ) [inst : Semiring R] (t : R), (SkewPolynomial.monomial n) t = 0 ↔ t = 0

theorem SkewPolynomial.monomial_eq_monomial_iff E0 #

∀ {R : Type u_1} [inst : Semiring R] {m n : ℕ} {a b : R},
  (SkewPolynomial.monomial m) a = (SkewPolynomial.monomial n) b ↔ m = n ∧ a = b ∨ a = 0 ∧ b = 0

theorem SkewPolynomial.induction E1 #

∀ {R : Type u_1} [inst : Semiring R] {motive : SkewPolynomial R → Prop} (p : SkewPolynomial R),
  motive 0 →
    (∀ (n : ℕ) (r : R) (q : SkewPolynomial R),
        n ∉ q.support → r ≠ 0 → motive q → motive ((SkewPolynomial.monomial n) r + q)) →
      motive p

abbrev SkewPolynomial.φ E1 #

{R : Type u_1} → [inst : Semiring R] → [MulSemiringAction (Multiplicative ℕ) R] → R →+* R

Ring homomorphism associated to the twist of the skew polynomial ring. The multiplication in a skew polynomial ring is given by xr = φ(r)x.

theorem SkewPolynomial.φ_def E0 #

∀ {R : Type u_1} [inst : Semiring R] [inst_1 : MulSemiringAction (Multiplicative ℕ) R],
  SkewPolynomial.φ = MulSemiringAction.toRingHom (Multiplicative ℕ) R (Multiplicative.ofAdd 1)

theorem SkewPolynomial.φ_iterate_apply E0 #

∀ {R : Type u_1} [inst : Semiring R] [inst_1 : MulSemiringAction (Multiplicative ℕ) R] (n : ℕ) (a : R),
  (⇑SkewPolynomial.φ)^[n] a = Multiplicative.ofAdd n • a

theorem SkewPolynomial.monomial_mul_monomial E1 #

∀ {R : Type u_1} [inst : Semiring R] [inst_1 : MulSemiringAction (Multiplicative ℕ) R] (n m : ℕ) (r s : R),
  (SkewPolynomial.monomial n) r * (SkewPolynomial.monomial m) s =
    (SkewPolynomial.monomial (n + m)) (r * (⇑SkewPolynomial.φ)^[n] s)

theorem SkewPolynomial.mul_def E0 #

∀ {R : Type u_1} [inst : Semiring R] {f g : SkewPolynomial R} [inst_1 : MulSemiringAction (Multiplicative ℕ) R],
  f * g = f.sum fun a₁ b₁ ↦ g.sum fun a₂ b₂ ↦ (SkewPolynomial.monomial (a₁ + a₂)) (b₁ * (⇑SkewPolynomial.φ)^[a₁] b₂)

def SkewPolynomial.C E1 #

{R : Type u_1} → [inst : Semiring R] → R →+ SkewPolynomial R

C a is the constant SkewPolynomial a. C is provided as an additive homomorphism.

theorem SkewPolynomial.monomial_zero_left E0 #

∀ {R : Type u_1} [inst : Semiring R] ⦃a : R⦄, (SkewPolynomial.monomial 0) a = SkewPolynomial.C a

theorem SkewPolynomial.C_0 E1 #

∀ {R : Type u_1} [inst : Semiring R], SkewPolynomial.C 0 = 0

theorem SkewPolynomial.C_add E1 #

∀ {R : Type u_1} [inst : Semiring R] {a b : R}, SkewPolynomial.C (a + b) = SkewPolynomial.C a + SkewPolynomial.C b

theorem SkewPolynomial.C_1 E1 #

∀ {R : Type u_1} [inst : Semiring R], SkewPolynomial.C 1 = 1

theorem SkewPolynomial.sum_C_index E0 #

∀ {R : Type u_1} [inst : Semiring R] {a : R} {β : Type u_3} [inst_1 : AddCommMonoid β] {f : ℕ → R → β},
  f 0 0 = 0 → (SkewPolynomial.C a).sum f = f 0 a

def SkewPolynomial.CRingHom E1 #

{R : Type u_1} → [inst : Semiring R] → [inst_1 : MulSemiringAction (Multiplicative ℕ) R] → R →+* SkewPolynomial R

CRingHom a is the constant SkewPolynomial a, as a ring homomorphism. This requires [MulSemiringAction (Multiplicative ℕ) R].

theorem SkewPolynomial.CRingHom_eq_C E1 #

∀ {R : Type u_1} [inst : Semiring R] {a : R} [inst_1 : MulSemiringAction (Multiplicative ℕ) R],
  SkewPolynomial.CRingHom a = SkewPolynomial.C a

theorem SkewPolynomial.C_mul E1 #

∀ {R : Type u_1} [inst : Semiring R] {a b : R} [inst_1 : MulSemiringAction (Multiplicative ℕ) R],
  SkewPolynomial.C (a * b) = SkewPolynomial.C a * SkewPolynomial.C b

theorem SkewPolynomial.C_pow E1 #

∀ {R : Type u_1} {n : ℕ} [inst : Semiring R] {a : R} [inst_1 : MulSemiringAction (Multiplicative ℕ) R],
  SkewPolynomial.C (a ^ n) = SkewPolynomial.C a ^ n

theorem SkewPolynomial.C_eq_natCast E1 #

∀ {R : Type u_1} [inst : Semiring R] [MulSemiringAction (Multiplicative ℕ) R] (n : ℕ), SkewPolynomial.C ↑n = ↑n

theorem SkewPolynomial.C_mul_monomial E0 #

∀ {R : Type u_1} {n : ℕ} [inst : Semiring R] {a b : R} [inst_1 : MulSemiringAction (Multiplicative ℕ) R],
  SkewPolynomial.C a * (SkewPolynomial.monomial n) b = (SkewPolynomial.monomial n) (a * b)

theorem SkewPolynomial.monomial_mul_C E0 #

∀ {R : Type u_1} {n : ℕ} [inst : Semiring R] {a b : R} [inst_1 : MulSemiringAction (Multiplicative ℕ) R],
  (SkewPolynomial.monomial n) a * SkewPolynomial.C b = (SkewPolynomial.monomial n) (a * (⇑SkewPolynomial.φ)^[n] b)

def SkewPolynomial.X E3 #

{R : Type u_1} → [inst : Semiring R] → SkewPolynomial R

X is the SkewPolynomial variable (aka indeterminate).

theorem SkewPolynomial.monomial_one_one_eq_X E1 #

∀ {R : Type u_1} [inst : Semiring R], (SkewPolynomial.monomial 1) 1 = SkewPolynomial.X

theorem SkewPolynomial.monomial_one_right_eq_X_pow E1 #

∀ {R : Type u_1} [inst : Semiring R] [inst_1 : MulSemiringAction (Multiplicative ℕ) R] (n : ℕ),
  (SkewPolynomial.monomial n) 1 = SkewPolynomial.X ^ n

theorem SkewPolynomial.X_mul E1 #

∀ {R : Type u_1} [inst : Semiring R] {p : SkewPolynomial R} [inst_1 : MulSemiringAction (Multiplicative ℕ) R],
  SkewPolynomial.X * p = (p.sum fun a b ↦ (SkewPolynomial.monomial a) (SkewPolynomial.φ b)) * SkewPolynomial.X

theorem SkewPolynomial.X_pow_mul E1 #

∀ {R : Type u_1} [inst : Semiring R] {p : SkewPolynomial R} [inst_1 : MulSemiringAction (Multiplicative ℕ) R] {n : ℕ},
  SkewPolynomial.X ^ n * p =
    (p.sum fun a b ↦ (SkewPolynomial.monomial a) ((⇑SkewPolynomial.φ)^[n] b)) * SkewPolynomial.X ^ n

theorem SkewPolynomial.monomial_mul_X E0 #

∀ {R : Type u_1} [inst : Semiring R] [inst_1 : MulSemiringAction (Multiplicative ℕ) R] (n : ℕ) (r : R),
  (SkewPolynomial.monomial n) r * SkewPolynomial.X = (SkewPolynomial.monomial (n + 1)) r

theorem SkewPolynomial.monomial_mul_X_pow E0 #

∀ {R : Type u_1} [inst : Semiring R] [inst_1 : MulSemiringAction (Multiplicative ℕ) R] (n : ℕ) (r : R) (k : ℕ),
  (SkewPolynomial.monomial n) r * SkewPolynomial.X ^ k = (SkewPolynomial.monomial (n + k)) r

theorem SkewPolynomial.X_mul_monomial E0 #

∀ {R : Type u_1} [inst : Semiring R] [inst_1 : MulSemiringAction (Multiplicative ℕ) R] (n : ℕ) (r : R),
  SkewPolynomial.X * (SkewPolynomial.monomial n) r = (SkewPolynomial.monomial (n + 1)) (SkewPolynomial.φ r)

theorem SkewPolynomial.X_pow_mul_monomial E0 #

∀ {R : Type u_1} [inst : Semiring R] [inst_1 : MulSemiringAction (Multiplicative ℕ) R] (k n : ℕ) (r : R),
  SkewPolynomial.X ^ k * (SkewPolynomial.monomial n) r = (SkewPolynomial.monomial (n + k)) ((⇑SkewPolynomial.φ)^[k] r)

theorem SkewPolynomial.coeff_monomial E1 #

∀ {R : Type u_1} {m n : ℕ} [inst : Semiring R] {a : R}, ((SkewPolynomial.monomial n) a).coeff m = if n = m then a else 0

theorem SkewPolynomial.coeff_zero E0 #

∀ {R : Type u_1} [inst : Semiring R] (n : ℕ), SkewPolynomial.coeff 0 n = 0

theorem SkewPolynomial.coeff_one_zero E0 #

∀ {R : Type u_1} [inst : Semiring R], SkewPolynomial.coeff 1 0 = 1

theorem SkewPolynomial.coeff_one E1 #

∀ {R : Type u_1} [inst : Semiring R] [MulSemiringAction (Multiplicative ℕ) R] (n : ℕ),
  SkewPolynomial.coeff 1 n = if 0 = n then 1 else 0

theorem SkewPolynomial.coeff_X_one E0 #

∀ {R : Type u_1} [inst : Semiring R], SkewPolynomial.X.coeff 1 = 1

theorem SkewPolynomial.coeff_X_zero E0 #

∀ {R : Type u_1} [inst : Semiring R], SkewPolynomial.X.coeff 0 = 0

theorem SkewPolynomial.coeff_monomial_succ E0 #

∀ {R : Type u_1} {n : ℕ} [inst : Semiring R] {a : R}, ((SkewPolynomial.monomial (n + 1)) a).coeff 0 = 0

theorem SkewPolynomial.coeff_X E1 #

∀ {R : Type u_1} {n : ℕ} [inst : Semiring R], SkewPolynomial.X.coeff n = if 1 = n then 1 else 0

theorem SkewPolynomial.coeff_X_of_ne_one E1 #

∀ {R : Type u_1} [inst : Semiring R] {n : ℕ}, n ≠ 1 → SkewPolynomial.X.coeff n = 0

theorem SkewPolynomial.coeff_C E1 #

∀ {R : Type u_1} {n : ℕ} [inst : Semiring R] {a : R}, (SkewPolynomial.C a).coeff n = if n = 0 then a else 0

theorem SkewPolynomial.coeff_C_zero E0 #

∀ {R : Type u_1} [inst : Semiring R] {a : R}, (SkewPolynomial.C a).coeff 0 = a

theorem SkewPolynomial.coeff_C_ne_zero E1 #

∀ {R : Type u_1} {n : ℕ} [inst : Semiring R] {a : R}, n ≠ 0 → (SkewPolynomial.C a).coeff n = 0

theorem SkewPolynomial.coeff_C_succ E0 #

∀ {R : Type u_1} [inst : Semiring R] {r : R} {n : ℕ}, (SkewPolynomial.C r).coeff (n + 1) = 0

theorem SkewPolynomial.coeff_natCast_ite E0 #

∀ {R : Type u_1} {m n : ℕ} [inst : Semiring R] [MulSemiringAction (Multiplicative ℕ) R],
  (↑m).coeff n = ↑(if n = 0 then m else 0)

theorem SkewPolynomial.coeff_ofNat_zero E0 #

∀ {R : Type u_1} [inst : Semiring R] [MulSemiringAction (Multiplicative ℕ) R] (a : ℕ) [inst_2 : a.AtLeastTwo],
  (OfNat.ofNat a).coeff 0 = OfNat.ofNat a

theorem SkewPolynomial.coeff_ofNat_succ E0 #

∀ {R : Type u_1} [inst : Semiring R] [MulSemiringAction (Multiplicative ℕ) R] (a n : ℕ) [h : a.AtLeastTwo],
  (OfNat.ofNat a).coeff (n + 1) = 0

theorem SkewPolynomial.C_mul_X_pow_eq_monomial E1 #

∀ {R : Type u_1} [inst : Semiring R] {a : R} [inst_1 : MulSemiringAction (Multiplicative ℕ) R] ⦃n : ℕ⦄,
  SkewPolynomial.C a * SkewPolynomial.X ^ n = (SkewPolynomial.monomial n) a

theorem SkewPolynomial.C_mul_X_eq_monomial E1 #

∀ {R : Type u_1} [inst : Semiring R] {a : R} [inst_1 : MulSemiringAction (Multiplicative ℕ) R],
  SkewPolynomial.C a * SkewPolynomial.X = (SkewPolynomial.monomial 1) a

theorem SkewPolynomial.C_injective E1 #

∀ {R : Type u_1} [inst : Semiring R], Function.Injective ⇑SkewPolynomial.C

theorem SkewPolynomial.C_inj E0 #

∀ {R : Type u_1} [inst : Semiring R] {a b : R}, SkewPolynomial.C a = SkewPolynomial.C b ↔ a = b

theorem SkewPolynomial.C_eq_zero E0 #

∀ {R : Type u_1} [inst : Semiring R] {a : R}, SkewPolynomial.C a = 0 ↔ a = 0

theorem SkewPolynomial.Nontrivial.of_polynomial_ne E1 #

∀ {R : Type u_1} [inst : Semiring R] {p q : SkewPolynomial R} [MulSemiringAction (Multiplicative ℕ) R],
  p ≠ q → Nontrivial R

theorem SkewPolynomial.ext_iff E0 #

∀ {R : Type u_1} [inst : Semiring R] {p q : SkewPolynomial R}, p = q ↔ ∀ (n : ℕ), p.coeff n = q.coeff n

theorem SkewPolynomial.ext E1 #

∀ {R : Type u_1} [inst : Semiring R] {p q : SkewPolynomial R}, (∀ (n : ℕ), p.coeff n = q.coeff n) → p = q

theorem SkewPolynomial.addHom_ext'_iff E0 #

∀ {R : Type u_1} [inst : Semiring R] {M : Type u_3} [inst_1 : AddMonoid M] {f g : SkewPolynomial R →+ M},
  f = g ↔
    ∀ (n : ℕ), f.comp (SkewPolynomial.monomial n).toAddMonoidHom = g.comp (SkewPolynomial.monomial n).toAddMonoidHom

theorem SkewPolynomial.addHom_ext' E1 #

∀ {R : Type u_1} [inst : Semiring R] {M : Type u_3} [inst_1 : AddMonoid M] {f g : SkewPolynomial R →+ M},
  (∀ (n : ℕ), f.comp (SkewPolynomial.monomial n).toAddMonoidHom = g.comp (SkewPolynomial.monomial n).toAddMonoidHom) →
    f = g

theorem SkewPolynomial.addHom_ext E1 #

∀ {R : Type u_1} [inst : Semiring R] {M : Type u_3} [inst_1 : AddMonoid M] {f g : SkewPolynomial R →+ M},
  (∀ (n : ℕ) (a : R), f ((SkewPolynomial.monomial n) a) = g ((SkewPolynomial.monomial n) a)) → f = g

theorem SkewPolynomial.addHom_ext_iff E0 #

∀ {R : Type u_1} [inst : Semiring R] {M : Type u_3} [inst_1 : AddMonoid M] {f g : SkewPolynomial R →+ M},
  f = g ↔ ∀ (n : ℕ) (a : R), f ((SkewPolynomial.monomial n) a) = g ((SkewPolynomial.monomial n) a)

theorem SkewPolynomial.linearMap_ext' E1 #

∀ {R : Type u_1} [inst : Semiring R] {M : Type u_3} [inst_1 : AddCommMonoid M] [inst_2 : Module R M]
  {f g : SkewPolynomial R →ₗ[R] M}, (∀ (n : ℕ), f ∘ₗ SkewPolynomial.monomial n = g ∘ₗ SkewPolynomial.monomial n) → f = g

theorem SkewPolynomial.linearMap_ext'_iff E0 #

∀ {R : Type u_1} [inst : Semiring R] {M : Type u_3} [inst_1 : AddCommMonoid M] [inst_2 : Module R M]
  {f g : SkewPolynomial R →ₗ[R] M}, f = g ↔ ∀ (n : ℕ), f ∘ₗ SkewPolynomial.monomial n = g ∘ₗ SkewPolynomial.monomial n

theorem SkewPolynomial.support_monomial E0 #

∀ {R : Type u_1} [inst : Semiring R] (n : ℕ) {a : R}, a ≠ 0 → ((SkewPolynomial.monomial n) a).support = {n}

theorem SkewPolynomial.support_monomial_subset E1 #

∀ {R : Type u_1} [inst : Semiring R] (n : ℕ) {a : R}, ((SkewPolynomial.monomial n) a).support ⊆ {n}

theorem SkewPolynomial.support_C E0 #

∀ {R : Type u_1} [inst : Semiring R] {a : R}, a ≠ 0 → (SkewPolynomial.C a).support = {0}

theorem SkewPolynomial.support_C_subset E1 #

∀ {R : Type u_1} [inst : Semiring R] (a : R), (SkewPolynomial.C a).support ⊆ {0}

theorem SkewPolynomial.support_C_mul_X E0 #

∀ {R : Type u_1} [inst : Semiring R] [inst_1 : MulSemiringAction (Multiplicative ℕ) R] {c : R},
  c ≠ 0 → (SkewPolynomial.C c * SkewPolynomial.X).support = {1}

theorem SkewPolynomial.support_C_mul_X_subset E1 #

∀ {R : Type u_1} [inst : Semiring R] [inst_1 : MulSemiringAction (Multiplicative ℕ) R] (c : R),
  (SkewPolynomial.C c * SkewPolynomial.X).support ⊆ {1}

theorem SkewPolynomial.support_C_mul_X_pow E0 #

∀ {R : Type u_1} [inst : Semiring R] [inst_1 : MulSemiringAction (Multiplicative ℕ) R] (n : ℕ) {c : R},
  c ≠ 0 → (SkewPolynomial.C c * SkewPolynomial.X ^ n).support = {n}

theorem SkewPolynomial.support_C_mul_X_pow_subset E1 #

∀ {R : Type u_1} [inst : Semiring R] [inst_1 : MulSemiringAction (Multiplicative ℕ) R] (n : ℕ) (c : R),
  (SkewPolynomial.C c * SkewPolynomial.X ^ n).support ⊆ {n}

theorem SkewPolynomial.support_binomial_subset E1 #

∀ {R : Type u_1} [inst : Semiring R] [inst_1 : MulSemiringAction (Multiplicative ℕ) R] (k m : ℕ) (x y : R),
  (SkewPolynomial.C x * SkewPolynomial.X ^ k + SkewPolynomial.C y * SkewPolynomial.X ^ m).support ⊆ {k, m}

theorem SkewPolynomial.support_trinomial_subset E1 #

∀ {R : Type u_1} [inst : Semiring R] [inst_1 : MulSemiringAction (Multiplicative ℕ) R] (k m n : ℕ) (x y z : R),
  (SkewPolynomial.C x * SkewPolynomial.X ^ k + SkewPolynomial.C y * SkewPolynomial.X ^ m +
        SkewPolynomial.C z * SkewPolynomial.X ^ n).support ⊆
    {k, m, n}

theorem SkewPolynomial.X_pow_eq_monomial E1 #

∀ {R : Type u_1} [inst : Semiring R] (n : ℕ) [inst_1 : MulSemiringAction (Multiplicative ℕ) R],
  SkewPolynomial.X ^ n = (SkewPolynomial.monomial n) 1

theorem SkewPolynomial.smul_X_eq_monomial E1 #

∀ {R : Type u_1} [inst : Semiring R] {a : R} {n : ℕ} [inst_1 : MulSemiringAction (Multiplicative ℕ) R],
  a • SkewPolynomial.X ^ n = (SkewPolynomial.monomial n) a

theorem SkewPolynomial.support_X_pow E0 #

∀ {R : Type u_1} [inst : Semiring R] [Nontrivial R] (n : ℕ) [inst_2 : MulSemiringAction (Multiplicative ℕ) R],
  (SkewPolynomial.X ^ n).support = {n}

theorem SkewPolynomial.support_X_empty E1 #

∀ {R : Type u_1} [inst : Semiring R], 1 = 0 → SkewPolynomial.X.support = ∅

theorem SkewPolynomial.support_X E0 #

∀ {R : Type u_1} [inst : Semiring R] [Nontrivial R] [MulSemiringAction (Multiplicative ℕ) R],
  SkewPolynomial.X.support = {1}

theorem SkewPolynomial.monomial_left_inj E1 #

∀ {R : Type u_3} [inst : Semiring R] {a : R},
  a ≠ 0 → ∀ {i j : ℕ}, (SkewPolynomial.monomial i) a = (SkewPolynomial.monomial j) a ↔ i = j

theorem SkewPolynomial.natCast_mul E1 #

∀ {R : Type u_3} [inst : Semiring R] (n : ℕ) (p : SkewPolynomial R) [inst_1 : MulSemiringAction (Multiplicative ℕ) R],
  ↑n * p = n • p

theorem SkewPolynomial.sum_eq_of_subset E1 #

∀ {R : Type u_1} [inst : Semiring R] {S : Type u_3} [inst_1 : AddCommMonoid S] {p : SkewPolynomial R} (f : ℕ → R → S),
  (∀ (i : ℕ), f i 0 = 0) → ∀ {s : Finset ℕ}, p.support ⊆ s → p.sum f = ∑ n ∈ s, f n (p.coeff n)

theorem SkewPolynomial.sum_zero_index E0 #

∀ {R : Type u_1} [inst : Semiring R] {S : Type u_3} [inst_1 : AddCommMonoid S] (f : ℕ → R → S),
  SkewPolynomial.sum 0 f = 0

theorem SkewPolynomial.sum_X_index E0 #

∀ {R : Type u_1} [inst : Semiring R] {S : Type u_3} [inst_1 : AddCommMonoid S] {f : ℕ → R → S},
  f 1 0 = 0 → SkewPolynomial.X.sum f = f 1 1

theorem SkewPolynomial.sum_add_index E1 #

∀ {R : Type u_1} [inst : Semiring R] {S : Type u_3} [inst_1 : AddCommMonoid S] (p q : SkewPolynomial R) (f : ℕ → R → S),
  (∀ (i : ℕ), f i 0 = 0) → (∀ (a : ℕ) (b₁ b₂ : R), f a (b₁ + b₂) = f a b₁ + f a b₂) → (p + q).sum f = p.sum f + q.sum f

theorem SkewPolynomial.sum_add' E0 #

∀ {R : Type u_1} [inst : Semiring R] {S : Type u_3} [inst_1 : AddCommMonoid S] (p : SkewPolynomial R) (f g : ℕ → R → S),
  p.sum (f + g) = p.sum f + p.sum g

See also SkewPolynomial.sum_add.

theorem SkewPolynomial.sum_add E0 #

∀ {R : Type u_1} [inst : Semiring R] {S : Type u_3} [inst_1 : AddCommMonoid S] (p : SkewPolynomial R) (f g : ℕ → R → S),
  (p.sum fun n x ↦ f n x + g n x) = p.sum f + p.sum g

See also SkewPolynomial.sum_add'.

theorem SkewPolynomial.sum_smul_index E1 #

∀ {R : Type u_1} [inst : Semiring R] {S : Type u_3} [inst_1 : AddCommMonoid S] (p : SkewPolynomial R) (b : R)
  (f : ℕ → R → S), (∀ (i : ℕ), f i 0 = 0) → (b • p).sum f = p.sum fun n a ↦ f n (b * a)

See also SkewPolynomial.sum_smul_index' for a version using smul on the RHS.

theorem SkewPolynomial.sum_smul_index' E1 #

∀ {R : Type u_1} [inst : Semiring R] {S : Type u_3} [inst_1 : AddCommMonoid S] {T : Type u_4} [inst_2 : DistribSMul T R]
  (p : SkewPolynomial R) (b : T) (f : ℕ → R → S), (∀ (i : ℕ), f i 0 = 0) → (b • p).sum f = p.sum fun n a ↦ f n (b • a)

See also SkewPolynomial.sum_smul_index for a version using multiplication on the RHS.

theorem SkewPolynomial.smul_sum E1 #

∀ {R : Type u_1} [inst : Semiring R] {S : Type u_3} [inst_1 : AddCommMonoid S] {T : Type u_4} [inst_2 : DistribSMul T S]
  (p : SkewPolynomial R) (b : T) (f : ℕ → R → S), b • p.sum f = p.sum fun n a ↦ b • f n a

theorem SkewPolynomial.coeff_add E0 #

∀ {R : Type u_1} [inst : Semiring R] (p q : SkewPolynomial R) (n : ℕ), (p + q).coeff n = p.coeff n + q.coeff n

theorem SkewPolynomial.sum_neg E0 #

∀ {R : Type u_1} [inst : Ring R] {S : Type u_2} [inst_1 : Ring S] (p : SkewPolynomial R) (f : ℕ → R → S),
  (p.sum fun n x ↦ -f n x) = -p.sum f

theorem SkewPolynomial.sum_sub E0 #

∀ {R : Type u_1} [inst : Ring R] {S : Type u_2} [inst_1 : Ring S] (p : SkewPolynomial R) (f g : ℕ → R → S),
  (p.sum fun n x ↦ f n x - g n x) = p.sum f - p.sum g

instance SkewPolynomial.instRing E0 #

{R : Type u_1} → [inst : Ring R] → [MulSemiringAction (Multiplicative ℕ) R] → Ring (SkewPolynomial R)

theorem SkewPolynomial.coeff_neg E0 #

∀ {R : Type u_1} [inst : Ring R] (p : SkewPolynomial R) (n : ℕ), (-p).coeff n = -p.coeff n

theorem SkewPolynomial.coeff_sub E0 #

∀ {R : Type u_1} [inst : Ring R] (p q : SkewPolynomial R) (n : ℕ), (p - q).coeff n = p.coeff n - q.coeff n

theorem SkewPolynomial.monomial_neg E0 #

∀ {R : Type u_1} [inst : Ring R] (n : ℕ) (a : R), (SkewPolynomial.monomial n) (-a) = -(SkewPolynomial.monomial n) a

theorem SkewPolynomial.support_neg E0 #

∀ {R : Type u_1} [inst : Ring R] {p : SkewPolynomial R}, (-p).support = p.support

theorem SkewPolynomial.monomial_sub E1 #

∀ {R : Type u_1} [inst : Ring R] {a b : R} (n : ℕ),
  (SkewPolynomial.monomial n) (a - b) = (SkewPolynomial.monomial n) a - (SkewPolynomial.monomial n) b

theorem SkewPolynomial.C_eq_intCast E1 #

∀ {R : Type u_1} [inst : Ring R] [MulSemiringAction (Multiplicative ℕ) R] (n : ℤ), SkewPolynomial.C ↑n = ↑n

theorem SkewPolynomial.C_neg E1 #

∀ {R : Type u_1} [inst : Ring R] {a : R} [MulSemiringAction (Multiplicative ℕ) R],
  SkewPolynomial.C (-a) = -SkewPolynomial.C a

theorem SkewPolynomial.C_sub E1 #

∀ {R : Type u_1} [inst : Ring R] {a b : R} [MulSemiringAction (Multiplicative ℕ) R],
  SkewPolynomial.C (a - b) = SkewPolynomial.C a - SkewPolynomial.C b

instance SkewPolynomial.instNontrivial E0 #

∀ {R : Type u_1} [inst : Semiring R] [Nontrivial R], Nontrivial (SkewPolynomial R)

theorem SkewPolynomial.X_ne_zero E1 #

∀ {R : Type u_1} [inst : Semiring R] [Nontrivial R], SkewPolynomial.X ≠ 0

def SkewPolynomial.erase E1 #

{R : Type u_1} → [inst : Semiring R] → ℕ → SkewPolynomial R → SkewPolynomial R

erase p n is the polynomial p in which the X ^ n term has been erased.

theorem SkewPolynomial.support_erase E0 #

∀ {R : Type u_1} [inst : Semiring R] {p : SkewPolynomial R} (n : ℕ),
  (SkewPolynomial.erase n p).support = p.support.erase n

theorem SkewPolynomial.monomial_add_erase E1 #

∀ {R : Type u_1} [inst : Semiring R] (p : SkewPolynomial R) (n : ℕ),
  (SkewPolynomial.monomial n) (p.coeff n) + SkewPolynomial.erase n p = p

theorem SkewPolynomial.coeff_erase E0 #

∀ {R : Type u_1} [inst : Semiring R] (p : SkewPolynomial R) (n i : ℕ),
  (SkewPolynomial.erase n p).coeff i = if i = n then 0 else p.coeff i

theorem SkewPolynomial.erase_zero E0 #

∀ {R : Type u_1} [inst : Semiring R] (n : ℕ), SkewPolynomial.erase n 0 = 0

theorem SkewPolynomial.erase_monomial E0 #

∀ {R : Type u_1} [inst : Semiring R] {n : ℕ} {a : R}, SkewPolynomial.erase n ((SkewPolynomial.monomial n) a) = 0

def SkewPolynomial.update E1 #

{R : Type u_1} → [inst : Semiring R] → SkewPolynomial R → ℕ → R → SkewPolynomial R

Replace the coefficient of a p : SkewPolynomial R at a given degree n : ℕ by a given value a : R. If a = 0, this is equal to p.erase n If p.natDegree < n and a ≠ 0, this increases the degree to n.

theorem SkewPolynomial.update_def E0 #

∀ {R : Type u_1} [inst : Semiring R] (p : SkewPolynomial R) (n : ℕ) (a : R),
  p.update n a = SkewMonoidAlgebra.update p (Multiplicative.ofAdd n) a

theorem SkewPolynomial.coeff_update E0 #

∀ {R : Type u_1} [inst : Semiring R] (p : SkewPolynomial R) (n : ℕ) (a : R),
  (p.update n a).coeff = Function.update p.coeff n a

theorem SkewPolynomial.update_zero_eq_erase E0 #

∀ {R : Type u_1} [inst : Semiring R] (p : SkewPolynomial R) (n : ℕ), p.update n 0 = SkewPolynomial.erase n p

theorem SkewPolynomial.support_update E1 #

∀ {R : Type u_1} [inst : Semiring R] (p : SkewPolynomial R) (n : ℕ) (a : R) [inst_1 : DecidableEq R],
  (p.update n a).support = if a = 0 then p.support.erase n else insert n p.support

theorem SkewPolynomial.support_update_zero E1 #

∀ {R : Type u_1} [inst : Semiring R] (p : SkewPolynomial R) (n : ℕ), (p.update n 0).support = p.support.erase n

theorem SkewPolynomial.support_update_ne_zero E1 #

∀ {R : Type u_1} [inst : Semiring R] (p : SkewPolynomial R) (n : ℕ) {a : R},
  a ≠ 0 → (p.update n a).support = insert n p.support

Deprecated aliases

NameNew nameSince
SkewPolynomial.coeff_update_applySkewPolynomial.coeff_update2026-07-06
SkewPolynomial.coeff_update_neSkewPolynomial.coeff_update2026-07-06
SkewPolynomial.coeff_update_sameSkewPolynomial.coeff_update2026-07-06
SkewPolynomial.erase_neSkewPolynomial.coeff_erase2026-07-06
SkewPolynomial.erase_sameSkewPolynomial.coeff_erase2026-07-06
SkewPolynomial.nat_cast_mulSkewPolynomial.natCast_mul2026-10-13