Elementary matrices
The following three types of square matrices are called elementary matrices.
Scaling matrices
A scaling matrix is a special diagonal matrix.
It represents a diagonal matrix whose -th diagonal entry is , where is required not to be , and all other entries are .
In particular, when is , is the identity matrix .
Switching matrices
A switching matrix is a special symmetric matrix.
The entries of a switching matrix are all or . All other diagonal entries are ; only the -th and -th diagonal entries are , while the entries in row , column , and row , column , are .
A switching matrix requires and to be distinct.
Addition matrices
An addition matrix is obtained from the identity matrix by setting the entry in row , column , to .
An addition matrix requires and to be distinct. If is , then degenerates to the identity matrix .
An addition matrix is either an upper-triangular or a lower-triangular matrix.
Determinants of elementary matrices
The three types of elementary matrices have determinants:
Since the determinant of a product of square matrices equals the product of their determinants, together with the equivalence between elementary transformations and matrix multiplication described below, this property of elementary matrices can be used to calculate determinants.
Elementary transformations
Elementary row and column transformations can be performed not only on square matrices but also on a general matrix ; together, they are called elementary transformations.
There are three types of elementary row transformations and, similarly, elementary column transformations: scaling (multiplication), switching, and addition. We introduce elementary row transformations first:
- Multiply row by the nonzero number : .
- Swap rows and : .
- Add times row to row : .
Replacing rows in the operations above with columns gives elementary column transformations.
Among elementary transformations, switching can be implemented using scaling and addition. Clearly, addition cannot be implemented using scaling and switching. Using determinants, together with the equivalence between elementary transformations and matrix multiplication described below, one can also show that scaling cannot be implemented using addition and switching.
Therefore, compared with switching, scaling and addition are more fundamental operations. Switching is an auxiliary operation introduced to keep elimination ordered during the elimination method.
Elementary transformations and matrix multiplication
The three types of elementary matrices can be seen as the results of applying the corresponding transformation once to the identity matrix . The correspondence between linear transformations and matrices, described later, is analogous to the relationship here.
Regardless of whether matrix is square, applying an elementary row transformation to is equivalent to left-multiplying by an elementary matrix. Applying an elementary column transformation to is equivalent to right-multiplying by an elementary matrix.
Scaling operations
Left-multiplying by a scaling matrix is equivalent to multiplying row by . Right-multiplying by a scaling matrix is equivalent to multiplying column by .
The product of diagonal matrices is still diagonal; for diagonal-matrix multiplication, multiply the corresponding diagonal entries. Since the identity matrix is a special scaling matrix, while a scaling matrix requires not to be , any diagonal matrix whose diagonal entries are all not can be decomposed into a product of scaling matrices.
For a general diagonal matrix, there is a corresponding conclusion regardless of whether its entries are . Left-multiplying by a diagonal matrix is equivalent to multiplying each corresponding row by a factor equal to the corresponding diagonal entry. Right-multiplication by a diagonal matrix performs the same operation on the corresponding columns.
Since the determinant of the scaling matrix is , after scaling a row or column of a square matrix, its determinant becomes times the original determinant. The determinant of a diagonal matrix is the product of its diagonal entries.
Multiplication of scaling matrices is commutative, as is multiplication of diagonal matrices; when only diagonal matrices are involved in a product, their order may be arbitrary.
The scaling operation corresponding to the identity matrix leaves matrix unchanged, so this operation is not performed in practice.
Switching operations
Left-multiplying by a switching matrix is equivalent to swapping rows and . Right-multiplying by a switching matrix is equivalent to swapping columns and .
Analogously to scaling matrices and diagonal matrices, we introduce the concept of a permutation matrix. A permutation matrix is a square matrix with exactly one in every row and every column, and everywhere else. The identity matrix is also a special permutation matrix.
A permutation matrix is the same as permuting the rows of the identity matrix , and also the same as permuting the columns of the identity matrix . The identity matrix itself corresponds to the identity transformation.
Left-multiplying by a permutation matrix is equivalent to permuting the rows of the original matrix, while right-multiplying by a permutation matrix is equivalent to permuting its columns. The corresponding permutation is performed in the same way as permuting the rows or columns of the identity matrix .
Permutation matrices correspond exactly to permutations, and the multiplicative group of permutation matrices is isomorphic to the permutation group. By the theorem that any permutation can be decomposed into a product of switches when the identity transformation is regarded as a product of zero switches, every permutation matrix can likewise be decomposed into a product of switching matrices.
Since the determinant of a switching matrix is , after switching rows or columns of a square matrix, its determinant becomes times the original determinant.
Multiplication of switching matrices is not commutative, and neither is multiplication of permutation matrices.
The determinant of a permutation matrix is , where is the inversion count of the permutation corresponding to the permutation matrix, that is, the number of switches in its decomposition as a product of switches.
Addition operations
Left-multiplying by an addition matrix is equivalent to adding times row to row . Right-multiplying by an addition matrix is equivalent to adding times column to column .
If this is difficult to remember, observe what operation the addition matrix performs on the identity matrix ; the two correspond. Left multiplication operates on rows, and right multiplication operates on columns, following the mnemonic “left row, right column.”
Since the determinant of an addition matrix is , addition operations on a square matrix leave its determinant unchanged.
Multiplication of addition matrices is not commutative.
The addition operation corresponding to the identity matrix leaves matrix unchanged, so this operation is not performed in practice.
Upper-triangular matrices
An addition matrix is either upper-triangular or lower-triangular. Since the two types of matrices are symmetric about the main diagonal, we discuss upper-triangular matrices here. In fact, this example only requires elementary row transformations, not column transformations.
If all diagonal entries of an upper-triangular matrix are , it can be decomposed into a product of a sequence of addition matrices. The order is to first perform addition operations on the first row of the identity matrix , then on the second row of , and so on, until every row has been processed.
Because multiplication of addition matrices is not commutative, the order of the operations above cannot be changed.
If all diagonal entries of an upper-triangular matrix are not equal to , it can be decomposed into a product of a sequence of addition and scaling matrices. When operating on each row of the identity matrix , we can first scale that row, making its diagonal entry the specified nonzero value.
If an upper-triangular matrix has on its diagonal, it cannot be decomposed into a product of a sequence of elementary matrices.
Whether or not an upper-triangular matrix has on its diagonal, its determinant equals the product of its diagonal entries, just as for a diagonal matrix.
Converting a square matrix to a diagonal matrix using addition operations
Any square matrix can be converted to a diagonal matrix using only addition operations; this example requires both elementary row and elementary column transformations.
If the first row and first column of a square matrix contain nonzero entries, addition operations can make the upper-left entry nonzero. Elementary row and column transformations can then make every other entry in the first row and first column equal to .
If the first row and first column of a square matrix are already all , we can simply examine the second row and second column.
Using this method, we can even require all nonzero entries of the diagonal matrix to lie in the upper-left corner.
If the first row and first column of a square matrix are already all , examine whether the remaining rows and columns contain any nonzero entries. If they do, addition operations can make some entry in the first row or first column not equal to , reducing the situation to the initial case and making the upper-left entry not equal to .
Only when the remaining rows and columns also contain no nonzero entries is it impossible to make the upper-left entry nonzero; at that point, the remaining square matrix is already the zero matrix.
Canonical-form matrices
Using elementary transformations, any matrix, regardless of its shape, can be reduced to a canonical-form matrix.
A canonical-form matrix has an identity matrix as a submatrix in its upper-left corner, with everywhere else. The reduction method is similar to converting a square matrix to a diagonal matrix, and also uses scaling operations to turn each nonzero upper-left entry into .
After a matrix is converted to canonical form, the number of entries equal to is exactly the rank of the matrix.
Invertible matrices
Let be an -th order matrix. If there exists an -th order matrix such that , then is called an invertible or nonsingular matrix, and is called the inverse matrix of , denoted by .
If matrix is invertible, the inverse matrix of is uniquely determined by .
The inverse of an invertible matrix is also invertible, and the inverse of is .
The product of two invertible matrices and is also invertible, with inverse .
The transpose of an invertible matrix is also invertible, and the transpose of the inverse equals the inverse of the transpose.
Inverses of elementary matrices
Every elementary matrix is invertible, and its inverse is an elementary matrix of the same type:
Clearly, the identity matrix is invertible, and its inverse is still .
Elementary transformations preserve invertibility: before and after a transformation, the matrices are either both invertible or both non-invertible.
Matrix is invertible if and only if can be written as a product of elementary matrices, equivalently, if and only if it can be transformed into the identity matrix by elementary transformations.
After determinants are introduced, we will know that:
Matrix is invertible if and only if matrix has rank , if and only if matrix has determinant not equal to .
A simple notation is to let be the matrix whose entry in row , column , is and whose other entries are zero. Then
This notation can also be applied to their inverses.
Applications
Solving systems of linear equations
For a system of linear equations, the coefficients before the unknowns form the coefficient matrix. Appending the constant terms of the system to the right of the coefficient matrix forms the augmented matrix.
Using elementary row transformations, the augmented matrix corresponding to a system of linear equations can first be converted into row echelon form and then into reduced row echelon form, completing the solution of the system. This method is called solving a system of linear equations by elimination; the Gauss–Jordan elimination described later is an elimination algorithm that follows a prescribed order.
Determinant calculation
Since the determinant of a product of square matrices equals the product of their determinants, the determinants of elementary matrices are convenient to calculate, and since elementary transformations are equivalent to multiplication by elementary matrices, elementary transformations are also used when calculating determinants.
Because performing elementary transformations in a prescribed order is more convenient for writing programs, determinant calculation can also use the Gauss–Jordan elimination algorithm described later.