%%
%% ch5.tex
%%
	
\chapter{Rings}
\label{ch-rings}

Every matrix in \Macaulay\ must have a base ring.  This base ring is a
polynomial ring in a certain number of variables, over a prime field
of characteristic p $>$ 0, for some p.  It is possible to work modulo an
ideal (see the qring command in \secref{sec-qrings}).

There may be many rings defined at any instant, but one of these rings
is defined as the ``current ring''.  For commands which input
polynomials (e.g. \icmd {poly, ideal, mat, sparse}), this current ring
is used as the base ring.  Most commands set the current ring, such as
\icmd{add} (add 2 matrices).  You may set it explicitly 
using the \icmd{setring} command.

If a matrix is used as an argument to a \Macaulay\ command which expects
a ring, the base ring of the matrix is used. These commands include 
\icmd{pring}, \icmd{setring}, \icmd{ring-sum}, and the ring map commands
(\chapref{ch-rmaps}).

When a ring is created, say with the name ``r'', the returned
value is actually a 1 by $n$ matrix consisting of all the variables in
the new ring.  


\section{The ``\icmd{ring}'' command}

The \icmd{ring} command is the most basic command in \Macaulay: a ring
must be defined before any matrix can be created.  We first describe
the simplest uses of this command.  

\cmd {ring} {\parm {result ring}}
\label{c-ring} % ring  Interactively define a ring

Interactively define a ring. You are asked for some obvious information,
and then for some more obscure information.

The following information is requested:
\begin{enumerate}

\item Characteristic of the ring -- a positive prime number less
than about 32000 is required.  If you want to simulate characteristic
zero, simply type \return.  A large characteristic is then selected.

\item The number of variables -- must be positive.  There is
also an upper limit on the number of variables (100 on Macintosh, 512 on
Unix systems).

\item Names of the variables (see \secref{sec-syvar} for the syntax of
ring indeterminates).  These should be given without intervening
spaces.  Sequences of variables may be generated by using ``-''
between two variables, e.g: \type{a-f} expands to \type{abcdef}, and
\type{a[1]-b[2]} expands to \type{a[1]a[2]b[1]b[2]}.
If not enough variables are given, you will be prompted for more.  If too
many are given, the extras are ignored (with a warning).

\item Weights of the variables.  An integer list is expected.
The weight of each variable must be a positive integer.  If \return\
is entered, then the variables are all assigned weight one.  If too
few weights are given, then the last weight given is assigned to the
remaining variables.  

\item The monomial order.  Typing \return\ selects the reverse
lexicographic order.  Typing in a number (which is less than the number of
variables) selects a product order (see \secref{sec-rorders} for
details, and the general form expected for the input).

\end{enumerate}

Very often, one types \return\ to requests (1), (4) and (5).  The
following examples define rings, using these defaults.

\begin{verbatim}
%  ; first define a ring with variables {a,b,c,d}:
%  ring R
! characteristic (if not 31991)       ? <return>
! number of variables                 ?  4
!   4 variables, please               ?  a-d
! variable weights (if not all 1)     ? <return>
! monomial order (if not rev. lex.)   ? <return>
;   largest degree of a monomial        : 512 

% <return>
; second, define a ring with variables {x,y,z,a[1,1], ..., a[2,2]}
%  ; (7 variables in all)
%  ring S
! characteristic (if not 31991)       ? <return>
! number of variables                 ?  7
!   7 variables, please               ?  xyza[1,1]-a[2,2]
! variable weights (if not all 1)     ? <return>
! monomial order (if not rev. lex.)   ? <return>
;   largest degree of a monomial        : 76 

% <return>
; display these rings using the "pring" command
%  pring R
; ring R
; characteristic           : 31991
; number of variables      : 4
; variables                : abcd
; weights                  : 1 1 1 1 
; monomial order           : 4 c 
; top degree of a monomial : 512 

%  pring S
; ring S
; characteristic           : 31991
; number of variables      : 7
; variables                : xyza[1,1]a[1,2]a[2,1]a[2,2]
; weights                  : 1 1 1 1 1 1 1 
; monomial order           : 7 c 
; top degree of a monomial : 76 

\end{verbatim}

