Structure Operations

Numerical Invariants

Note that the # operator only returns a value for finite (quotients of) polynomial rings.

Rank(P): RngMPol -> RngIntElt

Return the number of indeterminates of polynomial ring \(P\) over its coefficient ring.

Characteristic(P): RngMPol -> RngIntElt
#P: RngMPol -> RngIntElt

Ring Predicates and Booleans

The usual ring functions returning Boolean values are available on polynomial rings.

IsCommutative(P): RngMPol -> BoolElt
IsUnitary(P): RngMPol -> BoolElt
IsFinite(P): RngMPol -> BoolElt
IsOrdered(P): RngMPol -> BoolElt
IsField(P): RngMPol -> BoolElt
IsEuclideanDomain(P): RngMPol -> BoolElt
IsPID(P): RngMPol -> BoolElt
IsUFD(P): RngMPol -> BoolElt
IsDivisionRing(P): RngMPol -> BoolElt
IsEuclideanRing(P): RngMPol -> BoolElt
IsDomain(P): RngMPol -> BoolElt
IsPrincipalIdealRing(P): RngMPol -> BoolElt
P eq Q: RngMPol, RngMPol -> BoolElt

Return whether the polynomial rings \(P\) and \(Q\) are the same ring.

By default, each call to PolynomialRing(R, n) creates a new, non-global polynomial ring, even with the same arguments, while PolynomialRing(R) returns the same global univariate polynomial ring each time; the parameter Global changes this in both cases. Two different non-global multivariate polynomial rings are not contained in one another, so P eq Q gives an error for them rather than returning false, and the same holds for their elements and ideals. With Global := true, PolynomialRing(R, n) returns the unique global ring over \(R\) with \(n\) variables, so \(P\) and \(Q\) obtained in this way are the same ring and P eq Q is true. To test whether \(P\) and \(Q\) are the same ring without an error, use IsIdentical(P, Q); to test whether they have the same rank, coefficient ring and monomial order, compare Rank, BaseRing and MonomialOrder directly.

P ne Q: RngMPol, RngMPol -> BoolElt

Changing Coefficient Ring

The ChangeRing function enables the changing of the coefficient ring of a polynomial ring.

ChangeRing(P, S): RngMPol, Rng -> RngMPol

Given a polynomial ring \(P=R[x_1, \ldots, x_n]\) of rank \(n\) with coefficient ring \(R\), together with a ring \(S\), construct the polynomial ring \(Q=S[x_1, \ldots, x_n]\). It is necessary that all elements of the old coefficient ring \(R\) can be automatically coerced into the new coefficient ring \(S\).

Homomorphisms

In its general form, a ring homomorphism taking a polynomial ring \(R[x_1, \ldots, x_n]\) as domain requires \(n+1\) pieces of information, namely, a map (homomorphism) telling how to map the coefficient ring \(R\) together with the images of the \(n\) indeterminates.

hom< P -> S | f, y1, ..., yn >: RngMPol, Rng, Map, RngElt, ..., RngElt -> Map
hom< P -> S | y1, ..., yn >: RngMPol, Rng, RngElt, ..., RngElt -> Map

Given a polynomial ring \(P=R[x_1,\ldots, x_n]\), a ring \(S\), a map \(f : R\ar S\), and \(n\) elements \(y_1, \ldots, y_n\in S\), create the homomorphism \(g : P\ar S\) by applying the rules that \(g(rx_1^{a_1}\cdots x_n^{a_n})=f(r)y_1^{a_1}\cdots y_n^{a_n}\) for monomials and linearity, that is, \(g(M+N)=g(M)+g(N)\). 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 images \(y_i\) are allowed to be from a structure that allows automatic coercion into \(S\).

Example: Homomorphism into a Number Field (ex-a59b0c)

In this example we map \({\Q}[x, y]\) into the number field \({\Q}(\root 3 \of 2, \sqrt{5})\) by sending \(x\) to \(\root 3 \of 2\) and \(y\) to \(\sqrt{5}\) and the identity map on the coefficients (which we omit).

> Q := RationalField();
> R<x, y> := PolynomialRing(Q, 2);
> A<a> := PolynomialRing(IntegerRing());
> N<z, w> := NumberField([a^3-2, a^2+5]);
> h := hom< R -> N | z, w >;
> h(x^11*y^3-x+4/5*y-13/4);
-40*w*z^2 - z + 4/5*w - 13/4

Run in calculator (opens in a new tab)