up previous next
HilbertFn

the Hilbert function

Syntax
HilbertFn(R: RING|IDEAL): TAGGED("$hp.Hilbert")
HilbertFn(R: RING|IDEAL, N: INT): INT

Description
The first form of this function computes the Hilbert function for R. The second form computes the N-th value of the Hilbert function. The weights of the indeterminates of R must all be 1. If the input is not homogeneous, the Hilbert function of the corresponding leading term (initial) ideal or module is calculated. For repeated evaluations of the Hilbert function, use EvalHilbertFn instead of HilbertFn(R, N) in order to speed up execution.

The coefficient ring must be a field.

Example
/**/  Use R ::= QQ[t,x,y,z];
/**/  HilbertFn(R/ideal(z^2-x*y, x*z^2+t^3));
H(0) = 1
H(1) = 4
H(t) = 6*t -3   for t >= 2

/**/  R2 := NewFreeModule(R, 2);
/**/  MGens := matrix(R, [[x^3,y^3], [x*y^2,0], [0,z^3]]);
/**/  M := SubmoduleRows(R2, MGens);
/**/  HilbertFn(M);
H(0) = 0
H(1) = 0
H(2) = 0
H(3) = 3
H(4) = 12
H(t) = (1/3)*t^3 +(3/2)*t^2 +(-101/6)*t +35   for t >= 5

/**/  HilbertFn(M,3);
3
/**/  HilbertFn(M,5);
30

See Also