Direct sum of modules (source code)

= Direct sum of modules
{title2=$\bigoplus_{j\in J}M_j$}

The direct sum of a family of <modules> over the same <ring> consists of all tuples $(m_j)$ with $m_j\in M_j$ and only finitely many nonzero coordinates, with coordinatewise addition and scalar multiplication. For two <submodules> $N,P\subseteq M$, an internal direct sum $M=N\oplus P$ means $M=N+P$ and $N\cap P=\{0\}$. Equivalently, every element of $M$ is uniquely $n+p$: equality of two such expressions puts their difference in $N\cap P$. The projection $n+p\mapsto p$ is a <module homomorphism> with <kernel> $N$, image $P$, and square equal to itself.