restart: with(algcurves):

The puiseux program can give unnecessarily large answers. Reading the following code into Maple before using the puiseux command will help to prevent one (but not all) of the causes of these large answers, namely it will help to prevent some unnecessary expanding.

`algcurves/lift_exp` := proc(v, f, x, y)

local i, ii, r, res, v7, vv7, v3, ext, a, j, n, np, ram, j3;

if v[5] = 1 then return {v} end if;

v3 := degree(v[3], x);

res := {};

r := v[1] + y*x^v[2];

vv7 := v[7]*v3 + v[2] - 1;

vv7 := vv7 + v[5];

ii := `algcurves/truncate_subs`(subs(x = v[3], f), x, y, r, vv7 + 1,

v[4]);

if ii = 0 then error "degree estimate was wrong" end if;

v7 := (ldegree(ii, x) - v[2])/v3;

r := `algcurves/v_ext_m`(

`algcurves/g_factors`(tcoeff(ii, x), y, v[4]), y);

for i in r do res := res union `algcurves/lift_exp`([

v[1] + x^v[2]*i[1], v[2] + 1, v[3], [op(i[3]), op(v[4])], i[2],

v[6]*i[4], v7, [op(v[8]), [op(1 .. 4, v)]]], f, x, y)

end do;

if add(i[5]*i[6]*degree(i[3], x)/(v[6]*v3), i = res) >

degree(tcoeff(ii, x), y) then error "found wrong number of expansions"

end if;

if v[5] = degree(tcoeff(ii, x), y) then

if ldegree(ii, x) > vv7 then error "degree estimate was wrong"

end if;

return res

end if;

ii := collect(ii, y);

ii := add(`algcurves/normal_tcoeff`(coeff(ii, y, i), x)*y^i,

i = 0 .. degree(ii, y));

np := `algcurves/Newtonpolygon`(ii, x, y);

if nops(np) = 2 and np[1][3] = 0 then

error "found wrong number of expansions"

end if;

for j in np do

if 2 < nops(j) and 0 < j[3] and j[3] < 1 then

r := `algcurves/g_factors`(j[4], x, v[4]);

r := `algcurves/v_ext_m`(r, x);

for i in r do

j3 := j[3] - v[2];

ext := [op(i[3]), op(v[4])];

n := mods(1/numer(j3), denom(j3));

ram := i[1]^n*x^denom(j3);

a := v[2]*denom(j3) - numer(j[3]);

res := res union `algcurves/lift_exp`([collect(

subs(x = ram, v[1])

+ x^a*i[1]^((1 - n*numer(j3))/denom(j3)), x, normal),

a + 1, normal(subs(x = ram, v[3])), ext, i[2],

v[6]*i[4],

(j[2] - j[1]*j[3] - a/degree(ram, x))/degree(v[3], x),

[op(v[8]), [op(1 .. 4, v)]]], f, x, y)

end do

end if

end do;

res

end proc:

A:=(x^2+y)^2*(x^2-y)+a*x*y^3+b*y^4+c*x^3*y^2+d*x^2*y^3+e*x*y^4+f*y^5+g*x^5*y+h*x^4*y^2+j*x^3*y^3+k*x^2*y^4+l*x*y^5+m*y^6;

define polynomial [1] Having three segments where the slope is -2 is just flat out nasty because we will have three different roots. We break this into two cases: all three are the same, two of the roots are the same and one is different. If all three are different then the jets completely split and there are no more cases to consider. So, in this case, by substituting in the proper values for the coefficients of the terms that are represented by points on the Polygon, we ensure that two of the three roots are the same.

puiseux(A,x=0,y,0);

numerator=0 [2]

A1:=eval(A,c=a+g);

reevaluate the polynomial [3]

puiseux(A1,x=0,y,0);

discrim=0 [4]

discrim(2*_Z^2+(a-g)*_Z+h+b-d,_Z);

solve(%,d);

A2:=eval(A1,d=%);

reevaluate polynomial [3]

puiseux(A2,x=0,y,0);

numerator=0 [2]

solve(1/128*a^2*g-5/128*g^2*a+1/128*a^3+3/128*g^3-1/2*e+1/2*j+1/8*h*a-1/8*h*g-1/8*b*a+1/8*b*g,h);

