Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 7ebd25ac536d248d499a3ce2acda963a > files > 3889

Macaulay2-1.3.1-8.fc15.i686.rpm

<?xml version="1.0" encoding="utf-8" ?>  <!-- for emacs: -*- coding: utf-8 -*- -->
<!-- Apache may like this line in the file .htaccess: AddCharset utf-8 .html -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"	 "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head><title>Tutorial: Divisors</title>
<link rel="stylesheet" type="text/css" href="../../../../Macaulay2/Style/doc.css"/>
</head>
<body>
<table class="buttons">
  <tr>
    <td><div><a href="_basic_spcommutative_spalgebra.html">next</a> | <a href="___Tutorial_co_sp__Fano_spvarieties.html">previous</a> | forward | <a href="___Tutorial_co_sp__Fano_spvarieties.html">backward</a> | <a href="_mathematical_spexamples.html">up</a> | <a href="index.html">top</a> | <a href="master.html">index</a> | <a href="toc.html">toc</a> | <a href="http://www.math.uiuc.edu/Macaulay2/">Macaulay2 web site</a></div>

    </td>
  </tr>
</table>
<div><a href="index.html" title="">Macaulay2Doc</a> > <a href="_mathematical_spexamples.html" title="">mathematical examples</a> > <a href="___Tutorial_co_sp__Divisors.html" title="">Tutorial: Divisors</a></div>
<hr/>
<div><h1>Tutorial: Divisors</h1>
<div>In this tutorial we describe one way to represent divisors on a smooth projective subvariety <i>X</i> of <i><b>P</b><sup>r</sup></i>, and show methods for computing the group operations, computing the vector space of sections, and determining whether two divisors are linearly equivalent.  We also construct the canonical divisor on <i>X</i>.<p/>
We consider smooth varieties only, although most of this can be extended to normal varieties.  Cartier and Weil divisors on normal varieties might be the subject of a further tutorial.<p/>
Other possible future topics would be: intersection numbers, determining whether a divisor is very ample, and finding the base point locus of the divisor class.<p/>
The simplest case is when the homogeneous coordinate ring <i>S<sub>X</sub></i> of <i>X</i> satisfies the <i>S<sub>2</sub></i> condition of Serre: We say that a domain <i>R</i> is <i>S<sub>2</sub></i> if every proper nonzero principal ideal has pure codimension 1 (all associated primes of the ideal are of codimension 1).<p/>
In this tutorial, we consider the case when this holds (e.g., this holds for complete intersections).  In a further tutorial, we will make the necessary extensions to handle the non <i>S<sub>2</sub></i>-case.<p/>
An example that we will use throughout is the plane cubic curve <i>E</i>, whose homogenoeus coordinate ring is <tt>SE</tt>:<table class="examples"><tr><td><pre>i1 : KK = ZZ/31991

o1 = KK

o1 : QuotientRing</pre>
</td></tr>
<tr><td><pre>i2 : SE = KK[x,y,z]/(y^2*z - x*(x-z)*(x+3*z))

o2 = SE

