Divisors
\def\P{\bf P}
In this tutorial we describe one way to represent
divisors on a smooth projective subvariety
$X$ of $\P^r$, 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 $X$.
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.
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.
The simplest case is when the homogeneous coordinate
ring $S_X$ of $X$ satisfies the $S_2$ condition of Serre:
We say that a domain $R$ is $S_2$ if
every proper nonzero principal ideal
has pure codimension 1 (all associated
primes of the ideal are of codimension 1).
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 $S_2$-case.
An example that we will use throughout is the plane
cubic curve $E$, whose homogenoeus coordinate ring is {\tt SE}:
i1 : KK = ZZ/31991
o1 = KK
o1 : QuotientRing |
i2 : SE = KK[x,y,z]/(y^2*z - x*(x-z)*(x+3*z))
o2 = SE
o2 : QuotientRing |
The sections in this tutorial are
A. Representation of divisors
B. Group operations on divisors
C. Global Sections
D. Linear Equivalence
E. The canonical divisor
\beginsection{ A. Representation of divisors}\par
Let $X$ be a smooth irreducible
variety. A (Weil) divisor on
$X$ is an integral linear combination of irreducible
subvarieties of $X$ of codimension $1$. The divisor
is called effective if all the coefficients
are non-negative. To any ideal $I$ in the homogeneous
coordinate ring $S_X$ of $X$ we associate the
effective divisor that is the sum of the
pure codimension $1$ components of $I$, each
taken with the multiplicity it has in the
primary decomposition of $I$.
Let $D = E - F$
be a divisor, where $E$ and $F$ are effective.
Because $X$ is normal, there is a unique
homogeneous ideal $I$ in $S_X$
such that $V(I) = E$, and $I$ is either $(1)$, or has
pure codimension one. Similarly, there is a unique
such ideal $J$ with $V(J) = F$.
Our plan is to represent the divisor $D$ by the pair
of ideals $(I,J)$.
This representation is not unique. If $(I,J)$ and
$(I',J')$ are two pairs of ideals (such that each ideal
is either $(1)$ or has pure codimension one), then
$(I,J)$ and $(I',J')$ represent the same divisor iff
$$sat(I J') = sat(I' J),$$
where $sat(K)$ is the saturation of $K$ (the largest
ideal $L$ such that a power of the irrelevant ideal
times $L$ is in $K$)
Write $(I,J) \equiv (I',J')$ if $sat(I J') = sat(I' J)$.
This correspondence defines a bijection between
$Div(X)$ and $\{(I,J) \mid I,J$ are homogeneous ideals in $S_X$
either trivial, or pure codim one$\}/\equiv$.
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)}, a function that takes an arbitary
ideal $I$ in a ring satisfying $S_2$, and returns
the ideal which is the intersection of the
codimension 1 primary components of $I$.
In the next divisor tutorial (not yet written),
we will write a routine {\tt purify1(I)} which does
not require the ring to be $S_2$.
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 "Ideal is zero!";
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. The symbol ; is the statement separator so
-- (by definition!) we cannot put a ; after the last expression.
)
o3 = purify1S2
o3 : Function |
For example, in the ring
i4 : R = ZZ/5[a,b]
o4 = R
o4 : PolynomialRing |
we have
i5 : purify1S2(ideal(a^2,a*b))
o5 = ideal a
o5 : Ideal of R |
Throughout this tutorial, we will treat divisors
as equivalence classes of pairs, and our operations
will operate on pairs. So let's define a
divisor type in Macaulay2. The following declaration
provides a new data type, the {\tt Divisor}.
i6 : Divisor = new Type of List
o6 = Divisor
o6 : Type |
Let'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).
Defining {\tt divisor} to be a method allows us to define
different versions of this routine which take different
arguments.
i7 : divisor = method()
o7 = divisor
o7 : Function |
The following allows us to define an object of
class {\tt Divisor} from a pair of ideals.
i8 : divisor(Ideal,Ideal) := (I,J) ->
new Divisor from {purify1S2 I,purify1S2 J}
o8 = --function--
o8 : Function |
The following routine defines an (effective)
divisor from a single ideal.
i9 : divisor Ideal := (I) -> divisor(I, ideal(1_(ring I)))
o9 = --function--
o9 : Function |
The divisors of some rational points on the
elliptic curve $E$ include
i10 : P = divisor ideal(x,z)
o10 = {ideal (z, x), ideal 1}
o10 : Divisor |
i11 : R = divisor ideal(x,y)
o11 = {ideal (y, x), ideal 1}
o11 : Divisor |
i12 : R1 = divisor ideal(x-z,y)
o12 = {ideal (y, x - z), ideal 1}
o12 : Divisor |
i13 : R2 = divisor ideal(x+3*z,y)
o13 = {ideal (y, x + 3z), ideal 1}
o13 : Divisor |
i14 : Q1 = divisor ideal(y-6*z, x-3*z)
o14 = {ideal (y - 6z, x - 3z), ideal 1}
o14 : Divisor |
Testing equality of divisors is often made simpler
by having a ``normal form'' for divisors.
The normal form of a divisor $D$ is $E - F$ where
$E$ and $F$ are both effective and have disjoint support.
It is easy to see that the normal form of $(I,J)$ is
$(I:J, J:I)$.
In the following code, the expressions
{\tt D\#0} and {\tt D\#1} refer to the first and second ideals
in the list representing $D$. ({\tt D\#0} is the first
because Macaulay2 counts everything starting from 0.)
i15 : normalForm = method()
o15 = normalForm
o15 : Function |
Two pairs $(I,J), (I',J')$ define the same divisor
exactly when their normal forms are equal.
The following code establishes a method for testing
the equality of divisors. The last line tests
the two equalities of ideals that are necessary.
i16 : normalForm Divisor := (D) ->
new Divisor from {D#0 : D#1, D#1 : D#0}
o16 = --function--
o16 : Function |
We shall later show that with {\tt R1} and {\tt R2} as
above, the divisor {\tt (R1 + R2) - R1} is represented by
i17 : Divisor == Divisor := (D,E) -> (
D1 := normalForm D;
E1 := normalForm E;
D1#0 == E1#0 and D1#1 == E1#1
)
o17 = --function--
o17 : Function |
so that the normal form of $D$ is {\tt R2}:
i18 : D = divisor(ideal(y, x^2+2*x*z-3*z^2), ideal(x-z, y))
2 2
o18 = {ideal (y, x + 2x*z - 3z ), ideal (y, x - z)}
o18 : Divisor |
and we can directly test equality by
i19 : normalForm D
o19 = {ideal (y, x + 3z), ideal 1}
o19 : Divisor |
\beginsection{ B. Group operations on divisors}\par
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} routine):
Negation is even simpler, since all we need do
is exchange the two ideals. We don't use the
{\tt divisor} routine, since our ideals are already
saturated.
i21 : Divisor + Divisor := (D,E) -> divisor(D#0 * E#0, D#1 * E#1); |
Let's also include functions to compute differences
and to multiply by integers.
i22 : - Divisor := (D) -> new Divisor from {D#1, D#0}
o22 = --function--
o22 : Function |
i23 : Divisor - Divisor := (D,E) -> D + (-E); |
Some arithmetic of divisors on our elliptic curve
i24 : ZZ Divisor := ZZ * Divisor := (n,D) -> divisor((D#0)^n, (D#1)^n); |
i25 : 2P
2
o25 = {ideal (z, x ), ideal 1}
o25 : Divisor |
Notice that $3P$ is the hyperplane section $z=0$,
which is the equation of the flex line to the
cubic at the point $P$.
i26 : 3P
o26 = {ideal z, ideal 1}
o26 : Divisor |
i27 : D = P-R1
o27 = {ideal (z, x), ideal (y, x - z)}
o27 : Divisor |
\beginsection{ C. Global Sections}\par
Since we have assumed $X$ smooth, Weil divisors can
all be represented by Cartier divisors, that is,
by sections of an invertible sheaf. If $D = (I,J)$
is a divisor, and $sheaf(I)$ denotes the sheaf of
$O_X$-modules corresponding to $I$, then we put
$$O_X(D) = sheaf(I)^{-1} \otimes sheaf(J).$$
We define $L(D)$ to be the space of
global sections of the sheaf $O_X(D)$. Note that
a global section is the same as a
sheaf homomorphism $O_X \rightarrow O_X(D)$.
If we write $D = E-F$, where $E$ and $F$ are effective,
then global sections
of $O_X(E-F)$ can be identified with homomorphisms
$O_X(-E) \rightarrow O_X(-F)$.
If we write $D = (I,J)$, then
$L(D)$ and $Hom(I,J)$ can be identified with
subsets of the field of fractions of $S_X$.
Since $S_X$ satisfies $S_2$, these sets are equal.
The following proposition allows us to compute $Hom(I,J)$:
{\bf Proposition}. Suppose $X$ is a smooth projective variety
whose homogeneous coordinate ring $S_X$ is $S_2$.
If $D$ is the divisor $(I,J)$ and
$f$ is any non-zero element of $I$, then
$L(D)$ is the degree zero part of
$${{sat((f*J) : I)} \over f}.$$
{\bf Proposition}. If $s = g/f$ is section of the divisor
$D = (I,J)$ as above, then
the zero scheme of $s$ is defined by the ideal
$$ sat(f I : g) : J.$$
Consider the divisor $2P$ on our curve $E$:
i28 : D2 = 2P - 2R1
2 2
o28 = {ideal (z, x ), ideal (x - z, y )}
o28 : Divisor |
In this case, $I = (x^2, z)$, and $J = (1)$.
Compute the vector space of sections $L(2P)$:
i29 : D = 2P
2
o29 = {ideal (z, x ), ideal 1}
o29 : Divisor |
i30 : I = D#0
2
o30 = ideal (z, x )
o30 : Ideal of SE |
i31 : J = D#1
o31 = ideal 1
o31 : Ideal of SE |
The degree 0 part in the proposition is the
degree $d$ part of $sat((fJ) : I)$, divided by $f$,
where $d = \deg f$.
We can use the command {\tt basis} 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}
routine, see the tutorial on canonical embeddings
of plane curves and gonality)
i32 : f = z
o32 = z
o32 : SE |
i33 : LD = basis(degree f, purify1S2((f*J) : I))
o33 = {1} | 1 0 |
{1} | 0 1 |
o33 : Matrix |
so the vector space $L(2P)$
is generated by $1=z/z$, and $x/z$.
Since $J = (1)$, the zero locus of the section
$(z+x)/z$ is defined by the ideal
i34 : LD = super (LD ** (ring target LD))
o34 = {0} | z x |
1 2
o34 : Matrix SE <--- SE |
and its degree is:
i35 : imI = purify1S2(((z+x)*I) : z)
2 2
o35 = ideal (x + z, y - 4z )
o35 : Ideal of SE |
Let's now package this into a routine
{\tt globalSections} which takes an argument {\tt D} of class
{\tt Divisor}, and
computes a basis of $L(D)$, represented as
fractions with a common denominator.
The output is a row vector of the numerators,
followed by the denominator.
Another important task is to
find the ideal of zeros of a section $s = f/g$
of a divisor $D$.
i37 : globalSections = method()
o37 = globalSections
o37 : Function |
Let's find the image of the elliptic curve $E$
under the linear system $4P$. To do this we
define a ring homomorphism from the global
sections with the command
map. Its kernel defines the image of $E$.
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}); |
i39 : sectionIdeal = (f,g,D) -> (
I := D#0;
J := D#1;
purify1S2((f*I):g) : J
); |
i40 : D = 4P
2
o40 = {ideal (z , x*z), ideal 1}
o40 : Divisor |
i41 : L = globalSections D
2
o41 = {{0} | xz yz z2 x2 |, z }
o41 : List |
The image in $\P^3$ is a complete intersection of two
quadrics: the elliptic normal curve in $\P^3$.
For a less obvious example, consider
the divisor $4P - R$, 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:
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 <--- KK[a,b,c,d] |
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] |
i44 : D = 4P - R
2
o44 = {ideal (z , x*z), ideal (y, x)}
o44 : Divisor |
i45 : L = globalSections D
2
o45 = {{0} | yz xz x2 |, z }
o45 : List |
\beginsection{ D. Linear Equivalence}\par
Testing whether two divisors $E$ and $F$ are
linearly equivalent boils down to testing
whether $D = E-F$ is principal and thus
linearly equivalent to 0.
One method to determine whether $D$ is principal
is to compute the global sections of $D$.
A divisor $D$ is principal iff
$L(D)$ has dimension one, and the
zero locus of its generator is the empty set.
For example, on the elliptic curve $E$,
consider $P - R$:
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 |
$P-R$ has no global sections, so it is not equivalent
to 0.
Now consider $2 P - 2 R$
i48 : globalSections (P-R)
o48 = {0, z}
o48 : List |
Since the divisor $D = 2P-2R$ has degree 0 and has a
section, $D$ is linearly equivalent to 0.
The result shows that the
rational function $x/z$ has divisor $2P-2R$.
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.
Remember that in this tutorial
we are assuming that $S_X$ is $S_2$ and that $X$
is smooth. These computations are easily modified
in the non-$S_2$ case. See the corresponding tutorial,
once it is written!
i49 : D = 2 P - 2 R
2 2
o49 = {ideal (z, x ), ideal (x, y )}
o49 : Divisor |
We get the same answers as before:
i50 : LB = globalSections D
o50 = {{0} | x |, z}
o50 : List |
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)
); |
We now look at the group law on the cubic:
We take the point $P$ 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 $++$ on points of the curve
is defined by: $R ++ S =$
the unique point $T$ for which the divisor
$(R-P)+(S-P)$ is
linearly equivalent to $(T-P)$.
i.e. $R ++ S := $ unique effective divisor in $R+S-P$.
What we need to do is: given a divisor $R+S-P$, find
an effective divisor equivalent to it.
i52 : linearlyEquivalent(P,R)
o52 = false |
i53 : linearlyEquivalent(2P,2R)
x
o53 = -
z
o53 : frac SE |
i54 : effective = (D) -> (
LB := globalSections D;
L := LB#0; -- the matrix of numerators
if numgens source L == 0
then error(name D + " is not effective")
else divisor sectionIdeal(L_(0,0), LB#1, D)); |
i55 : effective(2R-P)
o55 = {ideal (z, x), ideal 1}
o55 : Divisor |
Some points are in the torsion subgroup:
i56 : addition = (R,S) -> effective(R + S - P); |
i57 : addition(R1,R2)
o57 = {ideal (y, x), ideal 1}
o57 : Divisor |
i58 : Q2 = addition(Q1, Q1)
o58 = {ideal (y, x - z), ideal 1}
o58 : Divisor |
i59 : Q3 = addition(Q2, Q1)
o59 = {ideal (y + 6z, x - 3z), ideal 1}
o59 : Divisor |
So the point $Q_1 = (3,6,1)$ is a point of order 4
in the group.
Exercise: Write a routine that computes
$n$ times a point in this group law.
\beginsection{ E. The canonical divisor}\par
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 $2\times2$ minors of the ``catalecticant''
matrix
i60 : Q4 = addition(Q3, Q1)
o60 = {ideal (z, x), ideal 1}
o60 : Divisor |
i61 : Q4a = addition(Q2,Q2)
o61 = {ideal (z, x), ideal 1}
o61 : Divisor |
i62 : S = ZZ/31991[a,b,c,d]; |
i63 : catalect = map(S^2, 3, (i,j)->S_(i+j))
o63 = {0} | a b c |
{0} | b c d |
2 3
o63 : Matrix S <--- S |
As a graded module, the
canonical class is given
as $K_X = Ext^c(S_X, S(-r-1))$,
where $c = codim X$,
$X \subset \P^r$, and $S = k[x_0,\ldots,x_r]$
is the polynomial ring.
i64 : IC = minors(2, catalect)
2 2
o64 = ideal (- b + a*c, - b*c + a*d, - c + b*d)
o64 : Ideal of S |
i65 : SX = S/IC
o65 = SX
o65 : QuotientRing |
i66 : KX = Ext^2(coker gens IC,S^{-4})
o66 = cokernel {1} | -d -c -b |
{1} | c b a |
2
o66 : S - module, quotient of S |
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 $S_X$, 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 $S_X$ whose
degree is equal to the degree of the
homomorphism.
First we find a homomorphism of lowest
degree:
i67 : canpres = substitute(presentation(KX), SX)
o67 = {1} | -d -c -b |
{1} | c b a |
2 3
o67 : Matrix SX <--- SX |
The degree is
i68 : betti canpres
o68 = total: 2 3
1: 2 3
o68 : Net |
We need to balance the degree {\tt dg} with a power
of the first nonzero generator of the ring.
This is done in the following packaged version.
i69 : I1 = transpose (syz transpose canpres)_{0}
o69 = {0} | c d |
1 2
o69 : Matrix SX <--- SX |
We start from a module over the ring {\tt SX}:
i70 : dg = (degrees (target I1))_0_0
o70 = 0 |
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 candiv = divisor(ideal I1)
else if d>0 then
candiv =
divisor(
ideal (I1**dual(target I1)),
ideal var1^d
)
else
candiv =
divisor(
ideal(
var1^(-d)**I1**dual target I1
))
); |
Some tests:
i72 : M = coker canpres
o72 = cokernel {1} | -d -c -b |
{1} | c b a |
2
o72 : SX - module, quotient of SX |
i73 : divisorFromModule(M)
o73 = {ideal (d, c), ideal 1}
o73 : Divisor |
i74 : use SX
o74 = SX
o74 : QuotientRing |
Here is the canonical divisor routine in packaged
form:
i75 : divisorFromModule(image matrix{{d^2}})
2
o75 = {ideal 1, ideal a }
o75 : Divisor |
i76 : divisorFromModule(SX^{1})
o76 = {ideal a, ideal 1}
o76 : Divisor |
There are other
ways of computing the canonical
class. Perhaps we have already written a
tutorial on this subject.



