Given a finitely generated Z-graded module M over a graded ring R (finitely generated over R_0, which is an Artinian local ring), the Hilbert function of M is the map H(M, i):Z->Z such that, for all a element Z, H(M, a) = ℓ(M_a), where ℓ denotes the length. If n is the dimension of M, then there exists a polynomial P_M(x) of degree n with rational coefficients (called the Hilbert polynomial of M) such that P_M(a) = H(M, a) for all sufficiently large a.