# When diagonalizing a matrix, do the square matrices multiplied with the original matrix have to be invertible?

Let's say we're converting a matrix $A$ into a diagonal matrix by the well-known algorithm: exchange rows and columns until the smallest element is placed on the $a_{11}$ position, and all other elements in this row and column are $0$. These actions are accomplished by multiplying with elementary matrices-exchanging rows, for example, is facilitated by multiplying $A$ with $\begin {pmatrix} 1&0&0&0\\0&0&1&0\\0&1&0&0\\0&0&0&1\end{pmatrix}$ if $A$ is a $4\times4$ matrix and we're exchanging the second and third rows. After this step is completed, we focus on the $3\times3$ matrix left, and again bring the lowest element to the $a_{22}$ position. This is facilitated by multiplying with the matrix $\begin {pmatrix} 0&0&0&0\\0&1&0&0\\0&0&0&1\\0&0&1&0\end {pmatrix}$, if we wish to exchange the second and third rows of the remainder $3\times3$ matrix. This matrix is not invertible, and neither is its product with the former invertible elementary matrix.

Hence, I don't understand how, when we say a matrix is diagonalized, we say $A'$ (the diagonalized matrix) $=QAP^{-1}$, when P may not even be invertible.

-
The algorithm to reduce a matrix to a diagonal matrix is different from Gaussian elimination. I don't understand the point you're making. Would be great if you could elaborate. Thanks –  Ayush Khaitan Apr 4 '13 at 16:01
Ah, right. Stupid comment, sorry. –  1015 Apr 4 '13 at 16:07

Regardless of whatever element I have in the 1-1 position, I will get the same result on multiplying with the resultant $3\times3$ matrix. Does this mean there are multiple ways to achieve the same result, or is my way just plain wrong? –  Ayush Khaitan Apr 4 '13 at 16:05
@AyushKhaitan I do not understand. Things will definitely be different for different $\alpha$. If you put $\alpha$ in the 1-1 position, you will multiply the first row of the matrix you wish to diagonalize by $\alpha$. That would be counterproductive when trying to determine what $Q$ and $P$ are. You can't be careless with the rows you have already "fixed". –  rschwieb Apr 4 '13 at 16:41
Let's suppose I have $\alpha$ in the 1-1 position. The matrix I am multiplying this matrix with has all $0$s in the $a_{11}$ row and column. Hence, $\alpha$ will have no impact on the form of the final product. –  Ayush Khaitan Apr 4 '13 at 16:45