## Over an integral domain, rank N + rank M/N = rank M

Let $R$ be an integral domain, let $M$ be a (left, unital) $R$-module, and let $N \subseteq M$ be a submodule. Prove that $\mathsf{rank}(N) + \mathsf{rank}(M/N) = \mathsf{rank}(M)$.

Suppose $S = \{s_i\} \subseteq N$ is a cardinality-maximal linearly independent set, and choose $T = \{t_i\} \subseteq M$ such that $\overline{T} \subseteq M/N$ is a cardinality-maximal linearly independent set and $T$ and $\overline{T}$ have the same cardinality. Note in particular that $S \cap T$ is empty. We claim that $S \cup T$ is linearly independent in $M$. To see this, suppose $\sum r_i s_i + \sum r_i^\prime t_i = 0$. Mod $N$, we see that $\sum r_i^\prime \psi(t_i) = 0$, so that $r_i^\prime = 0$. But then $\sum r_is_i = 0$, so that $r_i = 0$. Thus $S \cup T$ is linearly independent in $M$. In particular, $\mathsf{rank}(M) \geq \mathsf{rank}(N) + \mathsf{rank}(M/N)$.

Now let $A \subseteq M$ be the submodule generated by $S \cup T$. We claim that $M/A$ is torsion. Suppose to the contrary that $M/A$ is not torsion; that is, that there exists $y \in M/A$ such that if $ry \in A$, then $r = 0$. In other words, if $ry + \sum r_i s_i + \sum r_i^\prime t_i = 0$, then $r = 0$, and hence $r_i = r_i^\prime = 0$. Thus $S \cup T \cup \{y\}$ is linearly independent. If $y \in N$, then we violate the maximality of $S$, and if $y \notin N$, then we violate the maximality of $T$. So $M/A$ must be torsion. By this previous exercise, $\mathsf{rank}(M) = \mathsf{rank}(N) + \mathsf{rank}(M/N)$.