o2 : QuotientRing</pre>
</td></tr>
</table>
The sections in this tutorial are A. Representation of divisors<p/>
B. Group operations on divisors<p/>
C. Global Sections<p/>
D. Linear Equivalence<p/>
E. The canonical divisor<h4>A. Representation of divisors</h4>
Let <i>X</i> be a smooth irreducible variety.  A (Weil) divisor on <i>X</i> is an integral linear combination of irreducible subvarieties of <i>X</i> of codimension <i>1</i>. The divisor is called effective if all the coefficients are non-negative.  To any ideal <i>I</i> in the homogeneous coordinate ring <i>S<sub>X</sub></i> of <i>X</i> we associate the effective divisor that is the sum of the pure codimension <i>1</i> components of <i>I</i>, each taken with the multiplicity it has in the primary decomposition of <i>I</i>.<p/>
Let <i>D = E - F</i> be a divisor, where <i>E</i> and <i>F</i> are effective.  Because <i>X</i> is normal, there is a unique homogeneous ideal <i>I</i> in <i>S<sub>X</sub></i> such that <i>V(I) = E</i>, and <i>I</i> is either <i>(1)</i>, or has pure codimension one.  Similarly, there is a unique such ideal <i>J</i> with <i>V(J) = F</i>.  Our plan is to represent the divisor <i>D</i> by the pair of ideals <i>(I,J)</i>.<p/>
This representation is not unique.  If <i>(I,J)</i> and <i>(I&rsquo;,J&rsquo;)</i> are two pairs of ideals (such that each ideal is either <i>(1)</i> or has pure codimension one), then <i>(I,J)</i> and <i>(I&rsquo;,J&rsquo;)</i> represent the same divisor iff <p align=center><i>sat(I J&rsquo;) = sat(I&rsquo; J),</i></p> where <i>sat(K)</i> is the saturation of <i>K</i> (the largest ideal <i>L</i> such that a power of the irrelevant ideal times <i>L</i> is in <i>K</i>) Write <i>(I,J) &equiv;(I&rsquo;,J&rsquo;)</i> if <i>sat(I J&rsquo;) = sat(I&rsquo; J)</i>.<p/>
This correspondence defines a bijection between <i>Div(X)</i> and <i>{(I,J) &nbsp;|&nbsp;I,J</i> are homogeneous ideals in <i>S<sub>X</sub></i> either trivial, or pure codim one<i>}/&equiv;</i>.<p/>
As we will often have to saturate ideals of codimension 1, we give here the most efficient method we know, which has the additional advantage of throwing away all components not of codimension 1.  That is, we define <tt>purify1S2(I)</tt>, a function that takes an arbitary ideal <i>I</i> in a ring satisfying <i>S<sub>2</sub></i>, and returns the ideal which is the intersection of the codimension 1 primary components of <i>I</i>.  In the next divisor tutorial (not yet written), we will write a routine <tt>purify1(I)</tt> which does not require the ring to be <i>S<sub>2</sub></i>.<table class="examples"><tr><td><pre>i3 : purify1S2 = I -> (
         -- Assuming ring I is S2, and I is not 0, returns the 
         -- pure codimension 1 part of I.
         -- Find a nonzero element of I:
         M := compress gens I;
         -- Explanation: gens I is 
         -- the matrix of generators of I; compress
         -- removes the entries that are 0
         -- and := makes M a local variable.
         if numgens source M == 0 
         then error "purify1S2: expected nonzero ideal";
         f := ideal M_(0,0);
         -- f is the ideal generated by the first entry.
         -- Since ring I is S2, the ideal f is 
         -- pure codimension 1.  Thus
         f:(f:I)
         -- is the pure codimension 1 part. (The last 
         -- expression given in a function is the returned
         -- value, provided the semicolon is left off.)
         )

o3 = purify1S2

o3 : FunctionClosure</pre>
</td></tr>
</table>
For example, in the ring<table class="examples"><tr><td><pre>i4 : R = ZZ/5[a,b]

o4 = R

o4 : PolynomialRing</pre>
</td></tr>
</table>
we have<table class="examples"><tr><td><pre>i5 : purify1S2 ideal(a^2,a*b)

o5 = ideal(a)

o5 : Ideal of R</pre>
</td></tr>
</table>
B Unfortunately at this moment the quotient code B makes this slow.  Another possibility is B purify1S2 = saturation B which is (9/23/96) slightly faster (88 vs 106 sec).<p/>
Throughout this tutorial, we will treat divisors as equivalence classes of pairs, and our operations will operate on pairs.  So let&rsquo;s define a divisor type in Macaulay2. The following declaration provides a new data type, the <tt>Divisor</tt>.<table class="examples"><tr><td><pre>i6 : Divisor = new Type of BasicList

o6 = Divisor

o6 : Type</pre>
</td></tr>
</table>
Let&rsquo;s write a routine to create a divisor, from either a single ideal, or a pair of ideals.  (This routine should check that its arguments are pure codimension one, or trivial, and in the same ring, but we will ignore that).<p/>
Defining <tt>divisor</tt> to be a method allows us to define different versions of this routine which take different arguments.<table class="examples"><tr><td><pre>i7 : divisor = method()

