# 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
– user67803
Apr 4, 2013 at 16:01
• Ah, right. Stupid comment, sorry. Apr 4, 2013 at 16:07

The second matrix should simply contain a 1 in the 1-1 position. There is no reason to zero out that row of that permutation matrix. (In fact, one shouldn't really call it a permutation matrix if you make it singular like that.)

The presence of that 1 simply repeats the top row of the matrix you are multiplying it with, and so it won't be changed.

In general, there will be a growing identity matrix in the upper left hand corner of your permutation matrix, reflecting the fact that you want to leave those rows which you have already worked on unchanged. Something similar can be said for the column operations that you do on the right: the growing identity matrix reflects that you have stopped altering the first several columns.

• 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?
– user67803
Apr 4, 2013 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". Apr 4, 2013 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.
– user67803
Apr 4, 2013 at 16:45
• @AyushKhaitan OK, that is correct: but you will not always have all zeros in the top row. You might be trying to diagonalize a nonsingular matrix, for example. Apr 4, 2013 at 16:50