# Updated on 15 June 1999, to be compatable with Maple V.5
# Let Y^2 = sextic = f6*X^6 + ... + f0 be curve of genus 2.
# The following file relates to the discussion in Section 5
# of Chapter 6 of 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).
# Recall that the map mu of (6.1.9) has kernel precisely 2G
# exactly when Criterion (i) or Criterion (ii) of Lemma 6.5.1
# is satisfied. Criterion (i) is satisfied exactly when
# f6 = 0 or sextic has a rational root (this is easy to
# check using the maple command: factor(sextic)). Let us
# assume that neither of these are true. This file makes it easy
# to check when Criterion (ii) is satisfied.
# Let hx be as follows:
# hx = (x-(a1*a2*a3 + a4*a5*a6))*
# (x-(a1*a2*a4 + a3*a5*a6))*
# (x-(a1*a2*a5 + a3*a4*a6))*
# (x-(a1*a2*a6 + a3*a4*a5))*
# (x-(a1*a3*a4 + a2*a5*a6))*
# (x-(a1*a3*a5 + a2*a4*a6))*
# (x-(a1*a3*a6 + a2*a4*a5))*
# (x-(a1*a4*a5 + a2*a3*a6))*
# (x-(a1*a4*a6 + a2*a3*a5))*
# (x-(a1*a5*a6 + a2*a3*a4))
# where a1,..,a6 are the 6 roots of the sextic f6*X^6 + ... + f0.
# PROVIDED THAT hx IS SQUARE-FREE, we have that:
# Criterion (ii) is satisfied exactly when the degree 10 polynomial
# hx has a rational root.
# (N.B. there is a typo in the first printing of the book,
# where the condition that hx is square-free should have been
# mentioned on p.56, line -7).
# Note, however, that this requirement does not create a serious
# problem. Define h_a(x) to be identical to hx, except derived
# from F(x+a) instead of F(x). Then it is is straightforward
# to show that h_a(x) has a square factor for at most 45
# values of a (45 = the largest possible number of pairs of roots of hx).
# This leads to the following algorithm (pointed out to me by
# Michael Stoll) for determining the kernel of \mu:
# Compute hx.
# Factor it over k.
# If it has a simple root in k --> kernel of \mu = 2G
# If it hasn't and is square-free --> [kernel of \mu : 2G] = 2
# (supposing there is some point of odd degree on the curve)
# If neither --> replace F(x) by F(x+1) and repeat.
#
# The following maple commands give hx in terms of f0,...,f6.
#
# First fix your sextic (you should replace the following line
# with your own choice of sextic).
sextic := expand( subs(x=x+1, 5*(x^2-2)*(x^2-5)*(x^2-10)) ):
f6 := coeff(sextic,x,6):
f5 := coeff(sextic,x,5):
f4 := coeff(sextic,x,4):
f3 := coeff(sextic,x,3):
f2 := coeff(sextic,x,2):
f1 := coeff(sextic,x,1):
f0 := coeff(sextic,x,0):
k5 := f5/f6:
k4 := f4/f6:
k3 := f3/f6:
k2 := f2/f6:
k1 := f1/f6:
k0 := f0/f6:
h0 := k0^4*k5^6+k0^3*k2^2*k5^4-2*k0^3*k1*k3*k5^4-4*k0^4*k4*k5^4+k0^2*k1^2*k3^2*
k5^2-2*k0^3*k2*k3^2*k5^2-2*k0^2*k1^2*k2*k4*k5^2+8*k0^3*k1*k3*k4*k5^2+2*k0^2*k1^
3*k5^3-4*k0^3*k1*k2*k5^3+8*k0^4*k3*k5^3+k0^3*k3^4-2*k0^2*k1^2*k3^2*k4+k0*k1^4*
k4^2-2*k0*k1^4*k3*k5+8*k0^2*k1^2*k2*k3*k5-12*k0^3*k1*k3^2*k5-4*k0^2*k1^3*k4*k5+
k1^6-4*k0*k1^4*k2+8*k0^2*k1^3*k3:
h1 := k1^5*k4+8*k0^2*k1^3-8*k0^3*k3^3+8*k0^4*k5^3+k0^3*k2*k5^5-3*k0^3*k3^2*k5^3
-3*k0*k1^3*k3^2+2*k0^3*k1*k5^4+2*k0*k1^4*k5+k0^2*k1*k3^3*k5+k0^2*k1*k2*k3*k5^3+
k0*k1^3*k3*k4*k5+8*k0^2*k1*k2*k3^2+24*k0^3*k1*k3*k5-8*k0^2*k1^2*k3*k4-3*k0*k1^3
*k2*k5^2-16*k0^2*k1^2*k2*k5+6*k0^2*k1^2*k3*k5^2+8*k0^2*k1^2*k4^2*k5-8*k0^3*k2*
k3*k5^2-16*k0^3*k1*k4*k5^2-8*k0^2*k1*k2*k3*k4*k5+8*k0^3*k3^2*k4*k5-3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*k1*k3^2
*k5-3*k1^3*k4*k5+16*k0^2*k3*k4*k5+6*k0*k1^2*k5^2-2*k0^2*k2*k5^2-k1^2*k2^2-4*k0*
k2^3+k1^3*k3+16*k0*k1*k2*k3-15*k0^2*k3^2-2*k0*k1^2*k4+18*k0^2*k2*k4-30*k0^2*k1*
k5-27*k0^3:
h5 := k0*k2*k4^2*k5+k1^2*k3*k5^2-2*k0*k2*k3*k5^2-2*k0*k1*k4*k5^2+2*k0^2*k5^3+k1
*k2^2*k4-2*k1^2*k3*k4-k0*k2*k3*k4-4*k0*k1*k4^2-2*k1^2*k2*k5-4*k0*k2^2*k5+16*k0*
k1*k3*k5+3*k0^2*k4*k5+2*k1^3+3*k0*k1*k2+9*k0^2*k3:
h6 := k0*k4^3+k1*k2*k4*k5-3*k0*k3*k4*k5-k1^2*k5^2+k0*k2*k5^2+k2^3-3*k1*k2*k3+3*
k0*k3^2+k1^2*k4-9*k0*k2*k4+9*k0*k1*k5+27*k0^2:
h7 := k1*k4^2+k2^2*k5-2*k1*k3*k5-k0*k4*k5-k1*k2-6*k0*k3:
h8 := k2*k4-k1*k5-9*k0:
h9 := k3:
hx := x**10 + h9*x**9 + h8*x**8 + h7*x**7 + h6*x**6 + h5*x**5 + h4*x**4
+ h3*x**3 + h2*x**2 + h1*x + h0:
# The following makes hx defined overr the same ring as the f6*X^6 + ... + f0.
hx := hx*(f6**10):
hx := expand(hx):
# Now try to factor hx. Provided that hx is square-free,
# Criterion (ii) is satisfied if and only
# if at least one of the following factors is linear.
discrim(hx,x);
factor(hx);
# Note that in our test example here, hx is square-free and irreducible,
# so that Criterion (ii) is not satisfied.
# Had hx been divisible by a square factor, then we would
# have replaced F(x) by F(x+1) and repeated the above,
# a process guaranteed to terminate after 45 applications.