\chapter{Examples}
\label{app-examples}

\section{The rational quartic in P3}

Let $f : \proj r \rightarrow \proj n$ be a polynomial map.  We wish to compute
the equations in \proj n defining the image of this map.  Let
$f(\rowz x r) = (f_0({\bf x}), \ldots, f_n({\bf x}))$, where 
${\bf x} = \rowz x r$.

The ideal $I$ of the image of $f$ consists of the polynomial relations on
the polynomials \rowz f n, and therefore
	$$I = (y_0 - f_0({\bf x}), \ldots, y_n - f_n({\bf x})) 
		\cap k[\rowz y n].
	$$
We simply need to eliminate the variables \rowz x r from the ideal
$J = (y_0 - f_0({\bf x}), \ldots, y_n - f_n({\bf x}))$.

In \Macaulay\ this is accomplished by first defining a ring containing
both the ``x'' and ``y'' variables, and choosing either the elimination
or product order which orders the ``x'' variables before the ``y'' variables.
After computing a standard basis, we use the \icmd{elim} command to obtain
the final answer.

In the example below we apply this technique to determine the ideal of the 
rational quartic curve in \proj 3.  This is defined to be the image of
the polynomial map $f(s,t) = (s^4, s^3 t, s t^3, t^4)$ in \proj 3.

The following remarks refer to the \Macaulay\ session below.

\begin{enumerate}
  \item All polynomials of $J$ must be homogeneous (or quasi-homogeneous).
This will be the case if we set the weight of each variable 
$a, b, c, d$ to be four, and the weight of $s$ and $t$ to be one, by
using the \icmd{ring} command.  Notice that the last ``4'' is replicated
so that every variable $a,b,c,d$ has weight 4.

  \item In this example we have chosen the product order by responding
with ``{\tt 2 4}'' when asked for the monomial order.

  \item Before defining the ring $S$, the matrix $k$ contains the equations
of the rational quartic which is the desired result.  However, 
this ring has the extra variables $s$ and $t$, and the weight of the 
variables $a, \ldots, d$ is four. We define a ``cleaner'' ring $S$ and then
use the ring map command \icmd{fetch} to put the matrix $k$ in this 
simpler ring.  Next we compute its finite free resolution.

\end{enumerate}

\begin{verbatim}
%  ;; Finding the image of the polynomial map (s4, s3t, st3, t4), and 
%  ;; its finite free resolution.
%  ring R
! characteristic (if not 31991)       ? <return>
! number of variables                 ?  6
!   6 variables, please               ?  sta-d
! variable weights (if not all 1)     ?  1 1 4
! monomial order (if not rev. lex.)   ?  2 4
;   largest degree of a monomial        : 512 512 

%  ideal j
! number of generators ?  4
! (1,1) ?  a-s4
! (1,2) ?  b-s3t
! (1,3) ?  c-st3
! (1,4) ?  d-t4

%  type j
; -s4+a -s3t+b -st3+c -t4+d 

%  std j j
; 45.6.7.8.9.10.11.12.13.14.15.16.
; computation complete after degree 16

%  elim j k
[126k]
%  type k
; c3-bd2 bc-ad b3-a2c ac2-b2d 

%  ; put this ideal into a ring with only variables a,b,c,d all
%  ; having weight one.
%  ring S
! 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 

%  fetch k k

%  ; at this point the base ring of "k" is "S".
%  ; find the minimal finite free resolution of "k"
%  nres k kres
; 2.3...4...5...
; computation complete after degree 5

%  pres kres  ; and display it
; 
; ----------------------------------

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

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

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


\end{verbatim}

\section{An elliptic curve on the Veronese in \proj 5}

Let $f : \proj r \rightarrow \proj n$ be a polynomial map.  It is
useful to compute the image of a subvariety $X \subset \proj r$,
rather than \proj n.  The technique in the previous example is easily
modified to handle this case.

Let $I_X$ be the ideal defining the variety $X$.  The ideal defining the
image of $X$ in \proj n is
	$$I = (y_0 - f_0({\bf x}), \ldots, y_n - f_n({\bf x}), I_X) 
		\cap k[\rowz y n].
	$$
This is computed exactly as in the example above.

In this example, we find the image of the nonsingular cubic curve
$y^2z = x^3 - x z^2$ under the Veronese map to \proj 5: 
$(x^2, xy, xz y^2, yz, z^2)$.  After placing the result into a ``clean''
ring $S$, we compute its standard basis and find its Hilbert function.

