**The question.**

Let $R$ be a commutative ring. Let $M$ be an $R$-module with the property that there exists an $R$-module $N$ such that $M\otimes_R N\cong R$. Does there always exist an ideal $I$ of $R$ such that $M$ is isomorphic to $I$ as an $R$-module? (I suspect not in this generality)

**The background.**

Let $R$ be a commutative ring. Here are two groups that one could associate to $R$.

- The "class group".

The first group is "inspired by number theory". One takes the ideals of $R$ and observes that they have a natural multiplication defined on them. One defines two ideals $I$ and $J$ to be *equivalent* if there exist nonzerodivisors $s$ and $t$ such that $sI=tJ$. This relation plays well with the multiplication, giving us a multiplication on the equivalence classes (unless I screwed up; my reference is "back of an envelope calculation"). This makes the equivalence classes into a commutative monoid, and one could define the class group of $R$ to be units of this monoid, i.e. elements with an inverse.

Note: one could instead use fractional ideals. The theory of fractional ideals is often set up only for integral domains, and if I did screw up above then maybe I should have restricted to integral domains. A fractional ideal is defined to be an integral ideal with a denominator so I don't think this changes the group defined here.

- The Picard group.

The second group is "inspired by geometry" -- it's the Picard group of $\operatorname{Spec}(R)$. More concretely, take the collection (it's not a set) of isomorphism classes of $R$-modules $M$. This has a multiplication coming from tensor product, and satisfies the axioms of a monoid except that it's not a set. The units of this monoid however are a set, because another back of an envelope calculation seems to indicate that if $M\otimes_R N\cong R$ and we write $1=\sum_i m_i\otimes n_i$, a finite sum, then the $m_i$ generate $M$ as an $R$-module, giving us some control over the size of the units of the monoid -- they're all isomorphic to a quotient of $R^n$ so we have regained control in a set-theoretic sense. The units of the monoid are the second group.

The question comes from me trying to convince myself that these groups are not equal in general (for I don't really expect them to be equal in general). If $R$ is a Dedekind domain (so $\operatorname{Spec}(R)$ is a smooth affine curve) then we have here the classical definition and the fancy definition of the class group of $R$, and the answer to the question is "yes". This is because every rank 1 projective $R$-module is isomorphic to an ideal of $R$; if I recall correctly then more generally every rank $n+1$ projective $R$-module is isomorphic to $I\oplus R^n$ for some ideal $I$ (this is true at least for the integers of a number field) which enables you to compute the zero'th algbraic $K$-group (Grothendieck group) of $R$. But more generally than this I am not sure what is going on.

On the divisors Wikipedia page I read "Every line bundle $L$ on $X$ on an integral Noetherian scheme is the class of some Cartier divisor" which makes me think that the result might be true for Noetherian integral domains, but I don't see the proof even there (perhaps it's standard). The way it's phrased makes me wonder then whether there are non-Noetherian counterexamples.