A3:=eval(A2,h=%);

reevaluate polynomial [2]

puiseux(A3,x=0,y,0);

discrim=0 [4]

discrim((128*a-128*g)*_Z^2+(40*g^2*a-8*g^3+24*a^3+256*e-256*j-56*a^2*g)*_Z-16*j*a^2+12*b*a*g^2+32*j*g*a-12*b*a^2*g+a^5+4*b*a^3-4*b*g^3+32*e*a^2+32*e*g^2-4*a^4*g+6*a^3*g^2-4*a^2*g^3+g^4*a+64*k*a-16*j*g^2-64*f*a+64*f*g-64*k*g-64*e*a*g,_Z);

solve(%,k);

A4:=eval(A3,k=%);

reevaluate polynomial [3]

puiseux(A4,x=0,y,0);

numerator=0 [2]

solve(2048*b*g^2*e-2048*b*g^2*j-4096*a*b*e*g+128*a^3*g*j+256*g^2*a^2*e-2048*e*a*j-128*a*g^3*j+10240*e*g*j-384*a^3*g*e-256*g^2*a^2*j+384*a*g^3*e+4096*a*b*j*g+7*a^5*g^2-a^4*g^3-11*a^3*g^4-a^6*g+5*g^5*a^2+5*a*g^6-320*g^4*e+192*g^4*j+64*a^4*e+64*a^4*j+3072*e^2*a-7168*e^2*g-1024*j^2*a-3072*j^2*g-3*g^7-a^7+3072*f*a^2*g-3072*f*a*g^2+128*b*a^3*g^2+128*b*a^2*g^3-192*b*a*g^4-192*b*a^4*g+64*b*a^5+64*b*g^5-1024*f*a^3+1024*f*g^3+8192*a*l*g-4096*a^2*l-4096*l*g^2+2048*a^2*b*e-2048*a^2*b*j,l);

A5:=eval(A4,l=%);

reevaluate polynomial [3]

puiseux(A5,x=0,y,0);

discrim=0 [4]

discrim(-2752*g^5*a*e-8832*a^3*g^3*e-98304*e^2*j-12992*a^5*e*g+14336*b*g^4*j-14336*b*g^4*e+27648*e^2*g^3+3072*f*a*g^4-11*g^8*a+1120*g^6*e+3072*f*a^4*g-32768*m*g^3-699*a^8*g-2048*f*a^2*g^3-2048*f*a^3*g^2+1888*b*g^5*a^2-73728*b*g^2*a^2*e+73728*b*g^2*a^2*j-30720*g^3*e*j-27648*e^2*a^2*g-96*g^7*a^2-18432*g^2*a*e*j+129024*a^2*g*j*e+1866*g^4*a^5+27648*e^2*a^3+11040*b*g^3*a^4-7200*b*g^4*a^3-10240*b*a^4*e+10240*b*a^4*j+1696*g^2*a^7+98304*e*j^2-45056*b*a^3*j*g+424*g^6*a^3+3680*e*a^6-1046*g^5*a^4-2264*g^3*a^6+224*b*g^6*a+19136*a^5*g*j-101376*a^2*g*j^2-160*b*g^7+3488*a^2*g^4*e-7328*a^2*g^4*j-864*j*g^6+3072*j^2*g^3+121*a^9+32768*e^3+9*g^9-32768*j^3+52224*j^2*a^3-4960*j*a^6-32768*f*g^2*e+32768*f*g^2*j-32768*f*a^2*e+32768*f*a^2*j-65536*f*a*g*j+65536*f*a*g*e+65536*b*e*j*g-32768*b*e^2*g-32768*b*j^2*g-65536*a*b*e*j-98304*a^2*m*g+98304*a*m*g^2+32768*a*b*e^2+32768*a*b*j^2+32768*a^3*m+53248*b*g^3*e*a-53248*b*g^3*j*a-27808*a^4*g^2*j+19072*a^3*g^3*j+3616*b*a^6*g+16288*a^4*g^2*e-79872*a^3*j*e+(5632*a^6+512*g^6-212992*j*g^2*a-24576*a^5*g-36864*a^3*g^3+114688*e*g^2*a+81920*e*a^3-180224*e*a^2*g+42496*a^4*g^2+278528*j*a^2*g+16896*a^2*g^4-16384*e*g^3-16384*b*a^4+65536*b*a*g^3-114688*j*a^3+49152*j*g^3-4096*g^5*a+65536*b*a^3*g-98304*b*a^2*g^2-16384*b*g^4)*_Z-1024*f*a^5+(-196608*a^2*g-65536*g^3+65536*a^3+196608*g^2*a)*_Z^2-1024*f*g^5-8800*b*g^2*a^5+45056*b*a^3*e*g-27648*g^2*a*e^2+2752*g^5*a*j+46080*g^2*a*j^2-608*b*a^7,_Z);

