incr-set prlevel 1
if #0=3 START
incr-set prlevel -1
;;; Usage:
;;; 	<normal_conecone J T L
;;;
;;; Compute the graded ring T/L = R/J + J/J^2 + J^2/J^3 + ...,
;;; where R is the base ring of J, and T is a polynomial ring over R
;;; supplied by the user.  T/L corresponds to the normal cone of the scheme
;;; defined by J.
incr-set prlevel 1
jump END
;;; Parameters:
;;;  J = an ideal.
;;;  T = a polynomial ring over R in variables whose weights are
;;;	 proportional to the degrees of the generators of J.
;;;
;;; Output values:
;;;  L = the result ideal in the ring T.
;;;
;;; The ring R may be a quotient ring.
;;;
;;; The normal cone is computed by writing R[tJ] = T/L1.  Then the ideal
;;; L = L1 + JT.
;;;
; last modified 4/25/89 DE,MS, 5/23/89 MES
START:
     
<blowup #1 #2 #3
setring #3
fetch #1 @J
concat #3 @J
     
kill @J
     
END:
incr-set prlevel -1
     
$;;;;;;;; EXAMPLE SECTION ;;;;;;;;;;;;;;;;;;;;;;;;;
;; normal cone of the rational normal quartic curve in P4
;; note that the normal cone has an embedded component at the max ideal
;; in fact, since the ideal, j,  of the normal quartic is generated by the
;; 2x2 minors of a 3x3 matrix (m below), the symbolic square of j contains
;; det m, which then appears as an extra quadratic form in (l : (a,b,c,d,e)),
;; where l is the ideal of the normal cone.
     
<ring 5 a-e r
     
cat a m
    0 1 2
    0 1 2
     
; the ideal of the rational quartic is generated by the 2x2 minors of m
wedge m 2 m2
flatten m2 j
std j j
     
; we know that j has 6 minimal generators of degree 2
<ring 6 u-z s
ring-sum r s t
     
<normal_cone j t l
     
type l
std l ll
degree ll
fetch r max
quotient ll max lsat
numinfo ll
numinfo lsat
     
listvars
<normal_cone
     
