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 ais the skew polynomiala X ^ n. Note thatSkewPolynomial.monomial nis defined as anR-linear map.SkewPolynomial.C ais the constant skew polynomiala. Note thatCis defined as an additive homomorphism.SkewPolynomial.CRingHom ais the constant skew polynomiala, as a ring homomorphism. This requires to assume[MulSemiringAction (Multiplicative ℕ) R].SkewPolynomial.Xis the skew polynomialX, i.e.,SkewPolynomial.monomial 1 1.p.sum fis∑ n ∈ p.support, f n (p.coeff n), i.e., one sums the values of functions applied to coefficients of the polynomialp.SkewPolynomial.coeff p nis the coefficient ofX ^ ninp.SkewPolynomial.erase p nis the skew polynomialpin which one removes the monomial in degreen.SkewPolynomial.update p n ais the skew polynomial obtained by replacing the coefficient of degreenby a given valuea : R. Ifa = 0, this is equal top.erase nIfp.natDegree < nanda ≠ 0, this increases the degree ofpton.
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$.
Reference #
The definition is inspired by Chapter 3 of [Pap23].
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.
The skew polynomials over R is the type of univariate polynomials over R
endowed with a skewed convolution product.
Equations
Instances For
The set of all n such that X^n has a non-zero coefficient.
Equations
- p.support = Finset.map { toFun := ⇑Multiplicative.toAdd, inj' := SkewPolynomial.support._proof_1 } (SkewMonoidAlgebra.support p)
Instances For
Though SkewPolynomial.support is not definiyionally equal to SkewMonoidAlgebra.support we
can relate them using the following lemma.
coeff p n is the coefficient of X ^ n in p.
Equations
- p.coeff n = SkewMonoidAlgebra.coeff p (Multiplicative.ofAdd n)
Instances For
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.
Equations
- p.sum f = SkewMonoidAlgebra.sum p fun (n : Multiplicative ℕ) (r : R) => f (Multiplicative.toAdd n) r
Instances For
For a skew polynomial p, p.sum f can be written in terms of SkewMonoidAlgebra.sum p.
Ring homomorphism associated to the twist of the skew polynomial ring.
The multiplication in a skew polynomial ring is given by xr = φ(r)x.
Equations
Instances For
CRingHom a is the constant SkewPolynomial a, as a ring homomorphism. This requires
[MulSemiringAction (Multiplicative ℕ) R].
Instances For
See also SkewPolynomial.sum_add.
See also SkewPolynomial.sum_add'.
See also SkewPolynomial.sum_smul_index' for a version using smul on the RHS.
See also SkewPolynomial.sum_smul_index for a version using multiplication on the RHS.
erase p n is the polynomial p in which the X ^ n term has been erased.
Equations
Instances For
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.
Equations
- p.update n a = SkewMonoidAlgebra.update p (Multiplicative.ofAdd n) a