A linear subspace V of Rn is a non-empty collection of vectors in Rn such that
if x,y are in V, then x+y is in V
if x is in V, then kx is in V for any scalar k.
So in linear subspaces we can do vector addition and scalar multiplication.
Examples of linear subspaces
A plane passing through the origin in R3.
A line passing through the origin in R2.
All of Rn
Image of a linear transformation.
Kernel of a linear transformation
Non-examples of linear subspaces
The unit circle in R2. This is not closed under scalar multiplication or vector addition
The x- and y-axis of R2. This is closed under scalar multiplication, but not vector additiion.
For the first three examples, we have some intuitive idea of dimension or size. For example, a plane in R3 is 2-dimensional and a line in R2 is 1-dimensional. All of Rn is n-dimensional.
Linear subspaces contain the zero vector
Because of the second property, every linear subspace contains 0. Thus a plane not passing through the origin is not a linear subspace.
It turns out there is a nice way of talking about the dimension of an arbitrary linear subspace using:
Basis of a linear subspace
A set B={v1,…,vm} contained in a linear subspace V is a basis of V if
B spans V; which is to say that if v is in V, then we can express v in terms of B:v=c1v1+⋯+cmvmfor some scalars c1,…,cm.
B is linearly independent; which is to say that if c1v1+⋯+cmvm=0, then cj=0 for j=1,…,m. In otherwords, the only way to express 0 in the span of B is the trivial way.
Exericse: Practice with linear independence
Let v1,…,vn be nonzero vectors which are orthogonal. This means that if i=j, then vj⋅vi=0. Show that v1,…,vm are linearly independent. Solution: If c1v1+⋯+cmvm=0, then for any j, we have(c1v1+⋯+cmvm)⋅vjcj(vj⋅vj)=0⋅vj=0 Since vj is nonzero, vj⋅vj=0, so cj=0.
Exerise: Coordinates in a basis
Suppose {v1,…vm} is a basis for V. Show that for each v in V, there exist unqiue coefficients c1,…,cm such that v=c1v1+⋯+cmvm. This tells us that each representation in a specific basis is unique. We call the coefficients c1,…,cm the coordinates of v in the basis {v1,…vm}.
Solution: We know that V=span{v1,…vm}, so for v in V, there exist coefficients c1,…,cm such that v=c1v1+⋯+cmvm. If there were another set of coefficients c1′,…,cm′ such that v=c1′v1+⋯+cm′vm, then subtracting the two relationships gives (c1−c1′)v1+⋯+(cm−cm′)vm=0. Then, linear independence gives us that cj=cj′ for all j. So the coefficients are unique.
Exercise: Coordinates in an orthogonal basis
Suppose {v1,…,vm} is an orthogonal basis for a linear subspace V. Find a formula for the coordinates of some vector v in V.
Solution: If v is in V, then we may write v=c1v1+⋯+cmvm for some coefficients c1,…,cm. Taking the dot product of both sides of this relationship with vj gives us (by orthogonality): vj⋅v=cj(vj⋅vj). Hence, we have that the coordinates of v in this basis are given by cj=vj⋅vjvj⋅v. Note that this means that the representation of a vector in an orthogonal basis is the sum of the orthogonal projections of that vector onto each basis vector.
It turns out that there are some nice facts about bases of linear subspaces:
Every linear subspace has a basis
Every basis of a linear subspace has the same number of elements
Using these facts, we can define:
Dimension of a linear subspace
The dimension of a linear subspace V, denoted dim(V), is the number of vectors in any basis of V.
Finding Bases for Image and Kernel of Linear Transformations
We know that the image and kernel of a linear transformation are linear subspaces of their respective spaces. Let's investigate how to find bases for them.
Let A be an m×n matrix. Then we have ker(A)={x in Rn∣Ax=0}. To find such vectors, it is equivalent to solve rref(A)x=0. Suppose for example that the last two variables, xn−1 and xn, are the only free variables. Then solutions will look something like: x=c1,n−1xn−1+c1,nxn⋮cn−2,n−1xn−1+cn−2,nxnxn−1xn=xn−1c1,n−1⋮cn−2,n−110+xnc1,n⋮cn−2,n01.
From this, we know that span⎩⎨⎧c1,n−1⋮cn−2,n−110,c1,n⋮cn−2,n01⎭⎬⎫=ker(A). Moreover, it is easy to see that these two vectors are linearly independent by looking at the last two entries (the only way to represent the zero vector is to scale each vector by 0). Hence, we have a basis for the kernel.
More generally, we have:
Basis for kernel
A basis for the ker(A) can be found by expanding solutions to Ax=0 in terms of the free variables. The vectors used to express the solutions (the ones scaled by the free variables) form a basis for the kernel.
Finding a basis for the image is a little bit easier. We know by definition of matrix-vector mulitplication that the columns A1,…,An of A span the image: span{A1,…,An}=Im(A). Thus, to find a basis, we just need to find some subset of A1,…,An which still spans and is linearly independent.
If A is in row-reduced echelon form, then this is an easy task: we just take the columns with a pivot. These are indeed linearly independent because the only way to linearly represent the zero vector is to scale each vector by 0. Moreover, they span the image because the other columns without pivots are trivially linear combinations of the pivot columns. Thus, removing the non-pivot columns doesn't effect the span.
Because the system Ax=0 is equivalent to the system rref(A)x=0, the columns of A which correspond to pivot columns in rref(A) form a basis for the image. More specifically, we have c1A1+⋯+cnAn=0 if and only if c1B1+⋯+cnBn=0 where B1,…,Bn are the columns of rref(A). Hence the columns of A which correspond to pivot columns are immediately linearly independent via the pivot columns of rref(A). Moreover, a column Aj is the the span of the previous columns if and only if we can write c1A1+⋯+cj−1Aj−1+Aj=0. Thus it follows that the columns of A corresponding to non-pivot columns of rref(A) are in the span of the columns of A corresponding to pivots. Therefore, the columns of A which correspond to pivots indeed span the image.
Ignoring the details, we have
Basis for image
The columns of A which correspond to a pivot column of rref(A) form a basis for Im(A).
Example 1
Find a basis for the image and kernel of A=(121134) Solution: The RREF of this matrix is rref(A)=(100112). A basis for the image is thus {(12),(11)}. Moreover, we have ker(A)=⎩⎨⎧−s−2ss:s in R⎭⎬⎫=⎩⎨⎧s−1−21:s in R⎭⎬⎫=span⎩⎨⎧−1−21⎭⎬⎫. Thus ⎩⎨⎧−1−21⎭⎬⎫ forms a basis for the kernel because it spans and it is linearly independent (a single nonzero vector is trivially independent).
Example 2
Find a basis for the image and kernel of A=10000100540032000010 Solution: A basis for the image is ⎩⎨⎧1000,0100,0010⎭⎬⎫. In particular, for this example, it is easy to see that the non-pivot columns are in the span of the pivot columns.
The 3rd and 4th columns have no pivots, so solutions to Ax=0 will be of the form −5x3−3x4−4x3−2x4x3x40=x3−5−4100+x4−3−2010. So a basis for the kernel is ⎩⎨⎧−5−5100,−3−20110⎭⎬⎫ because its span is the kernel and is linearly independent by looking at the coordinates corresponding to the free variables.
Finding linearly independent subset of arbitrary set while preserving the span.
This method we used to find a basis for the image of a matrix can be used generally to find a linearly independent subset of an arbitrary set of vectors while preserving the span.
More specifically, if we have a set of vectors {v1,…,vm}, we can put them in a matrix A=[v1⋯vm]. Then a basis for Im(A) will be a linearly independent subset of {v1,…,vm} with the same span.
This also gives us a way to get a basis from a collection of vectors which we already know spans a linear subspace.
One thing to notice is that our method to find a basis for the kernel and image shows that dim(ker(A))=# of free variablesand dim(Im(A))=# of pivots=rank(A). We also know that the number of free variables plus the number of pivots always equals the number of columns. More generally, we have the following theorem:
Rank-Nullity Theorem
If T:Rn→Rm is a linear transformation, then we have dim(ker(T))+dim(Im(T))=n.
Exercise
True or false: there exists a 3×3 matrix such that dim(ker(A))=dim(Im(A)).
Solution: By rank-nullity, we have dim(ker(A))+dim(Im(A))=3, so it is impossible for the dimensions to match.
Exercise
Find a basis of the subspace in R3 described by solutions to 2x1+3x1+x3=0. This is a plane in R3.
Solution: We have that plane is exactly ker([231]). The matrix in row-reduced echelon form is [12321] so vectors in the kernel are of the form −23s−21tst, so a basis for the kernel is ⎩⎨⎧−2310,−2101⎭⎬⎫.
Exercise
Find a basis of the subspace of R4 defined by all vectors orthogonal to 10−11,0123
Invertibility
Using Rank-Nullity and otherwise, we have a few more equivalent definitions of invertibility:
Invertibility of a matrix A
The following are more equivalent definitions of a n×n matrix A being invertible: