
\chapter{Operations on standard bases}
\label{ch-stdcmds}

In this chapter we describe various commands which operate on standard
bases.  These break up naturally into five distinct groups:
elimination of variables, ideal (or submodule) membership,
manipulations where some of the variables are treated as constants,
numeric information, and saturation.  At the end of this chapter we
describe the commands for displaying information about finite free
resolutions.

Many of the commands in this chapter simply choose an appropriate subset
of either the standard basis or the leading terms of the standard basis.
Others, such as \icmd{hilb} and \icmd{reduce} involve computation.  In fact,
the computation of the Hilbert function often takes more time than computing 
the standard basis!

Most of the commands of this chapter assume that their argument is a
matrix which has previously had a standard basis constructed for the
submodule generated by its columns.  If the matrix given is not a
standard basis, a warning message is given, and the columns of the matrix
are used as if they formed a standard basis.  This is quite useful in many
cases, if you happen to know that the columns of the matrix already form
a standard basis.  However, one must exert some care!  If these columns do
{\em not} form a standard basis, the resulting answers might not answer
the question which you intended to ask.

For example, if $I$ is a $1$ by $n$ matrix whose entries generate an
ideal $I$, then ``{\tt codim I}'' will display a warning message, and
also display a number which it claims is the codimension of this
ideal.  Most likely, this number is wrong: it is the codimension of
the monomial ideal generated by the lead terms of the $n$ generators
of $I$.  Usually, this is not the correct answer.

\section{Elimination of variables}

Let $S$ be a polynomial ring, and let $R$ be the subring generated by
a subset of the variables of $S$.  One important construction is to
compute generators for $I \cap R$, where $I$ is an ideal of $S$: i.e.
{\em eliminate}  the variables not in the subring $R$.

Let $>$ be any monomial order which satisfies the following property:
	$$f \in R_n \iff \iin(f) \in R_n,$$
where $\iin(f)$ is the lead monomial of $f$ in this monomial order.
We can then compute $I \cap R$ via the following simple but important
fact.

\begin{prop}[Elimination of variables]

Let $\{g_1, \ldots, g_r\}$ be a standard basis of a submodule $I
\subset S^a$ with respect to the monomial order $>$.  Then
	$$\{g_1, \ldots, g_r\} \cap R_n$$
is a standard basis of $I \cap R_n$.

\end{prop}

The most important monomial orders which satisfy the above condition
are the elimination and product orders defined in
\secref{sec-rorders}.  For example, 
let $S = k[s,t,a,b,c,d]$, and let the monomial order $>$ be the product
order $s,t >> a,b,c,d$.  The \icmd{ring} command to produce the ring
with this order is

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

\end{verbatim}

Let $R = k[a,b,c,d] \subset S$.  We use the above proposition to compute
$I \cap R$ for any ideal $I$ of $S$.  Several examples are given in
\appref{app-examples}.  

\Macaulay\ stores each monomial in the above ring $S$ as a list of three
numbers: the part of the monomial in $s,t$, the part in the variables
$a,b,c,d$, and finally the module component number (see
\secref{sec-rorders} for more details).  The ring $R$ is generated by
those monomials of $S$ whose ``value'' on the first ``block'' of
variables is zero, i.e. $a,b,c,d$.  More generally, we can define the
subring generated by the variables (equivalently, monomials) whose
value on the first $n$ blocks is zero:

\begin{defn}
Let $S$ be a polynomial ring defined in \Macaulay.  Let $>$ be the
corresponding monomial order, and let $n$ be a positive integer.  
Define a subring $R_n$ of $S$ by
	$$ R_n = k[\{x^A \mid \mbox{the value of the first}\ n 
		\mbox{blocks of}\ x^A = 0\}]
	$$
\end{defn}

In the above example, $R_1 = k[a,b,c,d]$, and $R_2 = k$.  These subrings
are always generated by a subset of the variables.  If the monomial order
has been chosen to be an elimination order or a product order, the subring
of most interest is $R_1$, the subring generated by the variables whose value
on the first block is zero.

This notation is used in the descriptions below.

\cmd{elim}{\parm{standard basis} \parm{result matrix} \optparm{integer n}}

