If $M\oplus M$ is free, is $M$ free?

If $M$ is a module over a commutative ring $R$ with $1$, does $M\oplus M$ free, imply $M$ is free? I thought this should be true but I can't remember why, and I haven't managed to come up with a counterexample.

I apologize if this has already been answered elsewhere.


This is not true, in general. The modules $M$ which occur as direct summands of a free module are precisely the projective modules, which are not in general free.

The simplest counter-example is probably the ideal generated by $2$ and $1+\sqrt{-5}$ in the ring $\mathbf Z[\sqrt{-5}]$, which is projective over $\mathbf{Z}[\sqrt{-5}]$ but not free.

If you would like a geometric example where a similar situation fails, consider the tangent bundle of the sphere. It is not free, for instance because it has no nonvanishing section (hairy ball theorem). But its sum with the normal bundle of the sphere (sitting in $\mathbf R^3$) is free, because it is just the restriction to the sphere of the tangent bundle of $\mathbf R^3$ (which is free). (Of course, these are not the same as modules over a ring, but the phenomenon is the same.)

Edit: Ah, I just noticed you had written $M\oplus M$, rather than $M\oplus N$. It turns out that the example I provided above in $\mathbf Z[\sqrt{-5}]$ works for that as well (because the Grothendieck group of a Dedekind domain (or more precisely of its category of finite projective modules) is isomorphic to its ideal class group (summed with a copy of $\mathbf Z$). I believe that this is what Vahid below was trying to say: a module whose square is free, in this case, is simply a module whose class in $K_0$ is $2$-torsion).


This would mean that there is no element of order 2 in a $K$-group, which is clearly not correct. To find an example, you can try to find a ring $R$ such that $K_0(R)$ has an element of order 2. As an example related to my research interest, I can say $K_0(C(\mathbb{RP}^2))= \mathbb{Z}\oplus \mathbb{Z}/2\mathbb{Z}$, see Karoubi 1978, IV.6.47.


For invertible ideals $I,J$ of a Dedekind ring $R$, it is well-known that $I \oplus J \cong R \oplus I \cdot J$ (see for example May's Notes on Dedekind rings, Prop 6.4). For the ideal $I = (2,1+\sqrt{-5})$ of $R=\mathbb{Z}[\sqrt{-5}]$ we have $I^2=(4,2+2 \sqrt{-5},-4+2 \sqrt{-5})=(2) \cong R$. Hence $I \oplus I \cong R^2$ is free, but $I$ is not free, since it is invertible and not principal.