> // WRITING FUNCTIONS IN SINGULAR. PROVING GEOMETRIC STATEMENTS LOCALLY. > proc Milnor(poly h){ return(vdim(std(jacob(h))));}; > ring R =0, (x,y), ds; > poly h = x5+y2+2y3+y4; > Milnor(h); 4 > jacob(h); _[1]=5x4 _[2]=2y+6y2+4y3 > std(_); _[1]=y _[2]=x4 > ideal J = jacob(h); > LIB "zeroset.lib"; > Factor(J[2]); [1]: _[1]=2 _[2]=y _[3]=1+y _[4]=1+2y [2]: 1,1,1,1 > poly h'=subst(h,y,y-1); // move (0,-1) to the origin > Milnor(h'); 4 > poly h'=subst(h,y,y-1/2); // ** redefining h' ** > Milnor(h'); 4 > J; J[1]=5x4 J[2]=2y+6y2+4y3 > ring S = 0, (x,y), dp; > J; ? `J` is undefined ? error occurred in STDIN line 22: `J;` > ideal J'=fetch(R,J); > vdim(groebner(J')); 12 > // milnor and tjurina are functions in "sing.lib" > LIB "sing.lib"; > setring R; > milnor(h); 4 > . // Tjurina number . tjurina(h); 4 > h'; 1/16-1/2y2+y4+x5 > tjurina(h'); 0 // STAIRCASES for various weights > ring R=0, (x,y,z), ws(1,1,1); > poly s1 = x3-yz; > poly s2 = y3-xz; > poly s3 = z3-xy; > ideal I = s1,s2,s3; > kbase(std(I)); _[1]=z4 _[2]=z3 _[3]=z2 _[4]=z _[5]=y3 _[6]=y2 _[7]=y _[8]=x3 _[9]=x2 _[10]=x _[11]=1 > // DIAGONAL OF A PARALLELOGRAM > ring R=0,(a,b,c,d,u,v),dp; // ** redefining R ** > // relations in the parallelogam > ideal I = a-u-v, ad-bc, d*(v-u)-(c-u)*b; > // relations to prove > poly g1 = a2-2ac-2bd+b2; > poly g2 = 2cu-2cv-2bd-u2+v2+b2; > // try to prove globally > ideal gbrad = groebner(radical(I)); > reduce(g1,gbrad); b2-2bd-2cu+u2-2cv+2uv+v2 > reduce(g2,gbrad); b2-2bd+2cu-u2-2cv+v2 > // prove locally: notice that the statement > // obiously holds for the unit square > ring r=0,(c,d,a,b,u,v),(dp(2),ds(4)); > ideal I'=fetch(R,I); > I' = subst(I', a, a+1); > I' = subst(I', b, b+1); > I' = subst(I', u, u+1); > poly g1'=fetch(R,g1); > g1' = subst(g1', a, a+1); > g1' = subst(g1', b, b+1); > g1' = subst(g1', u, u+1); > poly g2'=fetch(R,g2); > g2' = subst(g2', a, a+1); > g2' = subst(g2', b, b+1); > g2' = subst(g2', u, u+1); > ideal stb = std(I'); > reduce(g1',stb); 0 > reduce(g2',stb); 0 >