Find the subset of the standard basis which lies in a subring.  If $S$
is the base ring of the standard basis, and $R_n$ is the subring of
$S$ defined above, create a matrix whose columns are those elements of
the standard basis whose lead monomials lie in $R_n$.  If an integer
$n$ is not specified, the default value for $n$ is 1.

In other words, this command finds the subset of the standard basis
corresponding to the above proposition.  This command is in general very 
useful.

For example, suppose that the ring $S$ is the same as above: the
variables are "{\tt stabcd}", and the monomial order is the product
order "{\tt 2 4}".  Then

\begin{verbatim}
%  putstd j js

%  type js ; the entire standard basis
; c2-bd bc-ad b2-ac t3-d sd-tc sc-tb sb-ta st2-c s2t-b s3-a 

%  elim j k

%  type k  ; the subset not involving s,t
; c2-bd bc-ad b2-ac 

\end{verbatim}
	
\cmd{in}{\parm{standard basis} \optparm{optional result matrix} \optparm{n}}

Display or create a matrix of lead terms.  If no optional parameters are
given, display the monomial submodule of lead terms using the same 
format as the \icmd{putmat} command.  If one optional parameter, the
name of the resulting matrix, is specified, create the matrix of lead
monomials.

If also a second optional parameter, an integer expression $n$, is
given, create the matrix whose columns are $\iin_n(g_j)$, where $g_j$
is the $j^{th}$ column of the standard basis, and $\iin_n(g)$ is the
sum of those terms of $g$ which have the same value as the lead term
of $g$ on the first $n$ blocks of the monomial.  The default value for 
$n$ is infinity.  In general this is not a monomial submodule.

For example, suppose that the ring $S$ is the same as above: the
variables are "{\tt stabcd}", and the monomial order is the product
order "{\tt 2 4}".  Then
	$$\iin_1(s^3a+s^3b+s^2tc+t^3d) = s^3a+s^3b,$$
since both $s^3a$ and $s^3b$ have the same value on the first block
(both have the value $s^3$).  The following example uses this same order.

\begin{verbatim}
%  putstd j js

%  type js
; c2-bd bc-ad b2-ac t3-d sd-tc sc-tb sb-ta st2-c s2t-b s3-a 

%  in js jin1 1
; warning: no standard basis. Using initial terms of matrix

%  type jin1  ; initial terms with same monomial in s,t.
; c2-bd bc-ad b2-ac t3 sd sc sb st2 s2t s3 

%  in js jin2 2
; warning: no standard basis. Using initial terms of matrix

%  type jin2  ; the initial monomials
; c2 bc b2 t3 sd sc sb st2 s2t s3 

\end{verbatim}

Possible applications include finding tangent cones and normal cones. 

\cmd{keep}{\parm{standard basis} \parm{result matrix} \optparm{n}}

Find the subset of the standard basis which does {\em not} lie in a
subring.  If $S$ is the base ring of the standard basis, and $R_n$ is
the subring of $S$ defined above, create a matrix whose columns are
those elements of the standard basis whose lead monomials do not lie
in $R_n$.  If an integer $n$ is not specified, the default value for
$n$ is 1.

The elements of the standard basis chosen are exactly the complement
of those chosen by the \icmd{elim} command.  
For example, suppose that the ring $S$ is the same as above: the
variables are "{\tt stabcd}", and the monomial order is the product
order "{\tt 2 4}".  Then

\begin{verbatim}
%  putstd j js

%  type js
; c2-bd bc-ad b2-ac t3-d sd-tc sc-tb sb-ta st2-c s2t-b s3-a 

%  keep j k

%  type k  ; exactly the complement of the "elim" command.
; t3-d sd-tc sc-tb sb-ta st2-c s2t-b s3-a 

\end{verbatim}
	
Possible applications include finding the degree of a rational map, and 
finding the locus where a birational map is not one to one.

\section{Ideal or submodule membership}

The commands \icmd{lift} and \icmd{reduce} are used to determine whether
the columns of a given matrix are in the submodule generated by a given
standard basis.  The result of the \icmd{lift} command is also part of
the output of the \icmd{reduce} command.  The \icmd{lift} command is 
included only for convenience.  

