I am very confused about the affine Hilbert function. Let us work in $\mathbb A^3$, the complex affine space.
If $A=\mathbb C[x,y,z]$, we have the vector subspace $A_k\subset A$ consisting of polynomials of total degree $\leq k$. Its dimension is $N_k:=\binom{3+k}{k}$.
For an ideal $I\subset A$, we can construct $I_k=I\cap A_k$, and the Hilbert function $h_I:\mathbb N\to\mathbb N$ takes $$m\mapsto h_I(m)=\dim_\mathbb C(A_k/I_k)=N_k-\dim I_k.$$
Example. The Hilbert function of the ideal $J=(x,y)$ is $h_J(k)=k+1$. The Hilbert function of the ideal $I=J\cap (x,y,z)^2$ is $h_I(k)=k+3$.
My problem. The complex vector space $V=J/I\subset A/I$ has dimension $2$, so I would expect it to correspond, as an ideal in $A/I$, to a length $2$ subscheme of $\textrm{Spec }A/I$. However, the exact sequence of vector spaces $0\to I\to J\to V\to 0$ suggests that its Hilbert function should be $h_V(k)=(k+1)-(k+3)=-2$.
Could you please explain to me how to solve these issue? Hopefully you will understand where my misunderstanding comes from. Feel free to suggest general remarks on the affine Hilbert function, I still need to grasp its meaning.
Thanks!