Bases for submodules of free modules over a PID

I have proved the following:

If $G$ is a free abelian group of rank $n$ and $H$ is a subgroup of $G$, then $H$ is free of rank $m\leq n$. Moreover, there exists a $\mathbb{Z}$-basis $x_1,\ldots,x_n$ for $G$ and $a_1,\ldots,a_m \in \mathbb{Z}$ such that $a_1x_1,\ldots,a_mx_m$ is a $\mathbb{Z}$-basis for $H$.

Does this theorem generalize if I replace $\mathbb{Z}$ by any PID $R,$ "abelian group" by "$R$-module" and "subgroup" with "submodule"?

Many thanks!

• If you mean for "free modules of finite rank over a PID", then the answer is yes, and you can find it in most of the algebra textbooks. – user26857 Feb 23 '15 at 20:23
• even the bit about bases? – user218740 Feb 23 '15 at 20:25
• Yes! Even about the basis part. What's more, you can choose those $a_i$'s in such a way that $a_1|a_2| \cdots |a_m$. – Krish Feb 23 '15 at 20:26
• thank you for your replies :) – user218740 Feb 23 '15 at 20:32