In mathematics, an elementary matrix is a matrix which differs from the identity matrix by one single elementary row operation. The elementary matrices generate the general linear group of invertible matrices. Left multiplication (pre-multiplication) by an elementary matrix represents elementary row operations, while right multiplication (post-multiplication) represents elementary column operations. The acronym "ERO" is commonly used for "elementary row operations".
Elementary row operations are used in Gaussian elimination to reduce a matrix to row echelon form. They are also used in Gauss-Jordan elimination to further reduce the matrix to reduced row echelon form.
There are three types of elementary matrices, which correspond to three types of row operations (respectively, column operations):
If E is an elementary matrix, as described below, to apply the elementary row operation to a matrix A, one multiplies the elementary matrix on the left, E⋅A. The elementary matrix for any row operation is obtained by executing the operation on the identity matrix.
The first type of row operation on a matrix A switches all matrix elements on row i with their counterparts on row j. The corresponding elementary matrix is obtained by swapping row i and row j of the identity matrix.
The next type of row operation on a matrix A multiplies all elements on row i by m where m is a non-zero scalar (usually a real number). The corresponding elementary matrix is a diagonal matrix, with diagonal entries 1 everywhere except in the ith position, where it is m.
The final type of row operation on a matrix A adds row j multiplied by a scalar m to row i. The corresponding elementary matrix is the identity matrix but with an m in the (i,j) position.