This chapter describes multivariate polynomial rings in Magma. A multivariate polynomial ring in any number of variables n >= 1 can be created over an arbitrary coefficient ring R, and we will denote it by P=R[x_1, ..., x_n]. Certain functions, however, will only apply for coefficient rings satisfying certain conditions.
Magma contains a powerful system for computing in ideals of multivariate polynomial rings. This is based on the construction of Gröbner bases of such ideals. Gröbner bases were introduced by Bruno Buchberger (On Finding a Vector Space Basis of the Residue Class Ring Modulo a Zero Dimensional Polynomial Ideal [German], PhD Thesis, Univ. of Innsbruck, Austria, 1965) and at the heart of the theory is the Buchberger algorithm which computes a Gröbner basis of an ideal starting from an arbitrary basis (generating set) of the ideal. Two excellent introductions to the theory of Gröbner bases are the books "Ideals, Varieties, and Algorithms" by D. Cox, J. Little, and D. O'Shea (Springer Verlag, New York, 2nd Ed., 1997), and "Gröbner Bases" by T. Becker and V. Weispfenning (Springer Verlag, New York, 1993). Both of these books have inspired a lot of the design and presentation of ideals of multivariate polynomial rings in Magma. In the following sections, the books will be referred to by mentioning the authors only.
Permutation and matrix groups have a natural action on multivariate polynomial rings. This leads to the subject of invariant rings of finite groups, which is covered in the chapter having that name. See also the chapter on modules over the multivariate polynomial rings K[x_1, ..., x_n] .
Multivariate polynomials in Magma are stored efficiently in distributive
form, using linked lists of coefficients and monomials,
but the arithmetic operations on polynomials of one variable stored in
this way may be considerably slower than the use of univariate polynomials.
It is possible but not advised to use distributive `multivariate' polynomials
in one single variable. (See the previous chapter for univariate
polynomial rings.)
Print Names
The AssignNames and Name functions can be used to associate
names with the indeterminates of polynomial rings after creation.
AssignNames(~P, s) : RngMPol, [ MonStgElt ]) ->
Procedure to change the name of the indeterminates of a polynomial ring P. The i-th indeterminate will be given the name of the i-th element of the sequence of strings s (for 1 <= i <= #s); the sequence may have length less than the number of indeterminates of P, in which case the remaining indeterminate names remain unchanged.This procedure only changes the name used in printing the elements of P. It does not assign to identifiers corresponding to the strings the indeterminates in P; to do this, use an assignment statement, or use angle brackets when creating the polynomial ring.
Note that since this is a procedure that modifies P, it is necessary to have a reference ~P to P in the call to this function.
Given a polynomial ring P, return the i-th indeterminate of P (as an element of P).
In its general form a ring homomorphism taking a polynomial ring R[x_1, ..., 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, y_1, ..., y_n > : RngMPol, Rng -> Map
Given a polynomial ring P=R[x_1, ..., x_n], a ring S, a map f : R -> S and n elements y_1, ..., y_n in S, create the homomorphism g : P -> S by applying the rules that g(rx_1^(a_1) ... x_n^(a_n))=f(r)y_1^(a_1) ... 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.
> 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