# Associativity of the internal direct sum

Let $${{M}_{1}},{{M}_{2}},...,{{M}_{n}}$$ be submodules of an $$R$$-module $$M$$. We define the external direct sum as$${{M}_{1}}+{{M}_{2}}+...+{{M}_{n}}=\left\{ {{m}_{1}}+{{m}_{2}}+...+{{m}_{n}}\left| \forall i\in \left\{ 1,2,...,n \right\}:{{m}_{i}}\in {{M}_{i}} \right. \right\}$$. On the other hand, the internal direct sum has an additional condition:

$${{M}_{1}}\oplus {{M}_{2}}\oplus ...\oplus {{M}_{n}}=\forall j\in \left\{ 1,2,...,n \right\}:\left( {{M}_{1}}+{{M}_{2}}+...+{{M}_{j-1}}+{{M}_{j+1}}+...+{{M}_{n}} \right)\bigcap {{M}_{j}}=\left\{ 0 \right\}$$

This condition ensures that, for instance, every element of the set $${{M}_{1}}\oplus {{M}_{2}}\oplus ...\oplus {{M}_{n}}$$ can be expressed as a sum $${{m}_{1}}+{{m}_{2}}+...+{{m}_{n}}\left| \forall i\in \left\{ 1,2,...,n \right\}:{{m}_{i}}\in {{M}_{i}} \right.$$ in a unique way.

My question is whether this proof is correct. Let $${{M}_{1}},{{M}_{2}},{{M}_{3}}$$ be arbitrary submodules of an $$R$$-module $$M$$. Obviously,

$${{M}_{1}}+{{M}_{2}}=\left\{ {{m}_{1}}+{{m}_{2}}\left| {{m}_{1}}\in {{M}_{1}}\And {{m}_{2}}\in {{M}_{2}} \right. \right\}$$

and

$$\left( {{M}_{1}}+{{M}_{2}} \right)+{{M}_{3}}=\left\{ {{m}_{s}}+{{m}_{3}}\left| {{m}_{s}}\in {{M}_{1}}+{{M}_{2}}\And {{m}_{3}}\in {{M}_{3}} \right. \right\}=\left\{ \left( {{m}_{1}}+{{m}_{2}} \right)+{{m}_{3}}\left| \left( {{m}_{1}}\in {{M}_{1}}\And {{m}_{2}}\in {{M}_{2}} \right)\And {{m}_{3}}\in {{M}_{3}} \right. \right\}$$

Applying the same method, we obtain $${{M}_{1}}+\left( {{M}_{2}}+{{M}_{3}} \right)=\left\{ {{m}_{1}}+{{\left( {{m}_{2}}+m \right)}_{3}}\left| {{m}_{1}}\in {{M}_{1}}\And \left( {{m}_{2}}\in {{M}_{2}}\And {{m}_{3}}\in {{M}_{3}} \right) \right. \right\}$$.

Therefore, $$\left( {{M}_{1}}+{{M}_{2}} \right)+{{M}_{3}}={{M}_{1}}+\left( {{M}_{2}}+{{M}_{3}} \right)$$. The internal direct sum is just a special case of the external direct sum, so $$\left( {{M}_{1}}\oplus {{M}_{2}} \right)\oplus {{M}_{3}}={{M}_{1}}\oplus \left( {{M}_{2}}\oplus {{M}_{3}} \right)$$. Could this be considered as a valid proof?

A note on terminology: What you call the "external direct sum" is what I would call the "sum" (of submodules of a fixed module $$M$$). For me, the external direct sum of $$M_1,\dots,M_n$$ is the set of ordered $$n$$-tuples $$\{(m_1,\dots,m_n)\mid m_i\in M_i \text{ for all }1\leq i \leq n\},$$ with the component-wise addition and scalar multiplication. Note that in the external direct sum, we don't need to know that the modules $$M_i$$ are submodules of some module $$M$$ - that's what makes it "external", rather than internal to $$M$$.