o7 = divisor

o7 : MethodFunction</pre>
</td></tr>
</table>
The following allows us to define an object of class <tt>Divisor</tt> from a pair of ideals.<table class="examples"><tr><td><pre>i8 : divisor(Ideal,Ideal) := (I,J) -> new Divisor from {purify1S2 I,purify1S2 J};</pre>
</td></tr>
</table>
The following routine defines an (effective) divisor from a single ideal.<table class="examples"><tr><td><pre>i9 : divisor Ideal := I -> divisor(I, ideal 1_(ring I));</pre>
</td></tr>
</table>
The divisors of some rational points on the elliptic curve <i>E</i> include<table class="examples"><tr><td><pre>i10 : P = divisor ideal(x,z)

o10 = Divisor{ideal (z, x), ideal 1}

o10 : Divisor</pre>
</td></tr>
<tr><td><pre>i11 : R = divisor ideal(x,y)

o11 = Divisor{ideal (y, x), ideal 1}

o11 : Divisor</pre>
</td></tr>
<tr><td><pre>i12 : R1 = divisor ideal(x-z,y)

o12 = Divisor{ideal (y, x - z), ideal 1}

o12 : Divisor</pre>
</td></tr>
<tr><td><pre>i13 : R2 = divisor ideal(x+3*z,y)

o13 = Divisor{ideal (y, x + 3z), ideal 1}

o13 : Divisor</pre>
</td></tr>
<tr><td><pre>i14 : Q1 = divisor ideal(y-6*z, x-3*z)

o14 = Divisor{ideal (y - 6z, x - 3z), ideal 1}

o14 : Divisor</pre>
</td></tr>
</table>
Testing equality of divisors is often made simpler by having a &ldquo;normal form&rdquo; for divisors.  The normal form of a divisor <i>D</i> is <i>E - F</i> where <i>E</i> and <i>F</i> are both effective and have disjoint support.  It is easy to see that the normal form of <i>(I,J)</i> is <i>(I:J, J:I)</i>.<p/>
In the following code, the expressions <tt>D#0</tt> and <tt>D#1</tt> refer to the first and second ideals in the list representing <i>D</i>. (<tt>D#0</tt> is the first because Macaulay2 counts everything starting from 0.)<table class="examples"><tr><td><pre>i15 : normalForm = method()

o15 = normalForm

