# Updated on 15 June 1999, to be compatable with Maple V.5
# Kummer.pro
# Anything on a line after a # is comment (like this).
# The object of this MAPLE program is to confirm the computations in
# Chapter 3, "The Kummer surface", in the book:
# "Progelomana to a middlebrow arithmetic of curves of genus 2".
# by J.W.S. Cassels and E.V. Flynn (Cambridge University Press, 1996).
# The essential formulae are saved in a file "Kit.sav".
# This may be used to compute with an explicitly given curve of
# genus 2. An example of this use is given in the program "Appl.pro".
# Part 1
# This part just sets up some of the standard functions
# for later use. Here X is normally an indeterminate and we
# denote a (usually generic) divisor by {(x,y),(u,v)}.
# The MAPLE system requires some modification of the usual
# notation. Note that multiplication must always be explicitly
# written as *. Exponiation is denoted by ^, so X^3 is the
# cube of X.
# We use FX to denote F(X), which will
# always be a sextic, the coefficient of X^j being fj.
# We use Fxu to denote F_0(x,u). We often use s for
# x+u, p for x*u and b for beta0. When we need homogeneity
# we take t for 1 so sigma0:sigma1:sigma2:beta0 is t:s:p:b.
P:=x*u: # temporary notation
S:=x+u: # ditto
#################### U was changed to R in the next 2 lines.
R:=[2,S,2*P,S*P,2*P^2,S*P^2,2*P^3]: # ditto
Fxu:=sum('f.i*R[i+1]',i=0..6): # F_0(x,u)
FX:=sum('f.i*X^i',i=0..6): # F(X)
Fx:=subs(X=x,FX): # F(x)
Fu:=subs(X=u,FX): # F(u)
No:=simplify((Fxu^2-4*Fx*Fu)/(x-u)^2): # Norm of beta0 times (x-u)^2
# The following routine transforms a homogeneous polynomial in
# x,u into a polynomial in s=x+u, p=x*u. Note that we cannot
# use S,P here (cf above) since MAPLE would automatically
# replace them by the above values in terms of x,u. We want to go the
# other way.
Sym := proc(X)
local Z,Z1,Z2,x1,u1,t;
Z := X;
while Z <> subs(x = x1,u = u1,Z) do
Z1 := subs(x = t,u = 0,Z);
Z2 := Z-subs(t = x+u,Z1);
Z2 := simplify(Z2/x/u);
Z := subs(t = s,Z1)+p*Z2
od:
Z
end:
# We now construct the equation of Kummer, that is the equation
# for b=beta0 over the field of x,u (or s,p).
unprotect(Norm): # Clears reserved word Norm for use as a variable.
Norm:= Sym(No): # Norm of beta0 times s^2-4*p = (x-u)^2.
K:=(x-u)^2*b^2-2*Fxu*b+No: # Temporary notation
# Now express in terms of s=x+u,p=xu
K:=Sym(K);
# We now express the Kummer in terms of the coordinates
# xx[1]=sigma0,xx[2]=sigma1,xx[3]=sigma2,xx[4]=beta0
# where we have homogenized.
K:=simplify(xx[1]^4*subs(s=xx[2]/xx[1],p=xx[3]/xx[1],b=xx[4]/xx[1],K));
# Part 2
# This part confirms the calcualtions in Section 2 of the Chapter
# "The Kummer surface"
# In this part we suppose that F(X)=G(X)H(X), where G is
# of degree 2. We evaluate the linear map of coordinates
# sigma0,sigma1,sigma2,beta0 induced by adding the divisor
# A: G(X)=0, Y=0 to the divisor X:= {(x,y),(u,v)}
# Note that sigma0(A):sigma1(A):sigma2(A) = g2:-g1:g0.
# At a later stage we take g2=1.
GX:=sum('g.i*X^i',i=0..2); # G(X) of degree 2, coefficients gj
HX:=sum('h.i*X^i',i=0..4); # H(X) of degree 4.
# We are now concerned with the special form of FX, which we
# shall call FFX
FFX:=collect(HX*GX,X);
# Now consider the intersection of the curve with a cubic
# Y=MX. We take it first to pass through GX=0, Y=0.
MX:=GX*(m1*X+m0);
# We now want to choose this cubic so that Y=MX passes through
# the points (x,y) and (u,v). To remain in polynomials, we introduce
# a denominator n
Gx:=subs(X=x,GX);
Gu:=subs(X=u,GX);
n:=Gx*Gu*(x-u); # G(x)G(u)(x-u)
solve({subs(X=x,MX)=n*y,subs(X=u,MX)=n*v},{m0,m1});# solve equations for
# m0,m1.
assign(%); # gives m0,m1 these values
m0:=collect(m0,[y,v]); # A MAPLE necessity before finding the
m1:=collect(m1,[y,v]); # coefficients below. Here functions are linear
MX:=collect(MX,[y,v]); # in y,v.
My:=coeff(MX,y,1); # coefficient of first power of y in M(X).
Mv:=coeff(MX,v,1); # ditto for v.
# We now want the analogues of Fx,Fu,Fxu for the form FFX=GX*HX
FFx:=subs(X=x,FFX);
FFu:=subs(X=u,FFX);
# But for FFxu it is more difficult
FFxu:=Fxu;
for i from 0 to 6 do
FFxu:=subs(f.i=coeff(FFX,X,i),FFxu)
od:
# We now square MX. We can now eliminate y,v by substituting for
# y^2,v^2 and yv. Put y^2=FFx,v^2=FFu, and b for
# beta0: b=(FFxu-2yv)/(x-u)^2. Then 2yv=FFxu-b*(x-u)^2.
# Call MX^2 with these substitutions MX2.
MX2:=My^2*FFx+Mv^2*FFu+My*Mv*(FFxu-b*(x-u)^2);
# To get the residual intersection, we equate this to n^2*FFX
W := `W`: # Clears reserved word W for use as a variable.
W:=MX2-n^2*FFX:
# we don't print W as it is very complicated.
# we now take out the factors that we know are there
# Again we don't print out the fairly complicated intermediate results
W:=simplify(W/GX):
W:=simplify(W/((X-x)*(X-u))):
W:=simplify(W/(x-u)^2):
W:=simplify(W/(Gx*Gu)):
# Apply Sym. This expresses in terms of s=x+u, p=xu
W:=Sym(W):
W:=collect(W,X): # Prepares for next stage.
# Now look at the coefficients. We store them in table U.
for i from 0 to 2 do
U[3-i]:=collect(coeff(W,X,i),[b,p,s])
od;
# We now homogenize..
for i from 1 to 3 do
V[i]:=simplify(t*subs(b=b/t,p=p/t,s=s/t,U[i])):
V[i]:=collect(V[i],[t,s,p,b]):
od:
# Now the V[i] are linear forms in t,s,p,b=sigma0,sigma1,sigma2,beta0
# We take them as a vector of variables labelled 1,2,3,4
# and we note that the values of t:s:p
# for the transformed point are V[1]:-V[2]:V[3] and may be taken to
# equal them.
# change the sign of V[2]
V[2]:=-V[2]:
# We have to find the b=beta0 coordinate of the transformed point. For
# this we use that the divisor A is of order 2, and so
# addition of A is an involution in the projective space.
# We need to invoke the MAPLE matrix routines.
with(linalg): # allow us to use more algebra routines.
A:=matrix(4,4); # defines A as a 4 by 4 matrix, entries
# specified below.
# This is to be the matrix of the transformation addition of A
# Put in the elements we know already
for i from 1 to 3 do
A[i,1]:=coeff(V[i],t):
A[i,2]:=coeff(V[i],s):
A[i,3]:=coeff(V[i],p):
A[i,4]:=coeff(V[i],b):
od:
# Finally we get the coefficients of the new beta0 by using that
# the square of the transformation is the identity in projective
# space: that is, the square of the matrix A is a multiple of the
# unit matrix. We first put in indeterminates for the missing values
for i from 1 to 4 do
A[4,i]:=a.i
od:
# We now square the matrix and solve for the a_i by equating suitable
# off-diagonal elements of the square B=A^2 to 0.
B:=multiply(A,A):
solve({B[1,2]=0},{a2}):
assign(%):
solve({B[1,3]=0},{a3}):
assign(%):
solve({B[1,4]=0},{a4}):
assign(%):
solve({B[2,1]=0},{a1}):
assign(%):
# With these values, we simplify the matrix A giving the transformation
# and, for good measure, also the matrix B: which should be a multiple
# of the identity.
for i from 1 to 4 do
for j from 1 to 4 do
A[i,j]:=simplify(A[i,j]);
B[i,j]:=simplify(B[i,j])
od:
od:
# We now display the matrices that have resulted
# We have to say op( ) as they are arrays.
op(A);
op(B);
# As it is not so easy to read the entries we confirm that
# matrix B is diagonal.
simplify(B[2,2]-B[1,1]); # Should be 0.
simplify(B[3,3]-B[1,1]); # ditto
simplify(B[4,4]-B[1,1]); # ditto
# Part 3
# Here we aim to construct the "bilinear" forms from the
# matrix giving the transformations by points of order 2.
# This gives flesh to the arguments sketched in Section 4
# of the Chapter "The Kummer surface".
# Recall that we look at the products of pairs of the
# resultant linear forms and then identify functions of
# the divisor of order 2 with corresponding functions of
# a general divisor.
# The first thing is transform the matrix A constructed above,
# which gives addition by a divisor of order 2.
# the matrix is given in terms of the coeffs of G and H,
# where G is quadratic (defining the divisor of order 2)
# and H is of degree 4. We first transform to the coefficients of G
# and those of F=GH, eliminating those of H. We shall also put
# g2=1 and g1=-s=-(x+u) and g0=p=xu. To eliminate the h's
# it is convenient to define a procedure
Subh:=proc(W)
###################### 1 Newly added line
local WW;
WW:=W;
WW:=subs(h0=f2+s*h1-p*h2,WW);
WW:=subs(h1=f3+s*h2-p*h3,WW);
WW:=subs(h2=f4+s*h3-p*h4,WW);
WW:=subs(h3=f5+s*h4,WW);
WW:=subs(h4=f6,WW);
WW:=simplify(WW);
WW
end;
# The matrix program supplies the entries as a matrix A.
# We need to introduce the Kummer coordinates of the
# divisor G=0,Y=0 and so replace g2,g1,g0 by 1,-s,p.
# The resultant matrix is called B,
# the matrix in terms of the f's, p,s.
B:=map((W->subs(g2=1,g1=-s,g0=p,W)),A);
# And now we eliminate the h's using the procedure defined just above.
B:=map(Subh,B);
# We define some familiar things.
# We now want the divisor G=0 to be a generic divisor
# of order 2. Since we we no longer need the original
# uses of x, u we use them as a pair of distinct
# zeros of FX. We need to express that they are distinct.
Bxu:=simplify((Fx-Fu)/(x-u)):
Bxu:=collect(Bxu,u):
# x is a root of FX of degree 6. u is another root of FX, so
# satisfies an equation Bxu of degree 5 over k(x).
# Here k=Q(f0,...,f6) is the ground field. We are concerned
# with the field of symmetric functions of x,u: which is of degree 15.
# By using Bxu we can reduce a symmetric poly in x,u to degree at most
# 4 in u. By symmetry it is of degree at most 4 in x and so of
# the shape s^i*p^j, with i+j at most 4. This gives 15 elements,
# and so is a basis of k(s,p) over k.
# The following program takes a symmetric function of x,u
# and makes the reduction.
Simp:=proc(W)
local WW;
WW:=W;
WW:=collect(WW,u);
WW:=rem(WW,Bxu,u);
WW:=collect(WW,x);
WW:=rem(WW,Fx,x);
WW:=simplify(WW);
WW
end;
# We now compute the beta0 of the divisor {(x,0),(u,0)}
Bet:=simplify((Fxu-Fx-Fu)/(x-u)^2);
#and put it in s,p terms
Bet0:=Sym(Bet); # Used in TryOn below
# We also do the same with s*beta0,p*beta0 and beta0^2
Bet1:=Sym(Simp((x+u)*Bet)); # Used in TryOn below/
Bet2:=Sym(Simp(x*u*Bet)); # ditto
Bet3:=Sym(Simp(Bet^2)); # ditto
# Note that 1,s,p,s^2,s*p,p^2, and the above 4 are linearly independent
# over k. (By inspection of the values just obtained. See also
# the routine TryOn below.)
# Any polynomial in s,p is equal to a linear form in the 15 basis
# elements s^i*p^j with i+j at most 4. We need a routine to do
# this. It goes via x,u
SimpSP:=proc(W)
local WW;
WW:=W;
WW:=subs(s=x+u,p=x*u,WW);
WW:=Simp(WW);
WW:=Sym(WW);
WW
end;
# apply this to the matrix B of coefficients
DD:=map(SimpSP,B):
# We also give a program to convert a linear form in the
# base elements into a quadratic form in z1=1,z2=s,z3=p,z4=beta0.
#As remarked above, these are linearly independent. As they don't
# span, it is a check on the correctness of the working that
# (in any given case) we get a quadratic form in the z's.
# Uses values of beta0,s*beta0,,p*beta0,beta0^2 obtained above.
TryOn:=proc(W)
local WW,W1,W2,W3;
WW := W;
WW := collect(WW,p);
W1 := 1/3*coeff(WW,p,4)/f6^2; # coeff gives the coefficient of p^4
# which occurs only in beta0^2=Bet3. So replace by z4^2.
WW := simplify(WW-W1*Bet3+W1*z4^2);
WW := collect(WW,p);
W1 := coeff(WW,p,2); #look for coeff or p^2*s^2 which [apart from
W1 := collect(W1,s); # Bet3 (now gone)] occurs only in Bet2.
W1 := -coeff(W1,s,2)/f6;
WW := simplify(WW-W1*Bet2+W1*z3*z4); #replace Bet2 by z3*z4.
WW := collect(WW,p);
W1 := coeff(WW,p,1); # Now Bet1 characterized by p*s^3.
W1 := collect(W1,s);
W1 := -1/2*coeff(W1,s,3)/f6;
WW := simplify(WW-W1*Bet1+W1*z2*z4);
WW := collect(WW,s);
W1 := -coeff(WW,s,4)/f6;
WW := simplify(WW-W1*Bet0+W1*z4); # Bet0 characterized by s^4.
# Note: not z1*z4. What is left should be a quadratic in s,p.
# We now homogenize the z's.
WW := z1^2*subs(z2= z2/z1,z3 = z3/z1,z4 = z4/z1,WW);
WW:=subs(s=z2/z1,p=z3/z1,WW);# Now substitute ratios for s,p.
WW := collect(simplify(WW),[z1,z2,z3,z4]); # simplify
WW
end;
# We now construct the biquadratic
# forms. We first make linear
# forms out of the matrix DD, which we got by transforming the
# A given by the Matrix program . The coefficients are called y1,..y4.
# To satisfy MAPLE's peculiar rules for sum we must unset j
j:='j';
# We now construct the xi_i(A+D) which occur on the right hand
# side of equation (4.2). In the preent notation, this is Y[i]
# which we defined next.
# Here Fraktur A
# is a generic divisor, whose Kummer coordinates will by
# (y1,y2,y3,y4) and Fraktur D is the divisor {(x,0),(u,0)}
# of order 2.
for i from 1 to 4 do
Y[i]:=sum('y.j*DD[i,j]',j=1..4)
od:
# Now for the biquadratic forms themselves. These are forms
# Bij quadratic in the yi and the coordinates zi of a second generic point
# Fraktur B, say. We have to show that the Bij are uniquely determined
# by the demand that (4.2) holds when Fraktur B is specialized
# to Fraktur D.
# We shall put the Bij in a square matrix BB
BB:=array(1..4,1..4);
# In the computation we use that matrix BB is symmetric
# We now us the routines we contructed above to find the Bij
# The following is a massive computation, so allow time and don't
# become impatient,
for i from 1 to 4 do
for j from i to 4 do
BB[i,j]:=simplify(TryOn(SimpSP(Y[i]*Y[j])));
BB[j,i]:=BB[i,j];
od:
od:
# And now we check that they actually are symmetric in the
# y's and the z's, although they are treated so very differently.
# This also checks that there is nothing left over in the applications
# of procedure TryOn.
for i from 1 to 4 do
for j from 1 to 4 do
Temp:=BB[i,j]:
TempA:=subs(y1=t1,y2=t2,y3=t3,y4=t4,z1=s1,z2=s2,z3=s3,z4=s4,Temp):
TempA:=subs(t1=z1,t2=z2,t3=z3,t4=z4,s1=y1,s2=y2,s3=y3,s4=y4,TempA):
C[i,j]:= simplify(Temp-TempA);
od;
od;
# Now for the test. Should be all 0.
op(C);
# Part 4
# This part checks the computations of Section 5 of the Chapter.
# The object of this partis to obtain the formulae
# for duplication. We use the bilinear forms constructed
# in Part 3 and set the two divisors involved
# equal. We check that the elements BB[i,j] with i,j not 4
# all vanish, as they should. The Kummer coordinates
# of the double point are then (BB[1,4],BB[2,4],BB[3,4],BB[4,4]/2).
# Note that the last element is halved.
# For the doubling map, we have to equate the two sets of
# variables occurring in BB. For later use, it will be convenient
# to have them as a vector rather than a collection of variables.
# We make a temporary procedure to make the substitution.
Temp:=proc(W)
local WW;
WW:=W;
WW:=subs(y1=xx[1],y2=xx[2],y3=xx[3],y4=xx[4],WW);
WW:=subs(z1=xx[1],z2=xx[2],z3=xx[3],z4=xx[4],WW);
WW
end;
# Make the substitution
DD:=map(Temp,BB):
# Now the doubling map is given by the elements of DD which involve
# the index 4. All the others should vanish, at least as
# consequences of the equation of the Kummer. check latter statement first
DD[1,1];
DD[1,2];
DD[1,3];
DD[2,3];
DD[3,3];
DD[2,2];
# We want to show that DD[2,2] and DD[1,3] vanish as
# a result of the definition of the Kummer.
simplify(DD[1,3]+K);
simplify(DD[2,2]-2*K);
# Should be 0
# We now define a vector giving the coordinates of the double
# of a generic point
Doub:=array(1..4);
Doub[1]:=2*DD[1,4]:
Doub[2]:=2*DD[2,4]:
Doub[3]:=2*DD[3,4]:
Doub[4]:=DD[4,4]:
# We make a procedure to double a vector on the Kummer
# Since we are substituting a vector we have to use eval
#
# The peculiarities of MAPLE mean that we have to act on the
# elements of the vector separately
Double:=proc(W)
local i,Vec;
for i from 1 to 4 do
Vec[i]:=eval(subs(xx=W,Doub[i]));
od;
Vec
end;
# Part 5
# The object of this part is to set up the machinery for the
# operation of the addition-subtraction bilinear form on a
# given curve Y^2=F(X). Here we work with generic coefficients f.i.
# It is envisaged that in working with this program one
# equates the coefficients to those of the special form one
# is interested in, but at first we leave them generic.
# A second program is given, which uses the formulae saved
# from this program to check the numerical example in
# Section 6 of the Chapter.
# For the applications it will be convenient to work with
# vectors, so we make the appropriate transformation of the
# biquadratic forms.
# the coords of the initial points
# will be yy[1]...yy[4] and zz[1]...zz[4]
yy:=array(1..4);
zz:=array(1..4);
Temp:=(WW ->subs(y1=yy[1],y2=yy[2],y3=yy[3],y4=yy[4],
z1=zz[1],z2=zz[2],z3=zz[3],z4=zz[4],WW)):
BBB:=map(Temp,BB):
# This is the final shape of the matrix of biquadratic forms
# The following routine computes the Kummer coordinates of a
# divisor {(xx,yy),(uu,vv)} as (X[1],X[2],X[3],X[4]).
Coord :=
proc(xx,yy,uu,vv)
local X,Temp;
X[1] := 1;
X[2] := xx+uu;
X[3] := xx*uu;
Temp := subs(x = xx,u = uu,Fxu);
X[4] := simplify((Temp-2*yy*vv)/(xx-uu)^2);
X
end:
# we now want to evaluate the Kummer of a vector. The procedure
# Kum does this.
Kum:=proc(ww)
local Temp;
Temp:=subs(xx=ww,K);
Temp:=eval(Temp):
Temp:=simplify(Temp);
Temp
end;
# We also need a procedure to evaluate the bilinear form for two
# given vectors.
Bilin:=proc(vv,ww)
local i,j,Temp,Res;
for i from 1 to 4 do
for j from 1 to 4 do
Temp:=BBB[i,j];
Temp:=subs(yy=vv,zz=ww,Temp);
Temp:=eval(Temp);
Temp:=simplify(Temp);
Res[i,j]:=Temp;
od;
od;
Res
end;
# To sum up. Kum( ) gives the Kummer and Bilin( , ) gives the
# bilinear form. To work with a given form one has to equate
# its coefficients with those (fi) of the generic form.
# The function Coord(x,y,u,v) computes the xi coordinates
# of the divisor {(x,y),(u,v)} on the curve.
# save what we need in the file Kit.sav
save(FX,Fx,Fu,Fxu,K,BBB,Doub,Double,Coord,Kum,Bilin,`Kit.sav`):