The following remarks refer to the \Macaulay\ session below.

\begin{enumerate}
  \item As in the previous example, we create a ring with variables $x,y,z$
of weight one, and variables $a,b,c,d,e,f$ of weight two.  We choose
the product order ``{\tt 3 6}'' which has the effect of eliminating the
variables $x,y,z$.

  \item The Hilbert series of the result is 
	$$H_{S/I}(t) = \frac{1-9t^2+16t^3-9t^4+t^6}{(1-t)^6}
		= \frac{1+4t+t^2}{(1-t)^2}.
	$$
The curve has degree 6 and genus 1, as expected.

\end{enumerate}

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

%  ideal J
! number of generators ?  7
! (1,1) ?  a-x2
! (1,2) ?  b-xy
! (1,3) ?  c-xz
! (1,4) ?  d-y2
! (1,5) ?  e-yz
! (1,6) ?  f-z2
! (1,7) ?  y2z-x3-xz2

%  ; now compute a standard basis, and then eliminate
%  std J J
; 23.4.5.6.7.8.
; computation complete after degree 8

%  elim J I

%  type I
; e2-df ce-bf cd-be c2-af bc-ae b2-ad ac+cf-df ab-de+bf a2-be+af 

%  ; now move I to a cleaner ring
%  ring S
! characteristic (if not 31991)       ? <return>
! number of variables                 ?  6
!   6 variables, please               ?  a-f
! variable weights (if not all 1)     ? <return>
! monomial order (if not rev. lex.)   ? <return>
;   largest degree of a monomial        : 117 

%  fetch I I

%  ; the base ring of I is now S.
%  ; Compute a standard basis and the Hilbert series of S/I
%  std I I
; 23.4.
; computation complete after degree 4

%  hilb I

;       1 t  0
;      -9 t  2
;      16 t  3
;      -9 t  4
;       1 t  6

;       1 t  0
;       4 t  1
;       1 t  2

; codimension = 4
; degree      = 6
; genus       = 1

\end{verbatim}

\section{The tangent developable of a rational normal curve}

In this example, we find the equations of the tangent developable to
the rational normal curve in \proj 6.  Recall that the rational normal
curve is given by the image of the polynomial map $f(s,t) = (s^6,
s^5t, \ldots, t^6)$, and that the tangent developable is the union of all the
tangent lines of the curve.

The tangent line at the image point $f(s_0, t_0)$ is given parametrically
by 
	$$T(s_0,t_0)(x,y) = \partial f/\partial s (s_0, t_0) x
		+ \partial f/\partial t (s_0, t_0) y.
	$$
Thus the tangent developable is given parametrically by
	$$T(s,t,x,y) = \partial f/\partial s (s, t) x
                + \partial f/\partial t (s, t) y.
	$$
In order to find the equations of the image we just embed using this map.

The following remarks refer to the \Macaulay\ example below.

\begin{enumerate}
  \item The variables of \proj 6 used in this example are $a,b,c,d,e,f,g$.
Each polynomial of the map $T$ has degree 6 in the variables $x,y,s,t$, and
so we set the weight of each variable $a, \ldots, g$ to be 6.

  \item The next several commands compute the map $T$ without having
to write down the equations directly.  The \icmd{cat} command provides a
handy way to write down matrices of indeterminates.

  \item We construct the polynomial map $f$ by using the \icmd{power} 
command.  This is simpler than typing in all the degree 6 monomials 
directly.  More importantly, changing this example to compute
the tangent developable in \proj n, for some other $n$ becomes a much easier
task.

  \item It turns out that the ideal of the tangent developable is
generated by degree 2 polynomials in $a,\ldots,g$.  In the ring $R$,
these polynomials have degree 12.  We use the \Macaulay\ parameters
``autocalc'' and ``autodegree'' to change the highest degree to which
\Macaulay\ will compute.  After we are done with the standard basis, we set
``autocalc'' back to its previous value.  Otherwise all subsequent 
computations will be done only to degree 12!

  \item Finally, using the \icmd{elim} command we obtain the ideal of
the tangent developable.  We then place this ideal into a cleaner
ring, and the compute its minimal finite free resolution.  The
\icmd{betti} command is used to display concisely the graded betti
numbers of the resolution.

\end{enumerate}