o15 : MethodFunction</pre>
</td></tr>
<tr><td><pre>i16 : normalForm Divisor := D -> new Divisor from {D#0 : D#1, D#1 : D#0};</pre>
</td></tr>
</table>
Two pairs <i>(I,J), (I&rsquo;,J&rsquo;)</i> define the same divisor exactly when their normal forms are equal.  The following code establishes a method for testing the equality of divisors.  The function "toList" converts a divisor to a list of ideals, and then we let the built in method for comparing lists take over: it compares corresponding elements.<table class="examples"><tr><td><pre>i17 : Divisor == Divisor := (D,E) -> toList normalForm D == toList normalForm E;</pre>
</td></tr>
</table>
An important point here is that the built in method for comparing two ideals used by the operator "==" succeeds even if the given generators differ.  We shall later show that with <tt>R1</tt> and <tt>R2</tt> as above, the divisor <tt>(R1 + R2) - R1</tt> is represented by<table class="examples"><tr><td><pre>i18 : D = divisor(ideal(y, x^2+2*x*z-3*z^2), ideal(x-z, y))

                         2            2
o18 = Divisor{ideal (y, x  + 2x*z - 3z ), ideal (y, x - z)}

o18 : Divisor</pre>
</td></tr>
</table>
so that the normal form of <i>D</i> is <tt>R2</tt>:<table class="examples"><tr><td><pre>i19 : normalForm D

o19 = Divisor{ideal (y, x + 3z), ideal 1}

o19 : Divisor</pre>
</td></tr>
</table>
and we can directly test equality by<table class="examples"><tr><td><pre>i20 : D == R2

o20 = true</pre>
</td></tr>
</table>
<h4>B. Group operations on divisors</h4>
To add divisors we multiply the corresponding ideals and then saturate.  This may be coded as follows (the products are saturated in the <tt>divisor</tt> routine):<table class="examples"><tr><td><pre>i21 : Divisor + Divisor := (D,E) -> divisor(D#0 * E#0, D#1 * E#1);</pre>
</td></tr>
</table>
Negation is even simpler, since all we need do is exchange the two ideals.  We don&rsquo;t use the <tt>divisor</tt> routine, since our ideals are already saturated.<table class="examples"><tr><td><pre>i22 : - Divisor := (D) -> new Divisor from {D#1, D#0};</pre>
</td></tr>
</table>
Let&rsquo;s also include functions to compute differences and to multiply by integers.<table class="examples"><tr><td><pre>i23 : Divisor - Divisor := (D,E) -> D + (-E);</pre>
</td></tr>
<tr><td><pre>i24 : ZZ Divisor := ZZ * Divisor := (n,D) -> divisor((D#0)^n, (D#1)^n);</pre>
</td></tr>
</table>
Some arithmetic of divisors on our elliptic curve<table class="examples"><tr><td><pre>i25 : 2 P

                         2
o25 = Divisor{ideal (z, x ), ideal 1}

o25 : Divisor</pre>
</td></tr>
<tr><td><pre>i26 : 3 P

o26 = Divisor{ideal(z), ideal 1}

o26 : Divisor</pre>
</td></tr>
</table>
Notice that <i>3P</i> is the hyperplane section <i>z=0</i>, which is the equation of the flex line to the cubic at the point <i>P</i>.<table class="examples"><tr><td><pre>i27 : D = P-R1

o27 = Divisor{ideal (z, x), ideal (y, x - z)}

o27 : Divisor</pre>
</td></tr>
<tr><td><pre>i28 : D2 = 2 P - 2 R1

                         2                  2
o28 = Divisor{ideal (z, x ), ideal (x - z, y )}

o28 : Divisor</pre>
</td></tr>
</table>
<h4>C. Global Sections</h4>
Since we have assumed <i>X</i> smooth, Weil divisors can all be represented by Cartier divisors, that is, by sections of an invertible sheaf.  If <i>D = (I,J)</i> is a divisor, and <i>sheaf(I)</i> denotes the sheaf of <i>O<sub>X</sub></i>-modules corresponding to <i>I</i>, then we put <p align=center><i>O<sub>X</sub>(D) = sheaf(I)<sup>-1</sup> &otimes;sheaf(J).</i></p><p/>
We define <i>L(D)</i> to be the space of global sections of the sheaf <i>O<sub>X</sub>(D)</i>. Note that a global section is the same as a sheaf homomorphism <i>O<sub>X</sub> &rarr; O<sub>X</sub>(D)</i>.  If we write <i>D = E-F</i>, where <i>E</i> and <i>F</i> are effective, then global sections of <i>O<sub>X</sub>(E-F)</i> can be identified with homomorphisms <i>O<sub>X</sub>(-E) &rarr; O<sub>X</sub>(-F)</i>.<p/>
If we write <i>D = (I,J)</i>, then <i>L(D)</i> and <i>Hom(I,J)</i> can be identified with subsets of the field of fractions of <i>S<sub>X</sub></i>.  Since <i>S<sub>X</sub></i> satisfies <i>S<sub>2</sub></i>, these sets are equal.  The following proposition allows us to compute <i>Hom(I,J)</i>: <b>Proposition</b>. Suppose <i>X</i> is a smooth projective variety whose homogeneous coordinate ring <i>S<sub>X</sub></i> is <i>S<sub>2</sub></i>.  If <i>D</i> is the divisor <i>(I,J)</i> and <i>f</i> is any non-zero element of <i>I</i>, then <i>L(D)</i> is the degree zero part of <p align=center><i>sat((f*J) : I) /f.</i></p><p/>
<p/>
<b>Proposition</b>. If <i>s = g/f</i> is section of the divisor <i>D = (I,J)</i> as above, then the zero scheme of <i>s</i> is defined by the ideal <p align=center><i> sat(f I : g) : J.</i></p><p/>
<p/>
Consider the divisor <i>2P</i> on our curve <i>E</i>:<table class="examples"><tr><td><pre>i29 : D = 2 P

                         2
o29 = Divisor{ideal (z, x ), ideal 1}

o29 : Divisor</pre>
</td></tr>
</table>
In this case, <i>I = (x<sup>2</sup>, z)</i>, and <i>J = (1)</i>.  Compute the vector space of sections <i>L(2P)</i>:<table class="examples"><tr><td><pre>i30 : I = D#0

                 2
o30 = ideal (z, x )

o30 : Ideal of SE</pre>
</td></tr>
<tr><td><pre>i31 : J = D#1

o31 = ideal 1

o31 : Ideal of SE</pre>
</td></tr>
<tr><td><pre>i32 : f = z

o32 = z

o32 : SE</pre>
</td></tr>
</table>
The degree 0 part in the proposition is the degree <i>d</i> part of <i>sat((fJ) : I)</i>, divided by <i>f</i>, where <i>d = deg f</i>.<p/>
We can use the command <tt>basis</tt> to obtain a vector space basis of a module or ideal in a given degree and thus compute the global sections (For an explanation of this use of the <tt>basis</tt> routine, see the tutorial on canonical embeddings of plane curves and gonality)<table class="examples"><tr><td><pre>i33 : LD = basis(degree f, purify1S2((f*J) : I))

o33 = {1} | 1 0 |
      {1} | 0 1 |

o33 : Matrix</pre>
</td></tr>
<tr><td><pre>i34 : LD = super (LD ** (ring target LD))

o34 = | z x |

               1        2
o34 : Matrix SE  &lt;--- SE</pre>
</td></tr>
</table>
so the vector space <i>L(2P)</i> is generated by <i>1=z/z</i>, and <i>x/z</i>.  Since <i>J = (1)</i>, the zero locus of the section <i>(z+x)/z</i> is defined by the ideal<table class="examples"><tr><td><pre>i35 : imI = purify1S2(((z+x)*I) : z)

                     2     2
o35 = ideal (x + z, y  - 4z )

o35 : Ideal of SE</pre>
</td></tr>
</table>
and its degree is:<table class="examples"><tr><td><pre>i36 : degree imI

o36 = 2</pre>
</td></tr>
</table>
Let&rsquo;s now package this into a routine <tt>globalSections</tt> which takes an argument <tt>D</tt> of class <tt>Divisor</tt>, and computes a basis of <i>L(D)</i>, represented as fractions with a common denominator.  The output is a row vector of the numerators, followed by the denominator.<table class="examples"><tr><td><pre>i37 : globalSections = method()

o37 = globalSections

o37 : MethodFunction</pre>
</td></tr>
<tr><td><pre>i38 : globalSections Divisor := (D) -> (
          -- First let's grab the parts (I,J) of D.
          I := D#0;
          J := D#1;
          -- Let 'f' be the first element of the 
          -- matrix of generators of the ideal I.
          f := (gens I)_(0,0);
          -- Now compute the basis of global sections
          -- just as above
          LD := basis(degree f, purify1S2((f*J) : I));
          LD = super (LD ** (ring target LD));
          -- Return both this vector space and the denominator
          {LD, f});</pre>
</td></tr>
</table>
Another important task is to find the ideal of zeros of a section <i>s = f/g</i> of a divisor <i>D</i>.<table class="examples"><tr><td><pre>i39 : sectionIdeal = (f,g,D) -> (
          I := D#0;
          J := D#1;
          purify1S2((f*I):g) : J
          );</pre>
</td></tr>
</table>
Let&rsquo;s find the image of the elliptic curve <i>E</i> under the linear system <i>4P</i>. To do this we define a ring homomorphism from the global sections with the command map. Its kernel defines the image of <i>E</i>.<table class="examples"><tr><td><pre>i40 : D = 4 P

                      2
o40 = Divisor{ideal (z , x*z), ideal 1}

o40 : Divisor</pre>
</td></tr>
<tr><td><pre>i41 : L = globalSections D

                         2
o41 = {| xz yz z2 x2 |, z }

o41 : List</pre>
</td></tr>
<tr><td><pre>i42 : phi = map(SE, ZZ/31991[a..d], L#0)

                                        2   2
o42 = map(SE,KK[a, b, c, d],{x*z, y*z, z , x })

o42 : RingMap SE &lt;--- KK[a, b, c, d]</pre>
</td></tr>
<tr><td><pre>i43 : ker phi

              2                       2
o43 = ideal (b  + 3a*c - a*d - 2c*d, a  - c*d)

o43 : Ideal of KK[a, b, c, d]</pre>
</td></tr>
</table>
The image in <i><b>P</b><sup>3</sup></i> is a complete intersection of two quadrics: the elliptic normal curve in <i><b>P</b><sup>3</sup></i>.<p/>
For a less obvious example, consider the divisor <i>4P - R</i>, which is not effective.  Since it has degree 3 as a divisor on an elliptic curve, the Riemann Roch theorem tells us that it is equivalent to an effective divisor; in fact that it has  three sections. We can check this as follows:<table class="examples"><tr><td><pre>i44 : D = 4 P - R

                      2
o44 = Divisor{ideal (z , x*z), ideal (y, x)}

o44 : Divisor</pre>
</td></tr>
<tr><td><pre>i45 : L = globalSections D

                      2
o45 = {| yz xz x2 |, z }

o45 : List</pre>
</td></tr>
<tr><td><pre>i46 : II = sectionIdeal(y*z+x*z+x^2, z^2, D)

              2                  2                2   2
o46 = ideal (y  + 3x*z + y*z + 3z , x*y + x*z - 3z , x  + x*z + y*z)

o46 : Ideal of SE</pre>
</td></tr>
<tr><td><pre>i47 : degree II

o47 = 3</pre>
</td></tr>
</table>
<h4>D. Linear Equivalence</h4>
Testing whether two divisors <i>E</i> and <i>F</i> are linearly equivalent boils down to testing whether <i>D = E-F</i> is principal and thus linearly equivalent to 0.<p/>
One method to determine whether <i>D</i> is principal is to compute the global sections of <i>D</i>.  A divisor <i>D</i> is principal iff <i>L(D)</i> has dimension one, and the zero locus of its generator is the empty set.<p/>
For example, on the elliptic curve <i>E</i>, consider <i>P - R</i>:<table class="examples"><tr><td><pre>i48 : globalSections (P-R)

o48 = {0, z}

o48 : List</pre>
</td></tr>
</table>
<i>P-R</i> has no global sections, so it is not equivalent to 0.  Now consider <i>2 P - 2 R</i><table class="examples"><tr><td><pre>i49 : D = 2 P - 2 R

                         2              2
o49 = Divisor{ideal (z, x ), ideal (x, y )}

o49 : Divisor</pre>
</td></tr>
<tr><td><pre>i50 : LB = globalSections D

o50 = {| x |, z}

o50 : List</pre>
</td></tr>
</table>
Since the divisor <i>D = 2P-2R</i> has degree 0 and has a section, <i>D</i> is linearly equivalent to 0.  The result shows that the rational function <i>x/z</i> has divisor <i>2P-2R</i>.<p/>
To check that a divisor of unknown degree is equivalent to 0, we attempt to find a section and show it does not vanish anywhere.  We include this in the routine below.<p/>
Remember that in this tutorial we are assuming that <i>S<sub>X</sub></i> is <i>S<sub>2</sub></i> and that <i>X</i> is smooth.  These computations are easily modified in the non-<i>S<sub>2</sub></i> case.  See the corresponding tutorial, once it is written!<table class="examples"><tr><td><pre>i51 : linearlyEquivalent = (D,E) -> (
          F := normalForm(D-E);
          LB := globalSections F;
          L := LB#0;
          -- L is the matrix of numerators. Thus numgens source L
          -- is the dimension of the space of global sections.
          if numgens source L != 1 
          then false
          else (
              R := ring L;
              V := sectionIdeal(L_(0,0), LB#1, F);
              if V == ideal(1_R) 
                then L_(0,0)/LB#1
                else false)
          );</pre>
</td></tr>
</table>
We get the same answers as before:<table class="examples"><tr><td><pre>i52 : linearlyEquivalent(P,R)

o52 = false</pre>
</td></tr>
<tr><td><pre>i53 : linearlyEquivalent(2 P, 2 R)

      x
o53 = -
      z

o53 : frac(SE)</pre>
</td></tr>
</table>
We now look at the group law on the cubic: We take the point <i>P</i> to be 0; we can then identify the natural group of divisor classes of degree 0 with the set of points on the curve.  With this identification, the group law <i>++</i> on points of the curve is defined by: <i>R ++ S =</i> the unique point <i>T</i> for which the divisor <i>(R-P)+(S-P)</i> is linearly equivalent to <i>(T-P)</i>.  i.e. <i>R ++ S := </i> unique effective divisor in <i>R+S-P</i>.<p/>
What we need to do is: given a divisor <i>R+S-P</i>, find an effective divisor equivalent to it.<table class="examples"><tr><td><pre>i54 : effective = (D) -> (
          LB := globalSections D;
          L := LB#0;  -- the matrix of numerators
          if numgens source L == 0 
          then error(toString D + " is not effective")
          else divisor sectionIdeal(L_(0,0), LB#1, D));</pre>
</td></tr>
<tr><td><pre>i55 : effective(2 R - P)

o55 = Divisor{ideal (z, x), ideal 1}

o55 : Divisor</pre>
</td></tr>
<tr><td><pre>i56 : addition = (R,S) -> effective(R + S - P);</pre>
</td></tr>
<tr><td><pre>i57 : addition(R1,R2)

o57 = Divisor{ideal (y, x), ideal 1}

o57 : Divisor</pre>
</td></tr>
</table>
Some points are in the torsion subgroup:<table class="examples"><tr><td><pre>i58 : Q2 = addition(Q1, Q1)

o58 = Divisor{ideal (y, x - z), ideal 1}

o58 : Divisor</pre>
</td></tr>
<tr><td><pre>i59 : Q3 = addition(Q2, Q1)

o59 = Divisor{ideal (y + 6z, x - 3z), ideal 1}

o59 : Divisor</pre>
</td></tr>
<tr><td><pre>i60 : Q4 = addition(Q3, Q1)

o60 = Divisor{ideal (z, x), ideal 1}

o60 : Divisor</pre>
</td></tr>
<tr><td><pre>i61 : Q4a = addition(Q2,Q2)

o61 = Divisor{ideal (z, x), ideal 1}

o61 : Divisor</pre>
</td></tr>
</table>
So the point <i>Q<sub>1</sub> = (3,6,1)</i> is a point of order 4 in the group.<p/>
Exercise:  Write a routine that computes <i>n</i> times a point in this group law.<h4>E. The canonical divisor</h4>
<p/>
The most important divisor class on a variety is the canonical class.  For example, consider the twisted cubic curve whose ideal is the ideal of <i>2&times;2</i> minors of the &ldquo;catalecticant&rdquo; matrix <table class="examples"><tr><td><pre>i62 : S = ZZ/31991[a,b,c,d];</pre>
</td></tr>
<tr><td><pre>i63 : catalect = map(S^2, 3, (i,j)->S_(i+j))

o63 = | a b c |
      | b c d |

              2       3
o63 : Matrix S  &lt;--- S</pre>
</td></tr>
<tr><td><pre>i64 : IC = minors(2, catalect)

                2                        2
o64 = ideal (- b  + a*c, - b*c + a*d, - c  + b*d)

o64 : Ideal of S</pre>
</td></tr>
<tr><td><pre>i65 : SX = S/IC

o65 = SX

o65 : QuotientRing</pre>
</td></tr>
</table>
As a graded module, the canonical class is given as <i>K<sub>X</sub> = Ext<sup>c</sup>(S<sub>X</sub>, S(-r-1))</i>, where <i>c = codim X</i>, <i>X &sub;<b>P</b><sup>r</sup></i>, and <i>S = k[x<sub>0</sub>,...,x<sub>r</sub>]</i> is the polynomial ring.<table class="examples"><tr><td><pre>i66 : KX = Ext^2(coker gens IC,S^{-4})

o66 = cokernel {1} | c  b  a  |
               {1} | -d -c -b |

                             2
o66 : S-module, quotient of S</pre>
</td></tr>
<tr><td><pre>i67 : canpres = substitute(presentation(KX), SX)

o67 = {1} | c  b  a  |
      {1} | -d -c -b |

               2        3
o67 : Matrix SX  &lt;--- SX</pre>
</td></tr>
<tr><td><pre>i68 : betti canpres

             0 1
o68 = total: 2 3
          1: 2 3

o68 : BettiTally</pre>
</td></tr>
</table>
Thus we need a routine that takes a rank 1 torsion free module over a domain and finds an ideal isomorphic to it.  We wish to compute homomorphisms from the canonical module into <i>S<sub>X</sub></i>, and take the divisor whose first ideal is the image of a homomorphism of non-negative degree, and whose second ideal is an arbitrary nonzero element of <i>S<sub>X</sub></i> whose degree is equal to the degree of the homomorphism.  First we find a homomorphism of lowest degree:<table class="examples"><tr><td><pre>i69 : I1 = transpose (syz transpose canpres)_{0}

o69 = | d c |

               1        2
o69 : Matrix SX  &lt;--- SX</pre>
</td></tr>
</table>
The degree is<table class="examples"><tr><td><pre>i70 : dg = (degrees (target I1))_0_0

o70 = 0</pre>
</td></tr>
</table>
We need to balance the degree <tt>dg</tt> with a power of the first nonzero generator of the ring.  This is done in the following packaged version.<table class="examples"><tr><td><pre>i71 : divisorFromModule = M -> (
        -- given a module M, returns the divisor of the image
        -- of a nonzero homomorphism to R, suitably twisted.
        -- first get the presentation of M
          I1 := transpose (syz transpose presentation M)_{0};
        -- The degree is
          d := (degrees target I1)_0_0;
        -- We need to balance the degree d with a power
        -- of the first nonzero generator of the ring.
          var1 := (compress vars ring M)_{0};
        -- Now fix up the degrees.
          if d==0 then divisor ideal I1
          else if d>0 then divisor(
                        ideal (I1**dual(target I1)),
                        ideal var1^d
                       )                          
          else divisor ideal( 
                     var1^(-d)**I1**dual target I1
                     )
      );</pre>
</td></tr>
</table>
We start from a module over the ring <tt>SX</tt>:<table class="examples"><tr><td><pre>i72 : M = coker canpres

o72 = cokernel {1} | c  b  a  |
               {1} | -d -c -b |

                               2
o72 : SX-module, quotient of SX</pre>
</td></tr>
<tr><td><pre>i73 : divisorFromModule M

o73 = Divisor{ideal (d, c), ideal 1}

o73 : Divisor</pre>
</td></tr>
</table>
Some tests: <table class="examples"><tr><td><pre>i74 : use SX

o74 = SX

o74 : QuotientRing</pre>
</td></tr>
<tr><td><pre>i75 : divisorFromModule image matrix{{d^2}}

                              2
o75 = Divisor{ideal 1, ideal(a )}

o75 : Divisor</pre>
</td></tr>
<tr><td><pre>i76 : divisorFromModule SX^{1}

o76 = Divisor{ideal(a), ideal 1}

o76 : Divisor</pre>
</td></tr>
</table>
Here is the canonical divisor routine in packaged form:<table class="examples"><tr><td><pre>i77 : canonicalDivisor= SX ->(
        -- Given a ring SX, computes a canonical divisor for SX
        I := ideal presentation SX;
        S := ring I;
        embcodim := codim I;
        M := Ext^embcodim(coker gens I,S^{-numgens S});
        M = coker substitute(presentation M, SX);
        divisorFromModule M
        );</pre>
</td></tr>
</table>
<p/>
<table class="examples"><tr><td><pre>i78 : canonicalDivisor SX

o78 = Divisor{ideal (d, c), ideal 1}

o78 : Divisor</pre>
</td></tr>
</table>
There are other ways of computing the canonical class. Perhaps we have already written a tutorial on this subject.</div>
</div>
</body>
</html>