/* ****************** CoeffEqs ********************* */

/* This script computes the 240 lines of the Del Pezzo surface 

	w^2 = x^6 + y^6 + z^3

It uses the equations for the coefficients of the exceptional curves
obtained with the script "lines". Recall an exceptional curve has equations
z = a*x^2 + b*x*y + c*y^2, w = \pm (r*x^3 + s*x^2* t*x*y^2 + u*y^3).
Playing around with MAGMA it is easy to see that the equations for
the coefficients all split completely in Q(cbroot(2),cbroot(-1)). We exploit
this to compute the coefficients explicitly and the intersection pairing
of exceptional curves. */

R<d, e> := PolynomialRing(RationalField(),2);
Q<s,t> := quo< R | d^3 - 2, e^2 - e + 1>;
P<x,y,z,w,a,b,c> := PolynomialRing(Q,7);

// "family number #" denotes the family in the output of "lines"

/* For family n, bn gives the possible values of b (in the form b - value);
 ditto for cn, an. The purpose of pn, qn and rn is to put bn, cn, an, respectively, 
 in a more presentable form. */ 

b1 := Factorization(b^3 - 12*b^2 + 12*b - 6);
p1 := [ -Reductum(factr[1]) : factr in b1 ];
c1 := [ Factorization(c^3 + 24/11*p1[i]^2 - 36/11*p1[i] + 20/11) : i in [1..#p1]];
q1 := [ -Reductum(factr[i][1]) : i in [1..#p1], factr in c1 ];
a1 := [ Factorization(a + 5/22*q1[j]^2*p1[i]^2 - 57/22*q1[j]^2*p1[i] 
            + 14/11*q1[j]^2) : j in [(i-1)*#p1 + 1..i*#p1], i in [1..#p1] ];
r1 := [ -Reductum(factr[1][1]) : factr in a1 ];

// values of a,b,c for family number 2 of curves characterized by b:

b2 := Factorization(b^3 - 2);
p2 := [ -Reductum(factr[1]) : factr in b2 ];
c2 := [ Factorization(c) : i in [1..#p2]];
q2 := [ -Reductum(factr[1][1]) :  factr in c2 ];
a2 := [ Factorization(a) : i in [1..#p2] ];
r2 := [ -Reductum(factr[1][1]) : factr in a2 ];

// values of a,b,c for family number 5 of curves characterized by b:

b3 := Factorization(b^3 + 12*b^2 + 12*b + 6);
p3 := [ -Reductum(factr[1]) : factr in b3 ];
c3 := [ Factorization(c^3 + 24/11*p3[i]^2 + 36/11*p3[i] + 20/11) : i in [1..#p3]];
q3 := [ -Reductum(factr[i][1]) : i in [1..#p3], factr in c3 ];
a3 := [ Factorization(a + 5/22*q3[j]^2*p3[i]^2 + 57/22*q3[j]^2*p3[i] 
              + 14/11*q3[j]^2) : j in [(i-1)*#p3 + 1..i*#p3], i in [1..#p3] ];
r3 := [ -Reductum(factr[1][1]) : factr in a3 ];

// values of a,b,c for family number 3 of curves characterized by b:

b4 := Factorization(b^3 + 2);
p4 := [ -Reductum(factr[1]) : factr in b4 ];
c4 := [ Factorization(c) : i in [1..#p4]];
q4 := [ -Reductum(factr[1][1]) : factr in c4 ];
a4 := [ Factorization(a) : i in [1..#p4] ];
r4 := [ -Reductum(factr[1][1]) : factr in a4 ];

// values of a,b,c for family number 5 of curves characterized by b:

b5 := Factorization(b);
p5 := [ -Reductum(factr[1]) : factr in b5 ];
c5 := Factorization(c*(c^3 + 4));
c52 := Factorization(c^3 + 1);
q5prov :=[ [ -Reductum(factr[1]) : factr in c5],[ -Reductum(factr[1]) : factr in c52]];
q5 := [ q5prov[i][j] : j in [1..#q5prov[i]], i in [1..#q5prov]];
a5 := [ Factorization((a^3+1)*(q5[i]^3 + 1)) : i in [1..#c5] ];
a52 := [ Factorization(a^4 - a*q5[i]^6 - 4*a*q5[i]^3 + a) : i in [#c5+1..#q5]];
r5prov := [ [-Reductum(factr[i][1]) : i in [1..#factr], factr in a5],
                   [ -Reductum(factr[i][1]) : i in [1..#factr], factr in a52]];
r5 := [ r5prov[i][j] : j in [1..#r5prov[i]], i in [1..#r5prov]];

// values of a,b,c for family number 6 of curves characterized by b:

b6 := Factorization(b^6 + 108);
p6 := [ -Reductum(factr[1]) : factr in b6 ];
c6 := Factorization(c^6 - 4*c^3 - 32);
q6 := [ -Reductum(factr[1]) : factr in c6 ];
a6 := [ Factorization(a - 1/48*q6[j]^5*p6[i]^2 + 1/12*q6[j]^2*p6[i]^2) 
             : j in [1..#q6], i in [1..#p6] ];
r6 := [ -Reductum(factr[1][1]) : factr in a6 ];

// values of a,b,c for family number 7 of curves characterized by b:

b7 := Factorization(b^6 - 12*b^5 + 132*b^4 - 132*b^3 + 72*b^2 - 72*b + 36);
p7 := [ -Reductum(factr[1]) : factr in b7 ];
c7 := [ Factorization(c^3 + 1/55*p7[i]^5 - 1/5*p7[i]^4 + 111/55*p7[i]^3 
               - 6/55*p7[i]^2 + 6/55*p7[i] - 26/55) : i in [1..#p7]];
q7 := [ -Reductum(factr[i][1]) : i in [1..#factr], factr in c7 ];
a7 := [ Factorization(a - 17/3960*q7[j]^2*p7[i]^5 + 13/440*q7[j]^2*p7[i]^4 
             - 13/40*q7[j]^2*p7[i]^3 - 1373/660*q7[j]^2*p7[i]^2 - 39/220*q7[j]^2*p7[i] 
             + 39/220*q7[j]^2) : j in [(i-1)*3 + 1..i*3], i in [1..#p7] ];
r7 := [ -Reductum(factr[1][1]) : factr in a7 ];

// values of a,b,c for family number 8 of curves characterized by b:

b8 := Factorization(b^6 + 12*b^5 + 132*b^4 + 132*b^3 + 72*b^2 + 72*b + 36);
p8 := [ -Reductum(factr[1]) : factr in b8 ];
c8 := [ Factorization(c^3 - 1/55*p8[i]^5 - 1/5*p8[i]^4 - 111/55*p8[i]^3 
            - 6/55*p8[i]^2 - 6/55*p8[i] - 26/55) : i in [1..#p8]];
q8 := [ -Reductum(factr[i][1]) : i in [1..#factr], factr in c8 ];
a8 := [ Factorization(a + 17/3960*q8[j]^2*p8[i]^5 + 13/440*q8[j]^2*p8[i]^4 
           + 13/40*q8[j]^2*p8[i]^3 - 1373/660*q8[j]^2*p8[i]^2 + 39/220*q8[j]^2*p8[i] 
           + 39/220*q8[j]^2) : j in [(i-1)*3 + 1..i*3], i in [1..#p8] ];
r8 := [ -Reductum(factr[1][1]) : factr in a8 ];