Problem with Structure Theorem of PID modules proof I am using Lang's Algebra to prove the Structure Theorem for finitely generated modules over PIDs, and I am having difficulties understanding the proof of the existence of the decomposition for $E(p)$. $E$ is a torsion module over a PID $R$, $p \in R$ prime element, and 
$E(p)=\{m \in E\, ;\, p^nm=0 \, \textrm{for some positive interger n}\}$.
Lang starts with Lemma 7.6 which I understand just fine. The next step is what I do not grasp.
From what I could get, the idea is to show that there is an independent generator of $E(p)$, lets say $\{y_1,...,y_1\}$ and by having that, since it is independent you could see it as a direct sum of cyclic modules, i.e.
$(y_1,..,y_n)= (y_1)\bigoplus...\bigoplus (y_n) \cong\frac{R}{(p^{r_1})} \bigoplus....\bigoplus \frac{R}{(p^{r_n})}$
where $p^{r_i}$ is $y_i$'s period.
This is how he does it (its a copy paste):  
Lang's Proof (Sorry for the sloppiness of the picture, but it was the best I could do with my knowledge) 
Apart from the fact that I don't get the overall proof, here are some doubts that pop to mind:


*

*Is $\overline{E_p}$ well defined? ($E_p=\{m \in E \, ; pm=0\}$)


Because he defines $\overline{E}$ using an element $x_1$ with a maximal period, but $x_1$ is not necessarily in $E_p$


*Lang says he does it by induction, induction over what?


Sorry if the question is not very well formulated. Thanks in advanced.
 A: *

*It's actually $\overline E_p$ and not $\overline{E_p}$ : you take $F= \overline{E}$ and then $F_p$, not $F=E_p$ and then $\overline F$.

*The induction is over the number of generators : you assume the result for all modules that have less than $r$ generators, and prove it for those that have $r$. 
A: Since Brahadeesh indicated a desire for further elaboration in the comment on Max's answer, I'll give it a shot.
Following Lang, I'll assume "without loss of generality that $E = E(p)$." Lang proves the theorem via induction on $\dim E_p$ where $E_p = \{x\in E: px=0\}$ is considered as a vector space over $R/pR$.
Given $E$, Lang denotes $x_1 \in E$ some element with period $p^{r_1}$ such that $r_1$ is maximal. Then Lang defines $\bar E = E/(x_1)$. Lang's goal is to apply Lemma 7.6 in the following way: if we already know $\bar E$ has a decomposition 
$$ \bar E = (\bar y_1) \oplus (\bar y_2) \oplus \dots \oplus (\bar y_k) $$
then Lemma 7.6 guarantees that $E$ has the decomposition
$$ E = (x_1) \oplus (y_1) \oplus (y_2) \oplus \dots \oplus (y_k) $$
But the only way we can already know $\bar E$ has the direct sum decomposition is via the inductive hypothesis, which applies only if $\dim \bar E_p < \dim E_p$ (where $\bar E_p = \{\bar x \in \bar E : p\bar x =0\}$ is considered as a vector space over $R/pR$). So Lang must show $\dim \bar E_p < \dim E_p$. To do this, Lang uses Lemma 7.6 in a different way. Let $m = \dim \bar E_p$. Then we can find $m$ linearly independent elements $\bar y_1, \bar y_2, \dots, \bar y_m \in \bar E_p$. By Lemma 7.6, we can decompose $E = (x_1) \oplus (y_1, y_2, \dots ,y_m)$, and since there is some element in $(x_1)$ of period $p$, that element will give rise to a nonzero element of $E_p$ linearly independent of the elements which come from $(y_1, y_2, \dots, y_m)$. Thus $\dim E_p \geq m+1 > \dim \bar E_p$.
This means, by the inductive hypothesis, $\bar E$ has a decomposition
$$\bar E = (\bar x_2) \oplus (\bar x_3) \oplus \dots \oplus (\bar x_s) = R/(p^{r_2}) \oplus R/(p^{r_3}) \oplus\dots\oplus  R/(p^{r_s})$$
with $r_2 \geq r_3 \geq \dots \geq r_s$. Now, by Lemma 7.6,
$$ E = (x_1) \oplus (x_2) \oplus (x_3) \oplus \dots \oplus (x_s) = R/(p^{r_1}) \oplus R/(p^{r_2}) \oplus R/(p^{r_3}) \oplus\dots\oplus  R/(p^{r_s})$$
Since $r_1$ was chosen to be maximal, we also have $r_1 \geq r_2 \geq r_3 \geq \dots \geq r_s$, which is the last thing we needed.
