Solution (source code)

= Solution

Choose a surjection $P_0=A^{r_0}\twoheadrightarrow M$. Since $A$ is a <Noetherian ring>, a finite <free module> is a <Noetherian module>, and its kernel $K_1$ is a <finitely generated module>. Choose a finite free surjection $P_1\twoheadrightarrow K_1$ and repeat. This constructs a <resolution by finitely generated free modules>
$$
\cdots\longrightarrow P_2\longrightarrow P_1\longrightarrow P_0\longrightarrow M\longrightarrow0,
$$
whose terms are, in particular, <finitely generated projective modules>. It may be infinite; the request is finite generation of every term, not finite length.

Now suppose the nonzero <finitely generated module> $M$ has finite <projective dimension> $n$. For $n\ge1$, its $n$th syzygy $K_n$ in this free resolution is projective. Indeed, dimension shifting along the successive kernel sequences gives
$$
\operatorname{Ext}_A^1(K_n,N)\cong\operatorname{Ext}_A^{n+1}(M,N)=0
$$
for every <module> $N$. The vanishing follows by computing the latter <Ext functor> from any length-$n$ <projective resolution>. Vanishing of $\operatorname{Ext}^1(K_n,-)$ makes every short exact sequence ending in $K_n$ split: apply the <long exact sequence of Ext groups> to a free surjection onto $K_n$ to lift its identity. Thus $K_n$ is a <projective module>. It is finitely generated by the preceding construction. Truncating gives
$$
0\longrightarrow P_n\xrightarrow{d_n}P_{n-1}\longrightarrow\cdots\longrightarrow P_0\longrightarrow M\longrightarrow0
$$
with every term finite projective.

Apply the <Hom functor> $\operatorname{Hom}_A(-,A)$ and write $P_i^*=\operatorname{Hom}_A(P_i,A)$. At the top degree,
$$
\operatorname{Ext}_A^n(M,A)=\operatorname{coker}\bigl(d_n^*:P_{n-1}^*\to P_n^*\bigr).
$$
If this group were zero, $d_n^*$ would be surjective. The <dual module> of a <finite projective module> is finite projective, so this surjection has a section $s:P_n^*\to P_{n-1}^*$. Finite projective modules identify with their <double dual modules>: the evaluation map is an <isomorphism> for a finite free module and passes to its direct summands. Dualizing $d_n^*s=\mathrm{id}$ therefore gives $s^*d_n=\mathrm{id}_{P_n}$. Hence $d_n$ splits, and $P_{n-1}/d_n(P_n)$ is projective. Replacing the last two terms by this quotient shortens the <projective resolution> to length $n-1$, contradicting minimality. This proves <top Ext detects finite projective dimension>:
$$
\boxed{\operatorname{Ext}_A^n(M,A)\ne0.}
$$
For $n=0$, $M$ is a nonzero finite projective module and embeds as a summand of $A^r$. Some coordinate projection restricts nontrivially to $M$, proving $\operatorname{Hom}_A(M,A)\ne0$ as required.

For infinite <projective dimension>, take the <dual-number algebra> $A=k[\varepsilon]/(\varepsilon^2)$ and $M=k=A/(\varepsilon)$. Multiplication by $\varepsilon$ has image and kernel both equal to $(\varepsilon)$, giving the <periodic resolution over dual numbers>
$$
\cdots\xrightarrow{\varepsilon}A\xrightarrow{\varepsilon}A\xrightarrow{\varepsilon}A\longrightarrow k\longrightarrow0.
$$
Applying $\operatorname{Hom}_A(-,k)$ makes every differential zero, so $\operatorname{Ext}_A^i(k,k)\cong k$ for every $i\ge0$. A finite <projective resolution> would force all sufficiently high <Ext functors> to vanish. Thus \b[$\operatorname{pd}_{k[\varepsilon]/(\varepsilon^2)}k=\infty$].

The finite-generation hypothesis is essential if the middle sentence's “a module” is interpreted as an unrestricted new module. A concrete <vanishing top Ext without finite generation> occurs for $A=k[[t]]$ and $K=A[1/t]=k((t))$. This <Noetherian ring> has the exact free presentation
$$
0\longrightarrow\bigoplus_{i\ge0}Ae_i\xrightarrow{d}\bigoplus_{i\ge0}Ae_i\longrightarrow K\longrightarrow0,\qquad d(e_i)=e_i-te_{i+1},\quad e_i\longmapsto t^{-i}.
$$
Injectivity of $d$ follows by examining the largest index of a finitely supported input, since $t$ is a <non-zero-divisor>. For exactness in the middle, use the relations to move a finite sum to its largest index $N$; its remaining coefficient is $\sum_{i=0}^Na_it^{N-i}$, which is zero precisely when its image in $K$ is zero. The map onto $K$ is surjective because every Laurent series has a lower bound on its exponents.

Applying $\operatorname{Hom}_A(-,A)$ gives on products the map $(b_i)\mapsto(b_i-tb_{i+1})$. It is surjective: for any $(c_i)$, set $b_i=\sum_{j\ge0}t^jc_{i+j}$. These are well-defined <formal power series>, because each coefficient receives only finitely many contributions, and $b_i-tb_{i+1}=c_i$. Consequently $\operatorname{Ext}_A^1(K,A)=0$. But $\operatorname{Hom}_A(K,A)=0$: the image of every $t^{-i}$ must lie in $\bigcap_{r\ge0}t^rA=0$, since it is divisible by every power of $t$. A nonzero <projective module> is a summand of a free module and therefore has a nonzero coordinate map to $A$. Thus $K$ is not projective, while its displayed resolution has length one. In particular,
$$
\operatorname{pd}_{k[[t]]}k((t))=1,\qquad\operatorname{Ext}_{k[[t]]}^1(k((t)),k[[t]])=0.
$$
The nonvanishing conclusion proved above retains the finitely generated $M$ introduced at the start of the question.