\begin{verbatim}
%  ring R
! characteristic (if not 31991)       ? <return>
! number of variables                 ?  11
!  11 variables, please               ?  stxya-g
! variable weights (if not all 1)     ?  1:4 6
! monomial order (if not rev. lex.)   ?  4 6
[252k];   largest degree of a monomial        : 512 512 512 

%  ; create 3 ideals (s,t), (x,y), and (a,b,c,d,e,f,g).
%  cat s st
! rows ?  0
! columns ?  0 1

%  cat x xy
! rows ?  0
! columns ?  0 1

%  cat a ag
! rows ?  0 
! columns ?  0..6

%  ; compute the polynomial map T
%  power st 6 f

%  type f
; s6 s5t s4t2 s3t3 s2t4 st5 t6 

%  jacob f Df s t

%  transpose Df Df

%  mult xy Df T

%  type T
; 6s5x 5s4tx+s5y 4s3t2x+2s4ty 3s2t3x+3s3t2y 2st4x+4s2t3y 

; t5x+5st4y 6t5y 

%  ; compute the ideal, T1, to eliminate.  Compute a standard basis and 
%  ; perform the elimination.
%  subtract ag T T1

%  type T1
; -6s5x+a -5s4tx-s5y+b -4s3t2x-2s4ty+c -3s2t3x-3s3t2y+d 

; -2st4x-4s2t3y+e -t5x-5st4y+f -6t5y+g 

%  set autocalc 1    ; see above remark

%  set autodegree 12 ; see above remark

%  std T1 T1
; 67.8.9.10.11.12.

%  set autocalc -1

%  elim T1 I

%  type I
; e2-4/3df+1/3cg de-3/2cf+1/2bg d2-9/5bf+4/5ag ce-8/5bf+3/5ag 

; cd-3/2be+1/2af c2-4/3bd+1/3ae 

%  ; place the result ideal I into a cleaner ring, and then compute
%  ; its resolution.
%  ring S
! characteristic (if not 31991)       ? <return>
! number of variables                 ?  7
!   7 variables, please               ?  a-g
! variable weights (if not all 1)     ? <return>
! monomial order (if not rev. lex.)   ? <return>
;   largest degree of a monomial        : 76 

%  fetch I I

%  nres I I
; 2..3...4.[315k]...5....6....
; computation complete after degree 6

%  betti I
; total:      1     6    10     6     1 
; --------------------------------------
;     0:      1     -     -     -     - 
;     1:      -     6     5     -     - 
;     2:      -     -     5     6     - 
;     3:      -     -     -     -     1 

%  pres I
; 
; ----------------------------------

; e2-4/3df+1/3cg de-3/2cf+1/2bg d2-9/5bf+4/5ag ce-8/5bf+3/5ag 

; cd-3/2be+1/2af c2-4/3bd+1/3ae 
; 
; ----------------------------------

; 0    a     b     c     d     0                0             
; a    0     -2/3c -8/9d -e    ce-8/5bf         de-6/5cf      
; -4b  -8/3c 0     8/9e  4/3f  12/5bg           -e2+9/5cg     
; 9/2b 3c    0     -e    -3/2f -de+3/2cf-16/5bg 3/2df-12/5cg  
; 3c   8/3d  2/3e  0     -1/3g -9/5cg           6/5ef-9/5dg   
; -3d  -3e   -f    -1/3g 0     9/5dg            -9/5f2+12/5eg 

; 0               0               0               
; 0               0               0               
; cd-3/2be+1/2af  -ce+8/5bf-3/5ag c2-4/3bd+1/3ae  
; 0               d2-9/5bf+4/5ag  0               
; -d2+9/5bf-4/5ag 0               0               
; 0               0               -d2+9/5bf-4/5ag 
; 
; ----------------------------------

; 0         -32/81dg 32/45eg          e2-4/3df-9/5cg    
; -d2+9/5bf 4/9cg    -32/45dg         -de+3/2cf+27/10bg 
; -9/5af    -cf      8/5df            -9/2ce-27/10ag    
; 0         bf-4/9ag -de              9/2be-3/2af       
; ad        0        ce-8/5bf+32/45ag ae                
; 0         -5/9d    e                -3c               
; a         5/9c     -8/9d            4b                
; -8/3d     0        -8/27g           -8/3e             
; 3c        -5/9e    4/3f             0                 
; 3e        5/27g    0                4f                

