Sorry in advance for the long exposition; it is necessary to include it.
I am trying to understand the proof of this result from Dummit & Foote (so in particular, I can't use the result yet):
Let $R$ be a Principal Ideal Domain, let $M$ be a free $R$ - module of finite rank $n$ and let $N$ be a submodule of $M$. Then
$(1)$ $N$ is free of rank $m$, $m \le n$ and
$(2)$ there exists a basis $y_1, y_2, ..., y_n$ of $M$ so that $a_1y_1, a_2y_2, ..., a_my_m$ is a basis of $N$ where $a_1, a_2, ..., a_m$ are nonzero elements of $R$ with the divisibility relations
$$a_1|a_2| \cdots | a_m$$
Somewhere in the middle of the proof, it says:
We now verify that this element $y_1$ can be taken as one element in a basis for $M$ and that $a_1y_1$ can be taken as one element in a basis for $N$, namely that we have
$(a)$ $M=Ry_1 \oplus \ker v$, and
$(b)$ $N = Ra_1y_1 \oplus (N \cap \ker v)$
This is the part I have a question about. It seems like there is a hidden theorem here which says
($\pm$ some assumptions of $R$ being an integral domain or a P.I.D.)
If $M$ is a free $R$-module, $N$ is a submodule, and $M = Ry \oplus N$, then there exists a basis of $M$ containing $y$.
However, I do not know how to prove this. If we already assumed the result, it would not be difficult; just take any basis for $N$ and adjoin it to $y$. However, without the result I am stuck.
Question: Did I identify the hidden theorem correctly? If so, how do we prove it?