I've been studying projective modules in Rotman, as well as the topic of localization. Now on the [Wikipedia](https://en.wikipedia.org/wiki/Projective_module#Projective_modules_over_commutative_rings) article about them, there's an example of a locally free module that is not projective.
The module in question is $R/I$ where $R$ is a direct product of countably infinite copies of $\mathbb{F}\_2$ and $I$ is a direct sum of countably infinite copies of $\mathbb{F}\_2$.


I understand why it is locally free, but in order to explain why it is not projective they mention the following theorem: If $I$ is an ideal of a commutative ring $R$ such that $R/I$ is a projective $R$-module, then $I$ is a principal ideal.


I'm not sure how to prove this (more general) theorem. I feel like I'm missing an obvious map to show that $I$ not principal implies $R/I$ not projective.



If a quotient ring is a projective module then the ideal is principal
Let $\pi:R\to R/I$ be the natural projection map. This is an $R$-module homomorphism (as well as a ring homomorphism). If $R/I$ is projective, then this map splits. Call such a splitting $\varphi:R/I\to R$. So we have $R= \varphi(R/I)\oplus \ker(\pi)$ (as internal direct sums of $R$-modules). But $\ker(\pi)=I$, and this shows that $I$ is cyclic. [In particular, $I$ will be generated by the idempotent of $R$ which corresponds to the direct sum decomposition.]