; -8/9d2+8/5bf 32/45cg       
; 0            -16/15bg      
; 0            4/3d2+16/15ag 
; -ad          -cd           
; ac           c2-4/3bd      
; a            c             
; 0            -4/3b         
; -8/3c        8/9e          
; 4b           0             
; 8/3d         -4/3f         
; 
; ----------------------------------

; 8/27de-4/9cf+4/27bg   
; 8/5cd-12/5be+4/5af    
; c2-4/3bd+1/3ae        
; -8/27d2+8/15bf-1896ag 
; -1/3e2+4/9df-1/9cg    
; -ce+8/5bf-3/5ag       
; 
; ----------------------------------


\end{verbatim}

\section{Finding an inhomogeneous standard basis}

\begin{verbatim}
%  ;; Problem: find a minimal standard basis of an inhomogeneous ideal.
%  ;;
%  ;; The technique we use is to homogenize the ideal, compute a standard 
%  ;; basis, and then find a minimal standard basis after dehomogenizing.
%  ring R
! characteristic (if not 31991)       ? <return>
! number of variables                 ?  5
!   5 variables, please               ?  a-dt
! variable weights (if not all 1)     ? <return>
! monomial order (if not rev. lex.)   ?  4 1
;   largest degree of a monomial        : 512 512 

%  ideal j
! number of generators ?  3
! (1,1) ?  a3-bc-1
! (1,2) ?  ab2-cd-a
! (1,3) ?  b3-bc-d+1

%  ; now we homogenize
%  homog j t k

%  type k
; a3-bct-t3 ab2-cdt-at2 b3-bct-dt2+t3 

%  ; compute a standard basis of "k"
%  std k k
; 34.5.6.7.8.9.
; computation complete after degree 9

%  ; find a subset of this standard basis which is minimal after
%  ; dehomogenization
%  stdpart k m a..d

%  putmat m
; 1
; 11
; c3d3t2-bc4t3+b2c2t4+3bc3t4-3c3dt4-3bcd2t4-2ac2t5-3bc2t5+c3t5 \
;     +abdt5+2bcdt5+8c2dt5+2ad2t5-abt6-3b2t6+5act6+2bct6-3c2t6 \
;     -4adt6+3bdt6-6cdt6-d2t6-at7-3bt7+3ct7+2dt7
; bcd3t-b2c2t2-ac2dt2-a2d2t2+abd2t2+c2d2t2-ad3t2+a2bt3-a2ct3 \
;     +b2ct3+a2dt3+2acdt3-bcdt3+ad2t3+a2t4+bt5-dt5+t6
; b2cdt-abdt2-c2dt2+abt3-act3+cdt3+at4
; b3-bct-dt2+t3
; ac2d2t2-bc3t3+2bc2t4-abdt4-2c2dt4+abt5+2b2t5-act5-bct5+c2t5 \
;     -bdt5+3cdt5+at6+bt6-2ct6-t7
; ac3dt2-c3d2t2+a2c2t3+b2c2t3-2ac2dt3-bcd2t3-a2bt4-a2ct4-b2ct4 \
;     +a2dt4-abdt4+bcdt4+ad2t4-a2t5-adt5-bt6+dt6-t7
; abct-bcdt-abt2+adt2-at3
; ab2-cdt-at2
; a2cdt-bc2t2-b2t3+bct3-cdt3+ct4+t5
; a2bdt2+ac2dt2-c2d2t2-a2bt3+a2ct3-2acdt3-a2t4
; a3-bct-t3

%  ; finally, dehomogenize
%  imap f m m
! variable, new image ?  t 1
! variable, new image ? <return>

%  ev f m m

%  ; and the final answer is
%  putmat m
; 1
; 11
; c3d3-bc4+b2c2+3bc3-3c3d-3bcd2-2ac2-3bc2+c3+abd+2bcd+8c2d+2ad2 \
;     -ab-3b2+5ac+2bc-3c2-4ad+3bd-6cd-d2-a-3b+3c+2d
; bcd3-b2c2-ac2d-a2d2+abd2+c2d2-ad3+a2b-a2c+b2c+a2d+2acd-bcd+ad2 \
;     +a2+b-d+1
; b2cd-abd-c2d+ab-ac+cd+a
; b3-bc-d+1
; ac2d2-bc3+2bc2-abd-2c2d+ab+2b2-ac-bc+c2-bd+3cd+a+b-2c-1
; ac3d-c3d2+a2c2+b2c2-2ac2d-bcd2-a2b-a2c-b2c+a2d-abd+bcd+ad2-a2 \
;     -ad-b+d-1
; abc-bcd-ab+ad-a
; ab2-cd-a
; a2cd-bc2-b2+bc-cd+c+1
; a2bd+ac2d-c2d2-a2b+a2c-2acd-a2
; a3-bc-1

