/*
Base fields:
orbit 39ij: Q(a,r1)
orbit 39gh: Q(a,r1)
orbit 39bf: Q(a,r1)
orbit 39acde: Q(a,r1,b1)
SIC fields:
orbit 39ij (ray class field): Q(a,r1,r2,b2,b3,b4,b5,b7,ir3) (degree 768)
orbit 39gh: Q(a,r1,r2,b1,b2,b3,b4,b5,b7,ir3) (degree 1536)
orbit 39bf: Q(a,r1,r2,b2,b3,b4,b5,b6,b7,ir3) (degree 2304)
orbit 39acde: Q(a,r1,r2,b1,b2,b3,b4,b5,b6,b7,ir3) (degree 4608)
*/
P0:=PolynomialRing(RationalField());
Fa:=NumberField(x0^2-10);
Pa:=PolynomialRing(Fa);
Fr1:=NumberField(xa^2-20);
Pr1:=PolynomialRing(Fr1);
Fr2:=NumberField(xr1^2-13);
Pr2:=PolynomialRing(Fr2);
Fb1:=NumberField(xr2^2-3*r1-18);
Pb1:=PolynomialRing(Fb1);
Fb2:=NumberField(xb1^2-(18*r2+78));
Pb2:=PolynomialRing(Fb2);
Fb3:=NumberField(xb2^2-(4*a+15)*(r1+5));
Pb3:=PolynomialRing(Fb3);
Fb4:=NumberField(xb3^2 - (2*a-5)*(r1-2)*b3-(8*a-35)*(r1-10));
Pb4:=PolynomialRing(Fb4);
// Irreducibility of the remaining defining polynomials was checked indirectly, using the argument described below.
Fb5:=NumberField(xb4^3 - 507*xb4 + 169: Check:=false);
Pb5:=PolynomialRing(Fb5);
Fb6:=NumberField(xb5^3 - 39*xb5 + a - 45 : Check:=false);
Pb6:=PolynomialRing(Fb6);
Fb7:=NumberField(xb6^2 + 6*a - 3: Check:=false);
Pb7:=PolynomialRing(Fb7);
F:=NumberField(xb7^2+3: Check:=false);
P:=PolynomialRing(F);
tau:=(((1/121680*r2 - 1/28080)*b2 + (-1/4680*r2 + 1/4680))*b5^2 + ((-1/2340*r2 + 1/540)*b2 + (-1/585*r2 - 1/90))*b5 + ((-1/360*r2 + 7/270)*b2 + (41/360*r2 - 11/360)))*ir3 + ((-1/40560*r2 + 1/9360)*b2 + (-1/4680*r2 + 1/4680))*b5^2 + ((1/780*r2 - 1/180)*b2 + (-1/585*r2 - 1/90))*b5 + (1/120*r2 - 7/90)*b2 + 41/360*r2 - 11/360;
/*
CHECKING IRREDUCIBILITY OF DEFINING POLYNOMIALS OF Fb5, Fb6, Fb7, F.
The tower is too big to do this directly in a reasonable amount of time, so adopt an indirect approach.
We first check that the defining polynomials in the towers
E1=Q(a,r1,r2,b1,b2,b3,b4,b7,ir3) (degree 512)
and
E2:=Q(a,b5,b6) (degree 18)
are irreducible, and that E2 is a normal extension of Q.
We next observe that the minimal polynomial of b6 must be irreducible over E1. For suppose otherwise.
Then E1 would contain a degree 3 element, which is impossible as 512 is coprime to 3. So the defining polynomials in the tower
E3=Q(a,r1,r2,b1,b2,b3,b4,b7,ir3,b6) (degree 1536)
are irreducible.
Now suppose that the minimal polynomial of b5 was not irreducible over E3. Then one of its roots, call it c, would be in E3.
The fact that E2 is normal over Q means that c would also be in E2. So c is in the intersection of E2 and E3, call it G.
deg(G) must divide GCD(deg(E2),deg(E3)) = 6. On the other hand Q(a,b6) is a subfield of G. So G=Q(a,b6), implying that c is in Q(a,b6).
But this would mean that the minimal polynomial of b5 is reducible over E, which we know is not the case.
We conclude that the defining polynomials in
Q(a,r1,r2,b1,b2,b3,b4,b7,ir3,b6, b7)
are irreducible, as required.
*/