Computations in a quotient ring R/I of a polynomial ring R can be done with the aid of a Groebner basis for the ideal I. One must begin by choosing a way to order the monomials of R, so that each polynomial has a designated leading term. A Groebner basis is then a generating set for I whose leading terms generate the ideal of leading terms of all the elements of I. See polynomial rings with other monomial orderings for information about setting up the ordering of the monomials.
Many routines in Macaulay 2 will compute and use Groebner bases silently, so ordinarily the user will not have to explicitly compute them. Recomputation is avoided, in that if a Groebner basis has already been partially computed, then it will be used whenever possible. Occasionally, the user will need to exercise closer control over the computations, and may need to compute the Groebner bases directly.
To demonstrate, we set up a polynomial ring. (The default ordering used here of the monomials is the graded reverse lexicographic ordering.)
i1 : R = ZZ/101[a..d]; |
i2 : I = ideal (a^2*b-c^2, a*b^2-d^3, c^5-d) |
The Groebner basis can be obtained with gb.
i3 : gb I |
The result obtained above is an object of class GroebnerBasis that encapsulates the basis, the state of the computation, in case it's incomplete, and several associated matrices.
The basis can be assembled into a matrix with generators, or its abbreviation, gens.
i4 : transpose generators gb I |
We transposed the matrix above, simply because column vectors of polynomials tend to fit on the page more easily than row vectors.
Here is another example, which illustrates the use of another monomial ordering convenient for the elimination of variables.
i5 : A = ZZ/101[t]; |
i6 : f = t^3 + t^2 + 1; |
i7 : g = t^4 - t; |
We wish to find a polynomial relation among f and g, so we set up a new ring with a monomial ordering tailored for the elimination of its first variable. (See Eliminate).
i8 : B = ZZ/101[t,F,G,MonomialOrder => Eliminate 1]; |
i9 : I = ideal(F - (t^3 + t^2 + 1), G - (t^4 - t)) |
i10 : transpose gens gb I |
The entry in the matrix above not involving t is the desired relation.
Computations in a quotient module M/N can be done with the aid of a Groebner basis for the submodule N.
i11 : clearAll |
i12 : R = ZZ/101[a..f]; |
i13 : N = image matrix {{a,b,c},{d,e,f}} |
i14 : gb N |
Notice the appearance of the 2 by 2 minors.
Groebner bases can be computed in various types of rings: polynomial rings over fields, skew-commutative-polynomial rings, Weyl algebras, and quotient rings of any such rings. Groebner bases in rings over the integers can be computed for homogeneous ideals. In the future Groebner bases will be provided for nonhomogeneous ideals in rings over the integers, in polynomial rings over polynomial rings, and in general noncommutative algebras.