\end{verbatim}

\section{The ideal of the 3 by 3 commuting matrices}

Given a (homogeneous) ideal $I \subset S = \kn$, what is the best way to
determine whether the ring $S/I$ is Cohen-Macaulay (C.M.)?  One way is to
compute a minimal finite free resolution of $S/I$.  $S/I$ is C.M. if and
only if the length of the resolution is equal to the codimension of $S/I$.
(see \cite{matsumura} for definitions and the basic properties of Cohen-
Macaulay rings and modules).

Unfortunately, this method sometimes fails, since it is often too time
consuming to compute the finite free resolution.  A much easier
approach is to use the following well known proposition.

\begin{prop}[Test for whether a ring is C.M.]

Let $I \subset S$ be a homogeneous ideal, and let $d = \dim S/I$.  Then
$S/I$ is Cohen-Macaulay $\iff \deg S/I = \deg S/(I,f_1, \ldots, f_d)$,
for some (and hence all) system of parameters $\{f_1, \ldots, f_d\}$.

\end{prop}

Recall that $\deg S/(I,f_1, \ldots, f_d) = \dim_k S/(I,f_1, \ldots,
f_d)$.  In \Macaulay, this number can be found from a standard basis
by the \icmd{degree} command.

One important problem is the following question of Artin and Hochster.  Let
$I \subset k[x_{ij}, y_{ij}]$ be the ideal of the entries of the $n$ by $n$
matrix $XY-YX$, where $X = (x_{ij})$, and $Y = (y_{ij})$.  Is $S/I$ 
Cohen-Macaulay?  If so, this easily implies that $S/I$ is a normal domain.
However, the question has still not been answered for $n \geq 4$.

In this example, we show that for $n = 3$, $S/I$ is Cohen-Macaulay.
For this example, it is possible but time consuming to compute a
finite free resolution, therefore our method of attack is to use the above
proposition.  The \Macaulay\ session to determine this is given below.
The following list of notes refers to this session.

\begin{enumerate}

  \item The monomial order for the ring $S$ is set to the default: the
reverse lexicographic order.  This allows the entire computation to take
much less time.  For example, the session below takes about 30 seconds on
either a SUN 3/140 or a Macintosh II.

  \item Notice the shorthand ``{\tt x[1]-y[9]}'' to specify the 18 variables
which we need.

  \item The matrices $X$ and $Y$ are created using the useful \icmd{cat}
command.  

  \item The \icmd{random} command is used to generate enough random numbers
so that we can construct 12 random linear forms.

  \item  The method we have chosen is not the fastest.  For example, the
standard basis computation of ``{\tt Icut}'' is done in the original ring 
$S$.  However, if we simply reduced $I$ with respect to the random linear
forms, we would have an ideal in 6 variables.  Computing a standard basis
here would be much more efficient.  In this example however, more efficiency
is not needed.

\end{enumerate}

\begin{verbatim}
%  ; first create a ring with 18 variables x[i]'s and y[j]'s.
%  ring S
! characteristic (if not 31991)       ? <return>
! number of variables                 ?  18
!  18 variables, please               ?  x[1]-y[9]
! variable weights (if not all 1)     ? <return>
! monomial order (if not rev. lex.)   ? <return>
;   largest degree of a monomial        : 16 

%  ; find the ideal I
%  cat x[1] X
! rows ?  0 3 6
! columns ?  0 1 2

%  cat y[1] Y
! rows ?  0 3 6
! columns ?  0 1 2

%  type X
; x[1] x[2] x[3] 
; x[4] x[5] x[6] 
; x[7] x[8] x[9] 

%  type Y
; y[1] y[2] y[3] 
; y[4] y[5] y[6] 
; y[7] y[8] y[9] 

%  mult X Y XY

%  mult Y X YX

%  subtract XY YX XY_YX

%  flatten XY_YX I

%  ; compute a standard basis of I, and its degree.
%  std I I
; 23.4.5.6.7.
; computation complete after degree 7

%  degree I
; codimension : 6
; degree      : 31

%  ; now find a system of parameters for I.
%  ; we need 12 linear forms (since dim(S/I) = 12).
%  ; we choose 12 random linear forms.
%  random 18 12 rand

%  mult S rand linears

