Lecture 6: Vector Spaces, Subspaces, Bases, and Dimension
These notes are interactive: click a section title to open it, click any dotted term to unfold its exact definition or statement in place, click ▸ Proof to expand a proof, and try the exercises — answers are checked instantly.
6.1 Vector spaces
In Lecture 1 we listed eight rules obeyed by the addition and scaling of vectors in , and a remark promised that other objects obey the same rules. Matrices of a fixed size do (Lecture 4), and so do polynomials, and so do functions. Each time we prove a result from the eight rules alone, it holds for all of these at once. That is the point of the abstract definition below: one proof, many applications. The price is that we may use only the rules; coordinates and entries are no longer available unless we bring them in on purpose.
A vector space (over ) is a set together with two operations,
- an addition, which assigns to any an element , and
- a scalar multiplication, which assigns to any and an element ,
- ;
- ;
- there is an element , the zero vector, with for every ;
- for each there is an element with ;
- ;
- ;
- ;
- .
With entrywise addition and scaling, is a vector space: the eight rules are the algebraic properties of Lecture 1. Its zero vector is the column of zeros. This is the model for everything that follows.
Let denote the set of all real matrices, with the entrywise addition and scalar multiplication of Lecture 4. The eight rules are the arithmetic of matrix addition; the zero vector is the zero matrix. As Lecture 4 put it, for adding and scaling an matrix is just a list of numbers arranged in a rectangle. (The matrix product is extra structure that a vector space does not need.)
For an integer , let be the set of all polynomials in a variable of degree at most , that is, with coefficients: Two polynomials are equal when they have the same coefficients. They are added, and multiplied by scalars, coefficient by coefficient: if , then The sum and multiples again have degree at most , so these operations stay in , and each rule is a rule of real arithmetic applied to one coefficient at a time, exactly as for . The zero vector is the zero polynomial, all of whose coefficients are . (We index by the number of coefficients, so that will turn out to have dimension : for instance consists of the polynomials of degree at most .) For example, in ,
Let be the set of all functions , added and scaled pointwise: and , just as linear maps were added in Lecture 4. Each rule holds because it holds for the real numbers , at every single ; the zero vector is the function that is everywhere. So is a vector space. Its vectors include , and ; signals, in engineering language.
Inside sit the continuous functions. With the same operations they form a vector space of their own: the zero function is continuous, and sums and scalar multiples of continuous functions are continuous, by the limit rules of calculus. The same holds for the differentiable functions. (In the language of the next section, these are subspaces of .)
In every vector space , for all and :
- the zero vector is unique, and so is the negative ;
- and ;
- ;
- if , then or .
We use the rules by number. (1) If and both satisfy rule 3, then , using rule 3 for , rule 1, and rule 3 for . If and both satisfy , then .
(2) By rule 6, . Add to both sides and use rules 2, 4 and 3: the left side becomes and the right side becomes . The same argument with rule 5 and gives .
(3) by rules 8 and 6 and part (2); so is a negative of , which is unique by part (1).
(4) If , then by rules 8 and 7 and part (2).
□In each statement of the proposition is obvious from the entries. The point of the proofs is that they use only the eight rules, so the statements hold in , in , in , and in every vector space we will ever meet, with no further checking. We write for .
Closure can fail. The polynomials of degree exactly (with the usual operations) do not form a vector space: and have degree , but their sum does not; and the zero polynomial is missing altogether. The set of vectors in with both entries is closed under addition, but not under scalar multiplication: falls outside it.
In , let and . What is the coefficient of in ?
Coefficientwise: .
Which of the following sets, with the usual addition and scalar multiplication, is a vector space?
A vector space must contain the zero vector. Which of these sets contain the zero matrix or zero polynomial? For the first set, check closure: if the entries of and of add up to , so do those of and of .
6.2 Subspaces and span
Most vector spaces we meet sit inside a bigger one: a plane through the origin inside , the symmetric matrices inside , the polynomials of degree at most inside those of degree at most . For such a subset, the eight rules come for free from the big space; only closure has to be checked. And the most important way to manufacture subspaces is to start with a few vectors and take all their linear combinations: their span.
A subspace of a vector space is a subset such that
- ;
- is closed under addition: if , then ;
- is closed under scalar multiplication: if and , then .
Every subspace of , with the operations of , is itself a vector space.
By (2) and (3) the operations of applied to elements of stay in . Rules 1, 2 and 5–8 are equations between elements of , true for all elements of , hence for those of . Rule 3 holds since . For rule 4: if , then by the proposition on consequences and (3).
□Every vector space has the two extreme subspaces (the zero subspace) and itself. In , every line through the origin, with , is a subspace: , , and . The figure shows three subsets of that fail, each for a different reason. In , lines and planes through the origin are subspaces (we will see why in the next examples); lines and planes that miss the origin are not.
In the symmetric matrices () form a subspace: , and . So do the upper triangular matrices, and the diagonal ones. But the invertible matrices do not: the zero matrix is not invertible.
In , the polynomials with form a subspace: the zero polynomial vanishes at , and if , then and . The polynomials with do not. Also is a subspace of . Inside we have the chain of subspaces : polynomials are continuous functions, and the continuous functions form a subspace of by the example on functions.
Let be vectors in a vector space . A linear combination of them is a vector and their span is the set of all such combinations: If , we say that span (or generate) , and call them a spanning set of . By convention the span of no vectors at all is .
For any , the set is a subspace of . It is the smallest subspace containing : every subspace that contains these vectors contains .
(using ). If and , then by the rules of a vector space and . Finally, a subspace containing every contains every by closure under scaling, and then every sum of these by closure under addition; that is, it contains .
□The span of one nonzero vector is the line through the origin in the direction of . The span of two vectors that are not multiples of each other is a plane through the origin, as in the figure; by the theorem it is a subspace.
Let , . Is in ? By the column view this asks whether is consistent, where : The system is consistent, with and ; indeed . The same computation with ends with the row , so is not in the plane.
, by the very form of a polynomial. In , the two polynomials and also span: any equals . In , the span of , and is the set of all , the subspace of symmetric matrices.
Let , and let Then
Call the two spans and . We show that each is contained in the other.
. An element of has the form . Substituting the definition of and collecting terms, which is a linear combination of , hence lies in .
. Solving the definition of for gives . So an element of equals which lies in . Hence .
□A span does not depend on the order in which the vectors are listed, so the proposition applies to any one of the vectors: replacing by plus a linear combination of the other vectors does not change the span. For example, This is the row operation “add a multiple of one row to another” in the language of spans; Lecture 7 uses it for the row space of a matrix.
If is a linear combination of , then
Write and apply the proposition with ; then , so the span equals . The zero vector contributes nothing to a linear combination (), so this is .
□In the span example, the vector lies in for exactly one value of . What is ?
The second entry forces , the first then , and the third entry must be .
Which subset of is a subspace?
The second set misses . The third contains and but not their sum.
6.3 The null space, column space, and row space of a matrix
Every matrix carries three subspaces, and together they record everything we have learned about . The null space, inside , holds the solutions of the homogeneous system; the column space, inside , holds the right-hand sides for which a solution exists; and the row space, inside , holds all combinations of the equations. One is described by equations, the other two by generators, and passing between the two descriptions is a matter of row reduction.
The null space (or kernel, or solution space) of an matrix is the set of all solutions of the homogeneous system :
For every matrix , is a subspace of .
, so . If and , then by linearity and .
□If , the solution set of is not a subspace, since is not a solution. By the structure theorem of Lecture 3 it is translated by a particular solution : a line or a plane that has been shifted off the origin.
For the matrix of Lecture 3's homogeneous example, row reduction gave the parametric vector form of the solutions, so This is the general recipe: solving and writing the solution in parametric vector form turns the equations that define into a spanning set, one vector for each free variable.
Let be an matrix with columns and rows .
- The column space of is the span of its columns: .
- The row space of is the span of its rows, each written as a column vector: . In other words, .
Let be . Then and a vector lies in if and only if is consistent. Moreover if and only if an echelon form of has a pivot in every row.
By the column view, ; as runs over this runs over all linear combinations of the columns. The second statement is a restatement of the first. The last one is part (2) of the theorem on surjectivity: the map is onto exactly when every row has a pivot.
□For the linear map from to , is the set of inputs sent to , called the kernel of , and is the set of all outputs, called the image (or range) of . By Lecture 3, is injective exactly when , and surjective exactly when .
Continue with the matrix of the previous example, whose columns are .
Column space. Lecture 3 read two relations off the null space: and . Removing and then by the corollary on redundant vectors, a plane in . It is not all of : the echelon form has a zero row. For instance is not in it, since the third row of is the sum of the first two, so every has .
Row space. The third row is the sum of the first two, so by the same proposition
Null space. As computed, is spanned by and . Notice that and live in the same space , while lives in .
By the proposition on replacing a vector, the row space of a matrix does not change when a row operation is performed. Write the rows of (as columns) .
- A replacement changes into (), which is exactly the situation of the proposition (see the remark after it).
- A swap only changes the order of the spanning vectors.
- A scaling changes into with ; a combination with weight on is the same as one with weight on .
In the same way, the column space does not change under column operations: swapping two columns, multiplying a column by a nonzero scalar, or adding a multiple of one column to another.
Row operations, however, usually do change the column space (and column operations the row space). In the example, every column of the reduced echelon form has third entry , while the column of does not; the two column spaces are different planes. Lecture 7 shows how an echelon form still tells us which columns of form a basis of .
is described implicitly, by equations: testing whether a given belongs to it is a single product , but producing its vectors requires solving a system. and are described explicitly, by generators: producing their vectors is easy (take any combination), but testing membership requires solving a system. Row reduction converts one description into the other.
Let be a matrix. In which spaces do , and live, in this order?
Solutions of have one entry per column; columns have one entry per row; rows have one entry per column.
For the matrix of the example, the vector lies in for exactly one value of . What is it?
Every vector of satisfies .
6.4 Linear independence, bases, and coordinates
A spanning set may contain redundant vectors, and redundancy is exactly linear dependence, as in Lecture 3. A spanning set with no redundancy is a basis. Bases are the coordinate systems of a vector space: once a basis is fixed, every vector has a unique list of coordinates, and every question about an abstract space (, matrices, subspaces) becomes a question about columns of numbers, which row reduction can answer.
Vectors in a vector space are linearly independent if the only scalars with are . Otherwise they are linearly dependent, and an equation of this form with some is a dependence relation. For this is the definition of Lecture 3.
In the polynomials are independent: is the zero polynomial only if all its coefficients are . The polynomials , , are dependent, because In the functions and are independent: if for every , then gives and gives .
Let . The vectors are linearly dependent if and only if at least one of them is a linear combination of the others. Also, a single vector is independent if and only if it is nonzero, and any list containing is dependent.
If with , solve for : . Conversely, if , then is a dependence relation, with coefficient on . For a single vector, with happens exactly when , by the proposition on consequences; and is a dependence relation for any list containing .
□A basis of a vector space is a list of vectors in that
- is linearly independent, and
- spans : .
Convention. In this course we consider only vector spaces that have a basis consisting of finitely many vectors (the finite-dimensional spaces, as they will be called in the next section). Spaces such as and , which are not spanned by any finite list of vectors, are not treated further.
: the standard basis vectors are independent (they are the columns of ) and span, since .
: let be the matrix with in position and elsewhere. Every matrix is , and this combination is the zero matrix only if every . So the matrices form a basis. For example .
: the monomials span (the span example) and are independent (the independence example); they form the standard basis of , with vectors.
The plane is the null space of the matrix . With and free, , so The two vectors span , and they are independent: if the combination is , its second entry gives and its third gives . So they form a basis of . (Other bases exist, for instance and ; a subspace other than has infinitely many bases.)
Vectors form a basis of if and only if the matrix is invertible, that is, if and only if .
By Lecture 3 the columns of are independent exactly when has only the trivial solution, and by the column-space theorem they span exactly when is consistent for every . By the invertibility theorem each of these conditions is equivalent to the invertibility of , and by Lecture 5 that is equivalent to .
□A list of vectors in a vector space is a basis of if and only if every can be written as for exactly one choice of scalars .
Suppose is a basis. Since it spans , every has at least one such representation. If , subtracting gives , and independence forces for all .
Conversely, if every has exactly one representation, then spans ; and has the representation with all , so by uniqueness it has no other: is independent.
□Let be a basis of and . The unique scalars with are the coordinates of relative to , and is the coordinate vector of . Relative to the standard basis of , .
Let and . The matrix has , so is a basis by the theorem on bases of . To find for , solve , that is, : so , , and : indeed . In general and .
The polynomials , , form a basis of (this is checked in the next section). To find the coordinates of , write , so : So , whereas relative to the standard basis the coordinate vector is .
Let be a basis of with vectors. For all and , Consequently, vectors are linearly independent if and only if their coordinate vectors are linearly independent in .
If and , then and ; by uniqueness these are the coordinates. Applying the two rules repeatedly, , and a vector of is exactly when its coordinate vector is . So the dependence relations among the are exactly those among their coordinate vectors.
□Are , , independent in ? Their coordinate vectors relative to are the columns of so the columns of are independent, and by the proposition so are the three polynomials.
With as in the example, , , find for . What is its first entry?
Solve , : , .
Which list is a basis of ?
Use the theorem: the first matrix has determinant . In the second list one vector is twice another; the third list cannot span , since a matrix has at most two pivots.
6.5 Dimension
A plane has many bases, but each consists of two vectors; has many bases, each of three vectors. The number of vectors in a basis does not depend on the basis, and that number is the dimension. The key fact behind it is a comparison: in a space spanned by vectors, any vectors are dependent. It is the abstract form of Lecture 3's corollary that more than vectors in are dependent, and its proof reduces to it.
Suppose . Then any vectors with are linearly dependent.
Each lies in the span of the , so we can write and collect the coefficients in an matrix . Since , Lecture 3 gives a nonzero with , that is, for every . Then a dependence relation among the , since .
□If a vector space has a basis of vectors, then every basis of has exactly vectors.
Let and be bases of . The 's are independent and lie in the span of the vectors , so by the theorem. Exchanging the roles gives .
□If a vector space has a basis of vectors, is called finite-dimensional, and its dimension is ; by the corollary this number does not depend on the basis. The zero space has dimension (its basis is the empty list). A vector space that is not spanned by any finite list of vectors is called infinite-dimensional; as agreed in the definition of a basis, we do not study such spaces.
From the standard bases: , , and . The symmetric matrices have dimension : the three matrices of the span example span them and are independent (look at the entries , , ). The plane of the plane example has dimension , as it should. The null space of the null-space example has dimension : its two spanning vectors are independent, because the second and fourth entries (the free-variable positions) of are and .
The space of all functions is infinite-dimensional: it contains for every , which are independent vectors, so by the theorem no finite list of vectors can span it.
Let be a finite-dimensional vector space and a subspace of .
- Every finite list spanning contains a basis of : remove vectors that are combinations of the others until the list is independent.
- Every linearly independent list in can be extended to a basis of . In particular is finite-dimensional and .
- If , then .
(1) If the list is dependent, the proposition on redundancy provides a vector that is a combination of the others, and removing it does not change the span, by the corollary on redundant vectors. Repeat; the process stops, since the list gets shorter, and it stops at an independent list that still spans .
(2) Let be independent. If they span , they are a basis. If not, choose outside their span. Then are still independent: in a relation we must have (otherwise would be a combination of the ), and then all . Repeat. All lists produced are independent lists in , and is spanned by vectors, so by the theorem no list has more than vectors; the process must stop, and it stops at a basis of with at most vectors.
(3) A basis of is an independent list of vectors in . If it did not span , part (2), applied with , would extend it to a basis of with more than vectors, contradicting the corollary. So it spans , and .
□Let be a vector space with . Then
- any linearly independent vectors in form a basis of ;
- any vectors that span form a basis of .
(1) By part (2) of the previous theorem, applied with , the vectors extend to a basis of , which has exactly vectors by the corollary; so nothing was added. (2) By part (1) of the previous theorem, again with , the vectors contain a basis, which has exactly vectors; so nothing was removed.
□Polynomials. The three polynomials of the coordinates example are independent in , which has dimension , so they form a basis. Likewise form a basis of : their coordinate vectors , , are the columns of an upper triangular matrix with determinant .
A subspace of . Let . The constant polynomial is not in , so and by the theorem. On the other hand , , lie in and are independent (they have different degrees, so the highest power in any nonzero combination cannot cancel). Hence , and these three polynomials form a basis of .
A subspace of has . If , ; if , is the span of one nonzero vector, a line through the origin; if , it is the span of two independent vectors, a plane through the origin; and if , then by part (3) of the theorem. There are no other subspaces.
What is the dimension of the space of all symmetric matrices?
A symmetric matrix is determined by its three diagonal entries and the three entries above the diagonal; the matrices and () form a basis.
Four polynomials are given in . What can you conclude?
, and is spanned by ; apply the theorem with .
For a matrix , the example found the dimension of by counting free variables, and the example of three subspaces found and as planes. Next lecture turns these observations into theorems: the dimensions of the three subspaces are all read off the pivots, the column space and the row space always have the same dimension (the rank of ), and . We will then pass from matrices to linear maps between arbitrary vector spaces, and see how a basis turns each such map into a matrix.
Index of statements
- Definition 6.1 (Vector space)
- Example 6.2 (The space )
- Example 6.3 (The space of matrices)
- Example 6.4 (The space of polynomials)
- Example 6.5 (Functions)
- Proposition 6.6 (Consequences of the rules)
- Remark 6.7 (Why bother with the proofs)
- Example 6.8 (Sets that are not vector spaces)
- Definition 6.9 (Subspace)
- Proposition 6.10 (A subspace is a vector space)
- Example 6.11 (Subspaces of and )
- Example 6.12 (Subspaces of matrices and polynomials)
- Definition 6.13 (Linear combination and span)
- Theorem 6.14 (A span is a subspace)
- Example 6.15 (Spans in , and a membership test)
- Example 6.16 (Spans of polynomials and matrices)
- Proposition 6.17 (Replacing a vector in a spanning list)
- Remark 6.18 (Any vector may be replaced)
- Corollary 6.19 (Removing a redundant vector)
- Definition 6.20 (Null space)
- Theorem 6.21 (The null space is a subspace)
- Remark 6.22 (Solutions of with )
- Example 6.23 (A null space as a span)
- Definition 6.24 (Column space and row space)
- Theorem 6.25 (What the column space measures)
- Remark 6.26 (Kernel and image)
- Example 6.27 (The three subspaces of one matrix)
- Remark 6.28 (Row and column operations)
- Remark 6.29 (Two ways to describe a subspace)
- Definition 6.30 (Linear independence)
- Example 6.31 (Independence outside )
- Proposition 6.32 (Dependence means redundancy)
- Definition 6.33 (Basis)
- Example 6.34 (Standard bases)
- Example 6.35 (A basis of a plane)
- Theorem 6.36 (Bases of )
- Theorem 6.37 (Unique representation)
- Definition 6.38 (Coordinates)
- Example 6.39 (Coordinates in )
- Example 6.40 (Coordinates of a polynomial)
- Proposition 6.41 (Coordinates are linear)
- Example 6.42 (Independence of polynomials by coordinates)
- Theorem 6.43 (Independent lists are no longer than spanning lists)
- Corollary 6.44 (All bases have the same size)
- Definition 6.45 (Dimension)
- Example 6.46 (Dimensions of familiar spaces)
- Theorem 6.47 (Reducing and extending to a basis)
- Theorem 6.48 (The basis test)
- Example 6.49 (Using the basis test)
- Example 6.50 (The subspaces of )
- Remark 6.51 (Looking ahead)