"Source: Text/Geometry/AlgSrf.text";
"Line: 3096";
"Date: Thu Sep 25 14:47:45 2025";
"Main: Fri Sep 26 14:29:19 2025";
// original file: Text/Geometry/AlgSrf.text, line: 3096
// Example: H126E16 ()
print "Example: H126E16";
ei := GetEchoInput();
SetEchoInput(true);
P<x,y,z,t> := ProjectiveSpace(Rationals(),3);
S := Surface(P,
z^2*t^7-x^8*t-8*x^7*t*y-4*x^6*t^2*y-24*x^6*t*y^2-24*x^5*t^2*y^2-
4*x^6*y^3-32*x^5*t*y^3-52*x^4*t^2*y^3-24*x^5*y^4-32*x^4*t*y^4-
48*x^3*t^2*y^4-52*x^4*y^5-64*x^3*t*y^5-16*x^2*t^2*y^5-48*x^3*y^6-
96*x^2*t*y^6-16*x^2*y^7-64*x*t*y^7-16*t*y^8);
dsds,typ := ResolveSingularSurface(S);
typ;  // resolution of blow-up type
#dsds; // 5 conjugacy classes of singular points
IntersectionMatrix(dsds[1]); // 2 conjugate A3 singularities
IntersectionMatrix(dsds[2]); // 2 conjugate A1 singularities
IntersectionMatrix(dsds[3]); // 2 more conjugate A1 singularities
IntersectionMatrix(dsds[4]); // 11-component singular point
 // 38-component singular point
IntersectionMatrix(dsds[5] : get_self_ints := false);
GeometricGenusOfDesingularization(S);
HomAdjoints(1,0,S);
P1<u,v> := Curve(ProjectiveSpace(Rationals(),1));
fib_map := map<S->P1|[x,y]>;
bs := ReducedSubscheme(BaseScheme(fib_map));
bs;
// bs is just the two rational singular points
f1 := Complement((P1![1,1])@@fib_map,bs);
GroebnerBasis(f1);
IsIrreducible(f1); IsReduced(f1);
Genus(Curve(f1));
imats := [*IntersectionMatrix(dsds[i]) : i in [1..4]*];
imat5 := IntersectionMatrix(dsds[5] : get_self_ints := false);
imat5 := imat5 + DiagonalMatrix([-2 : i in [1..33]] cat [-3,-3,-3,-4,-3]);
Append(~imats,imat5);
dms := [DifferentialMultiplicities(dsd) : dsd in dsds];
i2 := &+[(m*imats[i]*Transpose(m))[1,1] where m is Matrix(Vector(dms[i])) :
             i in [1..5]];
d := Degree(S); // d=9
K2 := d*(d-4)^2+i2;
K2;
time m1s,others := ExceptionalDivisors(S);
m1s; // The (-1)-curves
others; // the other curves to be contracted
C,_,mp := BlowUpDivisor(S,dsds[4],11);
mp := Restriction(mp,C,S : Check := false);
fmpC := Expand(mp*fib_map);
// manually remove common factors from defining equations to
// get the fibre map from C to P^1
fmpC := map<C->P1|[e div g : e in DefiningPolynomials(fmpC)]> where
  g is GCD(DefiningPolynomials(fmpC));
C; fmpC;
Image(fmpC); // It's onto!
C,_,mp := BlowUpDivisor(S,dsds[5],34);
mp := Restriction(mp,C,S : Check := false);
fmpC := Expand(mp*fib_map);
fmpC := map<C->P1|[e div g : e in DefiningPolynomials(fmpC)]> where
  g is GCD(DefiningPolynomials(fmpC));
C; fmpC;
Image(fmpC); // C maps to [-2:1]
// |H+K| divisor map is the (1,1)-adjoint map : HomAdjoints gives
// defining polynomials
HKeqns := HomAdjoints(1,1,S);
#HKeqns; // It's into P^30
SetEchoInput(ei);
