# Input: a square-free polynomial P of degree 4 or 5, representing a 5 point subset S # of C union {infinity}. Here infinity is in S iff P has degree 4. # # Output: An element of C that is invariant under Mobius transformations applied to S. # # Note: The input must be square-free, otherwise the program causes a division by 0. I5 := proc(P,x) local c0,c1,c2,c3,i; if lcoeff(P,x)<>1 then return procname(collect(P/lcoeff(P,x),x,evala),x) # From now on P will be monic elif degree(P,x)<>5 then # Handle the case that the degree is not 5: return I4_and_infinity(P,x) # From now on P is monic of degree 5. elif coeff(P,x,4) <> 0 then return procname(collect( eval(P, x = x - coeff(P,x,4)/5),x,evala),x) # After this, P = x^5 + c3*x^3 + c2*x^2 + c1*x + c0 for some c.i fi; c0,c1,c2,c3 := seq(coeff(P,x,i), i=0..3); # # Remark: the formula inside "evala" below was computed as follows: # # P5 := x^5 + c3*x^3 + c2*x^2 + c1*x + c0; # c0 := solve( subs(x=p, P5), c0); # P5 := collect(subs(x = x+p, P5),x,normal); # P5 := factor(subs(x=1/x, P5)); # P4 := numer(P5); # P4 := collect(P4/lcoeff(P4,x), x, factor); # INV := I4_and_infinity(P4,x); # INV := factor(evala(subs(p = RootOf(c0-c00,p), INV))); # unassign('c0'); subs(c00 = c0, INV); # # The denominator of the formula is discrim(P,x) # which is non-zero iff P is square-free. # evala( (6*c1*c3^3-2*c2^2*c3^2+25*c0*c2*c3+40*c1^2*c3-15*c1*c2^2+625*c0^2)^2/(108*c0^2*c3^5-72*c0*c1*c2*c3^4+16*c0*c2^3*c3^3+16*c1^3*c3^4-4*c1^2*c2^2*c3^3-900*c0^2*c1*c3^3+825*c0^2*c2^2*c3^2+560*c0*c1^2*c2*c3^2-630*c0*c1*c2^3*c3+108*c0*c2^5-128*c1^4*c3^2+144*c1^3*c2^2*c3-27*c1^2*c2^4-3750*c0^3*c2*c3+2000*c0^2*c1^2*c3+2250*c0^2*c1*c2^2-1600*c0*c1^3*c2+256*c1^5+3125*c0^4) ) end: # A FivePointInvariant, with 4 points given by a monic square-free polynomial P, and the 5'th point is infinity: I4_and_infinity := proc(P,x) local c0,c1,c2,c3,i; if degree(P,x)<>4 or lcoeff(P,x)<>1 then error "Input must be monic of degree 4" fi; c0,c1,c2,c3 := seq(coeff(P,x,i), i=0..3); # # Remark: The formula used here was found by the following computation: # # unassign('c0','c1','c2','c3'); # P4 := x^4 + c3*x^3 + c2*x^2 + c1*x + c0; # R := RootOf(P4,x); # P3 := evala(Normal( P4/(x-R) )); # F := algcurves[j_invariant](y^2 - P3, x,y); # F := evala(Trace(F)); # this is the sum of the j's of the 4 subsets of S that contain infinity # F := factor( F + algcurves[j_invariant](y^2 - P4, x,y) ); # this added j( S minus {infinity} ) # Next, we added and multiplied by suitable constants to reduce the size of the expression. Result: # evala( (6*c1*c3^3-2*c2^2*c3^2-15*c0*c3^2-19*c1*c2*c3+6*c2^3+40*c0*c2+9*c1^2)^2/(-27*c0^2*c3^4+18*c0*c1*c2*c3^3-4*c0*c2^3*c3^2-4*c1^3*c3^3+c1^2*c2^2*c3^2+144*c0^2*c2*c3^2-6*c0*c1^2*c3^2-80*c0*c1*c2^2*c3+16*c0*c2^4+18*c1^3*c2*c3-4*c1^2*c2^3-192*c0^2*c1*c3-128*c0^2*c2^2+144*c0*c1^2*c2-27*c1^4+256*c0^3) ) end: # Input: a square-free polynomial P of degree 4 or 5, representing a 5 point subset S # of C union {infinity}. Here infinity is in S iff P has degree 4. # # Output: An element of C that is invariant under Mobius transformations applied to S. # # Note: The input must be square-free, otherwise the program causes a division by 0. I5tilde := proc(P,x) local c0,c1,c2,c3,i; if lcoeff(P,x)<>1 then return procname(collect(P/lcoeff(P,x),x,evala),x) # From now on P will be monic elif degree(P,x)<>5 then # Handle the case that the degree is not 5: return I4tilde_and_infinity(P,x) # From now on P is monic of degree 5. elif coeff(P,x,4) <> 0 then return procname(collect( eval(P, x = x - coeff(P,x,4)/5),x,evala),x) # After this, P = x^5 + c3*x^3 + c2*x^2 + c1*x + c0 for some c.i fi; c0,c1,c2,c3 := seq(coeff(P,x,i), i=0..3); # The formula inside "evala" below was computed in the same way as in program I5. evala( (1536000*c3*c1^7-576000*c2^2*c1^6-268800*c3^3*c1^6+516800*c3^2*c2^2*c1^5-13760000*c0*c3*c2*c1^5+36224*c3^5*c1^5-1600000*c0^2*c1^5-244600*c3*c2^4*c1^4+4880000*c0*c2^3*c1^4-117760*c3^4*c2^2*c1^4-872000*c0*c3^3*c2*c1^4-224*c3^7*c1^4+6200000*c0^2*c3^2*c1^4+30575*c2^6*c1^3+120590*c3^3*c2^4*c1^3-942000*c0*c3^2*c2^3*c1^3+4572*c3^6*c2^2*c1^3+39050000*c0^2*c3*c2^2*c1^3+424000*c0*c3^5*c2*c1^3+10000000*c0^3*c2*c1^3+88*c3^9*c1^3+4560000*c0^2*c3^4*c1^3-55810*c3^2*c2^6*c1^2+771125*c0*c3*c2^5*c1^2-4536*c3^5*c2^4*c1^2-13421875*c0^2*c2^4*c1^2-480700*c0*c3^4*c2^3*c1^2-184*c3^8*c2^2*c1^2+5522500*c0^2*c3^3*c2^2*c1^2-23380*c0*c3^7*c2*c1^2-26750000*c0^3*c3^2*c2*c1^2-758500*c0^2*c3^6*c1^2+3125000*c0^4*c3*c1^2+11520*c3*c2^8*c1-99000*c0*c2^7*c1+1356*c3^4*c2^6*c1+192300*c0*c3^3*c2^5*c1+72*c3^7*c2^4*c1-3099375*c0^2*c3^2*c2^4*c1+18840*c0*c3^6*c2^3*c1-36093750*c0^3*c3*c2^3*c1+645750*c0^2*c3^5*c2^2*c1-19921875*c0^4*c2^2*c1+576*c0*c3^9*c2*c1-21937500*c0^3*c3^4*c2*c1+39600*c0^2*c3^8*c1+7968750*c0^4*c3^3*c1-864*c2^10-128*c3^3*c2^8-22800*c0*c3^2*c2^7-8*c3^6*c2^6+165000*c0^2*c3*c2^6-2964*c0*c3^5*c2^5+12125000*c0^3*c2^5-187750*c0^2*c3^4*c2^4-128*c0*c3^8*c2^3+6596875*c0^3*c3^3*c2^3-22800*c0^2*c3^7*c2^2+27421875*c0^4*c3^2*c2^2+165000*c0^3*c3^6*c2+33203125*c0^5*c3*c2-864*c0^2*c3^10+12125000*c0^4*c3^5+68359375*c0^6)*(40*c3*c1^2-15*c2^2*c1+6*c3^3*c1-2*c3^2*c2^2+25*c0*c3*c2+625*c0^2)/(256*c1^5-128*c3^2*c1^4+144*c3*c2^2*c1^3-1600*c0*c2*c1^3+16*c3^4*c1^3-27*c2^4*c1^2-4*c3^3*c2^2*c1^2+560*c0*c3^2*c2*c1^2+2000*c0^2*c3*c1^2-630*c0*c3*c2^3*c1+2250*c0^2*c2^2*c1-72*c0*c3^4*c2*c1-900*c0^2*c3^3*c1+108*c0*c2^5+16*c0*c3^3*c2^3+825*c0^2*c3^2*c2^2-3750*c0^3*c3*c2+108*c0^2*c3^5+3125*c0^4)^2 ) end: # I5tilde(P,x)-9/25*I5(P,x)^2+10*I5(P,x) is a little bit shorter than I5tilde(P,x) # A FivePointInvariant, with 4 points given by a monic square-free polynomial P, and the 5'th point is infinity: I4tilde_and_infinity := proc(P,x) local c0,c1,c2,c3,i; if degree(P,x)<>4 or lcoeff(P,x)<>1 then error "Input must be monic of degree 4" fi; c0,c1,c2,c3 := seq(coeff(P,x,i), i=0..3); # The formula inside "evala" below was computed in the same way as in program I4_and_infinity # except that the j-invariant was replaced by its square. At the end, we added and multiplied # by suitable constants in an effort to reduce the size, the result is: evala( (6*c2^3-2*c3^2*c2^2-19*c1*c3*c2+40*c0*c2+6*c1*c3^3-15*c0*c3^2+9*c1^2)*(88*c2^9-184*c3^2*c2^8+72*c3^4*c2^7-452*c1*c3*c2^7-224*c0*c2^7-8*c3^6*c2^6+1632*c1*c3^3*c2^6+4572*c0*c3^2*c2^6+508*c1^2*c2^6-660*c1*c3^5*c2^5-4536*c0*c3^4*c2^5-3666*c1^2*c3^2*c2^5-15936*c0*c1*c3*c2^5+36224*c0^2*c2^5+72*c1*c3^7*c2^4+1356*c0*c3^6*c2^4-2910*c1^2*c3^4*c2^4-4860*c0*c1*c3^3*c2^4-117760*c0^2*c3^2*c2^4+6020*c1^3*c3*c2^4-2176*c0*c1^2*c2^4-128*c0*c3^8*c2^3+1632*c1^2*c3^6*c2^3+17748*c0*c1*c3^5*c2^3+120590*c0^2*c3^4*c2^3+17735*c1^3*c3^3*c2^3+133220*c0*c1^2*c3^2*c2^3+199360*c0^2*c1*c3*c2^3-2738*c1^4*c2^3-268800*c0^3*c2^3-184*c1^2*c3^8*c2^2-6088*c0*c1*c3^7*c2^2-55810*c0^2*c3^6*c2^2-3666*c1^3*c3^5*c2^2-134455*c0*c1^2*c3^4*c2^2-258160*c0^2*c1*c3^3*c2^2-52285*c1^4*c3^2*c2^2+516800*c0^3*c3^2*c2^2-239728*c0*c1^3*c3*c2^2+2240*c0^2*c1^2*c2^2+576*c0*c1*c3^9*c2+11520*c0^2*c3^8*c2-452*c1^3*c3^7*c2+30588*c0*c1^2*c3^6*c2+127065*c0^2*c1*c3^5*c2+6020*c1^4*c3^4*c2-244600*c0^3*c3^4*c2+244770*c0*c1^3*c3^3*c2-61680*c0^2*c1^2*c3^2*c2+68265*c1^5*c3*c2-857600*c0^3*c1*c3*c2+119304*c0*c1^4*c2+1536000*c0^4*c2-864*c0^2*c3^10+88*c1^3*c3^9-1812*c0*c1^2*c3^8-16890*c0^2*c1*c3^7+508*c1^4*c3^6+30575*c0^3*c3^6-30252*c0*c1^3*c3^5-64635*c0^2*c1^2*c3^4-2738*c1^5*c3^3+406400*c0^3*c1*c3^3-171939*c0*c1^4*c3^2-576000*c0^4*c3^2+508800*c0^2*c1^3*c3-32697*c1^6-678400*c0^3*c1^2)/(16*c0*c2^4-4*c0*c3^2*c2^3-4*c1^2*c2^3+c1^2*c3^2*c2^2-80*c0*c1*c3*c2^2-128*c0^2*c2^2+18*c0*c1*c3^3*c2+144*c0^2*c3^2*c2+18*c1^3*c3*c2+144*c0*c1^2*c2-27*c0^2*c3^4-4*c1^3*c3^3-6*c0*c1^2*c3^2-192*c0^2*c1*c3-27*c1^4+256*c0^3)^2 ) end: # Test: f := x^5 + randpoly(x, degree=4, dense); g := numer(normal(subs( x = (3*x+5)/(7*x-11), f))); if I5(f,x) = I5(g,x) and I5tilde(f,x) = I5tilde(g,x) then lprint("It works") else error "program does not work!" fi; f := x^4 + randpoly(x, degree=3, dense); g := subs(zer=0, numer(normal(subs( x = (2*x-5)/(3*x+7), f*(zer*x-1))))); if I5(f,x) = I5(g,x) and I5tilde(f,x) = I5tilde(g,x) then lprint("It works") else error "program does not work!" fi;