Proof of the finite real matrix product laws
Let be positive integers, let , , and . All the following arguments use the row-by-column definition and finite real sums. For any output position ,
The middle equality only reorders two finite sums and uses real distributivity. Both products are , so equality at every position proves associativity. No factor has changed its order.
For , the same definition gives
For , it gives
Thus both distributive laws hold with the displayed matching sizes. For every real scalar ,
proving by entrywise equality. In particular, for and real ,
This proves the matrix-vector linearity used when comparing solutions of the same linear system. All identities concern compatible finite real matrices; they do not assert commutativity or cancellation of arbitrary matrix factors.
Build the elementary matrix from the identity
Suppose an elementary row operation is meant to act on matrices with rows. Start with the identity matrix , apply the same elementary row operation to , and call the result . All scalars are taken from the underlying field of the matrices; in particular, every nonzero scaling factor has a reciprocal in that field.
Definition
Elementary row-operation matrix
The elementary row-operation matrix associated with an elementary row operation on -row matrices is the matrix obtained by applying to .
This matrix is also called an elementary matrix. The longer name keeps its connection with the specified row operation visible.
Equivalently,
The reason this definition is useful is the following theorem.
Theorem
Elementary row operations are left multiplication
Let be any matrix with rows. If is one elementary row operation and denotes the result of applying it to , then
So applying that elementary row operation to is the same as multiplying on the left by the elementary row-operation matrix obtained from the same operation on .
The multiplication must be on the left. Row operations change rows by mixing rows. Left multiplication forms new rows of as linear combinations of old rows of . Right multiplication would instead mix columns.
The dimensions make the same point. If is , then is , so is defined and remains . There is no assumption that is square. By contrast, a column-operation matrix acting on these same columns would have size and multiply on the right.
Why left multiplication performs the operation
Proof
Verify the three elementary cases row by row
Write the rows of an arbitrary matrix as , and let denote row of . The basic identity
says that a row of a left multiplier selects the corresponding row of . Now check the three elementary operations.
-
For , the matrix has row equal to , row equal to , and every other row equal to . Thus the rows of are the rows of with precisely rows and exchanged.
-
For , where , row of is and all other rows are unchanged. Hence row of the product is
while row remains for .
-
For , where , row of is and every other row is unchanged. Therefore the new row is
exactly as prescribed.
These cases exhaust the elementary row operations, so they prove for every compatible . The proof does not claim that an arbitrary manipulation of rows has such an elementary matrix; must be one of the three operations just checked.
Acting on an augmented matrix
Suppose is represented by the augmented matrix . An elementary row operation must act on the full augmented matrix, not separately on whichever entries happen to be convenient. The multiplication identity is
Thus the coefficients and the right-hand side undergo the same combination of rows. A vector satisfies if and only if it satisfies : the forward implication follows by multiplying the equation by , and the reverse implication follows by applying the reverse elementary operation. This is the precise reason the solution set is preserved.
Changing only while leaving fixed, or changing only , generally produces a different system. The augmentation bar is therefore a visual separator, not a boundary at which a row operation may stop.
A sequence of elementary row operations becomes one matrix product
The real payoff is not just representing one elementary row operation. A whole sequence of elementary row operations becomes one product of elementary row-operation matrices.
Theorem
A sequence of elementary row operations as a product
Suppose
Then
Here every is an elementary row operation on matrices with the same number of rows. The product represents the whole sequence, although the product itself need not be a single elementary row-operation matrix.
The order in this formula is important. The first row operation appears closest to , because it is applied first:
Worked example
Two row operations combined
Let
Apply
The corresponding row-operation matrices are
After both operations, the result is
Instead of multiplying directly, you can also obtain this combined matrix by applying the same two elementary row operations to in the same order. The final numerical matrix also confirms that the second operation uses the already-updated row .
Reverse row operations and inverses
Every elementary row operation has a reverse operation:
- the reverse of is ;
- the reverse of , with , is ;
- the reverse of a row swap is the same row swap.
This gives a precise matrix statement.
Theorem
Elementary row-operation matrices are invertible
Every elementary row-operation matrix is invertible. Its inverse is the elementary row-operation matrix corresponding to the reverse elementary row operation.
Proof
Why the reverse matrix is a two-sided inverse
Let represent an elementary row operation , and let represent the reverse elementary operation. For every matrix with rows, applying and then reversing it restores . By the left-multiplication theorem,
This statement holds for every such ; in particular, put to obtain . Reversing first and then applying similarly gives . Hence
Concretely, a swap is its own inverse, scaling by is undone by scaling by , and adding times row to row is undone by adding times row to row .
For example, if
performs , then
performs .
This is the algebraic reason elementary row operations are reversible, and it explains why row reduction is so closely connected to invertible matrices.
Proof
Undo the last operation first
Let encode a chronological chain on matrices with rows, so its combined multiplier is . Each inverse represents the reverse of the corresponding elementary operation. To recover the input, the first move must undo , because that was the last change made to the rows. The remaining reverse moves undo in that order. Consequently the reverse multiplier is
There are two orders to distinguish: the time order of the reverse operations starts with , while the written product places that first action nearest the matrix being restored. For three steps, associativity gives
The other product cancels adjacent inverse pairs starting with and also equals . The same successive cancellation works for any finite chain. No factors have been commuted, and the argument does not require the matrix being transformed to be square.
Apply this reading to the earlier two-operation example. Its combined multiplier is , so its inverse is . Starting from the final matrix, first subtract twice the current second row from the first, recovering as the first row. Then subtract that recovered first row from the second, recovering . Reversing the chain means restoring the intermediate states, which explains the order without a memorized rule.
Finite elimination terminates and preserves the solution set
Let , , with positive finite integers . The permitted row operations are an exchange of two distinct rows, multiplication of a row by a nonzero scalar, and addition of a scalar multiple of one row to a different row. Their inverses are respectively the same exchange, multiplication by the reciprocal, and subtraction of that multiple. Applying an operation to the entire augmented array therefore preserves exactly the solutions of : the new equations are consequences of the old, and its inverse gives the reverse implication. Each operation is also multiplication on the left by the result of applying it to the identity matrix, an invertible elementary matrix.
Scan the coefficient columns from left to right, maintaining the next unused row. If the current column has a nonzero entry in an unused row, exchange that row into the next position, divide by its nonzero pivot, and subtract multiples of it from every other row to clear that column. Advance the unused-row index. If every unused entry in the column is zero, skip the column. Previously chosen pivot columns remain unit columns: the current unused rows have zeros in them, so the new pivot row and every subsequent subtraction preserve those zeros and earlier pivots. There are only column scans and at most pivots, each with finitely many row operations. Thus the algorithm terminates. At its end, the nonzero coefficient rows have increasing pivot columns and zeros below and above each pivot; any remaining coefficient row is zero. This proves the reduced echelon form used below, without assuming it will eventually appear.
Classification and the homogeneous freedom
Write for the number of pivots in the coefficient part. A zero coefficient row with a nonzero transformed right side is the impossible equation , so the system has no solution. Otherwise assign arbitrary real values to all nonpivot variables. In each pivot row, its pivot variable equals the transformed right side minus the displayed linear combination of these free variables; no other pivot variable occurs. These formulas both construct a solution and recover every solution. If the solution is unique. If , changing a free variable changes the vector, giving infinitely many solutions.
For the free variables can all be zero, giving the zero solution. If , set one free variable to one and the others to zero, and use the pivot formulas. This constructs a nonzero homogeneous solution. If , the formulas force every homogeneous variable to zero. For a consistent system, fixing one solution , subtraction proves that every solution has the form with , and substitution proves the converse.
For square , if every column has a pivot, the coefficient form is . The product of the finitely many elementary matrices satisfies . Since is invertible, and therefore also : is a two-sided inverse. If a pivot is missing, the nonzero homogeneous solution constructed above rules out any inverse. This also justifies applying the same row operations to to obtain in the invertible case.
Finite basis existence and extension, without a counting assumption
Let be a real vector space supplied with a finite spanning list . First prove that every independent list has length at most . After insertions, maintain a spanning list consisting of and surviving old vectors. Expand in this list. Some coefficient on a surviving old vector is nonzero; otherwise would be in the span of the earlier , contradicting independence. Solve for that old vector and replace it by . The new list spans the same space and keeps every earlier insertion. If , after steps the first independent vectors already span , contradicting independence of . This proves the bound, including .
Every subspace has a finite basis. Start with the empty independent list. If its current span is not , choose one vector of outside that span. A relation with nonzero coefficient on the new vector would express it in the old span, so the enlarged list remains independent. The proved bound permits at most additions; therefore the process stops with an independent spanning list for . If , it stops immediately with the empty basis. Starting instead with any given independent list in proves that list extends to a basis of . Only a bounded finite selection is used. Finally, if two bases have sizes , use each as the finite spanning list in the bound to obtain and . Thus basis size, called dimension, is well-defined. This supplies the existence, extension and dimension facts used in rank–nullity.
This optional proof note works over the real numbers. The argument also works over any field, because it uses only field arithmetic and invertible row operations. It establishes a structural fact; it does not prescribe a new elimination algorithm.
Gaussian elimination feels algorithmic, but one subtle theoretical question is still open:
If two people row-reduce the same matrix by different legal routes, why must they obtain the same RREF?
Existence says that some RREF can be reached. Uniqueness says that there is only one possible RREF. This second statement is what allows us to speak about the RREF of a matrix and to define rank without referring to a particular computation.
Before you start
This appendix uses three earlier facts.
- Row-equivalence can be written as multiplication on the left by an invertible matrix.
- Row-equivalence preserves linear relations among corresponding columns.
- In an RREF matrix, pivot columns and free columns have a very rigid shape.
The proof is longer than a row-reduction calculation, but the idea is simple: compare the columns of two possible RREFs from left to right. The pivot columns are forced first, and then every free column is forced by its linear relation with the pivot columns.
The theorem
Theorem
Uniqueness of RREF
Let be any matrix. Suppose and are both reduced row-echelon forms. If is row-equivalent to and is row-equivalent to , then
Since row-equivalence is transitive, it is enough to prove the following slightly more direct statement.
Theorem
Equivalent form
If and are reduced row-echelon forms of the same size and is row-equivalent to , then .
Notice the word reduced. Ordinary row-echelon form is not unique. A matrix can have many different REF outputs, but only one RREF output.
Column relations survive row-equivalence
Write the columns of two row-equivalent matrices as
If is row-equivalent to , then there is an invertible matrix such that
Thus for every column index .
Theorem
Preservation of column relations
Suppose
Then
Conversely, any relation among the corresponding columns gives the same relation among the corresponding columns.
The converse uses . This is why invertibility of is essential: we can move column relations forward and backward between row-equivalent matrices.
More explicitly, distributivity gives
The coefficients stay the same, even though the column vectors usually change. Applying proves the reverse implication. Consequently, if a column could be expressed using earlier columns on only one side, transporting that expression back would give a contradiction on the other side. This justifies preserving a failure of membership in an earlier span, as well as preserving an equation.
What RREF columns look like
Let be an RREF matrix. Suppose its pivot columns are
Then the pivot columns have the standard-vector shape:
where the vectors are written inside the ambient column length of .
Free columns are controlled by the pivot columns to their left. If is a free column and the pivot columns strictly to its left are , then
The coefficients are not mysterious: they are exactly the entries of in the pivot rows.
Finally, each pivot column is genuinely new at the moment it appears:
These three observations are the engine of the uniqueness proof.
To see why only earlier pivots are needed, inspect a row whose pivot occurs after column : every entry of that row through column is zero. The zero rows contribute nothing either. Thus a free column has nonzero entries only in rows whose pivots have already appeared. If there are no earlier pivots, the sum is empty and the column is zero. Conversely, at the -th pivot, every earlier column has zero -th entry, whereas has entry there. No combination of earlier columns can produce this pivot.
Proof by induction on the number of pivots
To avoid circularity, read "the rank of an RREF" in this proof simply as "the number of pivot columns in that RREF." Only after uniqueness is proved will we define the rank of an arbitrary matrix.
Proof
Full proof of RREF uniqueness
Let be the statement:
If and are RREF matrices of the same size, is row-equivalent to , and has exactly pivot columns, then .
We prove for all .
Base case. Suppose has no pivot columns. Then has no nonzero rows, so is the zero matrix. Since is row-equivalent to , we can write for some invertible matrix . Hence , so .
Induction step. Assume is true. Let have pivot columns, located at
Split both matrices at the last pivot column:
where and contain all columns strictly to the left of column .
Deleting a suffix of columns from an RREF leaves an RREF: rows whose pivots are retained keep their leading s and cleared pivot columns; rows whose pivots are deleted become zero rows, and they already occur below the retained pivot rows. This reasoning applies separately to both left blocks, without assuming that their pivot counts agree.
The same elementary row-operation chain taking to also acts on their left blocks: restricting columns commutes with each row operation. In particular, , with the same invertible multiplier as before. Hence the left blocks are row-equivalent, and has exactly pivots. When the prefix has positive width, the induction hypothesis applies and gives
If , there are no columns in either prefix and necessarily . Their equality is then vacuous; we need not apply the induction hypothesis to a matrix with no columns. If but , both prefixes are ordinary zero matrices by the base case. Thus leading zero columns and the empty prefix are both covered.
So the two matrices already agree in every column before .
Now compare column . In , this pivot column is not a linear combination of the columns to its left. Row-equivalence preserves this non-combination statement, so the -th column of is not a linear combination of the columns of to its left.
Since the left blocks are already equal, the first pivot columns of are exactly
If this column had zero entries below row , it would equal the combination of given by its first entries, contradicting the preceding non-combination statement. Therefore it has a nonzero entry below row .
Take the first such row. Its earlier entries are all zero because the prefixes agree. Its pivot is therefore in column . This row must be row : an intervening row would either be zero above a nonzero row, or have a pivot farther right above a pivot farther left. Both violate echelon order. Finally, the reduced conditions normalize this pivot to and clear every other entry in its column. Thus
It remains to compare columns to the right of . Every such column of is free, since was its last pivot. Let . Its entries in the pivot rows give the unique expression
Row-equivalence preserves this relation, so
But the pivot columns of and have now been shown to be the same. Therefore .
Every column of equals the corresponding column of , so . This proves , and the induction is complete.
Proof X-Ray
What each induction step is allowed to know
The induction parameter is the pivot count of alone. We do not assume that has the same count; proving equality will establish that fact. Restricting to the prefix creates a smaller case while preserving row-equivalence. Equality of that prefix fixes the first pivot rows. The next column is forced by an invariant non-combination statement and the RREF conditions. Finally, every remaining column of is already a combination of its now-matched pivots, so transporting those exact coefficients leaves no room for an additional pivot or a different free entry in .
A concrete miniature version
Worked example
Forced columns in a two-pivot RREF
The proof above may feel abstract because it tracks arbitrary columns. Here is the same logic in a small RREF matrix:
The pivot columns are columns and . They are
The free columns satisfy
Now suppose is another RREF matrix row-equivalent to . The first pivot column cannot disappear, so . Since the relation is preserved, , so the second column is forced.
The third column is not a combination of columns and , so it must become the next pivot column of : . Finally, the relation is preserved, so
Thus . The entire matrix is forced column by column.
Worked example
Leading zero columns do not interrupt the proof
Consider
Suppose is an RREF row-equivalent to . Since , transport gives . Column is nonzero, so invertibility prevents from vanishing; as the first nonzero RREF column, it must be . Next, forces .
Column cannot lie in the span of the first three columns, because they have second entry zero. Therefore is the next pivot column and equals . Finally,
This proves without choosing an elimination path. For the induction split at the last pivot, the left block has width and exactly one pivot; the original leading zero column remains in that prefix. Both matrices have rank once the uniqueness theorem has justified that definition.
Worked example
A singular multiplier can lose a column direction
Take
Both and are RREF matrices, but they are different. This does not contradict uniqueness: is singular, and alone does not establish row-equivalence. The columns of satisfy no nontrivial relation, whereas is a new relation with coefficient vector . Any invertible matrix taking to would transport that relation backward to , which is false. Hence no such invertible multiplier exists.
The forward transport of any existing relation still works for this singular by distributivity. What fails is the converse and, with it, preservation of non-combination. The corrected rule requires an invertible left multiplier. The pivot counts here are and , illustrating exactly the information that a non-reversible operation can destroy.
Rank is now well defined
Definition
Rank
For any matrix , the rank of , written , is the number of pivot columns in the unique RREF row-equivalent to .
This definition is legitimate because uniqueness has already been proved. If different row-reduction paths could end at different RREFs, then the number of pivot columns could depend on the route taken. The theorem rules out that possibility.
Rank is therefore not a memory of how you computed. It is an invariant of the matrix.
For computations, the workflow is now safe:
- reduce to RREF;
- mark the pivot columns of that RREF;
- count them to get .
If the question asks for a basis of the column space, use the pivot positions to return to the corresponding columns of the original matrix. If the question only asks for rank, the RREF itself is enough. This distinction matters because row operations preserve column relations, but they do not usually preserve the actual column space.
Common mistakes
Common mistake
Do not claim ordinary REF is unique
The uniqueness theorem is about RREF, not arbitrary row-echelon form. Before normalizing pivots and clearing entries above them, many different REF outputs can occur.
Common mistake
Do not define rank from a chosen reduction path
It is acceptable to compute rank by row reduction, but the definition is not "whatever pivot count I happened to get." The uniqueness theorem guarantees that all legal RREF paths give the same pivot count.
Common mistake
Do not forget the role of column relations
The proof does not say that row operations preserve the actual column space. They generally do not. The key preserved information is the pattern of linear relations among corresponding columns.
Quick checks
Checkpoint
If two RREF matrices are row-equivalent to the same matrix, what can you conclude?
Use the uniqueness theorem, not another row reduction.
Solution · Answer
They must be equal. A row-equivalence class contains exactly one RREF.
Checkpoint
How does RREF uniqueness justify the definition of rank used here?
Mention the number of pivot columns.
Solution · Answer
Rank is defined as the number of pivot columns in the RREF. If the RREF were not unique, different reduction paths might give different pivot counts. Since the RREF is unique, the pivot count is independent of the path.
Checkpoint
If the unique RREF row-equivalent to has pivot columns , , and , what is ?
Count the pivot columns, not the free columns.
Solution · Answer
The rank is , because there are three pivot columns.
Exercises
Exercise 1
Let
Identify the pivot columns and express each free column as a linear combination of the pivot columns.
Solution · Guided solution for exercise 1
The pivot columns are columns and :
The free columns are columns and . From their entries in the pivot rows,
Exercise 2
Suppose is an RREF matrix row-equivalent to the matrix in Exercise 1. Use column relations to explain why .
Solution · Guided solution for exercise 2
Since is the first pivot column, the first column of must be . The relation is preserved, so .
The third column of is not a combination of the columns to its left, so the third column of is forced to be the next pivot column:
Finally, is preserved, so
Thus every column agrees, and .
Exercise 3
Explain why the following two row-equivalent REF matrices do not contradict RREF uniqueness:
Solution · Guided solution for exercise 3
They are row-equivalent, and both have a row-echelon shape, but is not reduced row-echelon form because its leading entry is , not .
RREF uniqueness says that the reduced row-echelon representative is unique. It does not say that every intermediate REF representative is unique.
Related notes
Read this after 2.5 Existence of row-echelon forms and 5.1 Invertible matrices. It also supports 6.6 Column space, row space, and rank.