Structure Operations
Changing Rings
The ChangeRing function enables changing coefficient rings on a polynomial ring.
- ChangeRing(P, S): RngUPol, Rng -> RngUPol, Map
Given a polynomial ring \(P=R[x]\), together with a ring \(S\), construct the polynomial ring \(Q=S[y]\), together with the homomorphism \(h\) from \(P\) to \(Q\). It is necessary that all elements of the old coefficient ring \(R\) can be automatically coerced into the new coefficient ring \(S\). The homomorphism \(h\) will apply this coercion to the coefficients of elements in \(P\) to return elements of \(Q\). The usual angle bracket notation can be used for indeterminate names on the result.
- ChangeRing(P, S, f): RngUPol, Rng, Map -> RngUPol, Map
Given a polynomial ring \(P=R[x]\), together with a ring \(S\) and a map \(f\colon R\rightarrow S\), construct the polynomial ring \(Q=S[y]\) together with the homomorphism \(h\) from \(P\) to \(Q\) obtained by applying \(h\) to the coefficients of elements of \(P\). The usual angle bracket notation can be used for indeterminate names on the result.
- Example: Changing the Coefficient Ring (ex-332ea1)
In the first example of
ChangeRingbelow we use automatic coercion of integers to rationals to go from \({\mathbb{Z}}[x]\) to \({\mathbb{Q}}[y]\). In fact!can be used for this as well. In the second example we use a map to obtain a non-standard embedding (not mapping \(1\) to \(1\)) of \({\mathbb{Z}}\) in \({\mathbb{Q}}\).> Z := Integers(); > Q := RationalField(); > P<x> := PolynomialRing(Z); > S<y>, h := ChangeRing(P, Q); > h(x^3-2*x+5); y^3 - 2*y + 5 > S ! (x^3-2*x+5); y^3 - 2*y + 5 > m := hom< Z -> Q | x :-> 3*x >; > S<y>, h := ChangeRing(P, Q, m); > h(x^3-2*x+5); 3*y^3 - 6*y + 15
Numerical Invariants
The characteristic can be obtained for any polynomial ring, the rank for free polynomial rings, and the cardinality only for finite quotients.
- Rank(P): RngUPol -> RngIntElt
Return the rank of the polynomial ring \(P\), defined as the maximal number of independent indeterminates in \(P\) over its coefficient ring; for univariate polynomial rings this will therefore always return \(1\).
Ring Predicates and Booleans
The usual ring functions returning Boolean values are available on polynomial rings.
Homomorphisms
A ring homomorphism taking a polynomial ring \(R[x]\) as its domain requires \(2\) pieces of information, namely, a map (homomorphism) telling how to map the coefficient ring \(R\), together with the image of the indeterminate \(x\). The map may be omitted.
- hom< P -> S | f, y >: RngUPol, Rng, Map, RngElt -> Map
- hom< P -> S | y >: RngPol, Rng, RngElt -> Map
Given a polynomial ring \(P=R[x]\), a ring \(S\), a map \(f : R\ar S\), and an element \(y\in S\), create the homomorphism \(g : P\ar S\) given by that \(g(\sum s_ix^i)=\sum f(s_i)y^{i}\). The coefficient ring map may be omitted, in which case the coefficients are mapped into \(S\) by the unitary homomorphism sending \(1_R\) to \(1_S\). Also, the image \(y\) is allowed to be from a structure that allows automatic coercion into \(S\).
- Example: Homomorphism into the Real Field (ex-c83216)
In this example we map \({\mathbb{Z}}[x]\) into the reals by sending \(x\) to \(1/2\). Note that we do not have a choice for the coefficient map (since we require it to be unitary), and also that we give the image of \(x\) as a rational number that is automatically coerced into the reals.
> Z := Integers(); > P<x> := PolynomialRing(Z); > Re := RealField(20); > half := hom< P -> Re | 1/2 >; > half(x^3-3*x+5); 3.625