factor(%);

Because the discriminant factors, we have two cases to consider. Case B is the shorter factor.

B:=eval(A5,a=g);

Error, numeric exception: division by zero

Back to case A

solve(-992*g^5*a*e+1216*a^3*g^3*e-49152*e^2*j-224*a^5*e*g+4096*b*g^4*j-6144*b*g^4*e+14336*e^2*g^3+1536*f*a*g^4-12*g^8*a+528*g^6*e+1536*f*a^4*g-16384*m*g^3-3*a^8*g-1024*f*a^2*g^3-1024*f*a^3*g^2-368*b*g^5*a^2-512*a^5*b^2-18432*b*g^2*a^2*e+6144*b*g^2*a^2*j-18432*g^3*e*j+4096*e^2*a^2*g-4*g^7*a^2+16384*g^2*a*e*j+6144*a^2*g*j*e-20*g^4*a^5+1024*e^2*a^3+560*b*g^3*a^4-240*b*g^4*a^3-2048*b*a^4*j+4*g^2*a^7+512*b^2*g^5+49152*e*j^2-2560*a*b^2*g^4+2048*b*a^3*j*g+28*g^6*a^3+80*e*a^6-10*g^5*a^4+12*g^3*a^6+400*b*g^6*a+224*a^5*g*j-4096*a^2*g*j^2-112*b*g^7-208*a^2*g^4*e+400*a^2*g^4*j-336*j*g^6+6144*j^2*g^3+16384*e^3+5*g^9-16384*j^3+1024*j^2*a^3-16*j*a^6-16384*f*g^2*e+16384*f*g^2*j-16384*f*a^2*e+16384*f*a^2*j-32768*f*a*g*j+32768*f*a*g*e+32768*b*e*j*g-16384*b*e^2*g-16384*b*j^2*g-32768*a*b*e*j-49152*a^2*m*g+49152*a*m*g^2+16384*a*b*e^2+16384*a*b*j^2+16384*a^3*m+2560*a^4*b^2*g-5120*a^3*b^2*g^2+5120*a^2*b^2*g^3+18432*b*g^3*e*a-10240*b*g^3*j*a-48*a^4*g^2*j-704*a^3*g^3*j-80*b*a^6*g-400*a^4*g^2*e-4096*a^3*j*e-512*f*a^5-512*f*g^5-208*b*g^2*a^5+6144*b*a^3*e*g-19456*g^2*a*e^2+480*g^5*a*j-3072*g^2*a*j^2+48*b*a^7,m);

A6:=eval(A5,m=%);

reevaluate polynomial [2]

puiseux(A6,x=0,y,0);

numerator=0 [2]

