Dear Andrea: Hartshorne was right, but we need to do some work. Let $\mu(I)$ be the minimal number of generators of $I$, and $\mu_h(I)$ be the minimal number of a homogenous system of generators of $I$. Let $R=k[x_1,\cdots,x_n]$ and $m=(x_1,\cdots,x_n)$. Suppose $\mu_h(I)=n$ and $f_1,\cdots, f_n$ (f_1,\cdots, f_n)$is a minimal homogenous set of generators. At this point we switch to the local ring$A=R_m$(the reason: it is easier to do linear algebra over local rings, as anything not in$m$is now invertible). It will not affect anything since$I\subset m$. Construct a surjective map$F_0 = \oplus_1^n A(-deg \ f_i) \to I \to 0$and let$K$be the kernel. By grading consideration, one can show We claim that$K \subset mF_0$. If not, otherwise then one can find an element$(a_1,...,a_n) \in K$such that$\sum a_if_i=0$and$a_1$, say, has a degree$0$term$u_1\neq 0$. By considering terms of same degree in the sum one sees that there are$b_i$s such that:$$u_1f_1 = \sum_{2}^n b_if_i$$ so the system is not minimal, as$u_1 \in k$, contradiction. Now tensoring the sequence $$0 \to K \to F_0 \to I \to 0$$ with$k=A/m$. By the claim$K\subset mF_0$, so$F\otimes k \cong I\otimes k$. It follows that$n= rank\ F_0 = dim_k(I\otimes k)$. But over a local ring, the fact that the first syzygy last term is inside$mF_0$characterize minimal system of generators, so exactly$n=\mu(I)$, \mu(I)$, and we are done.
Dear Andrea: Hartshorne was right, but we need to do some work. Let $\mu(I)$ be the minimal number of generators of $I$, and $\mu_h(I)$ be the minimal number of a homogenous system of generators of $I$. Let $R=k[x_1,\cdots,x_n]$ and $m=(x_1,\cdots,x_n)$. Suppose $\mu_h(I)=n$ and $f_1,\cdots, f_n$ is a minimal homogenous set of generators. At this point we switch to the local ring $A=R_m$ (the reason: it is easier to do linear algebra over local rings, as anything not in $m$ is now invertible). It will not affect anything since $I\subset m$.
Construct a surjective map $F_0 = \oplus_1^n A(-deg \ f_i) \to I \to 0$ and let $K$ be the kernel. By grading consideration, one can show that $K \subset mF_0$, otherwise the system is not minimal. But over a local ring, the fact that the first syzygy is inside $mF_0$ characterize minimal system of generators, so $n=\mu(I)$, and we are done.