The standard (\Grobner) basis computations in \Macaulay\ require every
ideal to be homogeneous, and each matrix to be graded.  The weights of the
ring variables can often be set so that an ideal is homogeneous.  For example,
let $I = (x - s^3, y - s^2 t^4, z - t^5)$.  This ideal is not homogeneous.
However, if we set the weight of $s, t$ to one, and the weight of $x$ to
3, $y$ to 6, and $z$ to 5, then each generator of $I$ is homogeneous with
respect to these weights.  This is often used with elimination of variables.

\begin{verbatim}
%  ; define a ring with variables {a,b,c,d,e} having weights 5,3,1,1,1
%  ; notice that the last "1" typed is repeated, so that the variables
%  ; c,d,e all have weight one.
%  ring R
! characteristic (if not 31991)       ? <return>
! number of variables                 ?  5
!   5 variables, please               ?  a-e
! variable weights (if not all 1)     ?  5 3 1
! monomial order (if not rev. lex.)   ? <return>
;   largest degree of a monomial        : 372 

%  pring R
; ring R
; characteristic           : 31991
; number of variables      : 5
; variables                : abcde
; weights                  : 5 3 1 1 1 
; monomial order           : 5 c 
; top degree of a monomial : 372 

\end{verbatim}

See \appref{app-examples} for more examples.  

Caveat: the weight of each variable must be a positive integer.  If
any of the elements of the integer list are negative, every weight is
increased by the same amount in order for the weights to be all
positive.

The format for monomial orders is rather complicated, and a whole section
(\secref{sec-rorders}) is devoted to it.  

\section{Other ring commands}

Each of the commands in this section expect a ring as a parameter.  If 
instead a matrix is specified, the base ring of the matrix is used.  This
allows rings to be used ``anonymously''.  

\cmd {pring} {\optparm{user defined variable}}
\label{c-pring} % pring   Display the name and value of a ring

Display the name and value of the current ring if no parameters are
given.  If a ring is specified, display its name and value.  If a
variable is specified, display the name and value of its base ring.
For examples, see the \icmd{ring} command above.
	
\cmd {setring} {\parm {R}}
\label{c-setring} % setring  Set the current ring

Set the current ring to be the ring \parm{R}.  The commands which use
the current ring are
\begin{tabular}{llll}
    \bf 
    cat & fetch &ideal & iden \\
    is-zero & koszul & mat & pmap \\
    poly & pring & random & sparse
\end{tabular}

Most commands which manipulate matrices set the current ring to the
base ring of the matrix arguments.

\cmd {nvars} {\parm{ring} \optparm{result integer}}
\label{c-nvars} % nvars  Number of variables of a ring

Set the result integer variable, if given, to the number of variables
in the given polynomial ring.  If an integer is not specified,
display the number of variables.

\cmd {characteristic} {\parm{ring} \optparm{result integer}}
\label{c-characteristic} % characteristic  Characteristic of a ring

Set the result integer variable, if given, to the characteristic of
the given polynomial ring.  If an integer is not specified, display
the characteristic.

\cmd {ring-from-rows} {\parm{matrix} \parm{result ring}}
\label{c-ring-from-rows} % ring-from-rows  Create a ring from rows of matrix

Create a new ring with $n$ variables, where $n$ is the number of rows
of the given matrix.  The weight of each variable is the degree of the
corresponding row.  The user is prompted for the names of the
variables (which should be given exactly as in the \icmd{ring}
command).  The number of rows must be positive, otherwise an error
message is displayed.  If any of the weights are non-positive, the
same value is added to every weight so that the least weight is
one.  

The characteristic of the ring is set to the characteristic of the base ring
of the given matrix.

For example,

\begin{verbatim}
%  row-degs m
21 26 31 39

%  ring-from-rows m S
!   4 variables, please               ?  x[1]-x[4]
[126k]
%  pring S
; ring S
; characteristic           : 31991
; number of variables      : 4
; variables                : x[1]x[2]x[3]x[4]
; weights                  : 21 26 31 39 
; monomial order           : 4 c 
; top degree of a monomial : 512 

\end{verbatim}

\cmd {ring-from-cols} {\parm{matrix} \parm{result ring}}
\label{c-ring-from-cols} % ring-from-cols Create a ring from cols of matrix

Create a new ring with variables corresponding to the columns of the
given matrix.  This command is exactly like \icmd{ring-from-rows}, except
that the variables correspond to the columns rather than the rows.

\cmd {ring-sum} {\parm{ring $R_1$} \parm{ring $R_2$} \parm{result ring}}
\label{c-ring-sum} % ring-sum   Create the tensor product of two rings

