-- Exercise 5.3.19 restart R=QQ[x] f=(x-2)^2*(x+1)*(x^2+3*x-3) g=(x-2)^2*(x+1)*(-x^2+2*x+1) transpose sylvesterMatrix(f,g,x) -- careful, M2 have a transposed Sylvester matrix K=super basis kernel sylvesterMatrix(f,g,x) D0=submatrix(K,{7,8,9},{0,1,2}) D1=submatrix(K,{6,7,8},{0,1,2}) sub(D1,R)-x*sub(D0,R) factor det(sub(D1,R)-x*sub(D0,R)) eigenvalues D1 factor gcd(f,g) -- for checking -- Example 5.5.1 R=QQ[s,x1,x2,MonomialOrder=>Lex] resultant(x1-s,x2-s^2,s) factor resultant(x1-s^2,x2-s^4,s) I= ideal(x1-s^2,x2-s^4) transpose gens gb I -- Example 5.5.9 restart R=QQ[s,t,x_0,x_1,x_2] loadPackage "EliminationMatrices" f0=s^3; f1=s*t^2-s^2*t; f2=2*t^3-7*s*t^2+5*s^2*t; phi=matrix{{f0,f1,f2}} res ideal phi psi=syz phi L=matrix{{x_0,x_1,x_2}}*psi (bm,M)=degHomPolMap(L,{s,t},2) -- M is the matrix M_2 det M Msing=sub(M,{x_0=>1,x_1=>0,x_2=>0}) rank Msing -- rank=1: double point K=gens kernel transpose Msing D0=K^{0,1} D1=K^{1,2} factor(det(D1-t*D0)) -- polynomial defining the two points eigenvalues(sub(D1,RR)) -- computation assuming s=1 as D0=Id -- Example 5.5.10 restart R=QQ[s,t,x_0,x_1,x_2] loadPackage "EliminationMatrices" f0=s^2+t^2; f1=2*s*t; f2=s^2-t^2; phi=matrix{{f0,f1,f2}}; psi=syz phi L=matrix{{x_0,x_1,x_2}} * psi (bm,M)=degHomPolMap(L,{s,t},1) -- first inversion formula and check Invs=M_(1,0) Invt=-M_(0,0) sub(Invs,{x_0=>f0,x_1=>f1,x_2=>f2}) sub(Invt,{x_0=>f0,x_1=>f1,x_2=>f2}) -- second inversion formula and check Invs=M_(1,1); Invt=-M_(0,1); sub(Invs,{x_0=>f0,x_1=>f1,x_2=>f2}) sub(Invt,{x_0=>f0,x_1=>f1,x_2=>f2})