-- Hilbert functions and series restart R=QQ[x,y,z] I=matrix{{x^3+y^3+z^3}} coker I hilbertFunction(3,coker I) -- inspect up to the Hilbert function up to degree N N=10; matrix{for i from 0 to N list i, for i from 0 to N list hilbertFunction(i, coker I)} -- Hilbert series poincare R poincare coker I factor oo hilbertPolynomial(coker I,Projective=>false) -- test J=matrix{{x,x^3+y^3+z^3}} N=15; matrix{for i from 0 to N list i, for i from 0 to N list hilbertFunction(i, coker J)} poincare coker J factor oo -- check of th eHilbert polynomial computation. d=10 I=(random(d,R)) hilbertPolynomial(coker I,Projective=>false) {d,-(d-3)*d/2} -- Artinian ring restart R=QQ[x,y] poincare coker matrix {{x^2,y^2}} factor oo -- so the Hilbert series in a polynomial --it also works with quotient ring Q=R/ideal(x^2,y^2) poincare Q factor oo --- Slice of the union of two curves in P^3 restart R=QQ[x,y,z,w] m=matrix{{w^2-y*w, x*w-3*z*w, x^2*y-y^2*z-9*z^2*w+z*w^2, x^3-3*x^2*z-x*y*z+3*y*z^2}} hilbertPolynomial(coker m, Projective=> false) -- codim=2, degree=3 I=ideal m; codim I degree I netList primaryDecomposition I -- two irred components: plane conic in w=0 and a projective line -- This has dimension 3; we check this by slicing lin = ideal random (R^{1},R^1) slice=I+lin hilbertPolynomial(coker gens slice, Projective=>false) netList primaryDecomposition slice -- Draw the solution of this ideal; check the hilbertPolynomial restart R=QQ[x,y,z] I=ideal (x^2-x*z,y^3-y*z^2) netList primaryDecomposition I hilbertPolynomial(coker gens I, Projective=>false) -- Bezout and multiplicities restart R=QQ[x,y,z] I=ideal(y^2-x*z,x) hilbertPolynomial(coker gens I) -- 2 points indeed primaryDecomposition I -- the line is tangent to a curve of degree 2 radical I -- The twisted cubic -- Bezout theorem does not extend trivially restart R=QQ[x,y,z,w] M=matrix{{x,y,z},{y,z,w}} I=minors(2,M) hilbertPolynomial(coker gens I,Projective=>false) -- curve of degree 3 -- N.B: if x=1, this is parameterized by (1,y,y^2,y^3), -- so by slicing we expect a curve of degree 3, which is confirmed by the hilbert polynomial computation