I'm taking Non Commutative Algebra course and today my professor left the following exercise: if $R$ is a ring and $M$ is an $R$-module writtem as $$M = \sum_{i=1}^{n} V_i,$$ where each $V_i$ is an irreducible module (there are not non trivial submodules), then $$M = \bigoplus_{s=1}^{k}V_{i_s}.$$ How can I prove it?
After this exercise, he suggest us this result: if $R$ is an unital ring such that $$A=\bigoplus_i V_i,$$ where each $V_i$ is an irreducible module and the sum is not necessarily finite, then $$A = \bigoplus_{s=1}^{k}V_{i_s}.$$
To prove the last one, I use the fact that $1 \in R$ and then, there are $i_1, \dots, i_k$ such that $$1 = e_{i_1} + \dots + e_{i_s},$$ where $e_{i_j}\in V_{i_j}$. Then, for $r \in R$, $$r = 1r = e_{i_1}r + \dots + e_{i_s}r.$$ Since $V_{i_j}$ is an $R$-module, then $e_{i_j}r\in V_{i_j}$. This implies that $r \in \bigoplus_{s=1}^{k}V_{i_s}$, and that $A = \bigoplus_{s=1}^{k}V_{i_s}$ as we wanted. Is this proof correct? Can I use this kind of idea to prove the first exercise?