# Calculating the direct sum of cyclic modules?

This is stuff need to learn for PIDs.

But, in example it has

M=$\dfrac{R \oplus R \oplus R}{R(x+5,2,-3)+R(-1,X,1)+R(6,2,x-4)}$ where R=$\mathbb{C}[x]$.

In notes you put it in the matrix(

$M = \left[ {\begin{array}{*{20}c} -1 & x & 1 \\ x+5 & 2 & -3\\ 6 & 2 & x-4 \end{array} } \right]$

This is fine, but then in the notes this happens

$M = \left[ {\begin{array}{*{20}c} -1 & x & 1 \\ 0 & 2 +(x^2+5x) & -3+(x+5)\\ 0 & 2 +6x & x+2 \end{array} } \right]$

See I don't understand that calculation? How can do that?

In the notes it's described as taking a mutliple and subtracting the rows. However, I don't understand that.

Also, if R=$\mathbb{Q}[x]$ would it be the same way to work out diagonal matrix, but you aren't allowed to factorise stuff like $x^2-2$ and $x^2-1$?

-
You're doing row operations, but your "scalars" are now elements of $\mathbb{C}[x]$. Multiply the first row by $x+5$ and add it to the second row, and then multiiply the first row by $6$ and add it to the third. This is just what you would do with Gauss-Jordan. –  Chris Leary Dec 12 '11 at 2:35

You start with $$M = \left( {\begin{array}{ccc} -1 & x & 1 \\ x+5 & 2 & -3\\ 6 & 2 & x-4 \end{array} } \right).$$ Now add $(x+5)$ times the first row to the second row. Multiplying the first row by $(x+5)$ would give $(-(x+5), x^2+5x, x+5)$, which added to $(x+5, 2, -3)$ gives $(0, x^2+5x+2, x+2)$: $$\left( \begin{array}{ccc} -1 & x & 1 \\ 0 & x^2+5x+2 & x+2\\ 6 & 2 & x-4 \end{array} \right).$$ Adding $-6$ times the first row to the third row gives $$\left(\begin{array}{ccc} -1 &x & 1\\ 0 & x^2+5x + 2 & x+2\\ 0 & 6x+2 & x+2 \end{array}\right),$$ exactly what you have.
The point is that the module generated by $\mathbf{m}_1=(-1,x,1)$, $\mathbf{m}_2=(x+5,2,-3)$, and $\mathbf{m}_3=(6,2,x-4)$ is equal to the module generated by $\mathbf{n}_1=(-1,x,1)$, $\mathbf{n}_2=(0,x^2+5x+2,x+2)$, and $\mathbf{n}_3(0,6x+2,x+2)$: because \begin{align*} \mathbf{n}_1 &= \mathbf{m}_1,\\ \mathbf{n}_2 &= \mathbf{m}_2 + (x+5)\mathbf{m}_1,\\ \mathbf{n}_3 &= \mathbf{m}_3 + 6\mathbf{m}_1; \end{align*} so $\langle \mathbf{n}_1, \mathbf{n}_2,\mathbf{n}_3\rangle\subseteq \langle\mathbf{m}_1,\mathbf{m}_2,\mathbf{m}_3\rangle$. On the other hand, \begin{align*} \mathbf{m}_1 &= \mathbf{n}_1,\\ \mathbf{m}_2 &= \mathbf{n}_1 - (x+5)\mathbf{n}_1,\\ \mathbf{m}_3 &= \mathbf{n}_3 - 6\mathbf{n}_1; \end{align*} so $\langle \mathbf{m}_1,\mathbf{m}_2,\mathbf{m}_3\rangle\subseteq \langle\mathbf{n}_1,\mathbf{n}_2,\mathbf{n}_3\rangle$, giving equality.
If $R=\mathbb{Q}[x]$, you can multiply a row by any nonzero rational, but you cannot divide by nonconstant polynomials because they are not invertible in $R$. You can get to a diagonal matrix, which will be the Smith normal form.