Create a new ring with the variables from both $R_1$ and $R_2$.
The monomial order of the result is the product order, where each
variable of $R_1$ is greater than each variable of $R_2$.  If
either or both of $R_1$ and $R_2$ is a quotient ring, then the
result will be one as well.  For example,

\begin{verbatim}
%  ; the ring R has variables a,b,c,d, and S has variables x,y,z.
%  ring-sum R S T

%  pring T
; ring T
; characteristic           : 31991
; number of variables      : 7
;  4 variables for block 0 : abcd
;  3 variables for block 1 : xyz
; weights for block 0      : 1 1 1 1 
; weights for block 1      : 1 1 1 
; monomial order           : 4 3 c 
; top degree of a monomial : 512 512 

\end{verbatim}

Caveat: no warning message is given if there is a variable of $R_1$ with
the same name as a variable of $R_2$.  In this case, the new ring is created.
The two variables will have the same name, but be internally different.
This means that when inputting a matrix, the second variable cannot be named:
each occurence of the name refers to the variable corresponding to the
ring $R_1$.

\section {Quotient Rings}
\label{sec-qrings}

\cmd {qring} {\parm{standard basis} \parm {result ring}}
\label{c-qring} % qring  Create a quotient, or factor, ring

Given a standard basis of an ideal, create a new ring where all
operations in this new ring will be done modulo this ideal.  A warning
message is given if the first argument is not a standard basis.
Creating a quotient ring where the base ring of the standard basis is
already a quotient ring is legal.

All operations in \Macaulay\ can be done over a quotient ring, including
computing standard bases, syzygies, Hilbert functions, and all matrix
arithmetic.

For example,

\begin{verbatim}
%  putstd j k

%  type k
; b3-acd ab-cd a2-b2 

%  qring j S

%  pring S
; ring S
; characteristic           : 31991
; number of variables      : 4
; variables                : abcd
; weights                  : 1 1 1 1 
; monomial order           : 4 c 
; top degree of a monomial : 512 
; quotient ring by ideal:
; a2-b2
; ab-cd
; b3-acd

%  poly f (a+b)^2

%  ; f is reduced w.r.t. the above standard basis:
%  type f
; 2b2+2cd 

\end{verbatim}

Caveat: Using the \icmd{forcestd} command, it is possible to create a
quotient ring where the above ideal is not homogeneous.  In this case,
every computation command (\chapref{ch-comps}) will most likely 
compute, and compute, and compute...  These commands do not detect this
possibility.

\cmd{present-ring} {\parm{ring} \parm{result ideal $I$}}
\label{c-present-ring} % present-ring  Present a ring as a quotient of a polynomial ring

Present a ring as a polynomial ring modulo an ideal $I$.  If the given
ring is a quotient ring w.r.t. an ideal $J$, a copy of this ideal is
placed into the result $I$.  If the given ring is not a quotient ring,
$I$ is set to be the zero ideal over this ring.

\begin{verbatim}
%  ; the ring S is the quotient ring above.
%  present-ring S k

%  type k
; a2-b2 ab-cd b3-acd 

\end{verbatim}

\section{Monomial orders in \Macaulay}
\label{sec-rorders}

All polynomials in \Macaulay\ are stored as an ordered list of
monomials.  The order on monomials is a parameter for standard bases
which can be modified.  Different applications of standard bases
often require different monomial orders.  \Macaulay\ is flexible enough
to allow the user to define arbitrary monomial orders.  This order is
defined using the \icmd{ring} command.

The most important monomial orders are the reverse lexicographic
order, product orders and elimination orders.  Almost every
application involving standard (\Grobner) bases uses only these
orders.  On the first reading, most users should skip the section on
general monomial orders.

\subsection{Reverse lexicographic order}

The most important monomial order is the (graded) reverse
lexicographic order.  This is the default in \Macaulay, since it can
be shown that, in many cases, it is theoretically the most efficient
[BS1].  

\begin{defn}[Reverse lexicographic order]
The graded reverse lexicographic order on the monomials of \kn is
defined by 
  $x^A > x^B \iff \deg(x^A) > \deg(x^B)$, or 
	$\deg(x^A) = \deg(x^B)$, and the last non-zero component of 
	A-B is negative.
\end{defn}

