# $Source: /u/maple/research/lib/algcurves/src/RCS/genus_fx_plus_gy,v $ # $Notify: mvanhoei@daisy.uwaterloo.ca $ # Purpose of this file: compute the genus in an efficient way for curves # of the form (polynomial in x) + (polynomial in y). macro( genus_fx_plus_gy=`algcurves/genus_fx_plus_gy`, pq_formula=`algcurves/pq_formula` ): macro( g_factors=`algcurves/g_factors`, g_ext_r=`algcurves/g_ext_r` ): # Input: a polynomial f(x) and a polynomial g(y) # Output: consider the curve F(x,y)=f(x)+g(y), and the morphism # (x,y,z) -> (x,z) to P^1. Then compute S = Sum (e_P-1) where e_P are # the ramification indices of this morphism. genus_fx_plus_gy:=proc(f,g,x,y) local S,v,w,i,j,m; option `Copyright (c) 1996 Waterloo Maple Inc. All rights reserved. Author: M. van Hoeij`; # F:=f+g: # The sum of the e_P's at the line at infinity S:=pq_formula(degree(g,y),degree(g,y)-degree(f,x)); # Now for the finite points, determine the possible y coordinates # of ramification points: v:=g_factors(diff(g,y),y,g_ext_r([args])); for i in v do # # Determine the x coordinates: # w:=evala(Sqrfree(numer(subs(y=RootOf(i[1],y),F)),x))[2]; # S:=S+convert([seq(pq_formula(i[2]+1,j[2]) # *degree(j[1],x)*degree(i[1],y),j=w)],`+`) # the following is quicker: m:=sqrfree(numer(resultant(x-g,i[1],y)),x)[2][1]; w:=sqrfree(numer(resultant(f+y,subs(x=y,m[1]),y)),x)[2]; S:=S+m[2]*add(pq_formula(i[2]+1,j[2]) *degree(j[1],x),j=w) od; # Now apply the Hurwitz formula and return the genus: S/2+1-degree(g,y) end: # If a curve looks locally at 0 like y^p - x^q, then the Puiseux expansions are # of the form y=x^{q/p} * (the p different p'th roots of unity) + higher terms. # Then the ramification indices are denom(q/p), and the number of places at # (x,y)=(0,0) is p/denom(q/p). So the sum of (e_P-1), where e_P is the # ramification index, this sum taken over the places P at (0,0) is the # following (denom(q/p)-1)*p/denom(q/p), which is: pq_formula:=proc(p,q) option `Copyright (c) 1996 Waterloo Maple Inc. All rights reserved. Author: M. van Hoeij`; p-p/denom(q/p) end: #savelib('genus_fx_plus_gy','pq_formula'):