[proofplan]
We choose lifts in $P$ of a basis of the residue [vector space](/page/Vector%20Space) $P/\mathfrak m P$ and use them to define a map $R^r \to P$. A finite-generation form of [Nakayama's lemma](/theorems/2935), proved inside the argument, shows that this map is surjective. Projectivity splits the surjection, and reducing the resulting direct-sum decomposition modulo $\mathfrak m$ shows that the complementary summand has zero residue quotient. A second application of the same Nakayama argument forces the complement to vanish, so $P$ is isomorphic to $R^r$.
[/proofplan]
custom_env
admin
[step:Prove the finite-generation form of Nakayama's lemma]
We will use the following elementary form of Nakayama's lemma.
[claim:Nakayama for finitely generated modules over a local ring]
Let $M$ be a finitely generated $R$-module. If $M=\mathfrak m M$, then $M=0$.
[/claim]
[proof]
Assume, toward a contradiction, that $M \neq 0$. Since $M$ is finitely generated, among all finite generating sets of $M$ choose one with minimal cardinality, say $x_1,\dots,x_n \in M$, where $n \geq 1$. The equality $M=\mathfrak m M$ gives coefficients $a_1,\dots,a_n \in \mathfrak m$ such that
\begin{align*}
x_n=\sum_{i=1}^n a_i x_i.
\end{align*}
Rearranging,
\begin{align*}
(1-a_n)x_n=\sum_{i=1}^{n-1} a_i x_i.
\end{align*}
Because $R$ is local with maximal ideal $\mathfrak m$ and $a_n \in \mathfrak m$, the element $1-a_n$ is a unit in $R$. Hence
\begin{align*}
x_n=(1-a_n)^{-1}\sum_{i=1}^{n-1} a_i x_i.
\end{align*}
Thus $x_1,\dots,x_{n-1}$ still generate $M$, contradicting the minimality of $n$. Therefore $M=0$.
[/proof]
[/step]
custom_env
admin
[step:Choose residue classes and construct the comparison map]
Let $k:=R/\mathfrak m$ be the residue field. Since $P$ is finitely generated over $R$, the quotient $P/\mathfrak m P$ is a finite-dimensional $k$-vector space. Let $r:=\dim_k(P/\mathfrak m P)$, and choose elements $p_1,\dots,p_r \in P$ whose images
\begin{align*}
\overline{p}_1,\dots,\overline{p}_r \in P/\mathfrak m P
\end{align*}
form a $k$-basis. If $r=0$, this means $P/\mathfrak m P=0$.
Define the $R$-[linear map](/page/Linear%20Map)
\begin{align*}
f:R^r &\to P \\
(a_1,\dots,a_r) &\mapsto \sum_{i=1}^r a_i p_i.
\end{align*}
The induced $k$-linear map
\begin{align*}
\overline f:k^r &\to P/\mathfrak m P \\
(\overline a_1,\dots,\overline a_r) &\mapsto \sum_{i=1}^r \overline a_i\,\overline p_i
\end{align*}
is an isomorphism because $\overline p_1,\dots,\overline p_r$ is a $k$-basis of $P/\mathfrak m P$.
[/step]
custom_env
admin
[step:Use Nakayama to show the comparison map is surjective]
Let $C:=\operatorname{coker}(f)$ be the cokernel of $f:R^r \to P$. Since $P$ is finitely generated, $C$ is a finitely generated $R$-module. Reducing the exact sequence
\begin{align*}
R^r \xrightarrow{f} P \to C \to 0
\end{align*}
modulo $\mathfrak m$ gives the exact sequence
\begin{align*}
k^r \xrightarrow{\overline f} P/\mathfrak m P \to C/\mathfrak m C \to 0.
\end{align*}
Since $\overline f$ is an isomorphism, it is surjective, so $C/\mathfrak m C=0$. Equivalently, $C=\mathfrak m C$. By the Nakayama lemma proved above, $C=0$. Therefore $f$ is surjective.
[/step]
custom_env
admin
[step:Split the surjection using projectivity]
Because $P$ is projective and $f:R^r \to P$ is surjective, the identity map $\operatorname{id}_P:P\to P$ lifts through $f$. Hence there exists an $R$-linear map
\begin{align*}
s:P &\to R^r
\end{align*}
such that $f\circ s=\operatorname{id}_P$.
Let $K:=\ker(f)$. The splitting $s$ gives an $R$-module isomorphism
\begin{align*}
K\oplus P &\to R^r \\
(x,p) &\mapsto x+s(p).
\end{align*}
Indeed, every $y\in R^r$ decomposes as
\begin{align*}
y=(y-s(f(y)))+s(f(y)),
\end{align*}
where $y-s(f(y))\in K$, and the intersection $K\cap s(P)$ is zero because if $s(p)\in K$, then
\begin{align*}
p=f(s(p))=0.
\end{align*}
Thus $R^r\cong K\oplus P$.
[/step]
custom_env
admin
[step:Reduce the splitting modulo $\mathfrak m$ and kill the kernel]
Since $K$ is a direct summand of the finitely generated module $R^r$, the module $K$ is finitely generated. Reducing the direct-sum decomposition $R^r\cong K\oplus P$ modulo $\mathfrak m$ gives a $k$-vector space decomposition
\begin{align*}
k^r \cong K/\mathfrak m K \oplus P/\mathfrak m P.
\end{align*}
Under this reduction, the induced map $k^r\to P/\mathfrak m P$ is precisely $\overline f$, which is an isomorphism. Therefore the summand $K/\mathfrak m K$ must be zero. Equivalently, $K=\mathfrak m K$.
Applying the Nakayama lemma proved above to the finitely generated module $K$, we obtain $K=0$. Hence $\ker(f)=0$.
[/step]
custom_env
admin
[step:Conclude that the projective module is free]
The map
\begin{align*}
f:R^r &\to P
\end{align*}
is both surjective and injective, so it is an $R$-module isomorphism. Therefore
\begin{align*}
P\cong R^r.
\end{align*}
Thus every finitely generated projective module over the commutative local ring $(R,\mathfrak m)$ is free.
[/step]