Definition of direct sum of modules? I have just started studying modules, and am trying to figure out the definition of the direct sum of modules but I'm having trouble since different sources seem to give different definitions, for example:
MIT says:
The direct sum of the Mλ is the subset of restricted vectors:
$\bigoplus$ $M_{λ}$ := {($m_{λ}$) | $m_{λ}$ = 0 for almost all λ} 
Wolfram MathWorld says:
The direct sum of modules A and B is the module
A $\bigoplus$ B={a$\oplus$b|a $\in$ A,b $\in$ B},   
where all algebraic operations are defined componentwise.
[What is $\oplus$ anyway?]
My lecture notes say:
Define the direct sum of modules as the set theoretical product with the
natural addition and multiplication by elements of A.

The only one that makes sense to me is the last one, but it doesn't seem to agree with the other two
 A: Let $A,B$ be $R$-modules.  The direct sum $A\oplus B= \{(a,b) | a\in A, b\in B \}$ is a module under component wise operations: $(a_1,b_1)+(a_2,b_2)=(a_1+a_2,b_1+b_2)$ and $r(a,b)=(ra,rb)$.
This extends to a direct sum of finitely many $R$-modules.  However, for a direct sum of infinitely many $R$-modules, there is a further requirement that elements have all but finitely many components equal to $0$.
A: For finitely many summands everything agrees. Then $A\oplus B$ is what you wrote, and this holds in the same way for finitely many summands. For infinitely many summands there are differences, and we need to distinguish between $\oplus M_i$ and $\prod M_i$. This is expalined in books on rings and modules. A good example is the free $\mathbb{Z}$-module $\oplus_i \mathbb{Z}$, whereas the module $\prod_i \mathbb{Z}$ is not free, hence not projective.
A: In the second definition, the $\oplus$ in the set is just a symbol - $a\oplus b$ is just another way of writing the pair $(a,b)$, which should tell you why this definition is the same as the one in your lecture notes. The first definition is slightly different because it's telling you how to define the direct sum of any (possibly infinite) set of modules. If $\lambda\in\{1,2\}$ then the condition in the definition is vacuous, and you have the set of pairs $(m_1,m_2)$ with $m_i\in M_i$, as in the other two definitions. (This first definition doesn't discuss the operations, but again they are the "natural" ones).
You can define the direct sum of any finite set of modules inductively using definitions 2 and 3, but the first one is the only one that tells you what to do if you have an infinite set of modules.
