I'm somewhat confused about how to define Hilbert functions for affine varieties and for filtered rings in a compatible way. I'm familiar with how they are defined for projective varieties: Let $X$ be a projective variety over the field $k$, we define the Hilbert function for $X$ by
$$ h_X(m)= \dim (k[x_0,...,x_n]/I(X))_m$$ where $(k[x_0,...,x_n]/I(X))_m$ denotes the $m^\textit{th}$ graded piece of the homogeneous coordinate ring $k[x_0,...,x_n]/I(X)$. In this case, it agrees with the definition I know for the Hilbert function of a graded ring (in this case $k[x_0,...,x_n]/I(X)$) or for a homogeneous ideal (in this case $I(X)$). However, I have seen multiple sources define the Hilbert function for an affine variety as
$$ h_X(m)=\dim (k[x_1,...,x_n]_{\leq m}/I(X)_{\leq m}) $$
Where the $k[x_1,...,x_n]_{\leq m}$ denotes the set of polynomials of degree at most $m$ and $I(X)_m=k[x_1,...,x_n]_{\leq m} \cap I(X)$. Now, the coordinate ring, $k[X]=k[x_1,...,x_n]/I(X)$, is a filtered algebra $k[x_1,...,x_n]/I(X)=\bigcup_{m \geq 0} k[x_1,...,x_n]_{\leq m}/I(X)_{\leq m} $. So if I were to come up with a matching definition of the Hilbert function for filtered algebras $A=\bigcup_{m\geq 0} A_m$ that would match the above definition for $A=k[X]$ it would be $$h_A(m)=\dim A_m.$$
But on wikipedia, it says that the Hilbert function of a filtered algebra is the Hilbert function of the associated graded algebra $\mathcal{G}(A)=\bigoplus_{m\geq 0} G_m$ where $G_0=A_0$ and $G_m=A_m/A_{m-1}$ for $m>0$ which would give $$h_A(m)=\dim A_m - \dim A_{m-1}$$ for each $m>0$. I'm pretty sure these definitions aren't compatible.
My questions are:
- Is the Wikipedia definition the standard definition for the Hilbert function of a filtered algebra?
- If so, why is there a seemingly separate definition for affine Hilbert functions that doesn't match the definition for filtered algebras?
- Does the reasoning around my confusion even make sense, or am I missing something? Does it even matter?