\cmd{lift}
	{\parm{standard basis} \parm{matrix $N$ to lift} \parm{result $L$}}

Determine if each column of $N$ belongs to the submodule $M$ generated
by the standard basis.  If so, ``lift'' $N$, obtaining a matrix $L$
satisfying $N = M L$.  Otherwise display an error message.

For example,

\begin{verbatim}
%  type j
; b2-ac c2-bd -bc+ad 

%  lift-std j j
; 2.3.4.
; computation complete after degree 4

%  poly f (a+b+c2)*(b2-ac)-(a3+c4)*(c2-bd)+(a3+b3)*(ad-bc)

%  lift j f f'

%  type f'
; bd+a+b       
; -c4-a3+b2-ac 
; a3+b3        

%  mult j f' g

%  subtract f g h

%  ; f should equal g, i.e. h = 0:
%  type h
; 0 

\end{verbatim}

This command returns the same value $L$ as would be returned by the 
\icmd{reduce} command.  The same restrictions and caveats that apply to
\icmd{reduce} apply here as well: a standard basis of $M$
and a change of basis matrix from this standard basis to the
columns of $M$ must both have been computed.  Otherwise either an error
is generated or the matrix $L$ will consist entirely of zeros.

\cmd{reduce}{\parm{standard basis $M$} \parm{matrix $N$ to reduce} 
    	\parm{result reduced matrix $R$} \optparm{result lifted matrix $L$}}

Reduce each column of $N$ w.r.t. the standard basis $M$, placing each
reduced column into $R$. Both of these matrices should have the same
number of rows and the same base ring.  If a matrix $L$ is specified,
then $L$ is set to be the $m$ by $n$ lifted matrix
where $m$ is the number of columns of $M$, and $n$ is the number of
columns of $N$, and $M,N,R,L$ satisfy: 	$N = L M + R$.

For example, 

\begin{verbatim}
%  type j
; b2-ac c2-bd -bc+ad 

%  lift-std j j
; 2.3.4.
; computation complete after degree 4

%  poly f a6+(a+b+c2)*(b2-ac)-(a3+c4)*(c2-bd)+(a3+b3)*(ad-bc)

%  reduce j f red lift

%  type red
; a6 

%  type lift
; bd+a+b       
; -c4-a3+b2-ac 
; a3+b3        

%  ; find g := j.lift + red
%  mult j lift g

%  add g  red g

%  subtract f g h

%  ; f should equal g, i.e. h = 0:
%  type h
; 0 

\end{verbatim}

Restriction: If a standard basis of $M$ hasn't been constructed, then an
error message is given, and the reduction is {\em not} done.  In order to
use \icmd{reduce} with matrices which are not standard bases, use the
\icmd{forcestd} command.  

Important note: In order to compute $L$, it is necessary that a change
of basis matrix from the standard basis to generators of the matrix has been
computed.  The commands \icmd{lift-std}, \icmd{res}, and \icmd{nres}
compute this change of basis matrix, but no other computation command does.
	
\cmd{forcestd}{\parm{matrix $M$} \parm{result standard basis} 
	\optparm{matrix $C$}}

Create a matrix with an attached standard basis.  This command forces
the columns of $M$ to be considered as a standard basis.  If a change
of basis matrix $C$ is given, it will be placed in the attached
standard basis as if it were the change of basis matrix.  $C$ should
be a matrix having the same base ring and the same number of columns as $M$.
Otherwise an error message is displayed.  It is legal for the matrix $M$
to {\em not} be graded.  See the example below.

Warning: This command is useful if you happen to know that the columns of $M$
form a standard basis, but the amount of computation to verify this
is huge.  This command makes each column monic, since \Macaulay\ insists
that every standard basis element be monic.  If a change of basis
matrix is given, it is changed accordingly.  

The effect of the following example is to set the variables $c$ to be
the square root of $-1$, and $d$ to be the square root of $3$.

\begin{verbatim}
%  type j
; c2+1 d2-3 

%  forcestd j j 

%  poly f (ac+bd)^2

%  reduce j f f'

%  type f'
; 2abcd-a2+3b2 

\end{verbatim}

