## A characterization of rank in modules over an integral domain

Let $R$ be an integral domain and let $M$ be a (left, unital) $R$-module.

1. Suppose $M$ has rank $n$, and that $S = \{m_i\}$ is a linearly independent subset of $M$ having maximal cardinality. Let $N$ be the submodule of $M$ generated by $S$. Prove that $N$ is a free $R$-module having free rank $n$. Prove also that $M/N$ is torsion.
2. Conversely, prove that if there exists a submodule $N \subseteq M$ which is free and has free rank $n$ and such that $M/N$ is torsion, then $M$ has rank $n$.

1. Note that $N$ is free since its generating set $S$ is $R$-linearly independent, and that $S$ is a free generating set. Thus $N$ has free rank $n$. Now let $x+N \in M/N$. Note in particular that $x$ and $S = \{m_i\}$ are linearly dependent in $M$, since $S$ was a linearly independent set of maximal cardinality. Thus there exist $s,r_i \in R$ such that at least one of the $s,r_i$ is nonzero and $sx + \sum r_im_i = 0$. Suppose $s = 0$; then in fact $\sum r_i m_i = 0$, so that $r_i = 0$ for all $i$– a contradiction. Thus $s \neq 0$. Now $sx \in N$, so that $s(x+N) = 0$ in $M/N$. Thus $x+N$ is a torsion element. Since $x+N$ was arbitrary, $M/N$ is torsion.
2. Let $S \subseteq N$ be a free generating set (of cardinality $n$). It is certainly the case that $S$ is linearly independent in $M$, so that the rank of $M$ is at least $n$. Now let $T = \{t_i\}_{i=1}^{n+1}$ be a set of $n+1$ elements in $M$. Since $M/N$ is torsion, for each $t_i$, there exists a nonzero element $r_i \in R$ such that $r_it_i \in N$. If we have $r_it_i = r_jt_j$ for some $i$ and $j$, then $T$ is linearly dependent. Suppose this is not the case, so that $\{r_it_i\} \subseteq N$ is a subset having cardinality $n+1$. Since $N$ is free of free rank $n$, there exist nonzero $s_i$ such that $\sum s_ir_it_i = 0$. In particular, $T$ is linearly dependent in $M$. Hence the rank of $M$ is at most $n$. Thus the rank of $M$ is precisely $n$.