Thus, in $k[x,y,z]$, 
$$x^2 > x y > y^2 > x z > y z > z^2 > x > y > z > 1.$$
There are many reverse lexicographic orders, in fact, there is
one for each permutation of the variables.

The user can define the reverse lexicographic order using the
\icmd{ring} command.  For example, to define a polynomial ring with 
five variables of weight one, e.g. (a, b, c, d, e) , and using the
reverse lexicographic order in this ring, you need to simply input the
number of variables and \return\ (the default) for the monomial order.

\begin{verbatim}
%  ring R
! characteristic (if not 31991)       ? <return>
! number of variables                 ?  5
!   5 variables, please               ?  abcde
! variable weights (if not all 1)     ? <return>
! monomial order (if not rev. lex.)   ? <return>
;   largest degree of a monomial        : 217 

\end{verbatim}

As this example illustrates, you don't have to do anything special to
get the reverse lexicographic order.  Note that this order is {\it
graded}: it first orders by degree.  For example, in $k[x,y,z]$, if
$\deg(x)=2$, $\deg(y)=3$, and $\deg(z)=4$, then the order of monomials
in the reverse lexicographic order is $$x^2 > z > y > x > 1,$$ since
$\deg(x^2) = \deg(z) = 4 > \deg(y)$.

\subsection{Product and elimination orders}

Although the reverse lexicographic order is the best order to use in
many cases, there are applications where one must use other orders.
See the examples in the appendix for more information (e.g., computing
projections, images of maps to projective spaces, normal cones, computing
inhomogeneous standard bases using homogenization, etc.).

The product order and the elimination order are also useful monomial
orders.  The product order is used when you want one set of variables
to always be greater than the second set.  The elimination order is
used for computing projections (i.e. elimination of a set of
variables).

\begin{defn}[Product order]
Let $>_1$ (resp. $>_2$) be a monomial order on the monomials of \k x m (resp. 
\k y n).  The product order $>$ on the monomials of $k[\row x m,\row y n]$ is
defined by $x^A y^B > x^C y^D \iff x^A >_1 x^C$, or $x^A = x^C$, and 
	$y^B >_2 y^D$.
\end{defn}

Similarly, one can define the product order on any number of blocks of
variables.  The simplest product order is the product order where each 
$>_i$ is the reverse lexicographic order. In this case, we have

$$x_1^2 > x_1 x_2 > x_1 y_1^{100} > y_1^{100} > y_1 y_2 > 1.$$

We denote by $\row x m >> \row y n$, the product order where we use
reverse lexicographic order in each block.  This order can be
constructed with the \icmd{ring} command in response to the prompt for
the monomial order.  The user specifies $m$ blocks of variables by
inputting $m$ integers.  Each of these integers indicates how many
variables are in each block.  The blocks are determined by the order
of the variables input to the \icmd{ring} command.  \Macaulay displays
the maximum degrees that are allowed for a monomial.  Each number is
the maximum total degree of the variables in the corresponding block.

If this number is too small, then break up the
variables into more blocks.  By default, the maximum degree allowed is 512.
This can be changed by using the \Macaulay\ parameter ``maxdegree''.
This parameter is only a suggestion to \Macaulay: it may still be necessary
to break the variables into smaller blocks.

For example, to create the product order $$x, y, z >> a, b, c, d$$ in
$k[x,y,z,a,b,c,d]$, one responds to the prompts as follows:

\begin{verbatim}
%  ring R
! characteristic (if not 31991)       ? <return>
! number of variables                 ?  7
!   7 variables, please               ?  x-za-d
! variable weights (if not all 1)     ? <return>
! monomial order (if not rev. lex.)   ?  3 4
;   largest degree of a monomial        : 512 512 

\end{verbatim}

To create the product order $$s,t >> x,y,z >> a,b,c$$
one responds to the prompts as follows:

\begin{verbatim}
%  ring S
! characteristic (if not 31991)       ? <return>
! number of variables                 ?  8
!   8 variables, please               ?  stxyzabc
! variable weights (if not all 1)     ? <return>
! monomial order (if not rev. lex.)   ?  2 3 3
[189k];   largest degree of a monomial        : 512 512 512 

\end{verbatim}

The product order is very versatile, and has many applications.  However, 
the elimination order is in many instances more efficient.