\section{Treating variables as constants}

The commands in this section all have essentially the same form.
Their input is a standard basis, together with a list of ring
variables.  This variable list informs \Macaulay\ that these 
are the {\em actual} variables: the other variables are to be treated as
if they were in the ground field.

This is mainly useful when the monomial order of the base ring $R$ of the
standard basis is a product order.  Suppose that 
	$$R = k[\rowz t m][\rowz x n]$$
is a polynomial ring.  Let $>$ be the product order $\rowz x n >>
\rowz t m$.  The ``t'' variables are to be ``considered as
constants''.  If $f \in R$ is a polynomial, then we can write
	$$f = \alpha_1(t) x^{A_1} + \beta_1(t) x^{B_1} + \cdots$$
Notice that in the product order each monomial of $\alpha_1(t) x^{A_1}$ is
ordered greater than every other monomial of $f$.

The commands in this section refer to the following notation.  Let the
variables in the variable list be called the ``x'' variables, and the other
variables the ``t'' variables.  Let $\{\row g r\}$ be a standard basis for
the ideal or submodule $I$.  We can always write this standard basis as:
\begin{eqnarray*}
    g_1 & = & \alpha_1(t) x^{A_1} + \cdots \\
    g_2 & = & \alpha_2(t) x^{A_2} + \cdots \\
    \vdots \\
    g_r & = & \alpha_r(t) x^{A_r} + \cdots,
\end{eqnarray*}
where each monomial of $g_i$ in $\alpha_i(t) x^{A_i}$ occurs before each
monomial of $g_i$ not shown.

The default variable list, if one is not given, is always the first block 
of variables.  Caveat: the default is {\em not} the set of all the variables.

\cmd{inpart}{\parm{standard basis} \parm{result matrix} \optparm{variable list}}

Find the minimally generated monomial ideal or submodule of initial
forms of a standard basis, where some of the variables are considered
as constants.  In terms of the notation above, the result matrix is set with
a minimal set of generators for the submodule $\{x^{A_1}, \ldots, x^{A_r}\}$.
For example,

\begin{verbatim}
%  putstd j js

%  type js
; d2-3 c2+1 

%  inpart js jin 
; warning: no standard basis. Using initial terms of matrix

%  type jin    ; this is "1", since there were elements constant w.r.t. s,t.
; d2 c2 

%  keep js js1
; warning: no standard basis. Using initial terms of matrix

%  type js1
; d2-3 c2+1 

%  inpart js1 jin1
; warning: no standard basis. Using initial terms of matrix

%  type jin1
; d2 c2 

\end{verbatim}

Possible applications include finding the initial monomial ideal of an
ideal or submodule over a quotient field, and finding the initial
monomial ideal of an inhomogeneous ideal or submodule via
homogenization.
	
\cmd{std-minimal}{\parm{standard basis} \parm{result matrix}
        \optparm{variable list}}

Find the subset of the given standard basis whose lead monomials in a subset
of the variables are minimal generators.  In terms of the notation above,
if $x^{A_{i}}$ is a minimal generator of $\{x^{A_1}, \ldots, x^{A_r}\}$, then
place the $i^{th}$ standard basis element $g_i$ into the result matrix.
Note that several standard basis elements placed into the result matrix may
correspond to the same minimal monomial $x^A$.

For example,

\begin{verbatim}
%  keep js js1
; warning: no standard basis. Using initial terms of matrix

%  type js1
; d2-3 c2+1 

%  std-minimal js1 jmin
; warning: no standard basis. Using initial terms of matrix

%  type jmin
; d2-3 c2+1 

\end{verbatim}

Possible applications include finding the ramification locus of a projection,
and finding loci where a projection is not flat.

\cmd{stdpart}{\parm{standard basis} \parm{result matrix}
	\optparm{variable list}}

Find a subset of a standard basis whose lead monomials in a subset of the
variables minimally generate.  In terms of the notation above, 
if $x^{A_{i_1}}, \ldots, x^{A_{i_q}}$ minimally generate the submodule
$\{x^{A_1}, \ldots, x^{A_r}\}$, then the result is the matrix whose
columns are $g_{i_1}, \ldots, g_{i_q}$.

