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.
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.
A vector space is a set with addition and scalar multiplication satisfying the usual abelian-group and distributive axioms over a field . Columns are one model. Polynomials of degree at most , denoted , and linear maps between spaces are others. The zero polynomial is included in although its degree is not ordinarily defined.
A subspace contains zero and is closed under sums and scalar multiples. A list spans if every vector is a linear combination of its entries; it is independent if only the zero coefficients give zero. A basis is both. A finite spanning list can be reduced to a basis by deleting dependent entries; an independent list can be extended to a basis by adding vectors outside its span until the given finite spanning list is spanned.
Exchange lemma. An independent list of vectors in the span of vectors has . To see this, express the first independent vector in the spanning list, use a nonzero coefficient to replace one spanning vector by it, and repeat. At each stage independence ensures the next independent vector has a nonzero coefficient on an as-yet unreplaced spanning vector. There must be at least such slots. Comparing two bases in both directions proves that their lengths agree; this common length is .
Consequently, in dimension , any independent vectors form a basis, as do any spanning vectors. Counting a list is useful only after its independence or spanning has been justified.
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 map is linear if . Its kernel and image are subspaces. Choose a basis of and extend to a basis with . Then form a basis of : spanning follows by expanding any input; a dependence among these images places the corresponding input combination in the kernel, and independence of the extended basis makes all coefficients zero. Thus
This is rank–nullity. In equal finite dimensions, injectivity and surjectivity are equivalent, but the equivalence can fail in infinite-dimensional spaces.
Finite basis counting in a real vector space
Let be a real vector space with a finite basis of length . All lists below are finite. The span of the empty list is the zero space, using the empty sum as zero.
First recall the coefficient counting argument, which does not require the spanning list to be independent. If span and with , choose coefficients such that . The matrix has at most pivots, so has a nonzero solution. Then
Thus the are dependent. When , every is zero and a nonempty list is dependent directly. In particular, no independent list in has length greater than .
If an independent list does not span , choose outside its span. In a relation , a nonzero would express as a combination of the . Hence , and independence gives all . Appending therefore preserves independence. A list of independent vectors must already span: otherwise this construction would give independent vectors, contradicting the preceding bound. Starting with any independent list and appending outside vectors must stop by length ; stopping means spanning, so the final list is a basis retaining the original list.
Conversely, suppose a list of vectors spans . If it were dependent, choose a nontrivial zero relation and an index whose coefficient is nonzero. Solve for that vector and delete it. Substitution shows that the remaining vectors still span . The original basis of length would then be dependent by coefficient counting, a contradiction. Thus the list is independent and is a basis. More generally, repeatedly deleting a vector at a nonzero position in a dependence relation preserves the span and strictly shortens a finite spanning list. The procedure stops with an independent spanning list. For a singleton zero list, deletion leaves the empty list and its span is still the zero space.
These arguments prove both dimension shortcuts and the extension and reduction assertions for an arbitrary finite-dimensional real ; no ambient-coordinate realization of is required. Fewer than vectors cannot span, since the given basis would contradict coefficient counting for such a list.
They also give the subspace assertion without assuming in advance that a subspace has a basis. For a subspace, start with the empty independent list and append vectors of outside the current span. The same bound forces termination, producing a basis of with at most members. Hence . If equality holds, that basis of is an independent list of length in , so it spans and . The converse is immediate.
Standard finite models and the polynomial boundary
Here is a nonnegative integer and are positive integers. For , consists of the empty tuple and its standard basis is empty.
For , let have entry one at position and zero elsewhere. Every equals , and a zero combination has each coefficient zero by its corresponding entry. Thus these vectors form a basis and .
For real matrices, let have a single one in position . Every matrix equals . The entry of a zero combination is its coefficient on , so the matrices are independent as well as spanning. Therefore .
For , , use the usual equality of polynomial coefficients. Every polynomial is uniquely ; hence spans and is independent, and . For any finite list of arbitrary real polynomials, choose a common nonnegative degree bound , also allowing the zero polynomial. Every combination has no term above degree , whereas does. Thus no finite list spans the space of all real polynomials. Here “infinite-dimensional” means precisely the absence of a finite spanning list; no infinite-basis theorem is being asserted.
A spanning list represents every vector in a space, but a dependent list can give several coefficient lists for the same vector. Requiring independence as well as spanning makes each representation unique. A basis combines these two conditions.
Definition
Basis
A set of vectors is a basis for a vector space if both conditions hold:
- are linearly independent.
- .
Here the scalars are real and the displayed bases are finite. Fixing an order gives unique coordinates: spanning provides an expression for , and if , subtraction gives . Independence forces for every . Thus existence and uniqueness come from different parts of the definition.
Spanning and independence answer different questions
The following sequence separates the two basis conditions: spanning supplies every target, while independence removes redundant representations. Dimension records the common size of a basis; the counting proof comes next.
Compare a pair of scalar-multiple generators with an independent pair, and identify the span in each case.
The standard basis is the model example
The first basis most students meet is the standard basis of :
These vectors are important because each one isolates one coordinate direction.
Worked example
Why the standard basis of really is a basis
To show that is a basis for , you must check the two basis conditions.
First, they span . If
then
So every vector in can be built from .
Second, they are linearly independent. If
then comparing coordinates gives
So the only linear relation is the trivial one.
Since both conditions hold, is a basis for .
Once the standard basis is fixed, the coefficients , , and rebuild the vector uniquely.
Why the number of basis vectors matters
Different bases can use different vectors. To define dimension, we must first show that their lengths cannot differ:
Theorem
Every basis of the same space has the same size
If and are finite bases of the same real vector space , then they contain the same number of vectors.
This statement is what makes dimension well-defined. Without it, the phrase "the number of vectors in a basis" would depend on which basis you picked, and dimension would not be a stable idea.
The reason behind the theorem is the following counting principle.
Theorem
Too many vectors in a spanned space force dependence
Suppose spans a vector space . Then any collection of more than vectors in is linearly dependent.
Proof
Count coefficients before defining dimension
The goal is to produce a nontrivial relation among vectors , using only the fact that vectors span . Write
The coefficient matrix has rows and columns. Elimination gives at most pivots, so the homogeneous system has a free variable and a nonzero solution . For that solution,
This is the required nontrivial relation. We imposed the coefficient equations as a sufficient condition for the vector sum to vanish. We did not assume the spanning vectors were independent, so we must not infer conversely that every vanishing sum has zero coefficients relative to that list. When , the span is the zero space and any nonempty list in it contains only zero vectors, hence is dependent directly.
Now let the two finite bases have sizes . The first spans and the second is independent, so . Interchanging their roles gives , hence . This uses the earlier homogeneous-system theorem, not dimension itself; therefore defining dimension by basis size is not circular.
Dimension is a count of independent directions
Definition
Dimension
The dimension of a vector space , written , is the number of vectors in any basis of .
Dimension tells you how many genuinely independent directions the space has.
- the space of all real polynomials has infinite dimension, because no finite list can span all powers .
The zero space is the exceptional case:
Its basis is the empty list: its only linear combination is the empty sum, defined as zero, and it has no nontrivial coefficient relation. The singleton spans the zero space but is dependent, so it is not a basis.
A subspace has its own dimension
A vector can have three entries while belonging to a space with only two independent directions. The next example separates the ambient coordinate count from the dimension of the subspace.
Worked example
A basis for a plane inside
Let
This is the plane inside .
Consider
Every vector in has the form
so and span .
They are also linearly independent, because
forces .
Therefore is a basis for , and
So dimension does not count how many entries a vector happens to have. It counts how many independent directions the space itself contains.
How dimension becomes a shortcut
Once you know the dimension of a space, many basis questions become shorter.
If , then:
- any linearly independent vectors in automatically form a basis;
- any vectors in that span automatically form a basis;
- fewer than vectors cannot span ;
- more than vectors cannot all remain linearly independent.
This is why dimension is powerful. It turns a long two-part basis test into a one-part check when the number of vectors already matches the dimension.
A useful way to package the shortcut is the following three-way criterion. Suppose are vectors in a subspace . Consider the three statements:
- .
- are linearly independent.
- .
If any two of these statements are true, then the third is automatically true, and is a basis for .
This is often the cleanest way to write a solution. Instead of proving both independence and spanning from scratch, you first identify the dimension and then prove whichever of independence or spanning is easier.
Worked example
Using dimension to avoid a second calculation in
Let
We want to show that these three vectors form a basis for .
First test linear independence. The equation
has coefficient matrix
Row reduction gives an echelon form with a pivot in every column, for example
Therefore the homogeneous equation has only the trivial solution, and are linearly independent.
Since , three linearly independent vectors in automatically span . Hence the vectors form a basis. The point is that the spanning part is not ignored; it is supplied by the dimension theorem.
A nontrivial zero relation detects redundancy in the given list.
Extending and reducing lists
Theorem
Extension and reduction consequences
If , then:
- no set of fewer than vectors can span ;
- every linearly independent set with fewer than vectors can be extended to a basis of ;
- every spanning set with more than vectors can be reduced to a basis of by deleting redundant vectors.
A basis is also an inclusion-minimal spanning set: deleting any member loses spanning, since otherwise that member would be a combination of the others. Conversely, a dependent spanning list can be shortened by the redundancy theorem. A basis is inclusion-maximal among independent lists inside : every further vector already lies in its span. Conversely, if an independent list does not span , appending a vector outside its span preserves independence. These are inclusion statements, not merely guesses from list length.
Null spaces: a rank-nullity basis test
For a homogeneous system, the dimension shortcut becomes especially concrete. Let be a matrix with rank . Then
An RREF with pivots has free coordinates. Setting one free coordinate to one and the others to zero gives one null-space vector for each free coordinate. Every solution is their combination, and their free coordinates force the coefficients of any zero combination to vanish. This gives the dimension formula, including the empty basis when . Here rank is the pivot count; 6.6 Column space, row space, and rank identifies it with the dimensions of the row and column spaces.
So vectors form a basis for exactly when all three checks hold:
- each vector is actually in the null space, so ;
- the number of proposed vectors is correct, so ;
- the proposed vectors are linearly independent.
This avoids proving the full set equality directly.
Worked example
Testing a proposed basis for a null space
Let
and
First check membership. Direct multiplication gives and , so both vectors lie in .
Next compute the dimension of . A row-reduced form of is
so . Since has four columns,
Finally check independence. Put the proposed vectors into a matrix:
Row reduction gives a pivot in each column, so are linearly independent. We now have membership, the correct dimension count, and independence. Therefore form a basis for .
The failure modes are just as important:
- if some does not satisfy , the list cannot be a basis for ;
- if the list has fewer or more than vectors, the size is wrong;
- if the list has the correct size but is dependent, it still fails to be a basis.
Extracting a minimal spanning set
Sometimes the input is not a clean proposed basis. You may be given a long list of vectors and asked for the dimension of its span. The efficient method is to extract a basis from the original list.
Theorem
Pivot columns give a minimal spanning set
Let
Row-reduce . If the pivot columns of the reduced matrix occur in positions , then
is a basis for , and .
The positions are read from a row-reduced form, but the basis vectors themselves come from the original list. This is the same rule used for column space.
Worked example
Extracting a basis from a generating list
Let , where
Put the vectors into the columns of :
The pivot columns are columns and , so
is a basis for , and . The non-pivot column also tells us the redundancy relation:
Subspaces with the same dimension
Dimension also controls when one subspace can equal another. Suppose is finite-dimensional, is a subspace of , and both use the same real scalars. Then
Moreover,
The containment hypothesis matters. Equal dimension alone does not force two subspaces to be equal. For example, two different lines through the origin in both have dimension 1, but neither line contains the other. The theorem applies when one subspace is already known to sit inside the other.
To see the equality implication, take a basis of . It is an independent list inside of size , so the dimension criterion makes it a basis of too. Its span is both spaces. The finite-dimensional hypothesis is necessary for this counting argument; the earlier infinite polynomial space does not license extending this criterion to arbitrary infinite-dimensional inclusions.
Worked example
Using dimension to prove equality of subspaces
Let
and let
Every vector in has third coordinate zero, so . We also know from the earlier plane example that . Since the two displayed generators of are linearly independent, as well.
Thus is a subspace of and both have dimension 2. The comparable-subspace theorem gives .
Common mistake
Common mistake
Dimension is not just the number of coordinates
A subspace of can have dimension 0, 1, 2, or 3. The ambient space tells you how many entries vectors have; the dimension tells you how many independent directions the subspace itself has.
Another common mistake is to check spanning and stop there. A spanning set can still fail to be a basis if one vector is redundant.
Quick checks
Checkpoint
Can be a basis for ?
Think about both basis conditions, not just the number of vectors.
Solution · Answer
No. The two vectors point in the same direction, so they are linearly dependent. They also fail to span the vertical direction. Therefore they are not a basis for .
Checkpoint
Suppose and you already found three linearly independent vectors in . What remains to prove?
Use the dimension shortcut from this note.
Solution · Answer
Nothing essential remains. In a 3-dimensional space, any three linearly independent vectors automatically form a basis, so they already span .
Exercises
Checkpoint
Do the vectors , , and form a basis for ?
Try to test independence first. If they are independent, dimension does the rest.
Solution · Guided solution
Set
Comparing coordinates gives
Subtract the first two equations to get , so . Then the third equation becomes , so , and therefore too.
So the three vectors are linearly independent. Because has dimension 3, they automatically form a basis for .
Read this first
This note depends on 6.4 Linear dependence and independence and 6.3 Linear combinations and span.