Singular code for Tom and Jerry

TUTORIAL ON TOM AND JERRY: THE TWO SMOOTHINGS OF THE ANTICANONICAL CONE OVER P(1,2,3)



The code runs on Singular online.

Translate the original (1995) results for the versal deformation of the anticanonical cone over \PP(1,2,3) into the present notation:


ring rjs = 0, (v(0..3),w(1),u,w(2),a,b,c,d,e,f),ds;
ideal jsversal =
a*(a+b*v(3))*f+b*(e+f*w(2))*(v(2)-c)+v(1)*w(1)-v(0)*u,
-(a+b*v(3))*d*u-b*(e+f*w(2))*v(3)-a*f*w(2)-v(2)*w(1)+v(1)*u,
(e+f*w(2))*w(2)+v(3)*w(1)-(v(2)-c-d*w(2))*u,
-b*d*(e+f*w(2))*u-b*(e+f*w(2))^2+(a+b*v(3))*d*v(1)+a*f*w(1)-v(1)^2+v(0)*v(2),
-a*f*u-(e+f*w(2))*w(1)+v(1)*(v(2)-c-d*w(2))-v(0)*v(3),
-(a+b*v(3))*d*v(3)+(e+f*w(2))*u-v(2)*(v(2)-c-d*w(2))+v(1)*v(3),
-a*(a+b*v(3))*d-b*d*(v(2)-c)*w(2)+a*v(1)+b*(v(2)-c)^2+w(1)^2-v(0)*w(2),
(a+b*v(3))*(v(2)-c)+w(1)*u-v(1)*w(2),
(a+b*v(3))*v(3)+u^2-v(2)*w(2);
ring r =0, (a,b,c,x,d,e,f,g,l,y,n,z,m),ds;
map coordtfm = rjs, (a,b+gn-xln,c,x,d,e,f,-g,l,-y,-n,z,m);
ideal jsversal=coordtfm(jsversal);
jsversal;
The base is given by gy=gz=0. Write the two components and transform them into standardform with transformations mixing space and deformation variables.

ideal tom=reduce(jsversal,ideal(m,n,g));
tom;
ideal jerry= reduce(jsversal,ideal(l,y,z));jerry;
ideal tomcomp = reduce(jsversal,g);
tomcomp;
map tomtfm = r, (a-cln-yln,b,c,x,d,e,f,g,l,y-fn,n,z-fm,m);
reduce(matrix(tomtfm(tomcomp))-matrix(tom),std(tom));
ideal jerrycomp = reduce(jsversal,ideal(y,z));
jerrycomp;
map jerrytfm = r, (a+elm,b,c,x,d,e,f,g+xl,l,y,n,z,m);
reduce(matrix(jerrytfm(jerrycomp))-matrix(jerry),std(jerry));
Procedure to compute pfaffian ideal

LIB "sing.lib";

proc pfaff_4 (matrix A)
{ return(A[1,2]*A[3,4]-A[1,3]*A[2,4]+A[1,4]*A[2,3])}

proc pfaff_5 (matrix A)
{ ideal j; intvec vv=1..5; intvec vi;
 for (int i = 1; i<=5;i++)
 {vi=vv; vi[6-i]=0; vi=compress(vi);
 j[i]=pfaff_4(submat(A,vi,vi));
 }
return(j);
}
Check that the matrices (6) and a matrix from a preliminary version give correct equations, and get one as permutation of the other

ring r =0, (a,b,c,x,d,e,f,g,l,y,n,z,m),ds;
ideal skewB = 0,c,b,d,x,c,e,e,f,0;
matrix B=skewmat(5,skewB);
matrix BB = B;
print(B);
ideal i = pfaff_5(B);
ideal param = b-l2m, c-lm2, x-m3, d-l2n, e-lmn,f-ln2;
reduce(i,std(param));

skewB=b,d,c,0,0,e,c,f,e,x;
B=skewmat(5,skewB);
print(B);
i = pfaff_5(B);
reduce(i,std(param));

B=permcol(B,2,5);B=permrow(B,2,5);
B=permcol(B,3,4);B=permrow(B,3,4);
B=permcol(B,5,4);B=permrow(B,5,4);
B=multcol(B,1,-1);B=multrow(B,1,-1);
print(B); print(BB);

skewB = b, d, c+nf ,mf, g, e, c, f, e, x;
B=skewmat(5,skewB);
B=permcol(B,2,5);B=permrow(B,2,5);
B=permcol(B,3,4);B=permrow(B,3,4);
B=permcol(B,5,4);B=permrow(B,5,4);
B=multcol(B,1,-1);B=multrow(B,1,-1);
print(B);

skewB = z+mf,y+c+nf,b,d,x,c,e,e,f,lx-g;
B=skewmat(5,skewB);
i = pfaff_5(B);i;
Now compute the infinitesimal deformations of i:DX by first determining the generators of the perturbations of the Pfaffian in the ideal of D and then dividing out by trivial deformations

ring r = 0, (b,d,c,e,f,x),dp;

ideal skewBB = 0,c, b,d,x,c,e,e,f,0;
matrix BR=skewmat(5,skewBB);