%  concat linears I

%  ; compute a standard basis of (I, linears), and its degree.
%  std linears Icut
; 12.3.4.5.6.
; computation complete after degree 6

%  degree Icut
; codimension : 18
; degree      : 31

%  ; both have degree 31, therefore S/I is Cohen-Macaulay.
\end{verbatim}

\section{Linkage of curves in \proj 3}

Let $C \subset \proj 3$ be a curve. Let $I_C$ be its homogeneous
defining ideal.  Suppose that $f, g \in I_C$ are two homogeneous
polynomials such that $\{f, g\}$ is a regular sequence.  Then $X =
Z(f, g) \subset \proj 3$ is also a curve, and $X = C \cup D$, for some
(possibly reducible) curve $D$.  $D$ is called the link of $C$ via the
complete intersection $X$.

Linkages are an important technique in the theory of curves.  In this
example, we compute the link $D$ of the rational quartic curve via a
complete intersection $(f, g)$, where both $f$ and $g$ have degree
three.  This curve has degree five.  After we find the equations of $D$, we
then see whether the result is a nonsingular curve.

The ideal $I_D$ defining the curve $D$ is the ideal quotient
	$$((f,g) : I_C) = \{ h \in k[a,b,c,d] \mid h I_C \subset (f,g)\}.$$
This is accomplished in \Macaulay\ using the \icmd{quotient} command.

We find the singular locus of any variety by using the following 
proposition (see \cite{hartshorne, pg 36}).

\begin{prop}[Test for non-singularity]
Let $X \subset \proj n$ be a projective algebraic set of dimension
$d$, with defining ideal $I = \{\row f r\}$.  Let $Df = (\partial f_i /
\partial x_j)$ be the $(n+1)$ by $r$ Jacobian matrix. 
Let $J$ be the ideal consisting of $I$ together with all the $n-d$ by $n-d$
determinants of the matrix $Df$. 

(a) The singular locus of $X$ is exactly the zero locus $Z(J)$.

(b) $X$ is nonsingular $\iff$ codim $J = n+1$.

\end{prop}

The following list of remarks refers to the \Macaulay\ session below.

\begin{enumerate}
  \item It is necessary to choose $f$ and $g$ sufficiently ``generic''
in order for the result to be a nonsingular curve.  In this example we
use polynomial expressions using the generators for the ideal $I_C$.

  \item Before determining the codimension of the ideal $J$, it is essential
to concatenate the equations from $I_C$ to the equations from the minors
of the Jacobian matrix.  It is a common mistake to omit this step!

\end{enumerate}

\begin{verbatim}
%  type i_C  ; the ideal of the rational quartic
; c3-bd2 bc-ad b3-a2c ac2-b2d 

%  ; first we choose two cubics in this ideal
%  ideal i_X
! number of generators ?  2
! (1,1) ?  (c3-bd2)+(a+b-c+d)*(bc-ad)
! (1,2) ?  (b3-a2c)+2*(ac2-b2d)+3d(bc-ad)

%  ; now we compute the ideal "i_D" of D
%  quotient i_X i_C i_D
; 0.[378k]1.2.3..4..
; computation complete after degree 4

%  putmat i_D
; 1
; 5
; a3+a2b+3/2ab2+b3-5/2a2c+3/2b2c+ac2-1/2bc2+2c3-a2d-4abd-1/2b2d \
;     +3/2acd+3/2bcd-1/2ad2-5bd2+9/2d3
; a2b+ab2+abc+2b2c+ac2-2bc2+2c3-4a2d-3abd+b2d+4acd+2bcd-4ad2 \
;     -4bd2+3cd2
; ab2+2b3-a2c-b2c+2ac2+bc2-2abd-3b2d+acd+5bcd-2c2d-3ad2-2bd2+3d3
; abc+b2c-bc2+c3-a2d-abd+acd+bcd-ad2-bd2
; b3-a2c+2ac2-2b2d+3bcd-3ad2

%  ; is this nonsingular?
%  ; first construct the ideal J
%  jacob i_D Df

%  wedge Df 2 J   ; 2 by 2 minors, since 2 = codim C

%  flatten J J

%  concat J i_D   ; don't forget to add the ideal i_D!!

%  ; now compute the codimension of J
%  std J J
; 34.5.
; computation complete after degree 5

%  codim J
; codimension : 4

%  ; the codimension is 4, and therefore this curve is nonsingular.
\end{verbatim}
