Let $R$ be an integral domain, let $K = \operatorname{Frac}(R)$ be its fraction field, and let $\iota: R \to K$ be the canonical injective ring homomorphism. Let $n$ be a positive integer, let $R^n$ denote the coordinatewise $R$-module of $n$-tuples with entries in $R$, and let $K^n$ denote the coordinatewise $K$-vector space of $n$-tuples with entries in $K$. Let $M$ be an $R$-module, and assume there exists an $R$-module isomorphism $\varphi: M \to R^n$. Regard $K$ as an $R$-module through $\iota$, so that $r \in R$ acts on $a \in K$ by $\iota(r)a$. Regard $K \otimes_R M$ and $K \otimes_R R^n$ as $K$-vector spaces through left multiplication on the first tensor factor. If the rank of an $R$-module over the integral domain $R$ is defined by
paragraph
admin
\begin{align*}
\operatorname{rank}_R M = \dim_K(K \otimes_R M),
\end{align*}
latex_env
admin
then
paragraph
admin
\begin{align*}
\operatorname{rank}_R M = n.
\end{align*}