factor(-18*g^10-a^10-25600*e^2*a^3*g+19456*e^2*a^2*g^2+62464*e^2*g^3*a-5120*j^2*a^3*g+27648*j^2*a^2*g^2+9216*j^2*g^3*a-2080*b*g^4*a^4+1536*b*g^5*a^3+128*b*g^3*a^5+368*e*g^3*a^4-4976*e*g^4*a^3+4096*e*j*a^4+79872*e*j*g^4-16384*f*g^4*b-80*j*a^6*g-1296*j*a^5*g^2+4096*b*a^5*e+944*j*g^3*a^4+2768*j*g^4*a^3-2160*j*g^5*a^2+512*f*a^6-24576*b*a^3*j*g^2-360448*b*e*j*g^2-98304*a^2*b*e*j-180224*f*g^2*e*a+81920*f*g^2*j*a+114688*f*a^2*e*g-16384*f*a^2*j*g-294912*b*e^2*g*a-163840*b*j^2*g*a+1536*f*g^6+3*a^9*g+14*a^8*g^2+112*j*a^7+27*g^8*a^2+39*g^9*a+1296*j*g^7+432*b*g^8-16*b*a^8-1968*e*g^7-80*e*a^7-32*a^7*g^3-34*a^6*g^4+94*a^5*g^5+12*a^4*g^6-104*a^3*g^7+2048*e^2*a^4-58368*e^2*g^4-4096*j^2*a^4-27648*j^2*g^4+30720*e*j*g*a^3-59392*e*j*g^2*a^2-55296*e*j*g^3*a-16384*a^4*f*b-17920*a^2*b^2*g^4-1584*j*g^6*a+896*b*g^6*a^2-1408*b*g^7*a-256*b*a^7*g+768*b*a^6*g^2+2000*e*g^5*a^2+3216*e*g^6*a-400*e*a^6*g+1840*e*a^5*g^2+49152*e^3*a-245760*e^3*g+49152*j^3*a+147456*j^3*g+81920*f*g^3*e-49152*f*g^3*j-16384*f*a^3*e-16384*f*a^3*j+212992*b*e^2*g^2+147456*b*j^2*g^2+81920*a^2*b*e^2+16384*a^2*b*j^2+2560*a^4*b^2*g^2+10240*a^3*b^2*g^3-49152*e^2*j*a+638976*e^2*j*g-5120*a^5*b^2*g+11264*b^2*g^5*a-49152*e*j^2*a-540672*e*j^2*g+1536*f*g^4*a^2-4096*f*g^5*a+4096*f*g^3*a^3-3584*f*a^4*g^2+26624*b*g^5*e-18432*b*g^5*j+458752*b*e*j*g*a+45056*b*g^3*e*a^2-69632*b*g^4*e*a-12288*b*g^3*j*a^2+40960*b*g^4*j*a-22528*b*a^4*e*g+16384*b*a^3*e*g^2+14336*b*a^4*j*g-32768*b^2*g^3*e+32768*b^2*g^3*j+98304*a*b^2*e*g^2-98304*a*b^2*j*g^2+65536*a*f*b*g^3+65536*a^3*f*b*g+98304*a^2*b^2*j*g-98304*a^2*b^2*e*g-98304*a^2*f*b*g^2+32768*a^3*b^2*e-32768*a^3*b^2*j+1536*a^6*b^2-2560*b^2*g^6);

Case C: short factor=0; Case A: long factor=0 [7]

solve(32*e*a-160*e*g-2*a^3*g+4*g^2*a^2+2*a*g^3-a^4-3*g^4+32*j*a+96*j*g-64*b*g*a+32*b*g^2+32*b*a^2,j);

C:=eval(A6,j=%);

reevaluate polynomial [2]

factor(C);

C factors, so it is complete [5]. Back to case A.

solve(1024*b*j*g-1024*b*e*g+1024*f*a*g-96*b*a^2*g^2+192*b*a*g^3+144*j*g^2*a-64*b*a^3*g+176*j*a^2*g-80*j*a^3-5*a^5*g+48*b*a^4-80*b*g^4+112*e*a^3+336*e*g^3+14*a^3*g^3-7*a^2*g^4-9*g^5*a+a^6-240*j*g^3-512*f*a^2-512*f*g^2-144*e*a^2*g-304*e*g^2*a-3072*e*j+6*g^6+1536*e^2+1536*j^2-1024*a*j*b+1024*e*b*a,f);

A7:=eval(A6,f=%);

reevaluate polynomial [3]

puiseux(A7,x=0,y,0);

discrim=0 [4]

