Structure Operations
Numerical Invariants
Note that the # operator only returns a value for finite (quotients of) polynomial rings.
Ring Predicates and Booleans
The usual ring functions returning Boolean values are available on polynomial rings.
- 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, whilePolynomialRing(R)returns the same global univariate polynomial ring each time; the parameterGlobalchanges this in both cases. Two different non-global multivariate polynomial rings are not contained in one another, soP eq Qgives an error for them rather than returningfalse, and the same holds for their elements and ideals. WithGlobal := 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 andP eq Qistrue. To test whether \(P\) and \(Q\) are the same ring without an error, useIsIdentical(P, Q); to test whether they have the same rank, coefficient ring and monomial order, compareRank,BaseRingandMonomialOrderdirectly.
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