incr-set prlevel 1
if #0=3 START
incr-set prlevel -1
;;; Usage:
;;;     <line_bundle_image m y j
;;;
;;; Find the equations, "j", of the image to projective space defined by
;;; the line bundle which is the sheafification of the module "m",
;;; on the projective scheme X = Supp(m).  The variables of this
;;; new projective space are named y[0], ..., y[r].
;;;
incr-set prlevel 1
jump END
;;; Parameters:
;;;    m = a matrix whose sheafification is a line bundle on X.
;;;    y = a letter.  The variables in the base ring of the result are
;;;        y[0], ..., y[r], for some r.
;;;
;;; Output values:
;;;    j = the ideal in y[0], ..., y[r] defining the image to P^r
;;;        of the map corresponding to the elements of "m" of degree zero.
;;;
;;; See the forthcoming paper by M. Brundu and M. Stillman for a more
;;; detailed description and proof of this method.
;;;
;;; Caveats:  If the module "m" is not reflexive (or "S2"), then the
;;; elements of degree zero in m might not generate the entire vector space
;;; of global sections of the line bundle.  This script will compute the
;;; image using exactly these section.  You might wish to first use
;;; "double_dual" on the module "m".
;;;
; last modified 5/23/89 MES
START:
     
; find the sections of the sheaf corresponding to "M".  This is the
; vector space of degree 0 elements in the module M.
std #1 @M
k-basis @M @M0
    0
    0
     
; create the ring where the resulting ideal will live.  Also report the
; number of sections to the user.
ncols @M0 @n
shout echo Number of sections of the line bundle or sheaf:
shout type @n
<ring @nv #2[0]-#2[@nv-1] @R
     
; compute the image
<proj_bundle @M @M0 #3
     
; clean up
kill @M0 @nv @R
     
END:
incr-set prlevel -1
     
$;;;;;;;; EXAMPLE SECTION ;;;;;;;;;;;;;;;;;;;;;;;;;
;; test 1: canonical module of the twisted cubic.
     
<ring 4 a-d r
<monomial_curve 1 2 3 j
res j jj
transpose jj.2 n
dshift n 1
<line_bundle_image n y j
type j
     
;; test 2: canonical module of the 2 by 2 minors of the matrix "m":
<ring 4 a-d r
mat m
   nrows ? 2
   ncols ? 3
   1,1? a
   2,1? b
   1,2? c2+bd
   2,2? ac
   1,3? cd+b2
   2,2? d2
type m
wedge m 2 q
flatten q q
res q qq
transpose qq.2 n
type n
row-degs n
dshift n 4  ; the canonical module, since we are in P^3
<line_bundle_image n y j
; one can check that this is a singular curve