discrim(1894400*b*a^6*e*g-3115008*b*a^5*e*g^2+4521984*a^4*b*e*j+1890304*b^2*a^6*g^2+11632640*g^2*a*j^2*e-3506176*g^2*a*e^2*j-41254912*a^2*g*j^2*e-411648*b*a^7*e-1824*b*g^10+6422528*b*a^3*e^2*g-819200*b*g^4*j^2+31744*b^2*g^8+2686976*a^3*b^2*g^2*e-1376256*a^3*b^2*g^2*j+32768*b^3*g^6+926720*e^2*a^6+2016*e*g^9+1867776*e^3*g^3-22528*b*g^7*j-116736*b*g^7*e+425984*b^2*a^4*j*g-3211264*b^2*a^2*g^3*e-24352*b*a^10-6750208*b*a^2*g^2*e^2-10682368*b*a^2*g^2*j^2-2672640*a^6*e*j+4055040*b^2*a^4*g^4-32768*a^5*b^2*j-425984*b^2*g^5*e+22512*a^6*g^6-10715136*j^3*a^3-6979584*a^2*g*e^3-291840*e^2*g^4*a^2-111104*g^6*e*a^3+239552*e*g^5*a^4-181696*g^4*e*a^5+1348608*e^2*g^2*a^4+15552*b*a*g^9+173248*b*a^9*g+30507008*a^2*g*e^2*j+1288192*b^2*a^2*g^6-13346*a^11*g+708*a^2*g^10-1081344*b^2*a^4*e*g+9*g^12-884736*a^3*g^3*e*j+714752*b*a^7*j-1998848*b*a^4*e^2+27295744*e*a^3*j^2-1212416*b^2*g^4*j*a+60739*g^4*a^8-282624*g^5*e^2*a+36096*e*g^7*a^2-185856*e*g^3*a^6+507904*e^2*g^3*a^3+434944*e*g^2*a^7-12384*g^8*e*a+163840*a^5*b^2*e+17727488*j^3*g*a^2+586016*j*g*a^8+703616*b*a^5*g^5-990272*b*a^6*g^4+919808*b*a^7*g^3+153856*b*a^3*g^7-359488*b*a^4*g^6-531616*b*a^8*g^2-2322432*a^5*e^2*g-288416*a^8*e*g-115616*a^9*j+2053120*a^6*j^2+2228224*b*e^2*g^3*a+5373952*b*j^2*g^3*a+851968*b*e*j*g^4+18219008*b*e*j*g^2*a^2-571392*b^2*a^7*g+2844672*a^2*g^4*e*j+32768*b^3*a^6-29696*j^2*g^6+66848*e*a^9+6258688*e^3*a^3-8126464*b*e*j*g^3*a-15466496*b*e*j*g*a^3+98304*b*g^4*e^2+294912*b^2*g^5*j-32768*j^3*g^3+8487936*a^4*g^2*j^2-22839296*e^2*a^3*j+498688*a^2*g^4*j^2+159744*g^5*a*j^2-16416*g^8*a*j+2326528*e*g^3*j^2-4161536*e^2*g^3*j-196608*a^5*b^3*g+491520*a^4*b^3*g^2-655360*a^3*b^3*g^3+491520*a^2*b^3*g^4-196608*a*b^3*g^5-313344*b^2*g^7*a+1261056*g^3*a^6*j-1199872*g^2*a^7*j-726848*g^4*a^5*j-6959104*a^5*g*j^2+260416*g^5*a^4*j-4210688*a^3*g^3*j^2-2392064*b*a^4*j^2+7593984*a^5*g*e*j-942080*g^5*a*e*j+67584*g^6*e*j+52992*j*g^7*a^2-2634*g^9*a^3-12812*a^5*g^7+74752*b^2*a^8+6773*a^4*g^8-103936*g^6*a^3*j+8660992*a^5*b*j*g^2-3528704*a^5*b^2*g^3-61398*a^9*g^3+2208*j*g^9+38348*a^10*g^2+(182272*a^8-5308416*j*a^5+15335424*j*g^3*a^2+30720*g^8-458752*j*g^5-2424832*j*g^4*a-26869760*j*g^2*a^3+19726336*j*a^4*g-851968*b*g^6-1114112*b*a^6+2162688*e*g^5+3080192*e*a^5-978944*a^7*g+2142208*a^6*g^2-2437120*a^5*g^3+1556480*a^4*g^4-643072*a^3*g^5+282624*a^2*g^6-135168*g^7*a+16777216*e^2*a^2+16777216*e^2*g^2+16777216*j^2*a^2+16777216*j^2*g^2+19660800*b*g^3*a^3-14090240*b*g^4*a^2+5373952*b*g^5*a-15400960*b*g^2*a^4+6422528*b*g*a^5+3801088*e*g^3*a^2-6619136*e*g^4*a+6684672*e*g^2*a^3-9109504*e*a^4*g+67108864*e*j*g*a-33554432*e*j*a^2-33554432*e*j*g^2-33554432*e^2*g*a-33554432*j^2*g*a)*_Z+1900544*b^2*a^2*g^3*j+(-16777216*a*g^3-16777216*a^3*g+25165824*g^2*a^2+4194304*g^4+4194304*a^4)*_Z^2+1140736*b*g^4*e*a^3-1837056*b*g^5*e*a^2+1632256*b*g^3*e*a^4+813056*b*g^6*e*a+6518784*b*g^4*j*a^3+1983*a^12-58528*b*a^2*g^8+113664*e^2*g^6-3885056*b*a^6*j*g-2234368*b*g^5*j*a^2-10110976*b*g^3*j*a^4+358400*b*g^6*j*a-40756*g^5*a^7-67108864*e^3*j+100663296*e^2*j^2-67108864*e*j^3+8519680*b*a^3*j^2*g-126*g^11*a+16777216*e^4+16777216*j^4+1867776*b^2*g^4*a*e-2926592*b^2*a^3*g^5-6006784*a^4*g^2*e*j-6979584*g^2*a*j^3-1146880*g^2*a*e^3,_Z);

