The fundamental structure theorem for modules over a PID is a direct sum decomposition of each module into a free part and a torsion part. To understand both parts, it helps to look more closely at the ideas of linear (in)dependence and rank.

Definition of linear dependence

Let $M$ be a left $R$-module. A set of elements $\{{m}_{1},\dots ,{m}_{k}\}\subseteq M$ is $R$-linearly dependent if there exist ${r}_{1},\dots ,{r}_{k}\in R$ (not all zero) such that

Rank bounds the number of linearly independent elements

Let $R$ be an integral domain and $M$ be a free $R$-module of finite rank $n$. Then any set of more than $n$ elements in $M$ is $R$-linearly dependent.

Let $S\subseteq M$ be any subset of more than $n$ elements. Let $F=\mathrm{Frac}(R)$ be the field of fractions of $R$. Since we have an $R$-module isomorphism $M\simeq \underset{i=1}{\overset{n}{\u2a01}}R\simeq {R}^{n}$ and an injective $R$-module morphism $R\hookrightarrow F$ (since $R$ is an integral domain), we also have an injective $R$-module morphism $M\hookrightarrow \underset{i=1}{\overset{n}{\u2a01}}F\simeq {F}^{n}$. Then (the image of ) $S$ is a set of more than $n$ elements in the $n$-dimensional $F$-vector space ${F}^{n}$ and hence must be $F$-linearly dependent. For any nontrivial $F$-linear dependence relation among the elements in $S$, clearing denominators yields a nontrivial $R$-linear dependence relation among the elements in $S$. Thus, the set $S$ is $R$-linearly dependent.

Definition of rank of a module

Let $R$ be an integral domain and $M$ be an $R$-module. The rank of $M$ is the maximum^{[1]} number of $R$-linearly independent elements in $M$.

When $M$ is a free $R$-module, this notion of rank agrees with our previous notion. When $R=F$ is a field, this notion of rank matches the dimension of an $F$-module $M$ as a vector space.

For a general integral domain, however, an $R$-module of rank $n$ need not have a "basis." Even if $M$ is torsion free, it still might not be a free $R$-module. For example, you can show that when a ring $R$ is considered as an $R$-module, an ideal $I\subseteq R$ is a free $R$-module exactly when it is principal. So for example, in the ring $\mathbf{Z}[x]$ the ideal $I=(2,x)$ is not principal and hence not a free $\mathbf{Z}[x]$-module. The ring $\mathbf{Z}[x]$ is an integral domain, though, so $I$ is torsion free.

The structure of free modules over a PID

Let $R$ be a principal ideal domain and $M$ be a free $R$-module of finite rank $k$. For every submodule $N$ of $M$:

$N$ is free of rank $l\le k$; and

there exists a basis $\{{m}_{1},\dots ,{m}_{k}\}$ for $M$ and nonzero elements ${a}_{1},\dots ,{a}_{l}\in R$ such that $\{{a}_{1}{m}_{1},\dots ,{a}_{l}{m}_{l}\}$ is a basis for $N$ and^{[2]}

$${a}_{1}\mid {a}_{2}\mid \cdots \mid {a}_{l}.$$

Let's walk through the proof of this one. If $N$ is the trivial submodule then its rank is 0 and its basis is the empty set, so there's nothing to prove. Now suppose $N$ is nontrivial. We'll break this long proof until manageable subsections.

The general idea

The general idea of the proof is to create a direct sum decomposition $M=({m}_{1})\oplus \cdots \oplus ({m}_{k})$ that also induces a direct sum decomposition $N=({a}_{1}{m}_{1})\oplus \cdots \oplus ({a}_{l}{m}_{l})$ with the prescribed properties. One of those properties (the divisibility condition on the ${a}_{i}$) tells us that ${a}_{1}$ should be the "smallest" element among the ${a}_{i}$; i.e., correspond to the largest ideal $({a}_{1})\subseteq R$ among the ideals $({a}_{i})\subseteq R$. So that's where we begin: by looking for a projection from $M\to R$ for which the image of $N$ is the largest possible ideal of $R$ (obtainable from $N$).