\begin{defn}[Elimination order]
Let  $1 \leq i \leq n$.  The elimination order $>_i$ on the monomials
of \k x n is defined by $x^A > x^B \iff \deg_i(x^A) > \deg_i(x^B)$, or
$\deg_i(x^A) = \deg_i(x^B),$ and $x^A >_{rlex} x^B$, where
$\deg_i(x_1^{a_1} x_2^{a_2} \ldots x_n^{a_n}) := \deg x_1^{a_1}\ldots x_i^{a_i}$.
\end{defn}

If the $i^{th}$ variable is named $x$, we denote this order by $>_x$.  We
define an elimination order with the \icmd{ring} command in the
following way.  For example, suppose you want a ring with variables
s,t,w,x,y,z, and you want to choose the elimination order $>_t$.  
When prompted for the monomial
order respond with ``w''.  The ``w'' stands for ``weight
vector''.  After giving the default weights for the variables by
hitting the return key, you are then prompted for a ``weight
vector''.  You respond by typing in the name of the last variable you
wish to eliminate, in this case $t$.  For example,

\begin{verbatim}
%  ring R
! characteristic (if not 31991)       ? <return>
! number of variables                 ?  6
!   6 variables, please               ?  stw-z
! variable weights (if not all 1)     ? <return>
! monomial order (if not rev. lex.)   ?  w
! weight vector #1                    ?  t
;   largest degree of a monomial        : 117 

%  ; now display this ring
%  pring R
; ring R
; characteristic           : 31991
; number of variables      : 6
; variables                : stwxyz
; weights                  : 1 1 1 1 1 1 
; weight vector block 0    : 1 1 0 0 0 0 
; monomial order           : w 6 c 
; top degree of a monomial : 117 

\end{verbatim}

\subsection{Monomial orders for free modules}

So far we have only considered orders on the monomials in a polynomial
ring.  However, if we wish to compute standard bases of submodules of
free modules as well as for ideals, we need to define monomial orders
on the monomials in a free module.  First, what are the monomials in a
free module?  Let $e_i = (0, \ldots, 1, \ldots, 0)^T$ be the $i^{th}$
unit (column) vector in the free module ${\k x n}^s$, $1 \leq i \leq s$.
The monomials are just $x^A e_i$.  

There are two basic ways of extending a monomial order $>$ to free modules.

\begin{itemize}
  \item $x^A e_i > x^B e_j \iff x^A > x^B$, or $x^A = x^B$ and $i>j$.
  \item $x^A e_i > x^B e_j \iff i>j$, or $i=j$ and $x^A > x^B$.
\end{itemize}

The first of these is the default in \Macaulay.  The second can be
obtained using the \icmd{ring} command in the following way.  When
prompted for the monomial order, respond with the letter ``c''.  The
``c'' stands for the ``module component number'', or the ``row
number'' of the monomial.  The effect of this response is that the
higher the component, or row, number, the greater the monomial.

For example,

\begin{verbatim}
%  ring R
! characteristic (if not 31991)       ? <return>
! number of variables                 ?  5
!   5 variables, please               ?  a-e
! variable weights (if not all 1)     ? <return>
! monomial order (if not rev. lex.)   ?  c
;   largest degree of a monomial        : 217 

%  ; the component number is now considered before the order on the monomials
%  ; of the ring.
%  pring R
; ring R
; characteristic           : 31991
; number of variables      : 5
; variables                : abcde
; weights                  : 1 1 1 1 1 
; monomial order           : c 5 
; top degree of a monomial : 217 

\end{verbatim}

Important note for computing finite free resolutions: It is often much
more efficient, both in space and elapsed time, to use this second order 
rather than the default.  The default has been chosen to make elimination
of variables for modules a simpler process.

In fact, if you have several blocks of variables, you can put the
``c'' before or after any block.  The default in \Macaulay\ is to tag
the ``c'' on at the end of what you type (assuming you did not include
a ``c'').  At the end of this section we describe these more general
forms. 

Usually, when you display a polynomial using \icmd{type}, for example,
the monomials are displayed in descending order.  For column vectors
this is not possible, since the lead monomial can occur in any row.
You can see the initial monomial by using the \icmd{in} command. 

\subsection{General monomial orders in \Macaulay}

The most important monomial orders are those which have been
introduced earlier in this section.  Occasionally, one needs finer
control over the monomial order.  \Macaulay\ allows you to construct
arbitrary monomials orders.