factor(%);

Note that factor (a-g) has already been considered. The next shortest factor is considered in case D. The longest is considered in case A. [7]

solve(-17*a^2*g-15*g^2*a+11*a^3+21*g^3+384*e+128*b*a-384*j-128*b*g,j);

D1:=eval(A7,j=%);

reevaluate polynomial [3]

factor(D1);

puiseux(D1,x=0,y,0);

numerator=0 [2]

factor(243/4194304*g^5*a*e+45/2097152*a^3*g^3*e+3/4194304*a^5*e*g-27/32768*e^2*g^3-2187/2147483648*g^8*a+243/8388608*g^6*e-1/2147483648*a^8*g+81/2097152*b*g^5*a^2-1/73728*a^5*b^2-9/8192*b*g^2*a^2*e-9/32768*e^2*a^2*g-729/536870912*g^7*a^2-189/1073741824*g^4*a^5+1/432*b^3*a^3-1/32768*e^2*a^3+15/1048576*b*g^3*a^4+135/4194304*b*g^4*a^3-1/24576*b*a^4*e-3/536870912*g^2*a^7-567/536870912*g^6*a^3+1/25165824*e*a^6-567/1073741824*g^5*a^4-21/536870912*g^3*a^6+81/4194304*b*g^6*a+405/8388608*a^2*g^4*e-1/57982058496*a^9+1/128*e^3-729/2147483648*g^9+1/64*a*b*e^2-1/8192*a^4*b^2*g-3/8192*a^3*b^2*g^2-3/8192*a^2*b^2*g^3-9/8192*b*g^3*e*a+1/2097152*b*a^6*g+45/8388608*a^4*g^2*e+1/96*e*a^2*b^2+15/4194304*b*g^2*a^5-3/8192*b*a^3*e*g-27/32768*g^2*a*e^2+1/37748736*b*a^7);

solve(768*e+512*b*a-a^3-9*a^2*g-27*g^3-27*g^2*a,e);

D2:=eval(D1,e=%);

reevaluate polynomial [3]

factor(D2);

The polynomial factors, so case D is finished [5]. Now, case A.

solve(32*e*a-160*e*g-2*a^3*g+4*g^2*a^2+2*a*g^3-a^4-3*g^4+32*j*a+96*j*g-64*b*g*a+32*b*g^2+32*b*a^2,e);

A8:=eval(A7,e=%);

reevaluate polynomial [3]

factor(A8);

polynomial factors [5]