Invariance Theorem (Modules over a p.i.d). Jacobson's Basic Algebra I Well, in the cited book, (at page 192) Jacobson proves the following:

Let $M=Dz_1\oplus\cdots \oplus Dz_s=Dw_1 \oplus \cdots Dw_t$, where $\mathrm{ann}(z_1)\supset \mathrm{ann}(z_2)\supset \cdots \supset \mathrm{ann}(z_s)$ and $\mathrm{ann}(w_1)\supset \mathrm{ann}(w_2)\supset \cdots \supset \mathrm{ann}(w_t)$ and none of the components are 0. Then $s=t$ and $\mathrm{ann}(z_i)=\mathrm{ann}(w_i),1\leq i \leq s$.

What I don't get is in the part Reduction to primary torsion modules.  I quote what I don't get:

" ...the theorem will follow for torsion modules if we can show that any two descompositions of $M$ as direct sums of primary cyclic submodules have the same set of order ideals. This amounts to showing that for any prime power $p^e$ the number of cyclic direct summands with order ideal $(p^e)$ is the same for the two descompositions. Now if we fix $p$ and form sum of the cyclic summands in each descomposition having order ideals of the form $(p^e),e=1,2,\ldots$, then both of these sums coincide with the $p$-component $M_p$..."

The boldface part is what I don't understand (but actually I'm not sure of understand the whole paragraph, so I'd be grateful by an explanation).
Thanks in advance
 A: I think I know what is confusing you, but it could be at a few different places:


*

*How to divide the cyclic components into the $p$-primary decomposition

*That it is enough to merely check that the $p$-primary components are the same 


An example might clear this up rather than trying to reword an abstract explanation. 
Suppose we have the torsion abelian group $\mathbb{Z}$-module $M=\mathbb{Z}/2\mathbb{Z}\oplus \mathbb{Z}/24\mathbb{Z} \oplus\mathbb{Z}/360\mathbb{Z}$. I'm writing this in a form that you can just read off the corresponding annihilator ideals as $(2)$, $(24)$, and $(360)$ for clarity. In the theorem you would have generators $a, b, c$ of orders $2$, $24$, and $360$ respectively to give $M=\mathbb{Z}a\oplus \mathbb{Z}b \oplus \mathbb{Z}c$.
The Lemma on page 190 tells us that each of these factors can split up into parts in which we mod out by things of the form $(p_i^{e_i})$. The first factor is already of this form.
The next one $\mathbb{Z}/24\mathbb{Z} \simeq \mathbb{Z}/2^3\mathbb{Z}\oplus \mathbb{Z}/3\mathbb{Z}$ 
and lastly $\mathbb{Z}/360\mathbb{Z} \simeq \mathbb{Z}/2^3\mathbb{Z}\oplus \mathbb{Z}/3^2\mathbb{Z}\oplus \mathbb{Z}/5\mathbb{Z}$.
Now the primary decomposition of $M$ is just collecting for each prime all the terms that involve that prime into the same place: 
$M_2=\mathbb{Z}/2\oplus\mathbb{Z}/2^3 \oplus \mathbb{Z}/2^3$
$M_3=\mathbb{Z}/3\oplus \mathbb{Z}/3^2$
$M_5=\mathbb{Z}/5$
Since everything in sight is a direct sum, $M\simeq M_2\oplus M_3\oplus M_5$. That's how you go from the cyclic decomposition to the primary and is what is described by the bolded part. To figure out $M_2$ we fix $2$ and then look at the parts of each of the cyclic factors that involve $2$ and then collect them together.
To prove the invariance theorem for the torsion part it turns out to be enough to now check that after this process we get the same $M_p$ independently of the original cyclic decomposition. This is because there is only one way to put them back together to satisfy the hypotheses of the structure theorem. 
Namely, you must take the highest power occuring in a factor of each $M_p$ (in the way I wrote it above the rightmost term) and group those together to get the last term of the original cyclic decomposition. Next group the next highest powers together until you get down to nothing. If you do it in any other way, then you won't get the correct containment property.
