# Writing a matrix as a product of elementary matrices.

So if I have a matrix and I put it into RREF and keep track of the row operations, I can then write it as a product of elementary matrices. An elementary matrix is achieved when you take an identity matrix and perform one row operation on it. So if we have a matrix like $\begin{bmatrix}1&0\\0&1\end{bmatrix}$, one elementary matrix could look like $\begin{bmatrix}1&0\\-1&1\end{bmatrix}$ for the row operation $r_2 - r_1$ or $\begin{bmatrix}1&0\\0&1/2\end{bmatrix}$ for the row operation $\dfrac{r_2}{2}$. So if you put a matrix into reduced row echelon form then the row operations that you did can form a bunch of elementary matrices which you can put together as a product of the original matrix. So if a have a $2\times{2}$ matrix, what is the most elementary matrices that can be used. What would that look like?

• Many people use "elementary matrix" to mean "matrix with 1's on the diagonal and at most one nonzero off-diagonal element". Such matrices have determinant 1, so every matrix that can be written as a product of elementary matrices in this sense must have determinant 1. Should you add anything to your question? – DCarter Oct 26 '16 at 16:09
• An elementary matrix is a matrix obtained from I (the infinity matrix) using one and only one row operation. – david mah Oct 26 '16 at 16:11
• So for a 2x2 matrix. Start with a 2x2 matrix with 1's in a diagonal and then add a value in one of the zero spots or change one of the 1 spots. – david mah Oct 26 '16 at 16:12
• So you allow elementary matrices to be diagonal but different from the identity matrix. You may want to edit your question to clarify this. It would also be helpful to say something about the matrix coefficients; do they belong to a field? – DCarter Oct 26 '16 at 16:23
• I updated my question with specific examples about elementary matrices. – david mah Oct 26 '16 at 16:37

If $a \ne 0$, then a $2\times 2$ matrix with $a$ in the upper corner can be written as a product of 4 matrices that are elementary in the sense described:
$$\left( \begin{array}{cc} 1 & 0 \\ \frac{c}{a} & 1 \end{array}\right) \left( \begin{array}{cc} a & 0 \\ 0 & 1 \end{array}\right) \left( \begin{array}{cc} 1 & 0 \\ 0 & d-\frac{bc}{a} \end{array}\right) \left( \begin{array}{cc} 1 & \frac{b}{a} \\ 0 & 1 \end{array}\right) = \left( \begin{array}{cc} a & b \\ c & d \end{array}\right)$$
Notice that when $a=1$, three elementary matrices suffice.
If $a=0$ but $c\ne 0$, then $$\left( \begin{array}{cc} 1 & \frac{1}{c} \\ 0 & 1\end{array}\right) \left( \begin{array}{cc} 0 & b \\ c & d\end{array}\right)= \left( \begin{array}{cc} 1 & * \\ c & d\end{array}\right)$$ Since $\left( \begin{array}{cc} 1 & * \\ c & d\end{array}\right)$ can be written as a product of 3 elementary matrices, $\left( \begin{array}{cc} 0 & b \\ c & d\end{array}\right)$ can again be written as the product of 4. A similar argument holds when $a=0$ but $b \ne 0$.
I'll leave the case $a=b=c=0$ to the reader.