Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168744
Image: ubuntu2004
------------------------------------------------------------------- introducing some of gp's elliptic-curve functionality -------------------------------------------------------------------
"#" toggles gp's the timer-showing setting
#
timer = 1 (on)
Ask gp what the function "ellinit" does
?ellinit
ellinit(x,{flag=0}): x being the vector [a1,a2,a3,a4,a6] defining the curve Y^2 + a1.XY + a3.Y = X^3 + a2.X^2 + a4.X + a6, gives the vector: [a1,a2,a3,a4,a6,b2,b4,b6,b8,c4,c6,disc,j,[e1,e2,e3],w1,w2,eta1,eta2,area]. If the curve is defined over a p-adic field, the last six components are replaced by root,u^2,u,q,w,0. If optional flag is 1, omit them altogether. x can also be a string, in this case the coefficients of the curve with matching name are looked in the elldata database if available.
the elliptic curve with a1=a2=a3=0 and prescribed c4,c6
E1(c4, c6) = ellinit([0, 0, 0, -c4/48, -c6/864])
time = 0 ms. (c4,c6)->ellinit([0,0,0,-c4/48,-c6/864])
here's the syntax for getting the discriminant and j-invariant
E1(C4,C6).disc E1(C4,C6).j
time = 0 ms. 1/1728*C4^3 - 1/1728*C6^2 time = 0 ms. 1728*C4^3/(C4^3 - C6^2)
Mazur's celebrated torsion theorem also holds -- and is much easier to prove -- not just for elliptic surfaces over Q(T) [where it's also a consequence by specialization] but even for *nonconstant* elliptic surfaces over R(T) where R = field of real numbers, because (once the group is not contained in the 2-torsion) such a surface is tantamount to a map from P^1 to the modular curve parametrizing elliptic curves with the given torsion subgroup, and that curve is rational only for the groups in Mazur's list: cyclic of order 1,2,...,10 or 12, and 2x2n for n=1,2,3,4. Over C(T) there are three further possibilities that can't arise over R, namely 4x4, 3x6, and 5x5. We next give explicitly for each n=2,3,...,10 the universal elliptic curve E with an n-torsion point P. We call these E2, E3, ..., E10. In each case P is at [0,0] ([removed] a6=0), and for n>2 the tangent line at P is horizontal ([removed] a4=0). for n=2,3,4 the digits 1,2,3,4 in a1,a2,a3,a4 are weights; thus for instance E3(a1,a3) \isom E3(c*a1,c^3*a3). For n>4 the parameters a,b are homogeneous of the same weight, so we have the universal curve over the projective (a:b)-line X_1(n). These formulas, or equivalent ones, are all "well-known" but I don't know of a standard place that lists them all.
E2(a2,a4) = ellinit([0, a2, 0, a4, 0]) E3(a1,a3) = ellinit([a1, 0, a3, 0, 0]) E4(a1,a2) = ellinit([a1, a2, a1*a2, 0, 0]) E5(a,b) = ellinit([a+b, a*b, a*b^2, 0, 0]) E6(a,b) = ellinit([a-b, -a*(a+b), a*b*(a+b), 0, 0]) E7(a,b) = ellinit([a^2+a*b-b^2, a*b^2*(a-b), a^3*b^2*(a-b), 0, 0])
time = 0 ms. (a,b)->ellinit([a^2+a*b-b^2,a*b^2*(a-b),a^3*b^2*(a-b),0,0])
for E7 see [Tate 1966], with b/a being Tate's parameter d
E8(a,b) = ellinit([a^2+2*a*b-b^2, a^2*b*(a-b), a^3*b*(a^2-b^2), 0, 0])
time = 0 ms. (a,b)->ellinit([a^2+2*a*b-b^2,a^2*b*(a-b),a^3*b*(a^2-b^2),0,0])
use "\" at the end of a line to continue a long formula ...
E9(a,b) = ellinit([a^3-a^2*b-b^3, \ a^2*b*(b-a)*(a^2-a*b+b^2), \ a^2*b^4*(a-b)*(a^2-a*b+b^2), \ 0, 0])
time = 0 ms. (a,b)->ellinit([a^3-a^2*b-b^3,a^2*b*(b-a)*(a^2-a*b+b^2),a^2*b^4*(a-b)*(a^2-a*b+b^2),0,0])
or enclose it with {...}
{ E10(a,b) = ellinit([2*a^3-2*a^2*b-2*a*b^2+b^3, a^3*b*(b-a)*(2*a-b), a^3*b^2*(b-a)*(2*a-b)*(a^2-3*a*b+b^2), 0,0]) }
time = 0 ms. (a,b)->ellinit([2*a^3-2*a^2*b-2*a*b^2+b^3,a^3*b*(b-a)*(2*a-b),a^3*b^2*(b-a)*(2*a-b)*(a^2-3*a*b+b^2),0,0])
For E9 and E10 see e.g. Lemmermeyer, www.fen.bilkent.edu.tr/~franz/ta/ta18.pdf, Prop.6 and 7 with d=a/b note that these [a1,a2,a3,0,0] are much simpler than the usual "narrow Weierstrass" form [0,0,0,-c4/48,-c6/864]. For many purposes it is better to work with these extended, albeit less canonical, formulas; not only are they more appealing, but they also tend to show more of the relevant structure (we'll see some examples soon), and to make some computations easier as well. For example, here's a curve with a 10-torsion point whose conductor is small enough to be in the original (Tingley/"Antwerp") tables of modular elliptic curves:
e150 = E10(1,4)
time = 0 ms. [26, -24, -480, 0, 0, 580, -12480, 230400, -5529600, 635920, -505460800, 967458816000, 502270291349/1889568, [21.192885125388138623964593421846993079, 15.000000000000000000000000000000000000, -181.19288512538813862396459342184699308]~, 0.44231481206310345778424013850724800974, -0.22254995561866250220535248427167392204*I, -1.1448571628270195664827017261908148043, 14.781266735023331097131059416692649450*I, 0.098437141794120720083676855098948051574]
for a curve over Q, gp knows how to compute the torsion subgroup:
elltors(e150)
time = 0 ms. [10, [10], [[0, 480]]]
the output "[10, [10], [[0, 480]]]" says the group has size 10, with a single generator -- this is automatic here, but compare the outputs of "elltors(ellinit([0,0,0,-1,0]))" and "elltors(ellinit([0,0,0,4,0]))" -- and one choice of generator is [0,480] (which is not our P, but has the same x-coordinate, so must be -P). Note that the coefficients 26, -24, -480 have factors 2, 4, 8, so we can obtain an equivalent curve by scaling by 2:
? ellchangecurve e150 = ellchangecurve(e150,[2,0,0,0])
ellchangecurve(E,v): change data on elliptic curve according to v=[u,r,s,t]. time = 0 ms. [13, -6, -60, 0, 0, 145, -780, 3600, -21600, 39745, -7897825, 236196000, 502270291349/1889568, [5.2982212813470346559911483554617482698, 3.7500000000000000000000000000000000000, -45.298221281347034655991148355461748270]~, 0.88462962412620691556848027701449601949, -0.44509991123732500441070496854334784408*I, -0.57242858141350978324135086309540740214, 7.3906333675116655485655297083463247248*I, 0.39374856717648288033470742039579220630]
and now the coefficients are [13, -6, -60, 0, 0]. Compare this with the standard model
? ellglobalred e150_red = ellglobalred(e150) e150_standard = ellchangecurve(e150, e150_red[2])
ellglobalred(E): E being an elliptic curve, returns [N,[u,r,s,t],c], where N is the conductor of E, [u,r,s,t] leads to the standard model for E, and c is the product of the local Tamagawa numbers c_p. time = 0 ms. [1, 0, 0, -828, 9072, 1, -1656, 36288, -676512, 39745, -7897825, 236196000, 502270291349/1889568, [17.298221281347034655991148355461748270, 15.750000000000000000000000000000000000, -33.298221281347034655991148355461748270]~, 0.88462962412620691556848027701449601949, -0.44509991123732500441070496854334784408*I, -0.57242858141350978324135086309540740214, 7.3906333675116655485655297083463247248*I, 0.39374856717648288033470742039579220630]
at the cost of forcing a1, a2, a3 in {0,1,-1} we've made the coefficients a4, a6 much larger (-828 and 9072).
-------------------------------------------------------------------\\ A bit more about the universal curve E10 over X_1(10) \\ -------------------------------------------------------------------\\
for example, to test that P really is a 10-torsion point on E10(a,b):
E = E10(a,b);
time = 3 ms.
ending a line of input with ";" suppresses the output, which for E10(a,b) covers 30+ lines
P = [0,0] P_mult = vector(10,n,ellpow(E,P,n))
time = 0 ms. [0, 0] time = 0 ms. [[0, 0], [2*b*a^5 - 3*b^2*a^4 + b^3*a^3, -4*b*a^8 + 12*b^2*a^7 - 13*b^3*a^6 + 6*b^4*a^5 - b^5*a^4], [-2*b*a^5 + 9*b^2*a^4 - 12*b^3*a^3 + 6*b^4*a^2 - b^5*a, 4*b^2*a^7 - 24*b^3*a^6 + 53*b^4*a^5 - 57*b^5*a^4 + 32*b^6*a^3 - 9*b^7*a^2 + b^8*a], [2*b^2*a^4 - 3*b^3*a^3 + b^4*a^2, -2*b^2*a^7 + 5*b^3*a^6 - 4*b^4*a^5 + b^5*a^4], [-a^6 + 4*b*a^5 - 4*b^2*a^4 + b^3*a^3, a^9 - 5*b*a^8 + 8*b^2*a^7 - 5*b^3*a^6 + b^4*a^5], [2*b^2*a^4 - 3*b^3*a^3 + b^4*a^2, -4*b^3*a^6 + 12*b^4*a^5 - 13*b^5*a^4 + 6*b^6*a^3 - b^7*a^2], [-2*b*a^5 + 9*b^2*a^4 - 12*b^3*a^3 + 6*b^4*a^2 - b^5*a, 4*b*a^8 - 24*b^2*a^7 + 53*b^3*a^6 - 57*b^4*a^5 + 32*b^5*a^4 - 9*b^6*a^3 + b^7*a^2], [2*b*a^5 - 3*b^2*a^4 + b^3*a^3, 0], [0, 2*b^2*a^7 - 9*b^3*a^6 + 12*b^4*a^5 - 6*b^5*a^4 + b^6*a^3], [0]]
the last entry is [0], which is gp's notation for the zero point of an elliptic curve, and is not the same as P=[0,0].
P_mult is long enough that you might suspect there might be another [0] hiding in the middle (if P were really a 5-torsion point); so let's check:
vector(10,n,P_mult[n]==[0])
time = 0 ms. [0, 0, 0, 0, 0, 0, 0, 0, 0, 1]
the output is [0, 0, 0, 0, 0, 0, 0, 0, 0, 1], as desired; equivalently,
vector(10,n,P_mult[n]==[0]) == vector(10,n,n==10)
time = 0 ms. 1
outputs 1 (true).
Two warnings: 1) as in C, be careful about == vs. = 2) unlike C (and Python and Sage), gp's vectors and matrices are indexed starting at 1, not 0
Where are the singular fibers of this curve E = E10(a,b)? We'd like to answer this by telling gp "factor(E.disc)", but this returns the error message *** factor: sorry, factor for general polynomials is not yet implemented. -- and who knows when if ever it will be implemented in gp (Sage has it). Still, the discriminant is a homogeneous polynomial in (a:b), so we can dehomogenize by setting (a,b) = (d,1) [remember that our a/b is Lemmermeyer's d], and then the discriminant is a polynomial in one variable, which gp does know how to factor:
E_d = E10(d,1); E_d_sing = factor(E_d.disc)
time = 0 ms. time = 0 ms. [d - 1 10] [d 10] [2*d - 1 5] [d^2 - 3*d + 1 2] [4*d^2 - 2*d - 1 1]
we find that the discriminant factors as some constant times d^10 * (d-1)^10 * (2*d-1)^5 * (d^2-3*d+1)^2 * (4*d^2-2*d-1)
but that doesn't account for the zero of disc(E_d) at infinity, corresponding to b=0. The multiplicity of this zero can be found directly as a valuation:
valuation(E.disc,b)
time = 0 ms. 5
or by subtracting the degree of disc(E_d) from the homogeneous degree 3*12 = 36 (the factor of 3 is because the coefficients a1,a2,a3,a4,a6 are homogeneous of degree 3*1, 3*2, 3*3, 3*4, 3*6 -- equivalently, the arithmetic genus of our elliptic surface is 3):
3*12 - poldegree(E_d.disc)
time = 0 ms. 5
either way we find that the discriminant has a fifth-order zero at d=infinity (i.e. at b=0).
We claim that the reduction at each of those factors b=0, a=0, a=b, etc. of disc(E) is multiplicative. (This is a general fact about the universal eliiptic curve over X_1(n) for n>2; there's no such curve for n=2 due to quadratic twists.) Except in characteristics 2 and 3, this amounts to checking that c4 and c6 are relatively prime, because additive fibers are characterized by the simultaneous vanishing of c4 and c6:
gcd(E_d.c4,E_d.c6)
time = 0 ms. 1
and indeed it's 1. What about the fiber at infinity?
[poldegree(E_d.c4),poldegree(E_d.c6)]
time = 0 ms. [12, 18]
returns [12, 18] = [4*3, 6*3], so neither c4 nor c6 vanishes there either. This should remain the case mod p for all p>3 not dividing 10; we can check this by forming a resultant:
factor(polresultant(E_d.c4,E_d.c6))
time = 0 ms. [2 60] [3 18] [5 3]
which indeed returns 2^60 3^18 5^3. We conclude that our surface has multiplicative reduction of type I_10 at a=0 and a=b, of type I_5 at b=0 and 2*a=b, of type I_2 at each of the two roots of a^2-3*a*b+b^2 = 0, and of type I_1 at each of the two roots of 4*a^2-2*a*b-b^2.
(digression: actually "factor" always returns a matrix with 2 columns, one for factors and one for exponents; here's the syntax for reconstructing the product. First we need to know how many factors we have:
matsize(E_d_sing)
time = 0 ms. [5, 2]
returns [5,2], indicating 5 rows and 2 columns; in particular, matsize(E_d_sing)[1] = number of rows = number of factors, so:
D = prod(n=1, matsize(E_d_sing)[1], E_d_sing[n,1] ^ E_d_sing[n,2]); D / E_d.disc
time = 0 ms. 1
returns 1, so here the constant factor in the polynomial factorization is trivial. End of digression.)
-------------------------------------------------------------------\\ The canonical height of multiples of P \\ -------------------------------------------------------------------\\
Since each multiple mP is either the origin or has polynomial (not merely rational) homogeneous polynomials as its coordinates, the naive height of mP is always twice the arithmetic genus, which is 6. But the canonical height should vanish. gp does not (yet?...) have built-in caonical heights for elliptic surfaces, so we must compute them ourselves. Fortunately for a semistable eliiptic surface (i.e. one all of whose singular fibers are multiplicative) this is straightforward: for a point Q, the correction at a fiber of type I_n is m*(m-n)/n, where m in [0,n) is the index of the component where the corresponding section s_Q meets the fiber. This index is nonzero iff Q reduces to the singular point, and then can be computed (up to the involution m [removed] n-m, which does not change the local correction m*(m-n)/n) as the smaller of n/2 and the valuation of y(Q) - y(-Q).
Recall we've already computed E_d_sing, but for the dehomogenized model; first we construct the correspoding homogeneous factorization, remembering to incorporate the factor b "at infinity":
num_factors = matsize(E_d_sing)[1] + 1; E_sing = matrix(num_factors, 2); { for(n=1, num_factors-1, E_sing[n,1] = b^poldegree(E_d_sing[n,1]) * subst(E_d_sing[n,1], d,a/b); E_sing[n,2] = E_d_sing[n,2] ); } E_sing[num_factors,1] = b; E_sing[num_factors,2] = 5; E_sing
time = 0 ms. [a - b 10] [a 10] [2*a - b 5] [a^2 - 3*b*a + b^2 2] [4*a^2 - 2*b*a - b^2 1] [b 5]
let's check we got this right:
prod(n=1,num_factors, E_sing[n,1] ^ E_sing[n,2]) / E.disc
time = 0 ms. 1
indeed it comes to 1
the next program "corr" computes, for a point Q on elliptic surface e the correction to the canonical height associated to a factor f of disc(e) occurring to multiplicity n. The variables x, y, y_diff, and m are internal to the program.
{ corr(e,Q,f,n, x,y,y_diff,m) = x = Q[1]; y = Q[2]; if(valuation((e.a1*x + e.a3 - 2*y) , f) == 0, return(0)); if(valuation((3*x^2+2*e.a2*x + e.a4 - e.a1*y) , f) == 0, return(0)); y_diff = y - ellpow(e,Q,-1)[2]; if(y_diff == 0, return(-poldegree(f)*n/4)); \\ because then m = n/2 m = min(n/2, valuation(Q[2] - ellpow(e,Q,-1)[2], f)); return( poldegree(f) * m * (m-n) / n ) }
time = 0 ms. (e,Q,f,n,x,y,y_diff,m)->x=Q[1];y=Q[2];if(valuation((e.a1*x+e.a3-2*y),f)==0,return(0));if(valuation((3*x^2+2*e.a2*x+e.a4-e.a1*y),f)==0,return(0));y_diff=y-ellpow(e,Q,-1)[2];if(y_diff==0,return(-poldegree(f)*n/4));m=min(n/2,valuation(Q[2]-ellpow(e,Q,-1)[2],f));return(poldegree(f)*m*(m-n)/n)
we need the factor deg(f) because there are really deg(f) Galois-conjugate factors; that's analogous to the factor log(p) in the arithmetic setting that arises for the height correction at a prime p. Using "poldegree" without specifying the variable can give unpredictable results, but here it must work since f is irreducible.
So the following vector should be zero:
vector(9,n, 6 + sum(k=1,num_factors,corr(E,P_mult[n],E_sing[k,1],E_sing[k,2])))
time = 4 ms. [0, 0, 0, 0, 0, 0, 0, 0, 0]
and indeed it is. Check that the same is true for each of the cases E5, E6, E7, E8, E9 where both homogeneous parameters have the same weight.
-------------------------------------------------------------------\\ The universal curve over X_1(7) in characteristic 3 (and 5) \\ -------------------------------------------------------------------\\
To get examples of nonzero canonical height we need elliptic surfaces of positive rank. Computing the rank, let alone the Mordell-Weil group, of an elliptic surface over C is still an intractable problem in general. Over a finite field there's still no general algorithm known but we have some additional tools, as we'll illustrate with the reduction mod 3 of the universal ellipic curve over X_1(7). It's known, but probably not surprising, that in characteristic zero the universal curve over X_1(N) has no points outside its tautological torsion group Z/NZ, but remarkably this can fail in positive characteristic!
N=7 is the first case where this universal curve is not rational *as a surface*; instead it is a K3 elliptic surface (arithmetic genus 2). We describe its singular fibers as we did for X_1(10):
E = E7(a,b); E_d = E7(d,1); E_d_sing = factor(E_d.disc)
time = 0 ms. [d - 1 7] [d 7] [d^3 + 5*d^2 - 8*d + 1 1]
This time the factors are d^7 * (d-1)^7 * (d^3+5*d^2-8*d+1), and for the factor at infinity:
valuation(E.disc,b) 2*12 - poldegree(E_d.disc)
time = 0 ms. 7 time = 0 ms. 7
giving 7 either way.
gcd(E_d.c4,E_d.c6) \\ 1 [poldegree(E_d.c4),poldegree(E_d.c6)] \\ = [8,12] = 2*[4,6]
time = 0 ms. [8, 12]
so again multiplicative reduction everywhere: I_7 at d=0,1,infinity and I_1 at the conjugate roots of d^3+5*d^2-8*d+1.
factor(polresultant(E_d.c4,E_d.c6))
time = 0 ms. [-1 1] [2 24] [3 12] [7 1]
= 2^24 3^12 7, and it turns out that 2 and 3 are OK too.
Check as before that all nonzero multiples of P have canonical height 0:
num_factors = matsize(E_d_sing)[1] + 1; E_sing = matrix(num_factors, 2); { for(n=1, num_factors-1, E_sing[n,1] = b^poldegree(E_d_sing[n,1]) * subst(E_d_sing[n,1], d,a/b); E_sing[n,2] = E_d_sing[n,2] ); } E_sing[num_factors,1] = b; E_sing[num_factors,2] = 7; E_sing
time = 0 ms. [a - b 7] [a 7] [a^3 + 5*b*a^2 - 8*b^2*a + b^3 1] [b 7]
let's check we got this right:
prod(n=1,num_factors, E_sing[n,1] ^ E_sing[n,2]) / E.disc
time = 0 ms. -1
It comes to -1, which is still a constant.
P = [0,0] P_mult = vector(7,n,ellpow(E,P,n)) vector(6,n, 4 + sum(k=1,num_factors,corr(E,P_mult[n],E_sing[k,1],E_sing[k,2])))
time = 1 ms. [0, 0, 0, 0, 0, 0]
The I_7 fibers contribute 3*6=18 to the Picard number, and together with the contribution of the fiber and zero-section we get a total of 6*3 + 2 = 20, so in characteristic zero the Mordell-Weil rank is zero as expected and we have an "extremal" elliptic K3 (maximal Picard number, zero rank) of Neron-Severi discriminant -7^3 / |T|^2 = 7.
This should be reflected in the point-counts modulo a prime p other than 7. Each of the I_7 fibers contributes 7p (since the fiber components are rational -- that's automatic here because the components are separated by multiples of P); I_1 fibers need no special treatment because such a fiber's singular point is already smooth as a point on the surface in (x,y,d) space; so we just try all (x,d) values other than d=0,1,infty, remembering to include the point at infinity. The following works for odd p; we leave as an exercise (i.e. don't have the patience for) checking the special case p=2.
cubic(E,x) = poldisc(y^2 + E.a1*x*y + E.a3*y - (x^3 + E.a2*x^2), y); { N7(p) = 21*p + sum(n=2,p-1, p+1+sum(x=0,p-1, kronecker(subst(cubic(E_d,x),d,n),p) ) ) }
time = 0 ms. (p)->21*p+sum(n=2,p-1,p+1+sum(x=0,p-1,kronecker(subst(cubic(E_d,x),d,n),p)))
When (p/7) = -1, the count is exactly p^2 + 20 p + 1 (i.e. the trace of Frobenius on H^2 is 20p, same as the trace on NS; equivalently, the trace on the transcendental part of H^2 is zero), so the following run always prints [p,0]:
forprime(p=3,113,if(kronecker(p,7)==-1,print([p,N7(p)-(p^2+20*p+1)])))
[3, 0] [5, 0] [13, 0] [17, 0] [19, 0] [31, 0] [41, 0] [47, 0] [59, 0] [61, 0] [73, 0] [83, 0] [89, 0] [97, 0] [101, 0] [103, 0] time = 1,189 ms.
if (p/7) = +1, the number of points is between p^2 + 18 p + 1 and p^2 + 22 p + 1. The next run shows, for each such prime up to 113, how the point-count splits the interval of length 4p between those two bounds:
{ forprime(p=3,113, if(kronecker(p,7) == +1, n = N7(p); print([p, n-(p^2+18*p+1), p^2+22*p+1-n]) )) }
[11, 16, 28] [23, 64, 28] [29, 4, 112] [37, 36, 112] [43, 144, 28] [53, 100, 112] [67, 16, 252] [71, 256, 28] [79, 64, 252] [107, 400, 28] [109, 324, 112] [113, 4, 448] time = 788 ms.
What do you observe?
Since the transcendental lattice is only 2-dimensional, a single point count suffices to determine the L-function. (In general we'd also have to count over the fields of p^2, p^3, ..., p^e elements where e is roughly half the transcendental dimension.) In particular, when (p/7) = -1, the L-function has a 21st zero at s=1 over F_p, and a 22nd over F_{p^2}. So we expect two independent sections, one defined over F_p and the other only over F_{p^2}. More precisely, the BSD / Artin-Tate conjecture, which is a theorem in this setting of an elliptic K3 surface over F_q(t), indicates that over F_p(t) the M-W group is generated by [0,0] and a section P1 of canonical height 2p/7, while over F_{p^2}(t) the regulator is p^2/7. This, together with the existence of a Galois involution and the fact that the canonical height of any section is in (2/7)Z, implies that there's a section P2 of height 2p taken to -P2 by the Galois involution, with Q=(P1+P2)/2 and Q'=(P1-P2)/2 rational of height 4p/7 and switched with each other by the Galois involution.
In general the canonical height measures not just the complexity of a section but also the difficulty of finding it, in much the same way as in the more familiar setting of elliptic curves over Q. We next find these sections for p=3, the smallest prime "quadratic nonresidue" mod 7, and thus the one for which those canonical heights are smallest. as it happens, -1 is a nonsquare mod 3 as well, which means that we can work with F_9 as F_3[I] where I is [sic] gp's notation for a square root of -1; in general we could use F_p[w] where w is a quadratic irrationality (try "?quadgen"). It *is* possible to find the sections Q and Q' for larger primes p such that (p/7) = -1 in time polynomial in p, via the connection between our K3 surface and the square of a CM elliptic curve of discriminant -7; but that's a rather more complicated and extensive computation which is well beyond the scope of the present notes!
For p=3 we have 2p/7 = 6/7. There are three ways for a section of E7 to have this canonical height: it could be integral (i.e. with x,y homogeneous polynomials of degrees 4,6 in (a:b), or equivalently polynomials of degrees at most 4,6 in d), and with height corrections (here and later multiplied by -1 to forestall a deluge of minus signs) 0 + 10/7 + 12/7 or 6/7 + 6/7 + 10/7 adding up to 22/7 = 4 - 6/7 [NB the numerators 0, 6, 10, 12 are 0*7, 1*6, 2*5, 3*4]; or there could be a pole (i.e. the denominators of x and y are the square and cube of the same linear polynomial), so the naive height is 6, and at each of the three I_7 fibers the height correction is the maximal 12/7, adding to 36/7 = 6 - 6/7.
Now given an elliptic K3 surface E, a point of naive height h=4,6,8,10,... is specified by (3h/2)-1 = 5,8,11,... parameters: the h+1 coefficients of the numerator of x, and the (h/2)-2 non-leading coefficients of monic polynomial of whose square and cube are the demoniators of x and y. For such x to work, a polynomial of degree 3h occurring in the numerator of (2y + a1 x + a3)^2 must be a square, which is 3h/2 conditions; this suggests that the condition that such x exist is a union of hypersurfaces in the moduli space of K3 surface, which over C is confirmed by the Torelli theorem for K3's. But finding such a section when it exists is still a challenge, and even five variables is a lot if we want to solve a system of nonlinear equations. When the height is reduced by a correction m(n-m)/n, it's also easier to find the point, because the condition that the section (x,y) go through the m-th or (n-m)th component of an I_n fiber above d = d_0 anmounts to min(m,n-m) *linear* conditions on the coefficients of x, namely a choice of the first min(m,n-m) coefficients in the Taylor expansion of x about d_0. (This description is true for a general multiplicative fiber, not just in the K3 setting.) For example, the first of these coefficients must be the x-coordinate of the singular point of the Weierstrass equation, because all the non-identity components map to that singularity. The later coefficients are determined by the condition that (2y + a1 x + a3)^2 vanish to order at least 2, 4, 6, ..., 2*min(m,n-m) at d=d_0.
We illustrate this for our surface E7. Remember that cubic(x) computes (2y + a1 x + a3)^2. Setting d=0:
subst(cubic(E_d,x),d,0)
time = 0 ms. 4*x^3 + x^2
yields 4*x^3 + x^2, so clearly the singularity is at x=0. To find the next term, start from cubic7(x1*d), which automatically has a factor of d^2, and divide by that:
subst(cubic(E_d,x1*d)/d^2,d,0)
time = 0 ms. x1^2
to get x1^2. So, the next condition is that x is 0 mod d^2. Thus, the third condition:
subst(cubic(E_d,x2*d^2)/d^4,d,0)
time = 0 ms. x2^2
gives x2^2 so (x,y) is on component 3 or 4 at d=0 iff x = O(d^3). [This is basically retracing Tate's algorithm for our surface; the simplicity of the answer illustrates our earlier remarks on extended vs. narrow Weierstrass form.] Likewise at d=1:
subst(cubic(E_d,x),d,1) subst(cubic(E_d,x1*(d-1))/(d-1)^2,d,1)
time = 0 ms. x1^2 + 2*x1 + 1
the first step proceeded as before, but the second gives x1^2 + 2*x1 + 1 = (x1+1)^2, so:
subst(cubic(E_d,x2*(d-1)^2 - (d-1)) / (d-1)^4, d, 1)
time = 0 ms. x2^2 + 4*x2 + 4
and this gives x2^2 + 4*x2 + 4 = (x2+2)^2.
For d=infinity, we look at leading coefficients:
pollead(cubic(E_d,x4*d^4),d)
time = 0 ms. 4*x4^3 + x4^2
is 4*x4^3 + x4^2, with a double root at x4=0, so the singularity is at x4=0; thus projectively x vanishes (as a homogeneous function of degree 4 in (a:b)) at d=infinity (i.e. at b=0).
pollead(cubic(E_d,x3*d^3),d)
time = 0 ms. x3^2
is x3^2, so the next step is x=O(d^2), with a double zero at b=0; and then
pollead(cubic(E_d,x2*d^2),d)
time = 0 ms. x2^2 + 2*x2 + 1
gives (x2+1)^2, so components 3 and 4 have x = -d^2 + O(d) at infinity.
Thus: if we want to get height 6/7 with corrections 0/7, 10/7, and 12/7 we can put the 0/7 at infinity (there's an automorphism that cyclically permutes the cusps and thus the I_7 fibers), and the 10/7 and 12/7 are at d=0 and d=1 in some order. We put the 12/7 at d=0, because the other choice gives the 7-torsion point with x = d^2-d^3 that we know already. So, we want x to be a quartic in d congruent to 0 mod d^3 and to (d-1) modulo (d-1)^2. This is easy enough to calculate by hand, but gp's "chinese" program does it automatically:
lift(chinese(Mod(0,d^3), Mod(-(d-1), (d-1)^2)))
time = 0 ms. -d^4 + d^3
we get -d^4 + d^3, and then
factor(cubic(E_d, -d^4 + d^3))
time = 0 ms. [d - 1 4] [d 6] [3*d^2 - 4 1]
reveals a constant multiple of d^6 (d-1)^4 (3*d^2-4); so indeed this works in characteristic 3, and the constant is -1 so we we actually get a point over Z/3Z, not just the 9-element field. Solving for y we find that one solution is -(d-1)^2 d^4:
P1_d = [-d^4+d^3, -(d-1)^2*d^4];
time = 0 ms.
or in homogeneous form:
P1 = subst(P1_d,d,a/b); P1 = Mod(1,3) * [P1[1]*b^4, P1[2]*b^6] ellisoncurve(E,P1)
time = 0 ms. 1
The other choices for getting 6/7 come from translates by multiples of the 7-torsion point [0,0]:
P1_trans = vector(7,n,elladd(E,P1,ellpow(E,P,n)));
time = 0 ms.

It will be seen that translate by 5P is the one non-integral section of these 7. Check that all these have the same height 6/7:   [[We get the wrong output below in Sage, due probably to version dependent issues, maybe.]]

H_naive(P) = poldegree(subst(numerator(P[1]),a,d*b),b) H(P) = H_naive(P) + sum(k=1,num_factors,corr(E,P,E_sing[k,1],E_sing[k,2])) vector(7,n, H(P1_trans[n]))
time = 2 ms. [16/7, 18/7, 12/7, 12/7, 18/7, 16/7, 6/7]
Note that if (actually when) we later change E to another semistable elliptic surface, these functions will still work as long as we make sure to use d for its base coordinate (we could have avoided this by making d one of the variables) and re-setting E_sing.
[For p=5 we can find the section P1 similarly. Here we can get 10/7 as 4 - (0 + 6/7 + 12/7), so this time we make x a multiple of d^3 (to get the 12/7 at d=0) and require that the d^4 coefficient of x vanish to get the 6/7 correction from the reducible fiber at d=infinity.
yy = cubic(E_d, x1*d^3) / d^6
time = 0 ms. x1^2*d^4 + (4*x1^3 + 2*x1^2 + 2*x1)*d^3 + (3*x1^2 + 1)*d^2 + (-6*x1^2 - 4*x1 - 2)*d + (x1^2 + 2*x1 + 1)
that's a quartic in d that we want to make square; what's the square root?
yy2 = truncate(sqrt(yy+O(d^3))) yydiff = (yy2^2 - yy) / d^3 yydiff1 = yydiff / content(yydiff)
time = 0 ms. (2*x1^3 + 3*x1^2 + 3*x1 + 1)*d + (-x1^4 - 2*x1^3 - 2*x1^2 - 2*x1 - 1)
the "content" was 4*x1^5 / (x1+1)^6, and x1 cannot vanish because then we're back to a 7-torsion point. This gives us the linear polynomial (2*x1^3+3*x1^2+3*x1+1)*d - (x1^4+2*x1^3+2*x1^2+2*x1+1) in d, and we want to choose x1 to make that polynomial vanish identically. This is not possible in characteristic zero, because these coefficients have no common root; but:
polresultant(polcoeff(yydiff1,1,d), polcoeff(yydiff1,0,d), x1)
time = 0 ms. -5
returns -5, so modulo 5 (and no other prime) we get the desired section by making x1 a common root:
gcd(Mod(1,5)*polcoeff(yydiff1,1,d), Mod(1,5)*polcoeff(yydiff1,0,d))
time = 0 ms. Mod(1, 5)*x1 + Mod(3, 5)
gives x1+3 so we must take x1=2. This gives:
P1_5_d = [2*d^3, -d^4-2*d^3]; P1_5 = subst(P1_5_d,d,a/b) P1_5 = Mod(1,5) * [P1_5[1]*b^4, P1_5[2]*b^6]
time = 0 ms. [Mod(2, 5)*b*a^3, Mod(4, 5)*b^2*a^4 + Mod(3, 5)*b^3*a^3]
but back to p=3.]
There are three routes to 12/7: either naive height 4 and corrections 0, 6/7, 10/7, or naive height 6 and corrections 6/7, 12/7, 12/7 or 10/7, 10/7, 10/7. We choose the last of these, which leaves only two undetermined coefficients in x. Thus x = sextic(d) / (d-d0)^2 for some d0 other than 0, 1, and infinity, with x = O(d^2) at d=0, x = -(d-1) + O(d-1)^2 at d=1, and x = O(d^2) at d=infinity. Thus x = (c*d - (c+(d0-1)^2)) * (d-1) * d^2 / (d-d0)^2) for some c and d0, and after eliminating square factors we find a sextic in d that must be a square:
{ yy = subst(cubic(E_d,X), X, (c*d - (c+(d0-1)^2)) * (d-1) * d^2 / (d-d0)^2) * (d-d0)^6 / (d^4 * (d-1)^4); }
time = 16 ms. (c^2 + 2*c + 1)*d^6 + ((-2*d0 + 2)*c^2 + (-2*d0^2 - 4*d0 + 2)*c + (-2*d0^2 - 2*d0))*d^5 + (4*c^3 + (d0^2 - 4*d0 + 3)*c^2 + (4*d0^3 - 2*d0^2 - 4)*c + (d0^4 + 4*d0^3 - d0^2 + 4*d0 - 2))*d^4 + (-8*c^3 + (-10*d0^2 + 18*d0 - 18)*c^2 + (-2*d0^4 + 8*d0^3 - 14*d0^2 + 28*d0 - 10)*c + (-2*d0^5 - 6*d0^2 + 4*d0))*d^3 + (4*c^3 + (15*d0^2 - 12*d0 + 13)*c^2 + (8*d0^4 - 28*d0^3 + 30*d0^2 - 32*d0 + 14)*c + (d0^6 - 4*d0^5 + 11*d0^4 - 20*d0^3 + 28*d0^2 - 20*d0 + 5))*d^2 + ((-6*d0^2 - 2*d0)*c^2 + (-8*d0^4 + 16*d0^3 - 2*d0^2 - 4*d0)*c + (-2*d0^6 + 10*d0^5 - 14*d0^4 + 4*d0^3 + 4*d0^2 - 2*d0))*d + (d0^2*c^2 + (2*d0^4 - 4*d0^3 + 2*d0^2)*c + (d0^6 - 4*d0^5 + 6*d0^4 - 4*d0^3 + d0^2))
I'm not sure why this circumlocution is necessary instead of just yy = cubic(E_d, (c*d - (c+(d0-1)^2)) * (d-1) * d^2 / (d-d0)^2) etc. ...
yy2 = truncate(sqrt(yy+O(d^4))); yydiff = (yy2^2 - yy) / d^4; yydiff1 = yydiff / content(yydiff);
time = 0 ms. ((d0^2 + 2*d0 + 1)*c^6 + (-11*d0^3 - 13*d0^2 + 4*d0 + 6)*c^5 + (-d0^5 + 51*d0^4 + 21*d0^3 - 54*d0^2 - 10*d0 + 15)*c^4 + (5*d0^6 - 134*d0^5 + 43*d0^4 + 150*d0^3 - 66*d0^2 - 40*d0 + 20)*c^3 + (-10*d0^7 + 207*d0^6 - 208*d0^5 - 136*d0^4 + 214*d0^3 - 19*d0^2 - 50*d0 + 15)*c^2 + (7*d0^8 - 172*d0^7 + 285*d0^6 - 38*d0^5 - 197*d0^4 + 117*d0^3 + 15*d0^2 - 28*d0 + 6)*c + (56*d0^8 - 134*d0^7 + 87*d0^6 + 37*d0^5 - 69*d0^4 + 21*d0^3 + 8*d0^2 - 6*d0 + 1))*d^2 + ((2*d0^2 + 2*d0)*c^6 + (3*d0^4 - 17*d0^3 - 5*d0^2 + 12*d0)*c^5 + (d0^6 - 22*d0^5 + 80*d0^4 - 28*d0^3 - 56*d0^2 + 30*d0)*c^4 + (-5*d0^7 + 69*d0^6 - 231*d0^5 + 196*d0^4 + 64*d0^3 - 134*d0^2 + 40*d0)*c^3 + (7*d0^8 - 105*d0^7 + 387*d0^6 - 487*d0^5 + 125*d0^4 + 190*d0^3 - 146*d0^2 + 30*d0)*c^2 + (2*d0^9 + 64*d0^8 - 325*d0^7 + 553*d0^6 - 357*d0^5 - 33*d0^4 + 161*d0^3 - 77*d0^2 + 12*d0)*c + (-7*d0^10 + 92*d0^8 - 229*d0^7 + 230*d0^6 - 79*d0^5 - 39*d0^4 + 46*d0^3 - 16*d0^2 + 2*d0))*d + (d0^2*c^6 + (-d0^4 - 13*d0^3 + 5*d0^2)*c^5 + (-3*d0^6 + 6*d0^5 + 60*d0^4 - 57*d0^3 + 10*d0^2)*c^4 + (-d0^8 + 21*d0^7 - 28*d0^6 - 142*d0^5 + 225*d0^4 - 98*d0^3 + 10*d0^2)*c^3 + (6*d0^9 - 61*d0^8 + 89*d0^7 + 167*d0^6 - 424*d0^5 + 305*d0^4 - 82*d0^3 + 5*d0^2)*c^2 + (-12*d0^10 + 86*d0^9 - 146*d0^8 - 57*d0^7 + 378*d0^6 - 398*d0^5 + 180*d0^4 - 33*d0^3 + d0^2)*c + (8*d0^11 - 49*d0^10 + 94*d0^9 - 34*d0^8 - 117*d0^7 + 186*d0^6 - 122*d0^5 + 39*d0^4 - 5*d0^3))
there's still a common factor that "content" doesn't pick up but "gcd" does:
yydiff1 /= (c + (d0-1)^2) * d0
time = 0 ms. (((d0^2 + 2*d0 + 1)*c^6 + (-11*d0^3 - 13*d0^2 + 4*d0 + 6)*c^5 + (-d0^5 + 51*d0^4 + 21*d0^3 - 54*d0^2 - 10*d0 + 15)*c^4 + (5*d0^6 - 134*d0^5 + 43*d0^4 + 150*d0^3 - 66*d0^2 - 40*d0 + 20)*c^3 + (-10*d0^7 + 207*d0^6 - 208*d0^5 - 136*d0^4 + 214*d0^3 - 19*d0^2 - 50*d0 + 15)*c^2 + (7*d0^8 - 172*d0^7 + 285*d0^6 - 38*d0^5 - 197*d0^4 + 117*d0^3 + 15*d0^2 - 28*d0 + 6)*c + (56*d0^8 - 134*d0^7 + 87*d0^6 + 37*d0^5 - 69*d0^4 + 21*d0^3 + 8*d0^2 - 6*d0 + 1))/(d0*c + (d0^3 - 2*d0^2 + d0)))*d^2 + ((2*d0 + 2)*c^5 + (d0^3 - 15*d0^2 - 3*d0 + 10)*c^4 + (-5*d0^4 + 52*d0^3 - 29*d0^2 - 33*d0 + 20)*c^3 + (7*d0^5 - 93*d0^4 + 119*d0^3 + 7*d0^2 - 61*d0 + 20)*c^2 + (2*d0^6 + 75*d0^5 - 163*d0^4 + 81*d0^3 + 41*d0^2 - 45*d0 + 10)*c + (-7*d0^7 - 14*d0^6 + 71*d0^5 - 73*d0^4 + 13*d0^3 + 20*d0^2 - 12*d0 + 2))*d + (d0*c^5 + (-2*d0^3 - 11*d0^2 + 4*d0)*c^4 + (-d0^5 + 13*d0^4 + 36*d0^3 - 38*d0^2 + 6*d0)*c^3 + (6*d0^6 - 37*d0^5 - 45*d0^4 + 107*d0^3 - 48*d0^2 + 4*d0)*c^2 + (-12*d0^7 + 54*d0^6 + 7*d0^5 - 117*d0^4 + 98*d0^3 - 26*d0^2 + d0)*c + (8*d0^8 - 33*d0^7 + 20*d0^6 + 39*d0^5 - 59*d0^4 + 29*d0^3 - 5*d0^2))
We now have three simultaneous nonlinear equations (the vanishing of the coefficients of 1, d, and d^2 in yydiff) to solve for the two variables c, d0. We solve the first two of these, using a resultant to eliminate c, then check whether each of the solutions is feasible for the third equation:
R = polresultant(polcoeff(yydiff1,1,d), polcoeff(yydiff1,0,d), c) centerlift(factormod(R,3))
time = 0 ms. [d0 32] [d0 + 1 2] [d0 - 1 2] [d0^6 - d0^5 - d0^4 + d0^2 + d0 + 1 1] [d0^6 - d0^5 - d0^4 - d0^3 + d0^2 + d0 - 1 1]
we find that there are spurious roots d0=0 and d0=1 of multiplicity 32 and 2 (they must be spurious beause x must have zeros there, not poles); a double root at d0 = -1; and two further irreducible sextic factors d0^6-d0^5-d0^4+d0^2+d0+1, d0^6-d0^5-d0^4-d0^3+d0^2+d0-1 that cannot be right because we know our solution will be defined over the 9-element field. So we set d0 = -1 and solve for c:
yydiff1 = subst(yydiff1, d0, Mod(-1,3)); yydiff1 /= content(yydiff1)
time = 0 ms. (Mod(2, 3)*c^4 + Mod(2, 3)*c^3 + Mod(1, 3)*c^2)*d^2 + (Mod(2, 3)*c^3 + Mod(1, 3)*c^2 + Mod(1, 3))*d + (Mod(1, 3)*c^6 + Mod(2, 3)*c^5 + Mod(1, 3)*c^4 + Mod(2, 3)*c^3 + Mod(2, 3)*c^2 + Mod(2, 3)*c + Mod(2, 3))
for some reason gp recognizes the common denominator of c+1 but not the common factor of the numerator; so we ask for it directly:
gcd(gcd(polcoeff(yydiff1,0,d),polcoeff(yydiff1,1,d)),polcoeff(yydiff1,2,d))
time = 0 ms. Mod(2, 3)*c^2 + Mod(2, 3)*c + Mod(1, 3)
and we find a common factor -c^2-c+1, i.e. c=1+I or c=1-I. choose the first:
{ Q1_d_x = subst(subst( (c*d - (c+(d0-1)^2)) * (d-1) * d^2 / (d-d0)^2, d0, -1), c, 1+I) }
time = 0 ms. ((1 + I)*d^4 + (-6 - 2*I)*d^3 + (5 + I)*d^2)/(d^2 + 2*d + 1)
Finding the y-coordinate should be easy -- we're just solving a quadratic equation over F_9(d) -- but since gp doesn't factor multivariate polynomials we have to do it "by hand":
Q1_d_yy = Mod(1,3) * subst(cubic(E_d,X), X, Q1_d_x) * (d+1)^6 / (d^4 * (d-1)^4) Q1_d_yy_factor = factor(Q1_d_yy)
time = 1 ms. [Mod(1, 3)*d + (Mod(0, 3) + Mod(1, 3)*I) 2] [Mod(1, 3)*d + (Mod(2, 3) + Mod(1, 3)*I) 2] [Mod(1, 3)*d + (Mod(1, 3) + Mod(2, 3)*I) 2]
confirms that it's a square, at least up to a constant factor; but the leading coefficient is I mod 3, which is (1-I)^2, so:
Q1_d_yy_root = (1-I) * prod(n=1,3,Q1_d_yy_factor[n,1]^(Q1_d_yy_factor[n,2]/2)) Q1_d_yy_root^2 == Q1_d_yy
time = 0 ms. 1
it works. Now restore the factors (d^2 * (d-1)^2) / (d+1)^3 and use the quadratic formula...
Q1_d_y = Q1_d_yy_root * (d^2 * (d-1)^2) / (Mod(1,3) * (d+1)^3); Q1_d_y -= E_d.a1 * Q1_d_x + E_d.a3; Q1_d_y /= 2; Q1_d = [Q1_d_x, Q1_d_y] ellisoncurve(E_d, Q1_d)
time = 0 ms. 1
and this works too (whew). If we want to replace it by a simpler point that's equivalent under translation by a 7-torsion point, we can write:
Q1_d = elladd(E_d,Q1_d,ellpow(E_d,P,2))
time = 0 ms. [(Mod(0, 3) + Mod(1, 3)*I)*d^2 + (Mod(2, 3) + Mod(1, 3)*I)*d + (Mod(0, 3) + Mod(0, 3)*I), (Mod(2, 3) + Mod(0, 3)*I)*d^2 + (Mod(0, 3) + Mod(0, 3)*I)*d + (Mod(0, 3) + Mod(0, 3)*I)]
and then the homogeneous form is
Q1 = subst(Q1_d,d,a/b); Q1[1] *= b^4; Q1[2] *= b^6; Q1
time = 0 ms. [(Mod(0, 3) + Mod(1, 3)*I)*b^2*a^2 + (Mod(2, 3) + Mod(1, 3)*I)*b^3*a, (Mod(2, 3) + Mod(0, 3)*I)*b^4*a^2]
more pleasantly, Q1 is Mod(1,3) times...
centerlift(Q1)
time = 0 ms. [I*b^2*a^2 + (-1 + I)*b^3*a, -b^4*a^2]
after all this let's check that the canonical height is as expected:
H(Q1)
time = 0 ms. 22/7

and yes, this returns 12/7 [[as above, wrong output due to issue with PARI version...?]]. The Galois-invariant section of height 6/7 should be the sum of Q1 and its conjugate, up to multiplication by -1 and translation by a multiple of our torsion generator P, and indeed...

Q1_sym = elladd(E,Q1,conj(Q1)) Q1_sym == elladd(E,P1,ellpow(E,P,2))
time = 0 ms. 1
so it is. As for the anti-invariant section of height 6:
P2 = ellsub(E,Q1,conj(Q1)); centerlift(P2)
time = 0 ms. time = 0 ms. [(-a^6 - b^3*a^3 - b^4*a^2 - b^6)/(-a^2 + b*a - b^2), ((-1 - I)*a^9 + (-1 + I)*b*a^8 + (1 - I)*b^2*a^7 + (-1 + I)*b^3*a^6 + b^4*a^5 - b^5*a^4 + (1 + I)*b^6*a^3 + (-1 - I)*b^7*a^2 + b^8*a + (-1 + I)*b^9)/(-I*a^3 - I*b^3)]
note that the x-coordinate (a^6 + a^3*b^3 + a^2*b^4 + b^6) / (a+b)^2 is defined over the 3-element field but the y-coordinate isn't. to verify the height is as expected:
vector(7,n,H(elladd(E,P2,ellpow(E,P,n))))
time = 118 ms. [52/7, 54/7, 48/7, 48/7, 54/7, 52/7, 6]

yes, P2 and each of its translates by a multiple of P has canonical height 6.   [[Again, PARI version in Sage issue.]]

-------------------------------------------------------------------\\ An example of rank 4 with a 4-torsion point over Q \\ -------------------------------------------------------------------\\
We conclude by giving an example of a K3 elliptic surface over Q that has a 4-torsion point (and is thus a specialization of E4) and 4 independent sections. We shall compute some of its invariants and find the simplest specializations to elliptic curves over Q that retain the four points' independence.
See http://arxiv.org/pdf/0709.2908 (my "Three lectures on elliptic surfaces and curves of high rank" from Oberwolfach 2007), top of page 9 (typo: the coefficient of X^2 there [a.k.a. a2] should be b, not ab).
E = E4( (8*a-b)*(32*a+7*b), 8*b*(a+b)*(15*a-8*b)*(31*a-7*b) ); E_d = E4( (8*d-1)*(32*d+7), 8*(d+1)*(15*d-8)*(31*d-7) ); E_d == subst(subst(E,a,d),b,1) \\ true: E_d is dehomogenized E P = [0,0] { X_d = [ -15*(d+1)*(31*d-7)*(32*d+7)/4, (8*d-1)*(15*d-8)*(31*d-7)*(32*d+7), -(d+1)*(8*d-1)*(15*d-8)*(32*d+7), -4*(d+1)*(2*d+5)*(15*d-8)*(32*d+7) ]; } ?ellordinate Y_d = truncate(ellordinate(E_d,X_d));
ellordinate(E,x): y-coordinates corresponding to x-ordinate x on elliptic curve E. time = 14 ms. [[657324*d^4 + 4034061/8*d^3 - 1475901/8*d^2 - 192717/8*d + 58653/8, 58900*d^4 + 939075/8*d^3 + 441275/8*d^2 - 49875/8*d - 23275/8], [28569600*d^6 - 32461440*d^5 + 8624344*d^4 + 1254447*d^3 - 546047*d^2 + 13776*d + 3136, -59043840*d^6 + 48929408*d^5 - 6876632*d^4 - 2235367*d^3 + 521710*d^2 - 5047*d - 2744], [921600*d^6 - 378240*d^5 - 762776*d^4 + 525177*d^3 - 41567*d^2 - 26544*d + 3136, 61440*d^6 + 68992*d^5 - 39272*d^4 - 36785*d^3 + 12622*d^2 + 2191*d - 392], [921600*d^6 + 1868160*d^5 + 334864*d^4 - 1149792*d^3 - 389360*d^2 + 198912*d + 50176, 61440*d^6 + 403072*d^5 + 873712*d^4 + 620608*d^3 - 93332*d^2 - 221060*d - 39200]]
yes, ellordinate takes vector inputs for the x-coordinates... [when dealing with elliptic curves whose coefficients are polynomial or rational functions, "ellordinate" expands the necessary square roots in Taylor series about 0, whence the "truncate" command, which works componentwise too]
S_d = vector(4,n,[X_d[n],Y_d[n][1]]) ellisoncurve(E_d,S_d)
time = 0 ms. [1, 1, 1, 1]
... as does ellisoncurve.
Next we form the homogenized list of four sections. (as before we don't have to do this with the torsion generator P as well, because we've put it at (0,0)...)
S = subst(S_d,d,a/b); for(n=1,#S, S[n][1] *= b^4; S[n][2] *= b^6) ellisoncurve(E,S)
time = 0 ms. [1, 1, 1, 1]
[1,1,1,1] again. Now to set up the height computation:
E_d_sing = factor(E_d.disc)
time = 0 ms. [d + 1 4] [8*d - 1 2] [15*d - 8 4] [31*d - 7 4] [32*d + 7 2] [512*d - 113 1] [128*d^3 - 64*d^2 - 48*d + 63 1]
again there's also a multiplicative fiber at infinity, here of type I_4
num_factors = matsize(E_d_sing)[1] + 1; E_sing = matrix(num_factors, 2); { for(n=1, num_factors-1, E_sing[n,1] = b^poldegree(E_d_sing[n,1]) * subst(E_d_sing[n,1], d,a/b); E_sing[n,2] = E_d_sing[n,2] ); } E_sing[num_factors,1] = b; E_sing[num_factors,2] = 4; E_sing E.disc / prod(n=1,num_factors, E_sing[n,1]^E_sing[n,2])
time = 0 ms. 4096
here the constant multiplier not caught by "factor" is 4096 = 2^12.
Now the contribution of the on reducible fibers to the rank of the essential lattice is ...
sum(n=1,num_factors,E_sing[n,2]-1)
time = 0 ms. 14
which comes to 14; add the base and fiber components and four sections to get a Picard number of 2 + 14 + 4 = 20, so we're dealing with a singular elliptic surface. To get its Neron-Severi discriminant, we set up the height-pairing matrix:
M = matrix(#S,#S); \\ a zero matrix of the appropriate size for(i=1,#S, M[i,i] = H(S[i])); { for(i=1,#S,for(j=i+1,#S, M[i,j] = M[j,i] = (H(elladd(E,S[i],S[j])) - M[i,i] - M[j,j]) / 2 )) }
time = 20 ms.
since M has entries in (1/4)*Z it will be easier to read 4*M:
4*M matdet(M)
time = 0 ms. [4 1 -1 1] [1 6 -3 3] [-1 -3 6 -2] [1 3 -2 8] time = 0 ms. 163/64
This gives 163/64. To find the discriminant of the essential lattice, multiply this by the product of the orders of the reducible fibers (again there's a more general formula that does not assume semistability), and divide by the square of the size of the torsion group:
matdet(M) * prod(n=1,num_factors,E_sing[n,2]) / 4^2
time = 0 ms. 163
this comes to 163, so the Neron-Severi discriminant is -163. In fact this surface was obtained working back from -163 to the matrix to the Weierstrass form; by now you might be able to re-do this last step, i.e. using M (and auxiliary information computed along the way) to figure out what the equations for E_d and the four sections should look like and then solving for the undetermined coefficients.
BTW it is no accident that this is also within a factor of 4 of the field discriminant of the one factor of E.disc that has degree >1:
factor(nfdisc(E_d_sing[7,1]))
time = 0 ms. [-1 1] [2 2] [163 1]
Now to specialize as promised, taking care not to choose rational d at which the surface becomes singular:
? ellheightmatrix epsilon = .00000001; H_MAX = 4; { for(denom = 1, H_MAX, for(num = -H_MAX, H_MAX, if(gcd(denom,num) == 1, d0 = num / denom; if(subst(E_d.disc,d,d0) != 0, \\ as in C, this also works without "!= 0" E0 = subst(E_d,d,d0); S0 = subst(S_d,d,d0); E0red = ellglobalred(E0); E0 = ellchangecurve(E0,E0red[2]); S0 = ellchangepoint(S0,E0red[2]); \\ yes, "ellchangepoint" also works on a vector of points E0 = ellinit(E0); \\ to get the transcendental invariants needed to compute heights over Q M0 = ellheightmatrix(E0,S0); D0 = matdet(M0); if(D0 > epsilon, print([d0, E0red[1], D0])) ) ))) }
ellheightmatrix(E,x): gives the height matrix for vector of points x on elliptic curve E, assume to be a minimal model. [-4, 2846265422022, 310.93002406768064195691720412486033759] [-3, 233349990, 25.298276065478607810141226758063776503] [-2, 56812995198, 120.99297716060952185660964984726008387] [3, 10008103312122, 281.67246863185724832688179049835268459] [-3/2, 64362962391, 141.79873104931732082844183928508083402] [3/2, 7675594575, 97.512348946194753497139609144060503966] [-4/3, 12186878746350, 217.37605436671490700423800753924637694] [-2/3, 428673610734, 254.57170703726013011927761192015996712] [2/3, 203520480150, 86.991553111027055505981626430109620882] [4/3, 162699613147302, 351.96366065415020884500356068388196696] [-1/4, 4426772832, 127.61092517054205680849923140808375559] time = 22 ms.
E0 = ellinit(E0);
time = 0 ms.
we find 11 such specializations, with the smallest conductors arising at d = -3, -1/4, and 3/2, namely 233349990 = 2 3 5 17 53 89 97, 4426772832 = 2^5 3^2 23 47 59 241, and 7675594575 = 3 5^2 11 29 31 79 131.
One can then look for specializations of even higher rank; the current record rank of 12 for this torsion group was obtained this way by taking d = 18745/6321. But that's a story for a different occasion...