## An example of non-free projective module over integral domain

An ideal $I$  of an integral domain $R$  is a free $R$-module if and only if it is generated by one element. Indeed, given any two non-zero elements $x,y\in I$, $x\cdot y+(-y)\cdot x=0$. So any two elements are linear dependent. Hence, if $I$ were free module, it must generated by one element, or $I$ is a principle ideal. Our strategy is to find an ideal $I$ which is not principle and show that $I$ is projective.

Let $R=\mathbb{Z}[-21]=\{a+b\sqrt{-21}|a,b\in\mathbb{Z}\}$. Obviously $R$ is an integral domain. Let $I$ be the ideal generated by 5 and $2+\sqrt{-21}$. $I=\{5a+(2+\sqrt{-21})b|a,b\in R\}$.

$\mathbf{Claim:}$ $I$ is not a principal ideal.
$\mathbf{Proof:}$
Define $\phi:R\to \mathbb Z$ by $\phi(a+b\sqrt{-21})=a^2+21b^2$, then it is straightforward to verify $\phi(r_1r_2)=\phi(r_1)\phi(r_2)$, for all $r_1,r_2\in R$. If $r\in R$ is a unit, then $\phi(r)=1$, which means $a=\pm 1$ and $b=0$. So the only units in $R$ are $\pm 1$.

Now suppose $I$ is a principle ideal, then $\exists\,u$ such that $I=Ru$. Then $\exists\, r\in R$ such that $5=ru$, which means $25=\phi(r)\phi(u)$. Since $x^2+21y^2=5$ has no solution in $\mathbb Z$, $\phi(r)$ or $\phi(u)$ can not be 5. So we must have $\phi(r)=25$ and $\phi(u)=1$ or $\phi(r)=1$ and $\phi(u)=25$. The second case is impossible, because $\phi(r)=1$ means $r=\pm 1$. Then $I=5\cdot R$. We can obtain $2+\sqrt{-21}=5(a+b\sqrt{-21})$, this is impossible.

The only case we left is $\phi(u)=1$, which means $u=\pm 1$. Then $I=R$. We have $R\cong \mathbb Z[x]/(x^2+21)$, $I$ corresponds to the ideal $(5,2+x)/(x^2+21)$. If $I=R$, then $(5,2+x)=\mathbb Z[x]$. This fact leads to $1=f(x)\cdot 5+g(x)\cdot (2+x)$, for some $f(x)$, $g(x)\in \mathbb Z[x]$. If we set $x=-2$, then $1=f(-2)\cdot 5$ in $\mathbb Z$, this is impossible.

In conclusion, $I$ can not be principle. $\text{Q.E.D. }\hfill\square$

$\mathbf{Claim:}$ $I$ is a projective module.

$\mathbf{Proof:}$Define $\psi:R^2\to I$ by $\psi(a,b)=5a+(2+\sqrt{-21})b$. If we can find $i:I\to R^2$ such that $\psi i=id_I$, then $I$ is a direct summand of $R^2$, which is a free $R$-module. Consequently, $I$ is a projective module.

Let $x=5a+(2+\sqrt{-21})b\in I$, $a,b\in R$. There exist unique $u,v\in R$ such that
$(3-4\sqrt{-21})x=5u$
$(16+2\sqrt{-21})x=5v$
A straightforward calculation shows that, $u=3a+18b-(4a+b)\sqrt{-21}$, $v=16a-2b+(2a+4b)\sqrt{-21}$. Define $i(x)=(u,v)\in R^2$. It is easy to verify that $i$ is an $R$-module homomorphism. Moreover,
$\psi(u,v)=u\cdot 5+v\cdot(2+\sqrt{-21})$
$=5(3a+18b-(4a+b)\sqrt{-21})+[16a-2b+(2a+4b)\sqrt{-21}](2+\sqrt{-21})= 5a+(2+\sqrt{-21})b.$

This means $\psi i(x)=x$. Thus $I$ is a projective module. $\text{Q.E.D. }\hfill\square$

As discussed in the beginning of this section, since $I$ is not principle, we get a non-free projective module.