incr-set prlevel 1
if #0=3 START
incr-set prlevel -1
;;; Usage:
;;; 	<proj_bundle m m0 j
;;;
;;; Find the ideal, j, IN THE CURRENT RING R, such that R/j is
;;; isomorphic to the subring of P(M) generated by the elements of the
;;; submodule M0 in the projective bundle of M.  The number of
;;; variables in the ring R should be at least as large as the number
;;; of elements of M0 (i.e the number of columns of m0), and they
;;; should all have the same weight.
incr-set prlevel 1
jump END
;;;
;;; Parameters:
;;;    m = matrix presenting a module M over a ring S.
;;;    m0 = a matrix over S with the same number of rows as m, whose
;;;         columns generate a submodule M0 of M.
;;; Output values:
;;;    j = ideal in the current ring.
;;;
;;; The ring S may be either the polynomial ring, or the quotient ring
;;; with the same support as M.  The answer is the same in both instances.
;;; The resulting ideal is the ideal defining the image of the map
;;;     P(M) ----> P^r
;;; where m0 has (r+1) columns.
; created 7/6/89 MES
START:
; first we get a handle to the current ring:
poly @current 0
     
; compute the proj bundle by finding the symmetric algebra, and then
; saturating (wrt the "old" variables)
<symmetric_algebra #1 @SM @old @new
<sat @SM @old @PM
     
; map the given set of elements "m0" into PM:
ev @old #2 @M0
mult @new @M0 @M0
     
; M0 is now an ideal in PM, find the subring which it generates
std @PM @PM    ; needed for qring
qring @PM @R
fetch @M0 @M0
setring @current
<subring @M0 #3
     
; clean up
; kill @SM @old @new @PM @M0 @current @R @R'zero
END:
incr-set prlevel -1
     
$;;;;;;;; EXAMPLE SECTION ;;;;;;;;;;;;;;;;;;;;;;;;;
;; example: rational scroll.
<ring 2 st r
; now make a presentation matrix for R(1)+R(2)+R(3)
<zeromat 3 0 m
setdegs m
    1 2 3
    ;
     
; let m0 = all degree 4 elements
k-basis m m0
    4
    4
     
; setup the correct ring
ncols m0 nvars
<ring nvars a-z s
     
; now compute the proj bundle
<proj_bundle m m0 j
     
     