We begin by fixing a temporary basis $\{{m}_{1}^{\prime},\dots ,{m}_{k}^{\prime}\}$ for $M$. This is equivalent to fixing an $R$-module isomorphism $M\simeq F(\{{x}_{1},\dots ,{x}_{k}\})\simeq R\oplus \cdots \oplus R\simeq {R}^{k}$. This also allows us to define the $R$-module projection morphisms ${\pi}_{i}:M\to R$. Using these projections, each element $m\in M$ can be written uniquely as

Note that for every $R$-module morphism $\varphi :M\to R$ the image $\varphi (N)$ of $N$ is a submodule of $R$, i.e., an ideal of $R$. Since $R$ is a PID this ideal is principal, say $\varphi (N)=({a}_{\varphi})$ for some ${a}_{\varphi}\in R$. Now consider the collection $S$ of all such principal ideals in $R$ that are also nontrivial:

We first note that this collection is nonempty: since $N$ is not the trivial submodule, for at least one of the projection morphisms ${\pi}_{i}:M\to R$ the image ${\pi}_{i}(N)$ must be nontrivial, otherwise we would have for all $n\in N$

Since $R$ is Noetherian the collection $S$ has at least one maximal element. In other words there is an $R$-module morphism $\nu :M\to R$ so that the principal ideal $\nu (N)=({a}_{\nu})$ is not properly contained in any other element of $S$.^{[3]} Let ${a}_{1}={a}_{\nu}$ and ${n}_{1}\in N$ be any element with $\nu ({n}_{1})={a}_{1}$. Note that ${a}_{1}\ne 0$ by the definition of $S$.

Constructing the element ${m}_{1}$

Our next goal is to construct an element ${m}_{1}\in M$ so that $\nu ({m}_{1})={1}_{R}$. Intuitively, we already have $\nu ({n}_{1})={a}_{1}$ and so it would be nice to simply take ${m}_{1}={a}_{1}^{-1}{n}_{1}$. We would then have $\nu ({m}_{1})=\nu ({a}_{1}^{-1}{n}_{1})={a}_{1}^{-1}\nu ({n}_{1})={a}_{1}^{-1}{a}_{1}={1}_{R}$. However, there is no guarantee that the element ${a}_{1}\in R$ is actually invertible. We only know that it is nonzero and that $R$ is a PID (and not necessarily a field). So we need to be a little bit tricky.

We first show ${a}_{1}$ divides $\varphi ({n}_{1})$ for every $R$-module morphism $\varphi :M\to R$. To see this, fix some $R$-module morphism $\varphi :M\to R$ and let $I=({a}_{1},\varphi ({n}_{1}))$ be the ideal generated by ${a}_{1}$ and $\varphi ({n}_{1})$. Since $R$ is a PID this ideal is principal, so $I=(d)$ for some $d\in R$. We can then write $d={r}_{1}{a}_{1}+{r}_{2}\varphi ({n}_{1})$ for some ${r}_{1},{r}_{2}\in R$. But now consider the $R$-module morphism $\psi :M\to R$ defined by $\psi ={r}_{1}\nu +{r}_{2}\varphi $. By construction we have $\psi ({n}_{1})={r}_{1}\nu ({n}_{1})+{r}_{2}\varphi ({n}_{1})={r}_{1}{a}_{1}+{r}_{2}\varphi ({n}_{1})=d$, so that $d\in \psi (N)$ and hence $(d)\subseteq \psi (N)$. But we also have $({a}_{1})\subseteq (d)\subseteq \psi (N)$ so by the maximality of $({a}_{1})$ we must have equality: $({a}_{1})=(d)=\psi (N)$. This prove $({a}_{1})=(d)$ and hence $\varphi (n)\in ({a}_{1})$; i.e., ${a}_{1}$ divides $\varphi ({n}_{1})$.

