To calculate the local Milnor number we have to do the calculation with the same commands in a ring with local ordering. Define the localization of the polynomial ring at the origin.
ring rl = 0,(x,y,z),ds;
This ordering determines the standard basis which will be calculated.
Fetch the polynomial defined in the ring r
into this new ring,
thus avoiding retyping the input.
poly f = fetch(r,f); f; ==> z2+x3+y3+x3y2-x2y3
Instead of fetch
we can use the function imap
which is more general but less efficient.
The most general way to fetch data from one ring to another is to use maps.
In this ring the terms are ordered by increasing exponents. The local Milnor number is now
Milnor(f); ==> 4
This shows that f
has outside the origin in affine 3-space
singularities with local Milnor number adding up to
12-4=8.
Using global and local orderings as above is a convenient way to check
whether a variety has singularities outside the origin.
The command jacob
applied twice gives the Hessian of f
, a
3 x 3 - matrix.
matrix H = jacob(jacob(f)); H; ==> H[1,1]=6x+6xy2-2y3 ==> H[1,2]=6x2y-6xy2 ==> H[1,3]=0 ==> H[2,1]=6x2y-6xy2 ==> H[2,2]=6y+2x3-6x2y ==> H[2,3]=0 ==> H[3,1]=0 ==> H[3,2]=0 ==> H[3,3]=2
The print
command displays the matrix in a nicer form.
print(H); ==> 6x+6xy2-2y3,6x2y-6xy2, 0, ==> 6x2y-6xy2, 6y+2x3-6x2y,0, ==> 0, 0, 2
We may calculate the determinant and minors of different size.
det(H); ==> 72xy+24x4-72x3y+72xy3-24y4-48x4y2+64x3y3-48x2y4 minor(H,1); // the 1x1 - minors ==> _[1]=2 ==> _[2]=6y+2x3-6x2y ==> _[3]=6x2y-6xy2 ==> _[4]=6x2y-6xy2 ==> _[5]=6x+6xy2-2y3
The variety defined by the
1 x 1 - minors
is empty. The algorithm of the standard basis computations may be
affected by the command option
. For instance, a reduced standard
basis is obtained in the following way
option(redSB); groebner(minor(H,1)); ==> _[1]=1
This shows that 1 is contained in the ideal of the 1 x 1 - minors, hence the variety is empty.