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.
A fixed matrix determines two subspaces:
- the subspace generated by its columns;
- the subspace generated by its rows.
They describe which outputs the matrix can produce and which linear equations its rows generate.
- Which right-hand sides can occur in a system ?
- How much independent linear information is actually stored in the rows?
- How many genuinely independent directions remain after all redundancy is removed?
The answers are called the column space, the row space, and the rank of the matrix.
Column space: what outputs can the matrix produce?
Let be an matrix, and write its columns as
Definition
Column space
The column space of , written , is the span of the columns of :
It is a subspace of .
The most useful way to read this definition is through matrix multiplication. If , then
So every vector of the form is a linear combination of the columns. Conversely, every linear combination of the columns can be written as for some vector .
Theorem
Column space as an output set
For an matrix ,
Therefore a vector belongs to exactly when the system is consistent.
Row space: what linear information do the rows carry?
Write the rows of as , each a matrix. To regard their span as a subspace of the usual column-vector space , we take their transposes explicitly.
Definition
Row space
The row space of is
It is a subspace of .
Thus means for some , or, equivalently, : the row is a linear combination of the rows of . We may display rows horizontally while computing, but a row-space basis below consists of their transposes. This convention makes an actual equality of sets of column vectors.
The dimensions of the ambient spaces must be checked before comparing spaces. Columns of have entries, so ; transposed rows have entries, so . Applying the same definition to also gives . Even when , having the same ambient space does not force equality of the two spans. The distinction concerns their members, not merely their names.
Rank counts the independent directions
The dimension of the column space is called the column rank. The dimension of the row space is called the row rank. One of the central theorems of linear algebra says that these numbers are equal.
Definition
Rank
The rank of a matrix is the number of pivots in its RREF. The basis theorem proved below will establish the equivalent dimension formula:
When you row-reduce a matrix to RREF, the number of pivot columns is exactly the rank. So rank measures how many independent directions survive after all redundancy has been removed.
To find a basis for , use the pivot columns of the original matrix .
To find a basis for , use the transposes of the nonzero rows of the RREF of .
The pivot positions are read from the RREF, but the column-space basis vectors must be taken from the original matrix.
Worked example: read everything from one row reduction
Worked example
Column space, row space, and rank from a single matrix
Consider
Row-reducing gives
One explicit reduction is , followed by and . The third row becomes zero and the first two rows have their leading ones in columns one and two. This produces the displayed RREF rather than merely an echelon matrix with unexplained pivot positions.
There are two pivot columns, namely columns and .
Write the columns of as
Then a basis for the column space is
Indeed, the non-pivot columns are combinations of the pivot columns:
For the row space, we transpose the nonzero rows of :
So
Finally, if
then because
Equivalently, the system is consistent.
Static map for the worked example: pivot positions are read from the RREF, column-space basis vectors come from the original matrix, transposed nonzero RREF rows form a row-space basis, and both dimensions equal the rank.
Three results from one RREF
The following sequence revisits the same example. Distinguish the information read from the RREF from the column-space basis vectors taken from the original matrix.
Row reduction: what changes and what does not?
Row reduction preserves some of this structure while changing other parts.
Theorem
What invertible multiplication preserves
Let be a real matrix, an invertible matrix, and an invertible matrix. Then
In particular, row-equivalent matrices have the same row space. Their column spaces need not be equal.
Proof
Use the inverse for the reverse inclusion
If , write , so . Conversely, if , set . Then , giving the reverse inclusion. The first direction needs no inverse; the second uses it to produce a coefficient vector.
Now , and is invertible with inverse . Apply the just-proved result to get . A sequence of row operations is left multiplication by an invertible , so the row-equivalence assertion follows. Equivalently, every new row is a combination of old rows, and reversing the operations gives the other containment of their spans.
Left multiplication has a different effect on outputs: . Indeed, in both descriptions. This is an invertible image of the old column space, not necessarily the same subset of . If have the same number of rows, applying the same invertible gives if and only if : the forward direction applies to equal sets, and the reverse applies . Comparing two transformed spaces is different from claiming that either one is unchanged.
Why the basis rules and rank equality hold
Theorem
Pivot bases and the equality of ranks
Let be the RREF of a real matrix , with pivots in columns . The original columns form a basis of , and the transposes of the nonzero rows of form a basis of . Consequently,
Proof
Preserve coefficients and then inspect pivot coordinates
Write with invertible, and denote the columns of by . For every coefficient vector ,
The left side is zero exactly when the sum inside parentheses is zero: one direction multiplies by , the other by . Thus all homogeneous column relations, with their exact coefficients, are preserved in both directions. Relations involving only selected columns are covered by inserting zero coefficients in the remaining positions.
The pivot columns of have a single one in distinct pivot rows and zeros elsewhere, so they are independent. Every column is their combination with coefficients ; all rows below are zero. The preserved relations show that the corresponding original pivot columns span every . A zero combination of those original columns gives a zero combination of the pivot columns of , forcing every coefficient to vanish. This proves both spanning and independence for the column basis.
For the row basis, we already know . Deleting the zero rows leaves a spanning list of transposed nonzero rows. If their combination with coefficients is zero, inspect coordinate . In the RREF, that pivot column has one in row and zero in every other row, so this coordinate is exactly . Hence all coefficients are zero and the list is independent. Each basis has members, proving the dimension equalities. When , the matrix is zero, both spaces are the zero subspace in their respective ambient spaces, and both bases are empty.
This argument explains precisely why the reduction gives positions for the column basis but actual vectors for the row basis. It also yields by exchanging the two spaces. For an matrix the rank is at most , since the pivots occupy distinct rows and distinct columns. Rank is a number; no equality of row and column spaces is asserted by these equalities of numbers.
Equal dimensions do not identify the spaces
Worked example
Different spaces for one square matrix
Consider
Its first three columns are independent: their first three coordinates force all coefficients of a zero combination to vanish. The fourth column is the first plus half the second plus one third the third. Consequently, and its dimension is three. Both containment directions are explicit: every column has last coordinate zero, and any displayed vector is the combination of the first three columns with coefficients .
The nonzero transposed rows are , and . They are independent by their first three coordinates, and the remaining row is zero, so they form a basis of . Their general combination shows
Thus but it is not in . Conversely, does not satisfy the displayed row-space condition. The two spaces are distinct subspaces of the same , although both have dimension three. Scaling the second and third rows by and gives three pivots, agreeing with rank three.
Counterexample mode
Row reduction can move the column space
False claim. Row-equivalent matrices have the same column space.
Take
The operation is subtracting row one from row two, and adding it back supplies the inverse. Directly, whereas . The nonzero vector cannot equal : its first coordinate would force and its second would force . So the spaces differ. Yet both row spaces equal and both ranks are one. Even the redundant second-column relation is preserved: it is zero in both matrices.
Repaired statement. Row operations preserve row space, rank and the coefficients of column relations. The actual column space becomes ; a basis for the original column space must use original columns at the pivot positions. In this example the RREF pivot column is not even a member of the original column space, so it cannot be its basis.
Test membership by keeping the right-hand side
Worked example
A column space described by one equation
Let
Twice the first row plus sixteen times the second plus five times the third is zero. Hence every output satisfies . This proves one inclusion in the proposed description of ; a condition satisfied by every output need not alone prove it describes every output.
For the converse, suppose this equation holds. Use only the first two columns, with coefficients
Their combination is . The first two coordinates are , and the last is by the assumed equation. Thus , proving the other inclusion. We obtain
For , the condition gives ; indeed is six times the first column. For , it gives , so is inconsistent. One vector is accepted by an explicit coefficient choice, the other rejected by a necessary output equation.
More generally, if is an RREF with pivots, then is equivalent to . Its zero rows require the last coordinates of to vanish; its pivot equations impose no further condition on the right-hand side. Taking these last rows of as a matrix gives when . This describes the column space by equations instead of generators. For full row rank there are no such restrictions and . The right-hand side must undergo the same row operations as ; reducing only and leaving fixed would test a different system.
Common mistake
Common mistake
Do not use pivot columns of the RREF as a basis for the column space
Row reduction usually changes the column space. So while the pivot positions are read from the RREF, the actual basis vectors for must be taken from the corresponding columns of the original matrix.
Another common mistake is to say that column space and row space are equal because they have the same dimension. Equal dimension does not mean equal subspace; it only means they contain the same number of independent directions.
Quick checks
Checkpoint
If is a matrix, in which ambient space does live, and in which ambient space does live?
Count entries in a column and in a row separately.
Solution · Answer
is a subspace of , because each column has 4 entries. is a subspace of , because each row has 3 entries.
Checkpoint
If the RREF of a matrix has three pivot columns, what is the rank?
Recall how rank is read from RREF.
Solution · Answer
The rank is .
Exercises
Checkpoint
Let . Find the rank and a basis for the column space.
Row-reduce first, identify the pivot columns, and then go back to the original matrix.
Solution · Guided solution
Subtract the first and second rows from the third to obtain the RREF
There are exactly two pivots, in columns one and two, so the rank is two. The nonzero first two rows establish the lower bound as well as the zero third row establishing the upper bound.
Therefore a basis for the column space is
The third column is their sum, so it adds no new direction.
Read this first
This note depends especially on 2.3 Gaussian elimination and RREF, 3.3 Transpose, symmetric, and skew-symmetric matrices, and 6.5 Basis and dimension.