
(* This file contains the large expressions appearing in Sections 3 and 5 
of the paper "A three-paramameter family of Hurwitz-Belyi maps *)

pisemicub[{a_,b_,c_}] := Module[{(* n,orig,first,second *)},
n = a+b+2c;
orig = (y^a (y-1)^b (y^2 + r y + s)^c)/(x^a (x-1)^b (x^2 + r x + s)^c);
first = orig /. r->  (-n x^3 +(a+2 c) x^2 - (a +b) s x+a s)/(((a+b+c)x^2-(a+c) x));
second = (first  /. y-> a s/(n x^2)) 
   /. s->(n  (a+b+c) x^4-2 n (a+c) x^3+ (a+c) (a+2 c) x^2)/((a+b) (a+b+c) x^2-2 a  (a+b+c)x+a (a+c));
Factor[second]]
(* pisemicub[{a,b,c}] runs through the proof of Theorem 3.1 and outputs the
formula of 3.1 *)

fsemicub[{a_,b_,c_}] := 
Module[{n},
n=a+b+2c;
(a^a b^b (n  (n-c) x^2-2 n  (a+c) x+ (a+c) (a+2 c))^(a+c)
 (-n  (a+b) x^2+2 a n x-a (a+2 c))^c
(n  (c-n) x^2+2 a n x- a (a+c))^(b+c)
 -v  2^c c^(2 c) n^n  x^(a+2 c) (x-1)^(b+2 c)
 ((a+b)
    (n-c) x^2 -2 a  (n-c) x+a (a+c))^(n-c))
]
(* fsemicub[{a,b,c}] gives the final formula of Theorem 3.1, in the polynomial form that
it appears at the beginning of Corollary 5.1.  Thus Factor[Solve[fsemicub[{a,b,c}]==0,v][[1]]] 
gives the same output as pisemicub[{a,b,c}] *)

discform[{a_,b_,c_}] := Module[{d},d = a + b + 2 c;
b^(-a + 2*a^2 - b + 6*a*b + 3*b^2 - 2*c + 8*a*c + 12*b*c + 8*c^2)*
a^(-a + 3*a^2 - b + 6*a*b + 2*b^2 - 2*c + 12*a*c + 8*b*c + 8*c^2)*
(a + c)^(2*a^2 - b + 3*a*b + b^2 - c + 7*a*c + 5*b*c + 6*c^2) *
(b+c)^(-a + a^2 + 3*a*b + 2*b^2 - c + 5*a*c + 7*b*c + 6*c^2) *
(a+b)^((-1 + a + b + c)*(a + b + 2*c))*
c^(-2*a + 3*a^2 - 2*b + 6*a*b + 3*b^2 - 3*c + 17*a*c + 17*b*c + 20*c^2)*
d^(d(3d+2)) (a+2c)^((a+2c)^2) (b+2c)^((b+2c)^2) (a+b+c)^((a+b+c)(2 (a+b+c) + 1))* v^(3 d - 7) (v-1)^9 2^(d(2d+c)) (-1)^(Binomial[a,2]+Binomial[b,2]+c)]
(* discform[{a,b,c}] gives the discriminant formula of Corolllary 5.1 *)

checksemicub[{a_,b_,c_}] := Factor[Discriminant[fsemicub[{a,b,c}],x]/discform[{a,b,c}]]
(* this check returns 1 for small (a,b,c).  If one sets v equal to say 2, computations
become substantially easier and it returns 1 for (a,b,c) in a larger range. *)

Pisemicub[{u_,v_,w_}] := pisemicub[{-v - w, -u - w, u + v + w}]
(* switching to symmetric coordinates *)

hurcov = 
((8 x-5)^2 (8 x^2-24 x+15)^3 (8 x^2-8 x+3))/(2^14 (x-1)^3 x^5 (4 x-3)^2)

othercov = (-(8 x-5)^2 (464 x^2-840 x+375)^3 (2528 x^2-4400 x+1875))/
(2^16 5^5 (x-1)^3 x^5 (4   x-3)^2)
