Decomposition of abelian finite $p-$groups

Here is the beginning of a proof that

Every abelian finite group $(B,+)$ with $|B|=p^r$ ($p$ prime, $r\in\mathbb{N}$) is isomorphic to a direct product of cyclic groups.

By induction on $r$. If $r=1$, then $B$ is cyclic.

Else let $b\in B$ of maximal order and $B_1$ the cyclic group generated by $b$. We use the induction hypothesis on $\bar B=B/B'$: $$\bar B\cong \bar B_1\times \bar B_2\times\cdots \times \bar B_k$$ where $\bar B_1, \dots, \bar B_k$ are cyclic groups.

Then the proof uses that

$$\bar B_1+ \bar B_2+\cdots+ \bar B_k\cong \bar B_1\times \bar B_2\times\cdots\times \bar B_k \ \small (1)$$ to prove that there exists cyclic sub-groups of $B$, $B_1, \dots, B_k$ such that $$B_1+\cdots+B_k\cong B_1\times\cdots\times B_k$$

The isomorphism $\small (1)$ should be obvious as it is given without any details, but I am unable to understand why it holds.

Could someone enlighten me ?

-
Ehr... where did the $A_i$ come from? Is that last displayed equation meant to be $B_1+\cdots+B_k = B_1\times\cdots\times B_k$? –  Arturo Magidin Feb 24 '11 at 20:18
Yes, sorry. It is fixed, thank you. –  Klaus Feb 24 '11 at 20:21

You are identifying the cyclic group $\overline{B}_i$ with the subgroup $$\{(\overline{b}_1,\ldots,\overline{b}_k)\in \overline{B}\mid b_j=0\mbox{ for }j\neq i\}.$$ That is, you are going from the "external" direct product to the "internal" direct product.
The corresponding subgroups of $\overline{B}$ are disjoint ($\overline{B}_i\cap\mathop{\oplus}\limits_{j\neq i}\overline{B}_j = {0}$), and span $\overline{B}$. So you get that the sum equals $\overline{B}$, and hence is isomorphic to the direct product/sum of the groups.
Sorry, but I unfortunately do not understand... Isn't $C_i=\{(\overline{b}_1,\ldots,\overline{b}_k)\mid b_j=0\mbox{ for }j\neq i\}$ a subgroup of $\bar B_1\times \bar B_2\times...\times \bar B_k$ rather than one of $\bar B$ ? As they are disjoint and spanning the latter, we get $$\bar B\cong\bar B_1\times \bar B_2\times...\times \bar B_k=C_1+\dots+C_k\cong C_1\times\dots\times C_k$$ but then ? –  Klaus Feb 24 '11 at 19:58
@Klaus: $\overline{B}$ is isomorphic to the product, so there are corresponding subgroups in $\overline{B}$ that have the appropriate properties. (I'm identifying $\overline{B}$ with the direct product). These subgroups satisfy that their sum, as subgroups, equals their direct product (as groups) up to isomorphism. Perhaps if you tell me where you are getting this argument from, I can be of some help (since I haven't been of help so far). –  Arturo Magidin Feb 24 '11 at 20:01
@Klaus: Would you agree with the equation/isomorphism if $\overline{B}$ were exactly the product, as opposed to just isomorphic to it? –  Arturo Magidin Feb 24 '11 at 20:56