We now apply the above property to the projection morphism ${\pi}_{i}:M\to R$, and so we see that ${a}_{1}$ divides ${\pi}_{i}(n)$ for each $i=1,\dots ,k$. Write ${\pi}_{i}({n}_{1})={a}_{1}{b}_{i}$ for some ${b}_{i}\in R$ and define

We therefore have that ${a}_{1}=\nu ({n}_{1})=\nu ({a}_{1}{m}_{1})={a}_{1}\nu ({m}_{1})$ and hence (since ${a}_{1}$ is nonzero and $R$ is an integral domain)

$$\nu ({m}_{1})={1}_{R}.$$

Verifying ${m}_{1}$ can be part of a basis for $M$

We will now verify that ${m}_{1}$ can be taken as one element in a basis for $M$ and that ${a}_{1}{m}_{1}$ can be taken as one element in a basis for $N$. First, let $m\in M$ be an arbitrary element and write

and so $m-\nu (m){m}_{1}$ is in the kernel of $\nu :M\to R$. This shows that we at least have $M=({m}_{1})+\mathrm{ker}(\nu )$. To see that this is a direct sum decomposition, suppose $r{m}_{1}\in \mathrm{ker}(\nu )$ for some $r\in R$. Then

Thus, we do indeed have $({m}_{1})\cap \mathrm{ker}(\nu )=(0)$ and hence we have a direct sum decomposition $M=({m}_{1})\u2a01\mathrm{ker}(\nu )$. This implies that ${m}_{1}$ can indeed be taken as one element in a basis for $M$.

Verifying ${a}_{1}{m}_{1}$ can be part of a basis for $N$

Observe that for every ${n}^{\prime}\in N$ the element $\nu ({n}^{\prime})$ is divisible by ${a}_{1}$ (since ${a}_{1}$ generates the ideal $\nu (N)$). So given any ${n}^{\prime}\in N$ we can write $\nu ({n}^{\prime})=b{a}_{1}$ for some $b\in R$. Then we can write

We therefore have $N=({a}_{1}{m}_{1})+(N\cap \mathrm{ker}(\nu ))$, and once again the trivial intersection between those two submodules proves this is a direct sum decomposition, $N=({a}_{1}{m}_{1})\oplus (N\cap \mathrm{ker}(\nu ))$. This implies ${a}_{1}{m}_{1}$ can indeed be taken as one element in a basis for $N$.

Proving $N$ is free of rank no more than $k$

We now prove $N$ is free of rank $l\le k$, by induction on $l$. (Recall that the rank of $N$ is defined as the maximum number of linearly independent elements in $N$.)

If $l=0$, then for every $n\in N$ the set $\{n\}$ is $R$-linearly dependent; i.e., $rn={0}_{N}$ for some nonzero $r\in R$. But $N$ is a submodule of the free $R$-module $M$, which is torsion free, so we must have $n=0$. This implies $N=(0)$ is the trivial submodule, a contradiction to our running assumption that $N$ is nontrivial.

Now assume that the rank of $N$ is $l>0$ and that all submodules of $M$ of rank less than $l$ are free. In our direct sum decomposition $N=({a}_{1}{m}_{1})\u2a01(N\cap \mathrm{ker}(\nu ))$, the submodule $N\cap \mathrm{ker}(\nu )$ has rank $l-1$ and hence by our induction hypothesis is free. By the direct sum decomposition, adjoining ${a}_{1}{m}_{1}$ to any basis for $N\cap \mathrm{ker}(\nu )$ gives a basis for $N$, so $N$ is also free (of rank $l$).

Proving property (2) of the proposition

Finally, we prove property (2) of the proposition by induction on the rank $k$ of $M$. Applying property (1) to the submodule $\mathrm{ker}(\nu )$ shows that this submodule is free, and because of the direct sum decomposition