ideal i= pfaff_5(BR);
ideal mm = std(maxideal(2));

matrix NR;
NR=BR; NR[1,2]=1;
matrix nb=transpose(reduce(pfaff_5(NR),mm));
NR=BR; NR[1,3]=1;
nb=concat(nb,transpose(reduce(pfaff_5(NR),mm)));
NR=BR; NR[1,4]=1;
nb=concat(nb,transpose(reduce(pfaff_5(NR),mm)));
NR=BR; NR[1,5]=1;
nb=concat(nb,transpose(reduce(pfaff_5(NR),mm)));
NR=BR; NR[4,5]=1;
nb=concat(nb,transpose(reduce(pfaff_5(NR),mm)));
NR=BR; NR[2,5]=1;
nb=concat(nb,transpose(reduce(pfaff_5(NR),mm)));
NR=BR; NR[3,5]=1;
nb=concat(nb,transpose(reduce(pfaff_5(NR),mm)));
NR=BR; NR[2,3]=1;
nb=concat(nb,transpose(reduce(pfaff_5(NR),mm)));
NR=BR; NR[2,4]=1;
nb=concat(nb,transpose(reduce(pfaff_5(NR),mm)));
NR=BR; NR[3,4]=1;
nb=concat(nb,transpose(reduce(pfaff_5(NR),mm)));

print(nb);

matrix dd[1][4]=c,e,f,x;
module normb=concat(submat(nb,1..5,1..5),outer(dd,submat(nb,1..5,6..10)));

matrix trim = jacob(i);
module triv=concat(submat(trim,1..5,1..2),outer(dd,submat(trim,1..5,3..6)));


qring qr = std(i);
module normb = imap(r,normb);
module triv = imap(r,triv);
homog(triv);
attrib(triv,"isHomog");
module infdef = modulo(normb,triv);
attrib(infdef);

print(normb*kbase(std(infdef),1));
print(normb*kbase(std(infdef),2));
print(normb*kbase(std(infdef),3));
print(triv);
Compute the unprojection over base and check that it gives the same ideal as computed earlier.

ring r =0, (a,b,c,x,d,e,f,g,l,y,n,z,m),ds;
ideal skewB = z+mf,y+c+nf,b,d,x,c,e,e,f,lx-g;
matrix B=skewmat(5,skewB);
ideal i = pfaff_5(B);
ideal bas =std(reduce(i, ideal(c,e,f,x))); bas;

qring qr = std(i+bas);
matrix unproj=minbase(syz(transpose(syz(ideal(c,e,f,x)))));
setring r;
matrix unproj = fetch(qr,unproj);
ideal ai = unproj*matrix(ideal(-1,a+cln+yln+fln2),2,1);
map coordtfm = rjs, (a,b+gn-xln,c,x,d,e,f,-g,l,-y,-n,z,m);
ideal jsversal=coordtfm(jsversal); jsversal;
i+ai;
reduce(jsversal,std(i+ai+bas));
Computation of infinitesimal deformations of i:DX in the elliptic curve case (with numerical value for the modulus)

int n=5;
ring r = 0, (b,d,c,e,f,x),dp;

poly p = f-x-b-n*c;

ideal skewBB = 0,c, b,d,x,c,e,e,f,0;
matrix BB=skewmat(5,skewBB);
matrix BR = reduce(BB,p);

ideal i= pfaff_5(BR);

matrix NR=BR;
NR[1,2]=b;
matrix nb=transpose(diff(pfaff_5(NR),b));
NR=BR; NR[1,3]=b;
nb=concat(nb,transpose(diff(pfaff_5(NR),b)));
NR=BR; NR[1,4]=b;
nb=concat(nb,transpose(diff(pfaff_5(NR),b)));
NR=BR; NR[1,5]=b;
nb=concat(nb,transpose(diff(pfaff_5(NR),b)));
NR=BR; NR[2,5]=b;
nb=concat(nb,transpose(diff(pfaff_5(NR),b)));
NR=BR; NR[3,5]=b;
nb=concat(nb,transpose(diff(pfaff_5(NR),b)));
NR=BR; NR[4,5]=b;
nb=concat(nb,transpose(diff(pfaff_5(NR),b)));
NR=BR; NR[2,3]=b;
nb=concat(nb,transpose(diff(pfaff_5(NR),b)));
NR=BR; NR[2,4]=b;
nb=concat(nb,transpose(diff(pfaff_5(NR),b)));
NR=BR; NR[3,4]=b;
nb=concat(nb,transpose(diff(pfaff_5(NR),b)));
matrix dd[1][4]=c,e,f,x;
module normb=concat(submat(nb,1..5,1..7),outer(dd,submat(nb,1..5,8..10)));

matrix trim = simplify(jacob(i),2);
module triv=concat(submat(trim,1..5,1),outer(dd,submat(trim,1..5,2..5)));
print(triv);

ring rb= 0, (d,c,e,f,x),dp;
qring qr = std(imap(r,i));
module normb = imap(r,normb);
module triv = imap(r,triv);
homog(triv);
attrib(triv,"isHomog");
module infdef = modulo(normb,triv);
print(normb*kbase(std(infdef)));


Jan Stevens