When you are prompted for the monomial order by the \icmd{ring}
command, you are actually specifying the internal representation of
monomials for the ring being defined.  The representation is a series
of 32 bit non-negative integers, one for each specifier given.  
The specifiers may be
\begin{enumerate}
\item ``w'' for a weight vector.  The program prompts later to have the
weight vectors input, in order.

\item a number, specifying the number of variables to put into the
``next'' block of variables to be created.  That is, for \type{3 w 5},
the third specifier refers to the 4th through the 8th variable.
Within a given block, \Macaulay\ uses the graded reverse lexicographic
order.

\item ``c'' for the position of the component number.  At most one ``c'' 
can be used.  Except for computing difficult finite free resolutions, this
is best omitted: \Macaulay\ will insert it last automatically.

\item ``-'': Put this first to suppress the component.

\end{enumerate}

If the representation is ``incomplete'', it is completed automatically
by \Macaulay, which adds one or two fields to the end of the list: any
variables not included in a given block of variables are made into a
block, and a component field (specified by ``c'') is put at the end of
the list, unless it is already present or has been inhibited by the
presence of a ``-'' specifier.

Caveat: use the ``-'' specifier at your own risk.  No matrices with more
than one row are allowed in such a ring.  This is mostly useful for
computing a standard basis of an ideal which will use alot of memory.


\subsection*{Weight vectors}

\Macaulay\ next prompts for the weight vectors, one for each ``w'' given
above.  A weight vector in a ring with variables \row x n is a vector
$(\row w n)$.  \Macaulay\ expects an integer list or a ring variable.
The 32 bit integer which is placed into the corresponding field is the
value of the monomial $x_1^{a_1} \ldots x_n^{a_n}$ under this weight vector:
$\sum w_i a_i$.  

Specifying a ring variable corresponds to using the weight of each variable
up to and including the variable given, and zeros afterwards. This
is useful for specifying elimination orders.

It is possible to have a name conflict between a user defined integer
variable and a ring variable.  Therefore, in order to use an integer
variable you must enclose it in curly braces.

Weight vectors have integer entries: they can be negative if desired.
If so, \Macaulay\ adds a multiple of the variable weights to the weight
vector so that each component will be non-negative.

For example,

\begin{verbatim}
%  ring R
! characteristic (if not 31991)       ? <return>
! number of variables                 ?  7
!   7 variables, please               ?  xyza-d
! variable weights (if not all 1)     ?  2 3 4 1 1 2 2
! monomial order (if not rev. lex.)   ?  w w 
! weight vector #1                    ?  2:3 0
! weight vector #2                    ?  z
;   largest degree of a monomial        : 146 

%  pring R
; ring R
; characteristic           : 31991
; number of variables      : 7
; variables                : xyzabcd
; weights                  : 2 3 4 1 1 2 2 
; weight vector block 0    : 2 2 2 0 0 0 0 
; weight vector block 1    : 2 3 4 0 0 0 0 
; monomial order           : w w 7 c 
; top degree of a monomial : 146 

%  ; notice the two weight vectors, and that the specifiers "7 c"
%  ; have been added to the end of the monomial specification.
\end{verbatim}

\subsection*{The general monomial order}

The monomial order which \Macaulay\ uses is the strict lexicographic
order on the 32 bit integers which form the internal representation of
a monomial. For example,

\begin{verbatim}
%  ring R
! characteristic (if not 31991)       ? <return>
! number of variables                 ?  7
!   7 variables, please               ?  xyza-d
! variable weights (if not all 1)     ?  1:3 4
! monomial order (if not rev. lex.)   ?  w 3 4
! weight vector #1                    ?  1 0:6
;   largest degree of a monomial        : 512 512 

%  pring R
; ring R
; characteristic           : 31991
; number of variables      : 7
;  3 variables for block 1 : xyz
;  4 variables for block 2 : abcd
; weights for block 1      : 1 1 1 
; weights for block 2      : 4 4 4 4 
; weight vector block 0    : 1 0 0 0 0 0 0 
; monomial order           : w 3 4 c 
; top degree of a monomial : 512 512 

%  poly f x2+xy10a+xy10+a50+a53b

%  type f
; x2+xy10a+xy10+a53b+a50 

%  ; The weight vector (1,0,...,0) takes precedence: the monomials
%  ; are ordered first by highest power in "x", then by the (graded)
%  ; reverse lexicographic order in x,y,z (ignoring a,...,d), and finally
%  ; by the reverse lex. order in a,b,c,d.
\end{verbatim}
