Elementary Matrices and Row Operations
Suppose you are solving a linear system by Gaussian elimination. You swap rows, scale them, or add multiples of one to another. What is really happening to the matrix at each step? Every such row operation, it turns out, is nothing more than left multiplication by a specific invertible matrix. This single observation converts an entire computational technique — row reduction — into a statement in the algebra of matrix multiplication. It is the bridge between the mechanical process of elimination and the structural theory of Invertible Matrices. The idea matters because it explains why row reduction works. It explains why the solution set of a linear system is unchanged by elementary row operations. It explains why row reduction can be used to compute inverses. It also explains why the reduced row echelon form of a matrix is unique. Without this bridge, elimination looks like a bag of tricks. With it, elimination is revealed as repeatedly multiplying by invertible matrices. It is hence an instance of Matrix Multiplication as Composition of invertible linear maps. These are operations that never change the fundamental algebraic properties (rank, solution sets, column space relations) of the matrix being transformed. The big picture is this: there are exactly three types of elementary row operations. Each corresponds to a specific type of elementary matrix. That matrix is obtained by applying the operation to the identity matrix. Left-multiplying a matrix by an elementary matrix performs the corresponding row operation on . Elementary matrices are invertible with elementary inverses. Because of this, row-equivalence is an equivalence relation. Every matrix can be reduced to a unique canonical form by repeated left multiplication by elementary matrices. This canonical form is the reduced row echelon form (RREF). This article gives the precise definitions of the three elementary row operations and their matrices. It proves that left multiplication by an elementary matrix performs the corresponding operation. It proves that every elementary matrix is invertible. It also proves the existence and uniqueness of reduced row echelon form. Along the way we set up exactly the tools needed to later measure the Rank of a Matrix as an invariant of row-equivalence.
- Every elementary row operation on a matrix equals left multiplication by an elementary matrix obtained by applying that operation to the identity.
- There are three types: row swap, row scaling (by a nonzero scalar), and adding a multiple of one row to another.
- Every elementary matrix is invertible, and its inverse is again elementary (of the same type).
- Row-equivalence of matrices ( if for elementary ) is an equivalence relation.
- Every matrix has a reduced row echelon form obtainable via elementary matrices, and this RREF is unique.
- Elimination is invertible matrix algebra in disguise: solving by row reduction never changes the solution set because it multiplies both sides by invertible matrices.
- Key idea: row operations = left multiplication by invertible elementary matrices, so row reduction is a sequence of composed invertible linear maps.
Where this lives today
Row reduction via elementary matrices underlies LU decomposition in numerical linear algebra: factoring (or with a permutation matrix , itself a product of Type I elementary matrices) is precisely recording the elementary matrices used in Gaussian elimination without pivoting into a lower-triangular factor . This is the computational backbone of solving large linear systems in engineering simulation and scientific computing. In cryptography and coding theory, row reduction over finite fields (e.g. ) computes the rank and null space of parity-check matrices for linear codes, using exactly the elementary-matrix framework developed here, since the field-independence of the proofs (only requiring to be invertible in ) makes them apply verbatim over or . In statistics, Gauss-Jordan elimination (reduction all the way to RRECF) is used to invert covariance and design matrices in regression analysis, and the elementary-matrix viewpoint explains why numerically stable pivoting strategies (choosing which Type I swap to perform) do not change the final answer, only the arithmetic path taken. In pure mathematics, this machinery is the direct route to computing the rank of a matrix as an invariant of row-equivalence (foreshadowing Rank of a Matrix): since RRECF is unique and elementary matrices are invertible, the number of pivots — a property manifestly preserved by left multiplication by invertible matrices — becomes a well-defined invariant of the original matrix, independent of the elimination path chosen.
Ask the tutor: How does counting the pivots in a matrix's reduced row echelon form give a rigorous, well-defined notion of the rank of a matrix?
Let be integers and let be a matrix over a field , with rows . An elementary row operation on is one of the following three types.
Type I (row swap). For , interchange rows and .
Type II (row scaling). For a scalar with , replace by .
Type III (row addition). For and a scalar , replace by . For each such operation there is an associated elementary matrix of size : the matrix obtained by applying that same operation to the identity matrix . Explicitly, writing for the matrix with in position and elsewhere:
- Type I: , the matrix obtained from by swapping rows and .
- Type II: (that is, with its entry replaced by ).
- Type III: for (that is, with a inserted in the off-diagonal position).
Two matrices are called row-equivalent, written , if can be obtained from by a finite sequence of elementary row operations.
Intuition
Think of a matrix as a stack of row vectors. A row operation rearranges or recombines these rows without ever using more than "linear combination" moves that can be undone. The three types are exactly the ways to modify a list of vectors while keeping their span unchanged: you may reorder them, rescale one by a nonzero number, or add a multiple of one to another. None of these can create a linear combination not already present, and none can destroy one — each is reversible by an operation of the same type. The key trick of this article is bookkeeping: instead of describing the operation in words, encode it as a matrix by asking "what happens to under this same operation?" That matrix, left-multiplied onto , reproduces the operation on exactly, because matrix multiplication computes each row of the product as a linear combination of the rows of , with coefficients read off from the corresponding row of the left factor. This is the same principle behind Matrix Multiplication as Composition: the -th row of is the linear combination of rows of dictated by row of .
Central results
Let and let be the elementary matrix obtained by applying a given elementary row operation to . Then is the matrix obtained from by applying that same row operation to .
We use the fact that for matrices and , the -th row of equals
i.e., the -th row of the product is the linear combination of the rows of whose coefficients are the entries of row of . This is immediate from the definition of matrix multiplication: entry of is , and collecting this over all for fixed gives exactly the stated linear combination of the row vectors . We check each type.
Type I. Let , obtained from by swapping rows and (). Then row of is (the standard basis row with a in position ) and row of is ; every other row of equals . By the row-combination formula above:
- row of equals ,
- row of equals ,
- row of equals for .
Hence is exactly with rows and swapped, which is the Type I operation applied to .
Type II. Let (), obtained from by replacing row with ; every other row of equals . Then row of equals , and row of equals for . Hence is with row scaled by , which is the Type II operation applied to .
Type III. Let (), obtained from by adding times row to row : explicitly row of is , and every other row equals . Then row of equals , and row of equals for . Hence is with row replaced by , which is the Type III operation applied to . In all three cases equals with the corresponding elementary row operation applied.
∎Let be an elementary matrix. Then is invertible and is an elementary matrix of the same type. Specifically:
By the previous theorem (row operations are left multiplication by elementary matrices), left-multiplying by performs an elementary row operation, and every elementary row operation is reversible by another elementary row operation of the same type:
- Swapping rows twice returns to itself: applying Type I with the same undoes Type I.
- Scaling row by then by (valid since in the field ) returns row to its original value.
- Replacing by and then replacing the new by returns row to its original value, since row is untouched throughout.
Apply this reasoning with . Applying the Type I operation for indices to gives ; applying it again to returns . By the theorem, applying an operation to a matrix equals left-multiplying by the corresponding elementary matrix, so applying Type I twice to equals . Since this returns , we get , so is its own inverse. Similarly, applying to gives , and then applying the reverse scaling operation (scale row by ) to gives ; the reverse operation is left multiplication by , so . Since as well (scaling by then in either order returns to the start, by direct entrywise computation on the diagonal matrix), is invertible with inverse . Finally, applying to gives , and applying the reverse addition operation (add times row to row ) undoes it, giving ; this reverse operation is left multiplication by . Hence . A direct computation confirms as well: both are and types (using matrix units satisfying since ), so
Thus is invertible with inverse . In every case exists and is elementary of the same type.
∎For , define if for some finite sequence of elementary matrices (equivalently, is obtained from by a finite sequence of elementary row operations, by the theorem above). Then is an equivalence relation on .
Reflexivity. , and is (vacuously, or by convention) the empty product of elementary matrices; so .
Symmetry. If with each elementary, then since each is invertible with elementary inverse by the Lemma above, we have
which exhibits as obtained from by a finite sequence of elementary matrices ( first, ..., last). Hence .
Transitivity. If and for elementary matrices , then
a product of elementary matrices applied to , so . All three properties hold, so is an equivalence relation.
∎Every matrix is row-equivalent to exactly one matrix in reduced row echelon form (RREF), meaning satisfies: 1. Every row of that consists entirely of zeros lies below every nonzero row. 2. In each nonzero row, the first (leftmost) nonzero entry, called the pivot, equals . 3. Each pivot lies strictly to the right of the pivot in the row above it. 4. Each pivot column has in every entry other than the pivot itself.
Existence. We argue by induction on the number of columns . Base case : the unique matrix is vacuously in RREF. Inductive step: Suppose every matrix with fewer than columns can be row-reduced to RREF using elementary row operations. Let have columns. Consider the leftmost column of , say column , that contains a nonzero entry (if no such column exists, is the zero matrix, already in RREF). Suppose the nonzero entry is in row , i.e., . Apply a Type I operation (row swap , or the identity if ) to move this row to the top: this produces a matrix with nonzero entry in position . Apply a Type II operation to scale row so its entry becomes (valid since is invertible in the field ). Then, for each row with a nonzero entry in column , apply the Type III operation to clear it. After these steps, column has a single in row and elsewhere; call the resulting matrix , obtained from by finitely many elementary row operations, hence . Let be the submatrix of formed by rows and columns ; this has fewer than columns (indeed since ). By the inductive hypothesis, is row-equivalent, via elementary row operations acting on rows restricted to those columns, to a matrix in RREF. Performing the corresponding row operations on rows of the full matrix (leaving row and columns untouched, since these operations only add multiples of rows to each other, scale them, or swap them — never touching row ) transforms into a matrix whose submatrix on rows , columns is , and whose columns are unchanged from (in particular column is still the standard basis vector , since operations restricted to rows leave a column that is already zero in those rows unchanged, and leave row untouched). It remains to clear any nonzero entries appearing above a pivot introduced in the recursive step, in order to satisfy condition (4) for the newly created pivot columns from . Each pivot in , lying in some row and column , has entry there and in that column for all other rows (by being in RREF, condition 4, applied within rows ). If row has a nonzero entry in that pivot column, apply the Type III operation to clear it; this does not disturb column (still ) nor any other already-cleared pivot column, since row has zero entries in all columns to the left of except column where it is already , and zero entries in all other already-processed pivot columns (by induction, 's pivot columns are cleared amongst rows , and row 's only nonzero entries in columns are the pivot at itself, given RREF conditions 3–4 for ). Performing this clearing for each pivot column of , in order from left to right, yields a matrix satisfying all four RREF conditions, and is obtained from by a finite sequence of elementary row operations, so . This completes the induction, proving existence of an RREF for every .
Uniqueness. Suppose and are both in RREF and , . By the corollary above (row-equivalence is an equivalence relation), , so there is an invertible matrix (a product of elementary matrices) with . We show by proving that RRECF is determined by the linear-algebraic data of alone, which is preserved under left multiplication by an invertible matrix, using the following two facts, each of which we justify. Fact 1: left multiplication by an invertible matrix preserves the set of solutions to . Indeed , since invertible implies , and conversely . Hence and have the same solution set to and respectively — indeed the same set, since these are the same equation up to left-multiplying by : . Fact 2: left multiplication by an invertible matrix preserves, for every subset of column indices , whether the corresponding columns of are linearly dependent, and preserves the coefficients of any dependence. Indeed if are columns of with , then multiplying by gives with the same coefficients (since acts on columns of exactly as it acts on any vector, by linearity: , and ). Since is invertible this correspondence of dependence relations is exact (reversible using ). Now we determine the pivot columns of an RRECF matrix purely from these two data (solution sets and column dependencies), which are shared by and since with invertible. Claim: column of is a pivot column if and only if column of is not a linear combination of the columns of strictly to its left. If column is a pivot column, it is the standard basis vector for the row of that pivot (by RREF conditions 2,4), and no column strictly to the left of has a nonzero entry in row (by RRECF condition 3: any pivot in a row above occurs strictly left of 's column only among columns left of , contributing to rows above , and condition 1 makes rows below the last pivot row zero; more directly, since is in echelon form, the pivot at is the first nonzero entry of row , so every column left of has in row , hence any combination of them has in coordinate , whereas column has there) — so cannot be written as such a combination. Conversely if column is not a pivot column, then (by the echelon structure) it lies weakly to the right of some pivot column(s) whose pivot rows cover every nonzero entry appearing in column : precisely, writing column 's nonzero entries as occurring only in rows that are pivot rows for columns (an immediate consequence of the echelon conditions 1–3, since row can have a nonzero entry in column only if row 's pivot column is , otherwise the leftmost nonzero entry of row would occur to the right of , contradicting a nonzero entry at column pivot column), column is exactly the linear combination of the pivot columns at or before with coefficients equal to its own entries in those pivot rows (again since each pivot column is a standard basis vector). This claim characterizes the pivot columns of via Fact 2's invariant (linear dependence on columns to the left), so and have pivot columns in the identical set of positions . Next, for each pivot column , both and restricted to that column equal (the -th standard basis vector), by RRECF condition 2 and 4 together with condition 3 (pivots occur in strictly increasing rows as columns increase, and since are the pivot columns in order, the pivot rows must be respectively — the only way to satisfy strict monotonicity starting from row , using also that rows above the first pivot row cannot exist by condition 1). So and agree exactly on all pivot columns. Finally, for a non-pivot column , both and are the unique linear combination of the pivot columns at or before reproducing that column's entries in the pivot rows (as shown in the Claim's converse direction) — and since agree on all pivot columns and (by Fact 2, applied to the specific set of columns where is the last pivot column ) the coefficients of the dependence of column on the earlier pivot columns are shared between and , the non-pivot columns of and coincide as well. Hence column by column, proving uniqueness.
∎Worked examples
Example 1 — writing elimination as an explicit product of elementary matrices. Let
We row-reduce and track every elementary matrix used. Step 1. Scale row by : .
Step 2. Clear column below the pivot: , i.e. .
Step 3. , i.e. .
Step 4. Clear column below the pivot: , i.e. .
Step 5. Scale row : .
Step 6. Clear column above the pivot: (), then ():
Step 7. Clear column above the pivot: , :
So is row-equivalent to (its RREF is ), and setting (a product of elementary matrices, each invertible by the Lemma), we get , so . This exhibits the standard fact that row-reducing to while performing the identical operations on simultaneously computes — because that parallel bookkeeping is exactly accumulating the product . As a check: , consistent with being invertible (RREF ).
Example 2 — a matrix whose RREF has a free column, illustrating non-invertible reduction. Let
Step 1. (), ():
Step 2. Column has no nonzero entry below row — it is not a pivot column. Move to column : scale row by ():
Step 3. ():
Step 4. Clear column above its pivot: ():
This satisfies all four RRECF conditions: pivots in columns , each equal to , each pivot column clear elsewhere, pivot columns strictly increasing left to right, and the zero row at the bottom. Columns and are non-pivot ("free") columns, and indeed column and column — exactly the phenomenon described in the uniqueness proof, where non-pivot columns are forced linear combinations of earlier pivot columns.
Why the hypotheses are needed
The Type II operation is defined only for nonzero scalars . Suppose we relax this and allow , defining as the matrix obtained from by replacing row with the zero row. Take , : . This matrix is not invertible: . Concretely, for
which has lost all information in row of : there is no way to recover from , since infinitely many matrices (any choice of row ) map to the same product. Hence the Lemma (every elementary matrix is invertible) fails outright, and with it the entire apparatus: row-equivalence via would not be symmetric (we could reach from , but not conversely, in general), breaking the equivalence-relation corollary and undermining uniqueness of RRECF (a "row operation" of this illegitimate type could turn two different matrices into the same output, so tracking back to a canonical form would not correspond to a well-defined inverse chain of operations). This is exactly why Type II operations require : it is precisely the hypothesis that makes invertible.
Scope, edge cases & common traps
| Situation | What holds | What can go wrong if ignored |
|---|---|---|
| Field with (e.g. ) | All results hold verbatim; "" still means nonzero in | None — the proofs use only field axioms, not characteristic zero |
| (non-square ) | RRECF existence/uniqueness theorem applies as stated | Confusing RRECF with invertibility: non-square matrices are never invertible, but still have unique RRECF |
| Column operations instead of row | Not covered by this theorem | Left-multiplication does rows; right-multiplication by an elementary matrix performs the analogous column operation — mixing the two is a common error |
| Zero matrix | RRECF of the zero matrix is itself | Vacuous but must be checked in the induction base case for existence |
| Using RRECF-uniqueness to conclude "the sequence of row ops is unique" | False — only the final RRECF is unique | Many different sequences of operations reach the same RRECF; the theorem never claims uniqueness of the path |
The mathematician behind it
Origins · 1 minCarl Friedrich Gauss and how this was discovered
Gauss developed the systematic elimination technique bearing his name while working on least-squares methods for astronomical and geodetic calculations, formalizing an approach that had appeared in earlier Chinese mathematical texts (the Nine Chapters on the Mathematical Art) but lacked the systematic matrix-theoretic framing given later. The recognition that elimination corresponds precisely to multiplication by invertible matrices belongs to the broader development of matrix algebra in the work of Cayley and subsequent 19th- and 20th-century algebraists who built the linear-algebraic language in which "elementary matrix" became a precise object.
Why does left multiplication (not right multiplication) correspond to row operations?
Matrix multiplication computes each row of a product as a linear combination of the rows of , with coefficients taken from the corresponding row of : entry of is , so row of is . This is inherently a "row" operation because it recombines the rows of . Right multiplication instead computes each column of as a linear combination of the columns of , so it performs the analogous column operations. The asymmetry comes directly from how the summation index sits in the matrix product formula, not from any special convention.
Is the reduced row echelon form the same over every field?
The definition and both existence and uniqueness proofs use only field axioms — the ability to divide by nonzero elements (for scaling to make pivots equal to ) and standard arithmetic. Hence RRECF exists and is unique over any field, including finite fields like or , and the complex numbers . The specific entries of the RRECF will of course depend on the field's arithmetic (e.g., means something different in than in ), but the structural conditions (pivot positions, uniqueness) are field-independent.
Does every matrix reduce to the identity matrix?
No — only square invertible matrices reduce to the identity. A non-square matrix, or a square matrix with linearly dependent rows, will have an RRECF with at least one zero row (if ) or fewer pivot columns than columns (if the matrix is not injective as a linear map), as illustrated in Worked Example 2. The RRECF equals precisely when is and invertible — this is in fact a standard characterization of invertibility.
How does this connect to solving linear systems ?
If is a product of elementary matrices reducing to RRECF , then , because is invertible (multiplying both sides by an invertible matrix preserves the solution set exactly, by the same argument used in the uniqueness proof). So row-reducing the augmented matrix to never changes the solution set, and reading off solutions from the simpler system is legitimate. This is the theoretical justification for why Gaussian/Gauss-Jordan elimination correctly solves linear systems.
Are elementary matrices always square?
Yes. An elementary matrix acting on by left multiplication must be , since it operates on the rows of and matrix multiplication requires the number of columns of to match the number of rows of . The size of the elementary matrix is always determined by the number of rows of the matrix it acts on, regardless of how many columns that matrix has.
What is the difference between "row echelon form" (REF) and "reduced row echelon form" (RRECF)?
Row echelon form only requires conditions (1)–(3): zero rows at the bottom, pivots strictly increasing left to right down the rows, but without requiring pivots to equal or requiring entries above a pivot to be zero. RRECF additionally requires condition (2) (pivots normalized to ) and condition (4) (pivot columns cleared both above and below). REF is not unique — many different echelon forms can arise from different elimination orders — while RRECF is unique, which is precisely the content of the uniqueness half of the theorem proved here.
Can elementary row operations change the column space or rank of a matrix?
Row operations can change the column space as a specific subspace of (since they mix the coordinates), but they preserve the dimension of the column space, i.e. the rank, because they are left multiplications by invertible matrices, which are bijective linear maps and hence preserve dimensions of images under composition. This dimension-preservation is exactly what allows rank to be computed via RRECF (counting pivots), foreshadowing the treatment of Rank of a Matrix as a row-equivalence invariant.