*** Hilbert function *** ---------------------------------------------- -- ---------------------------------------------- -- Hilbert function leads to Hilbert polynomial leading to a way to compute dimension and degree of a variety. -- -- * Hilbert function and Hilbert polynomial -- -- * Invariants: dimension and degree ---------------------------------------------- -- Hilbert function and Hilbert polynomial ---------------------------------------------- -- In a ring R = QQ[x,y,z]; -- with the default ({\em graded} reverse lexicographic) order take the following ideal sph = x^2+y^2+z^2-1; I = ideal {sph*(x-1), sph*(y-2)} -- The {\em Hilbert function} $H_{R/I}(d)$ is defined as the vector-space -- dimension of $R_d/I_d$ where $R_d$ are polynomials of degree at -- most $d$ and $I_d = I \cap R_d$. -- To get a value of the Hilbert function one can count standard monomials: B = basis(0,3,R/I) numcols B -- In this example $H_{R/I}(3) = 20$. -- -- The built-in function computes another variant of the function, the -- {\em projective} Hilbert function: the only dirrence is that -- instead of at most degree $d$ {\em exactly} degree $d$ polynomials -- are considered. hilbertFunction(3,R/I) -- There is an obvious relationship between the two, for instance, 18 == sum({0,1,2,3}, d->hilbertFunction(d,R/I)) -- Note that the Hilbert function for the initial ideal is the -- same. In fact, one way to compute the function is via monomial cone -- decomposition of the set of standard monomials: there is a function -- producing the {\em standard pairs} for a given monomial ideal -- describing such a decomposition. inI = monomialIdeal I -- initial ideal of I standardPairs inI -- For instance $\{\{x, \{y, z\}\}$ stands for the 2-dinesional cone -- of multiples of $x$ by monomials in $y$ and $z$, while $\{x^3 y^3 , -- \{\}\}$ is a 0-dimensional cone, i.e., a single monomial. -- -- The following function uses the monomial cone decomposition to compute the {\em Hilbert polynomial} HP = I -> ( S := QQ[symbol s]; s := S_0; sum(standardPairs monomialIdeal I, mx ->( (m,x) := toSequence mx; t := sum degree m; product(#x,i->s-t+1+i)/(#x)! -- s-t+#x choose s-t )) ) HP I -- The Hilbert polynomial agrees with the Hilbert function for $d$ large enough, for instance, sub(HP I,matrix{{3}}) -- coincides with the previously computed value, however sub(HP I,matrix{{0}}) -- is clearly not the value of the Hilbert function. ---------------------------------------------- -- Invariants: dimension and degree ---------------------------------------------- -- The dimension of the variety $\mathbb{V}(I)$ equals the degree of the Hilbert polynomial sph = x^2+y^2+z^2-1; I = ideal {sph*(x-1), sph*(y-2)} h = HP I degree h dim I -- while the leading coefficient determines the {\em degree} of the variety deg = d! * leadCoefficient h deg == degree I -- Alternatively, the degree is the number of points of intersection -- of the variety and a general affine plane of codimension $d$. -- -- The Hilbert polynomial, however, is a stronger invariant than -- dimension and degree and the Hilbert function is even stronger. -- -- Consider two point and a line not passing through them. R = QQ[x,y,z] A = ideal(x-1,y,z) -- (1,0,0) B = ideal(x,y-1,z) -- (0,1,0) line = ideal(x+y+z-3,x-2*y+3*z-5) -- While the dimension and degree of the varieties given by Aline = intersect(A,line); dim Aline, degree Aline ABline = intersect(A,B,line); dim ABline, degree ABline -- are the same, the Hilbert polynomials are not: HP Aline HP ABline -- Now consider another couple of points: C = ideal(x-1/2,y-1/2,z) -- (1/2,1/2,0) -- is on the line AB and D = ideal apply(3,i->random(1,R)+random(0,R)) -- is a random point that is likely not on that line. -- -- The Hilbert polynomials are, expectedly, the same, ABC = intersect(A,B,C);ABD = intersect(A,B,D); HP ABC == HP ABD -- but the Hilbert function distinguishes the triple of colinear -- points from the triple in general position: hilbertFunction(1,ABC) != hilbertFunction(1,ABD)