I've recently been learning some homological algebra, mainly out of Northcott and some other sources, and I'm having trouble with the notion of projective dimension. In particular, I have a question (not from Northcott) that says
Let $R = k[x,y]$ for a field $k$ and $M$ a finitely generated $R$-module. Then $M$ has projective dimension $2$ if and only if $\text{Hom}_R(k,M) \neq 0$, where we consider $k$ as an $R$-module with the ideal $\mathfrak m=(x,y)$ acting as $0$ on $k$ (i.e. $k = R/\mathfrak m$).
I have attempted the problem but I don't see any of linking the notion of projective dimension to the Hom-set. What I have so far:
We have a projective resolution $$0\rightarrow P_2\rightarrow P_1\rightarrow P_0\rightarrow M\rightarrow 0$$ of $M$ and so we have a long exact sequence $$0\rightarrow \text{Hom}(k,P_2)\rightarrow \text{Hom}(k,P_1)\rightarrow \text{Hom}(k,P_0)\rightarrow \text{Hom}(k,M)\rightarrow \text{Ext}^1(k,P_2)\rightarrow \dots$$
We also have the exact sequence $$0\rightarrow \mathfrak m\rightarrow R\rightarrow k\rightarrow 0$$ which gives rise to the long exact sequence $$0\rightarrow \text{Hom}(k,M)\rightarrow \text{Hom}(R,M)\rightarrow \text{Hom}(\mathfrak m, M)\rightarrow \text{Ext}^1(k,M)\rightarrow \text{Ext}^1(R,M)\dots$$
Of these two long exact sequences I think the second one is more useful because we don't know anything about the $P_i$'s from the first one. Also $\text{Ext}^1(R,M) = 0$ since $R$ is projective, so we have an exact sequence with just four nonzero terms if we ignore everything past that.
However I have no idea how to include the projective resolution of $M$ which I imagine is necessary since the projective dimension of $M$ is a hypothesis. Also not sure how to use the finitely generated assumption.
So, I'd like a hint or two to proving this particular claim, and also if possible some general tips on proving things about projective dimension and using long exact sequences in general.
One direction is false. Let me investigate this problem:
Over $k[x,y]$ free and projective is the same for finitely generated modules by Quillen-Suslin.
We have an exact sequence $$0 \to C \to F \to M \to 0,$$ where $F$ is free and $C$ is free if and only if the projective dimension of $M$ is strictly smaller than two.
Note that $F$ has $\mathfrak m$-depth two because it is free, hence $\operatorname{Hom}(k,F) = \operatorname{Ext}^1(k,F)=0$. The long exact sequence yields $\operatorname{Hom}(k,M) \cong \operatorname{Ext}^1(k,C)$.
If the projective dimension of $M$ is $<2$, then $C$ is free and the RHS is zero. This direction works fine.
If the projective dimension of $M$ is $2$, then $C$ is not free (but it is torsion-free as a submodule of $F$). So we would have to show that this implies $\operatorname{Ext}^1(k,C) \neq 0$. This is due to Auslander-Buchsbaum in the local case but in our non-local case this is false.
Choose $C$, s.t. $C$ is free at $\mathfrak m$ but not free at another maximal ideal of $R$. For instance let $C$ be the maximal ideal $\mathfrak n=(x,y-1)$. Then $C_\mathfrak m = R_\mathfrak m$ is free , but $C$ is not free. We can compute
$$\operatorname{Ext}^1_R(R/\mathfrak m,C)_\mathfrak m = \operatorname{Ext}^1_{R_\mathfrak m}(R/\mathfrak m,C_\mathfrak m) = 0,$$ since $C_\mathfrak m$ is free. And for all other maximal ideals we have $(R/\mathfrak m)_{\mathfrak q} = 0$, so clearly $\operatorname{Ext}^1_R(R/\mathfrak m,C)_\mathfrak q =0$. Thus $\operatorname{Ext}^1_R(R/\mathfrak m,C)$ is zero, because it is locally zero.
This gives us a counterexample for $M$, namely $M = R/(x,y-1)$. It has projective dimension two (It cannot have projective dimension one, because its localization at $\mathfrak n$ has projective dimension two), but $\operatorname{Hom}_R(R/\mathfrak m,M)=0$.