For example,

\begin{verbatim}
%  keep js js1
; warning: no standard basis. Using initial terms of matrix

%  type js1
; d2-3 c2+1 

%  stdpart js1 jstd
; warning: no standard basis. Using initial terms of matrix

%  type jstd
; d2-3 c2+1 

\end{verbatim}
	
Possible applications include finding a standard basis of an ideal or
submodule over the quotient field generated by a set of the variables
(this set is the complement of the variable list given as a
parameter), and finding a minimal standard basis of an inhomogeneous
ideal or submodule via homogenization.

\cmd{k-basis}
	 {\parm{standard basis} \parm{result matrix} \optparm{variable list}}

Create a matrix whose columns form a $k$-basis for the module $M$ presented
by the given standard basis, where each variable not appearing in the variable
list is considered to be a constant. You are prompted for two integer
expressions, $lo$ and $hi$.  A $k$-basis for the module in degrees between
$lo$ and $hi$ inclusive is placed into the result matrix.  These always
consist of monomials in the specified variable list.  If \return\ is
entered in response to the lowest degree (resp. the highest degree), the 
default is negative infinity (resp. positive infinity).

For example, if the variables are ``{\tt x,y,a,b,c}'', the monomial
order is the product order $x,y >> a,b,c$, and $j$ is a standard
basis, then

\begin{verbatim}
%  std j j
; 23.4.
; computation complete after degree 4

%  putstd j
; 1
; 2
; y2-bc
; x2-ab

%  k-basis j jk
! lowest degree (default=no lowest degree)  ? <return>
! highest degree (default=no high degree)   ? <return>

%  type jk
; 1 x xy y 

\end{verbatim}

If the module $M$ does not have finite length, and no higest degree is given,
a large matrix will be constructed, and an error message displayed.

\cmd{truncate}
	{\parm{standard basis} \parm{result matrix} \optparm{variable list}}

Create the matrix whose columns generate the submodule of $M$,
$M_{\geq d}$ of all elements of $M$ of degree at least $d$, where $M$
is the module presented by the given standard basis, and $d$ is an
integer for which the user is prompted.

The result matrix consists of a $k$-basis of $M$ in degree $d$, and the
set of column unit vectors corresponding to those rows of degree at least $d$.
Each column of the result matrix is a monomial in the variables specified
in the variable list.

For example, if the variables are ``{\tt abcd}'', and the variables are all
in one block,

\begin{verbatim}
%  type m
; a a2 b4 
; b c2 c4 

%  std m m
; 12.3.4.5.6.7.8.
; computation complete after degree 8

%  putstd m ms

%  type ms
; b4 a 0         0      0     0         
; c4 b b4c2-a2c4 b5-ac4 ab-c2 a3c4-b3c4 

%  truncate ms m1
! lowest degree (default=0)  ?  1
; warning: no standard basis. Using initial terms of matrix

%  type m1
; b c d 0 0 0 0 
; 0 0 0 a b c d 

\end{verbatim}


\section{Saturation of ideals or submodules}

\cmd{sat}{\parm{standard basis} \parm{result matrix} \parm{variable} 
	\optparm{max power $d$}}

Divide each column of the standard basis by the specified ring
variable as many times as possible, or as much as $d$ times, if $d$ is
given on the command line.  The highest power divided by is then
displayed.

This command is most useful in conjunction with the reverse
lexicographic order, where the ring variable is the least variable in
the order.

For example, if the variables are "abct", and the monomial order is
the reverse lexicographic order, then

\begin{verbatim}
%  putstd j k

%  type k
; b2t-act ab-ct a2-bt 

%  sat j jsat t
; largest division was by t

%  type jsat
; b2-ac ab-ct a2-bt 

\end{verbatim}
	
Possible applications include finding ideal quotients using the
reverse lex. order with the given ring variable being the least variable in
the order.

\section{Computing numerical information}
\label{sec-numinvar}

    The commands below take a standard basis, perform some
combinatorics on the initial monomial ideal or submodule, and produce
numerical information.  In each case, it does not matter which
monomial order was used to produce the standard basis.  What does
matter is that the matrix be a standard basis.  If no standard basis
is present, the generators of the matrix itself are used, and a
warning message is displayed.  In this case the user must be sure that
the matrix forms a standard basis.

