Let $R$ be commutative unital ring, and $M$ an $R$-module. $M$ is called invertible (a.k.a. projective module of rank one), if it is finitely generated, and $M_{\mathfrak{p}} \cong R_{\mathfrak{p}}$ for every $\mathfrak{p} \in \operatorname{Spec} R$. Equivalently, there are $a_1, \dotsc, a_n \in R$ such that $(a_1, \dotsc, a_n) = R$ and $M_{a_i} \cong R_{a_i}$ for every $i$. There is a third equivalent definition: $M$ is finitely generated, and there is an $R$-module $N$ such that $M \otimes_R N \cong R$. See e.g. Bourbaki: Commutative Algebra, II, 5.4, Theorem 3, or Proposition 19.8 in Pete Clark's note on Commutative Algebra. Both of these references assume that $M$ is finitely generated in the third definition.
My question: is the finitely generatedness really necessary in the last definition? It seems to me that if $M \otimes_R N \cong R$, then $M$ and $N$ are automatically finitely generated. This would make the last definition really simple.
Remark: I have a proof in mind, so as a second question: is the following argument correct?
If $\varphi \colon M \otimes N \to R$ is an isomorphism, then $\varphi^{-1}(1) = \sum_{i=1}^s x_i \otimes y_i$ for some $x_i \in M$ and $y_i \in N$. Then let $M'$ be the submodule of $M$ generated by $x_1, \dotsc, x_s$. The composition $M' \otimes N \xrightarrow{\sigma} M \otimes N \xrightarrow{\varphi} R$ is surjective (because $\sum_{i=1}^r x_i \otimes y_i \in M' \otimes N$ goes to $1 \in R$), and $\varphi$ is an isomorphism, so $\sigma$ is also surjective. Let $M'' = M/M'$, so $0 \to M' \to M \to M'' \to 0$ is exact. Then $M' \otimes N \xrightarrow{\sigma} M \otimes N \to M'' \otimes N \to 0$ is also exact. However $\sigma$ is surjective, thus $M'' \otimes N = 0$. But then $$ 0 = (M'' \otimes N) \otimes M \cong M'' \otimes (N \otimes M) \cong M'' \otimes R \cong M'', $$ therefore $M = M'$. So $M$ is indeed finitely generated.