\cmd{hilb}{\parm{standard basis}}

	Computes the Hilbert series of the module $M$ presented by the
given standard basis.  By the theory of standard (\Grobner)
bases, the Hilbert series of the module generated by the columns
of the standard basis is the same as the Hilbert series of the
monomial submodule of lead monomials of each column of the standard
basis.  Define the Hilbert series of a graded module $M$ by:

\begin{defn}[Hilbert series]
Let $M$ be a graded module over \k x n.  The Hilbert series of
$M$ is the power series 
$$H_M(t) = \sum_{i=-\infty}^{\infty} \dim M_i \mbox{\ } t^i.$$
\end{defn}


It turns out that $H_M(t)$ can be written in two useful ways: First,
$H_M(t) = Q(t)/(1-t)^{n}$, where $Q(t)$ is a polynomial in $t$, and $n$
is the number of variables in the polynomial ring.  $Q(t)$ is
intimately linked with the graded betti numbers of the module $M$.
Second, $H_M(t) = P(t)/(1-t)^{dim(M)}$, where $P(t)$ is a polynomial,
and $\deg M = P(1)$.

The output of \icmd{hilb} is 
\begin{enumerate}
  \item the polynomial $Q(t)$,
  \item the polynomial $P(t)$,
  \item the codimension of $M$, i.e. $ n - \dim M$,
  \item the degree of $M$, i.e. $P(1)$,
  \item the (sectional) genus of $M$.  If $\dim M = 2$, this is the arithmetic
genus of $M$.
\end{enumerate}

Some notes:
\begin{enumerate}

  \item The ring variables must all have weight 1, or the results mean
very little.

  \item By using interrupts (see \secref{sec-cfine}), it is possible
to stop a Hilbert series computation.  It is not possible to
then restart it, except at the beginning.

  \item If the \Macaulay\ parameter ``verbose'' is set to true, then
some feedback is given.  Each time a new generator is considered,
a ``.'' is displayed.  Bear in mind that the process
is not linear!  The worst case is for each new element to take
about twice as long as the last one (roughly).  Usually, the
process works nicely for less than 200 or so standard basis
elements, and for more than 1000 generators it almost never works
(at least in 30 or 40 variables).  If you just need the codimension
or degree, use the two commands below, 	since they work well on {\em any}
(I think!) number of generators.
\end{enumerate}

For example, for the rational quartic curve, $j$, in \proj 3,

\begin{verbatim}
%  putstd j
; 1
; 4
; c3-bd2
; bc-ad
; b3-a2c
; ac2-b2d

%  hilb j

;       1 t  0
;      -1 t  2
;      -3 t  3
;       4 t  4
;      -1 t  5

;       1 t  0
;       2 t  1
;       2 t  2
;      -1 t  3

; codimension = 2
; degree      = 4
; genus       = 0

\end{verbatim}

In this example, $Q(t) = 1-t^2-3t^3+4t^4-t^5$, and $P(t) = 1+2t+2t^2-t^3$.

\cmd{codim}{\parm{standard basis} \optparm{integer result}}

Set the result integer, if given, to the codimension of the module $M$
presented by the given standard basis.  If an integer is not
specified, then display the codimension.

The codimension of $M$ presented by the standard basis is the
same as the codimension of the submodule of initial monomials in the
standard basis.  Given this monomial submodule, the codimension is
computed by finding a minimal set of variables which form an
associated prime for the submodule.

The weights of the variables can be arbitrary, and the module $M$
doesn't even need to be graded.  This command works well even for very
large standard bases (several thousand elements in the standard
basis).

For example, if $j$ is the rational quartic curve in \proj 3,

\begin{verbatim}
%  type j
; bc-ad b3-a2c c3-bd2 ac2-b2d 

%  codim j
; codimension : 2

\end{verbatim}

If the \Macaulay\ parameter ``verbose'' is set to a positive value, then
each associated prime having minimal codimension (so far) is displayed
as a vector: if the $i^{th}$ value is set to one, the $i^{th}$ variable
is in the associated prime.

\cmd{degree}
   {\parm{standard basis} \optparm{integer codim} \optparm{int degree}}

Set the first integer, if given, to the codimension of the graded module $M$
presented by the standard basis.  Set the second integer, if given, to
the degree of the module $M$.  If either one or both of these integers
are not specified, display the corresponding information.

The degree of $M$ is the same as the degree of the submodule of
initial monomials in the standard basis.  Given this monomial
submodule, the degree is computed by finding every set of variables of
minimal length which form an associated prime for the submodule, and
then finding the degrees of these components.

For example, if $j$ is the rational quartic curve in \proj 3,

\begin{verbatim}
%  type j
; bc-ad b3-a2c c3-bd2 ac2-b2d 

%  degree j
; codimension : 2
; degree      : 4

\end{verbatim}

Restrictions: The weight of each ring variable is assumed to be one.

If the \Macaulay\ parameter ``verbose'' is set to a positive value, then
the running sum of the degrees of each associated prime of minimal codimension
is displayed.  These eventually sum to the resulting degree.

\section{Displaying Information about Resolutions}

The commands \icmd{betti}, \icmd{numinfo}, and \icmd{pres} display
information about a set of matrices.  Usually, this is the set of
matrices which occur as the result of a \icmd{res} or \icmd{nres}
calculation, but one can apply these commands to a single matrix as
well.

\cmd{betti} {\parm{complex}}

Display the graded betti numbers of a set of matrices.  The main use
is to display the graded betti numbers of a resolution produced via
\icmd{res} or \icmd{nres}.

For example, if $j$ is the ideal of the rational quartic curve in \proj 3,
then

\begin{verbatim}
%  type j
; bc-ad b3-a2c c3-bd2 ac2-b2d 

%  nres j jr
; 2.3...4...5...
; computation complete after degree 5

%  betti jr
; total:      1     4     4     1 
; --------------------------------
;     0:      1     -     -     - 
;     1:      -     1     -     - 
;     2:      -     3     4     1 

\end{verbatim}

This should be read as follows.  From the line starting with ``1:'',
the ideal has one generator in degree 2, and three generators of
degree 3.  The degree of an entry is the sum of the degree ``d:'' and
$i$, where $i$ is the column (starting at 0, from the left).  Thus,
there are 4 first syzygies, all in degree $4 = 2+2$, and one $2^{nd}$
syzygies in degree 5.

Finally, notice that the ``regularity'' (see \cite{bs:reg}) of the
module presented by the first matrix is $m$, where $m$ is the largest
index ``d:'' which occurs.  In the above example, the regularity is 2.

\cmd{numinfo}{\parm{complex}}

Display numeric information about a set of matrices.  Usually
\parm{complex} is the result of a \icmd{res} or \icmd{nres} command,
but it may also be a matrix.

For example, if $j$ is the ideal of the rational quartic curve in \proj 3,
then

\begin{verbatim}
%  type j
; bc-ad b3-a2c c3-bd2 ac2-b2d 

%  nres j jr
; 2.3...4...5...
; computation complete after degree 5

%  numinfo jr
; name    #rows #cols #standard  degrees
; 1       1     4     4          2 3:3
; 2       4     4     9          4:4
; 3       4     1     1          5

\end{verbatim}

For each matrix the following information is displayed: its index, number
of rows and columns, number of standard basis elements (if any), and
the degree of each column of the matrix.

\cmd{pres}{\parm{complex}}

Displays each matrix in \parm{complex}. If \parm{complex} is the result of
\icmd{res} or \icmd{nres}, then each column of the $i^{th}$ matrix is a
syzygy of the columns of the $(i-1)^{st}$ matrix.

For example, the finite free resolution of the ideal of the rational 
quartic curve in \proj 3 is

\begin{verbatim}
%  pres jr
; 
; ----------------------------------

; bc-ad b3-a2c c3-bd2 ac2-b2d 
; 
; ----------------------------------

; ac bd c2 b2 
; -d 0  0  -c 
; 0  -a -b 0  
; -b c  d  -a 
; 
; ----------------------------------

; -c 
; -b 
; a  
; d  
; 
; ----------------------------------


\end{verbatim}


