Skip to main content
Logo image

Elementary Linear Algebra: For University of Lethbridge Math 1410

Section 5.3 Subspaces of \(\mathbb{R}^n\)

One of the things we noted in Example 2.7.7 was that since \(\vec{w}\) belonged to \(\operatorname{span}\{\vec{u},\vec{v}\}\text{,}\) adding \(\vec{w}\) to any vector in \(\operatorname{span}\{\vec{u},\vec{v}\}\) resulted in another vector in \(\operatorname{span}\{\vec{u},\vec{v}\}\text{.}\) This leads to the notion of a subspace, another one of the key concepts in linear algebra.
What sets subspaces apart from other subsets of \(\mathbb{R}^n\) is the requirement that all of the properties listed in Theorem 2.7.2 remain valid when applied to vectors from that subspace. We will not prove it here, but it suffices that the subspace be closed under the operations of addition and scalar multiplication.

Definition 5.3.1. Subspace of \(\mathbb{R}^n\).

A non-empty subset \(V\subseteq \mathbb{R}^n\) is called a subspaceof \(\mathbb{R}^n\text{,}\) provided that the following conditions hold:
  1. For any vectors \(\vec u, \vec v\in V\text{,}\) \(\vec u + \vec v \in V\)
  2. For any vector \(\vec v \in V\) and scalar \(c\in \mathbb{R}\text{,}\) \(c\vec{v}\in V\text{.}\)
It follows from Definition 5.3.1 that any linear combination of vectors in a subspace \(V\) is again an element of that subspace. One other important consequence of Definition 5.3.1 must be noted here: since any subspace \(V\) is closed under scalar multiplication by any scalar, and since \(0\cdot\vec v = \vec 0\) for any vector \(\vec v\text{,}\) every subspace contains the zero vector. This often provides an easy test when we want to rule out the possibility that a subset is a subspace.

Example 5.3.2. Identifying subspaces.

Determine which of the following subsets of \(\mathbb{R}^3\) are subspaces:
  1. \(\displaystyle R = \left\{\left. \bbm x\\y\\z\ebm \, \right|\, 2x-4y+3z=0\right\}\)
  2. \(\displaystyle S = \left\{\left.\bbm x\\4x\\3\ebm \, \right| \, x\in \mathbb{R}\right\}\)
Solution.
  1. From our work in Section 2.6, we notice right away that the set \(R\) describes a plane with normal vector given by \(\vec n = \bbm 2\\-4\\3\ebm\text{.}\) Moreover, this particular plane passes through the origin, since \(2(0)-4(0)+3(0)=0\text{,}\) telling us that \(\vec 0 \in R\text{.}\)
    It turns out that any plane through the origin is a subspace, and \(R\) is no exception, but let’s verify this directly using Definition 5.3.1. Suppose
    \begin{equation*} \vec u = \bbm u_1\\u_2\\u_3\ebm \quad \text{ and } \quad \vec v = \bbm v_1\\v_2\\v_3\ebm \end{equation*}
    are vectors in \(R\text{,}\) so that \(2u_1-4u_2+3u_3=0\) and \(2v_1-4v_2+3v_3=0\text{.}\) For the vector
    \begin{equation*} \vec u + \vec v = \bbm u_1+v_1\\u_2+v_2\\u_3+v_3\ebm\text{,} \end{equation*}
    we find
    \begin{equation*} 2(u_1+v_1)-4(u_2+v_2)+3(u_3+v_3) = (2u_1-4u_2+3u_3) + (2v_1-4v_2+3v_3) = 0 + 0 = 0, \end{equation*}
    which shows that \(\vec u+\vec v\in R\text{.}\) Similarly, for any scalar \(c\text{,}\)
    \begin{equation*} 2(cu_1)-4(cu_2)+3(cu_3) = c(2u_1-4u_2+3u_3) = 0\text{,} \end{equation*}
    verifying that \(c\vec u \in R\text{.}\) Since \(R\) is closed under both addition and scalar multiplication, it is a subspace.
  2. For the subset \(S\text{,}\) we immediately notice that the third component must always equal 3; therefore, it is impossible for the zero vector to belong to \(S\text{,}\) and thus \(S\) is not a subspace.
To make sure we’ve got the hang of things, we’ll try a couple more examples.

Example 5.3.3. Identifying subspaces.

Determine which of the following subsets of \(\mathbb{R}^3\) are subspaces:
  1. \(\displaystyle T = \left\{\left.\bbm 3a-2b\\a+b\\a-4b\ebm \, \right| \, a,b\in \mathbb{R}\right\}\)
  2. \(\displaystyle U = \left\{\left.\bbm x+y\\3xy\\x^2\ebm \, \right| \, x,y\in \mathbb{R}\right\}\)
Solution.
  1. Suppose we have two vectors \(\vec v = \bbm 3a-2b\\a+b\\a-4b\ebm\) and \(\vec w = \bbm 3c-2d\\c+d\\a-4b\ebm\) in the subset \(T\text{.}\) Then we find
    \begin{align*} \vec v + \vec w \amp = \bbm 3a-2b\\a+b\\a-4b\ebm + \bbm 3c-2d\\c+d\\a-4b\ebm = \bbm (3a-2b)+(3c-2d)\\(a+b)+(c+d)\\(a-4b)+(c-4d)\ebm\\ \amp = \bbm 3(a+c)-2(b+d)\\(a+c)+(b+d)\\(a+c)-4(b+d)\ebm\text{.} \end{align*}
    Since \(a+c\) and \(b+d\) are again real numbers, we see that \(\vec v+\vec w\) fits the definition of \(T\text{,}\) so \(\vec v+\vec w\in T\text{.}\)
    Next, if \(k\in \mathbb{R}\) is a scalar, we have
    \begin{equation*} k\vec v = k\bbm 3a-2b\\a+b\\a-4b\ebm = \bbm k(3a-2b)\\k(a+b)\\k(a-4b)\ebm = \bbm 3(ka)-2(kb)\\(ka)+(kb)\\(ka)-4(kb)\ebm, \end{equation*}
    which again fits the patter for vectors in \(T\text{,}\) so \(k\vec v\in T\text{.}\) From Definition 5.3.1, we can conclude that \(T\) is a subspace.
  2. You probably recall from your high school mathematics that a function such as \(f(x)=ax+b\) is considered linear, since its graph is a straight line. Functions like \(f(x)=x^2\) are considered non-linear, since their graphs are curved. One of the morals a student does well to learn quickly in linear algebra is that any expressions involving non-linear functions of any variables present are not going to play well with the rules of linear algebra.
    For the subset \(U\text{,}\) the expressions \(3xy\) and \(x^2\) tip us off that we are probably not dealing with a subspace here. The easiest way to make sure of this is to check the rules in Definition 5.3.1 using specific vectors.
    If we let \(x=1\) and \(y=2\) in the definition of the set \(U\text{,}\) we get the vector
    \begin{equation*} \vec v = \bbm 1+2\\3(1)(2)\\1^2\ebm = \bbm 3\\6\\1\ebm\text{.} \end{equation*}
    Now consider the vector \(4\vec v\text{.}\) We have
    \begin{equation*} 4\vec v = 4\bbm 3\\6\\1\ebm = \bbm 12\\6\\4\ebm\text{.} \end{equation*}
    Looking at the definition of the set \(U\text{,}\) we know that if \(4\vec v\in U\text{,}\) then the third component of \(\vec v\) tells us \(x^2=4\text{,}\) so \(x=\pm 2\text{.}\) Now, let’s look at the other two components. If \(x=2\text{,}\) we must have
    \begin{equation*} 2+y = 12 \text{ and } 3(2)(y) = 6\text{.} \end{equation*}
    The first equation tells us that \(y=10\text{,}\) while the second requires \(y=1\text{.}\) Since \(10\neq 1\text{,}\) this is impossible. Similarly, if \(x=-2\text{,}\) then we would have to have \(y=14\) looking at the first component, and \(y=-1\) from the second. Since this is again impossible, it must be the case that \(4\vec v\notin U\text{.}\) Since \(U\) is not closed under scalar multiplication, \(U\) is not a subspace.
After seeing a few examples (and a few exercises), the reader can probably develop some intuition for identifying subspaces. To make sure we don’t become too reliant on intuition, however, we’ll give one more example with two very similar-looking sets, only one of which is a subspace.

Example 5.3.4. Identifying subspaces.

Determine which of the following subsets of \(\mathbb{R}^3\) are subspaces:
  1. \(\displaystyle V = \left\{\left.\bbm u+2v\\v+4\\u-2\ebm \, \right| \, u,v\in \mathbb{R}\right\}\)
  2. \(\displaystyle W = \left\{\left.\bbm 2u+v\\v+4\\u-2\ebm \, \right| \, u,v\in \mathbb{R}\right\}\)
Solution.
  1. The expressions \(v+4\) and \(u-3\) in the definition of \(V\) look like the sort of linear functions we see in high school, but we need to keep in mind that in linear algebra the zero vector has an important role in making sure the algebra works properly. In Linear Algebra, among all functions of the form \(f(x)=mx+b\text{,}\) only those with \(b=0\) are considered “linear”: these are the functions whose graphs are lines through the origin.
    The first thing we might check is whether or not \(\vec 0 \in V\text{.}\) If we want
    \begin{equation*} \bbm u+2v\\v+4\\u-2\ebm = \bbm 0\\0\\0\ebm\text{,} \end{equation*}
    then clearly we need \(v=-4\) and \(u=2\) from the second and third components, but \(2+2(-4) = -6\neq 0\text{,}\) so there is no way to obtain the zero vector as an element of \(V\text{,}\) telling us that \(V\) is not a subspace.
  2. The subset \(W\) looks a lot like the subset \(V\text{,}\) so our instinct is probably telling us that \(W\) is not a subspace, either. To know for sure, the first thing we might check is whether or not \(\vec 0 \in W\text{.}\) In this case, we see that \(\vec 0\) is indeed in there. Setting \(u=2\) and \(v=-4\text{,}\) we get the vector
    \begin{equation*} \bbm 2(2)+(-4)\\-4+4\\2-2\ebm = \bbm 0\\0\\0\ebm = \vec 0, \end{equation*}
    so \(\vec 0 \in W\text{.}\) Let’s try the addition test. Setting \(u=1\) and \(v=0\) gives us the vector
    \begin{equation*} \vec v = \bbm 2(1)+0\\0+4\\1-2\ebm = \bbm 2\\4\\-1\ebm \in W\text{.} \end{equation*}
    Setting \(u=0\) and \(v=1\) gives us the vector
    \begin{equation*} \vec w = \bbm 2(0)+1\\1+4\\0-2\ebm = \bbm 1\\5\\-2\ebm \in W\text{.} \end{equation*}
    We now check to see whether or not \(\vec v + \vec w \in W\text{.}\) We have
    \begin{equation*} \vec v + \vec w = \bbm 2\\4\\-1\ebm + \bbm 1\\5\\-2\ebm = \bbm 3\\9\\-3\ebm\text{.} \end{equation*}
    If this is an element of \(W\text{,}\) then we must have \(v+4=9\) for some \(v\in\mathbb{R}\) (looking at the second component) and \(u-2=-3\) for some \(u\in \mathbb{R}\) (looking at the third component), so \(u=-1\) and \(v=5\text{.}\) Putting these values into the first component, we need to have \(2(-1)+5=3\text{,}\) which is true! Does this mean \(W\) is a subspace? Not so fast: we only checked addition for one pair of vectors, and we haven’t checked scalar multiplication.
    If we try a few more examples (the reader is encouraged to do so), we find that things keep working out, so we begin to suspect that maybe \(W\) really is a subspace. The only way to know for sure is to attempt to verify Definition 5.3.1 with a general proof. Suppose
    \begin{equation*} \vec v = \bbm 2a+b\\b+4\\a-2\ebm \text{ and } \vec w = \bbm 2c+d\\d+4\\c-2\ebm \end{equation*}
    are arbitrary elements of \(W\text{.}\) Adding these vectors, we get
    \begin{equation*} \vec v + \vec w = \bbm 2(a+c)+(b+d)\\ (b+d)+8\\(a+c)-4\ebm\text{,} \end{equation*}
    which certainly doesn’t look like an element of \(W\text{;}\) the constants are all wrong! We have an 8 in the second component instead of a 4, and a \(-4\) in the third component instead of a \(-2\text{.}\) (This is why constant terms in the definition of a subset are generally problematic.)
    However, with a bit of sleight of hand, things are not as bad as they seem. Let’s write the second component as \((b+d+4)+4\text{,}\) and the third as \((a+c-2)-2\text{,}\) and let \(v=b+d+4\text{,}\) and \(u=a+c-2\text{.}\) If \(\vec v + \vec w\) is an element of \(W\text{,}\) then we’re going to need
    \begin{equation*} 2(a+c)+(b+d) = 2u+v\text{,} \end{equation*}
    so that \(\vec v + \vec w = \bbm 2u+v\\v+4\\u-2\ebm\) fits the definition of \(W\text{.}\) Is this true? Let’s check:
    \begin{equation*} 2u+v = 2(a+c-2)+(b+d+4) = 2(a+c)-4+(b+d)+4 = 2(a+c)+(b+d)\text{.} \end{equation*}
    The extra constants cancel, so addition works! Similarly, we find
    \begin{align*} k\vec v \amp = \bbm k(2a+b)\\k(b+4)\\k(c-d)\ebm\\ \amp = \bbm 2(ka)+(kb)\\(kb)+4k\\(ka)-2k\ebm\\ \amp = \bbm 2(ka)+(kb)\\(kb+4k-4)+4\\(ka-2k+2)-2\ebm\\ \amp = \bbm 2(ka-2k+2)+(kb+4k-4)\\(kb+4k-4)+4\\(ka-2k+2)-2\ebm\text{,} \end{align*}
    which fits the definition of \(W\text{.}\) Note that in the last equality, things cancel out again:
    \begin{equation*} 2(ka-2k+2)+(kb+4k-4) = 2(ka)-4k+4+(kb)+4k-4 = 2(ka)+(kb)\text{.} \end{equation*}
    Whew! That wasn’t so straightforward. Could we have made our lives a little bit easier? (The answer to this rhetorical question is almost always yes.)
    We know that the potential trouble here came from the constant terms, so one option we have is to try burying them. Given the element
    \begin{equation*} \vec v = \bbm 2u+v\\v+4\\u-2\ebm \in W\text{,} \end{equation*}
    we’re under no obligation to stick with the variables \(u\) and \(v\text{.}\) Let’s try to simplify a bit: if we let \(x = u-2\) (so \(u=x+2\)) and \(y = v+4\) (so \(v=y-4\)), then
    \begin{equation*} 2u+v = 2(x+2)+(y-4) = 2x+4+y-4 = 2x+y\text{,} \end{equation*}
    and thus we can write \(\vec v = \bbm 2x+y\\y\\x\ebm\text{,}\) with no more constant terms. In this form it’s much easier to verify that \(W\) is a subspace.
Let’s take a second look at the subspaces \(T\) and \(W\) from Example 5.3.3 and Example 5.3.4. Given an element \(\vec v = \bbm 3a-2b\\a+b\\a-4b\ebm\) of \(T\text{,}\) we note that
\begin{equation*} \vec v = \bbm 3a-2b\\a+b\\a-4b\ebm = \bbm 3a\\a\\a\ebm + \bbm -2b\\b\\-4b\ebm = a\bbm 3\\1\\1\ebm + b\bbm -2\\1\\-4\ebm\text{;} \end{equation*}
in other words, \(T\) can be written as the span of the vectors
\begin{equation*} \bbm 3\\1\\1\ebm \text{ and } \bbm -2\\1\\-4\ebm\text{.} \end{equation*}
Similarly, if we write \(\vec w = \bbm 2x+y\\y\\x\ebm\in W\) for an arbitrary element of \(W\) (using our change of variables), we have
\begin{equation*} \vec w = \bbm 2x\\0\\x\ebm + \bbm y\\y\\0\ebm = x\bbm 2\\0\\1\ebm + y\bbm 1\\1\\0\ebm\text{,} \end{equation*}
so the subspace \(W\) again can be rewritten as
\begin{equation*} W = \operatorname{span}\left\{\bbm 2\\0\\1\ebm, \bbm 1\\1\\0\ebm\right\}\text{.} \end{equation*}
In fact, although we will not prove it in this textbook, every subspace of \(\mathbb{R}^n\) can be written as the span of some finite set of vectors. We can, however, prove that every span is a subspace.
To see that this is true, recall that any element of a span is by definition a linear combination. Given two arbitrary elements
\begin{align*} \vec a \amp = a_1\vec{v}_1+a_2\vec{v}_2+\cdots + a_k\vec{v}_k\\ \vec b \amp = b_1\vec{v}_1+b_2\vec{v}_2+\cdots + b_k\vec{v}_k \end{align*}
of \(V\text{,}\) we note that
\begin{align*} \vec a + \vec b \amp = (a_1\vec{v}_1+a_2\vec{v}_2+\cdots + a_k\vec{v}_k) + (b_1\vec{v}_1+b_2\vec{v}_2+\cdots + b_k\vec{v}_k)\\ \amp = (a_1\vec{v}_1+b_1\vec{v}_1)+(a_2\vec{v}_2+b_2\vec{v}_2)+\cdots + (a_k\vec{v}_k+b_k\vec{v}_k)\\ \amp = (a_1+b_1)\vec{v}_1+(a_2+b_2)\vec{v}_2 + \cdots + (a_k+b_k)\vec{v}_k\text{,} \end{align*}
so that \(\vec a + \vec b\) can be written as a linear combination of the vectors \(\vec{v}_i\) and therefore belongs to \(V\text{.}\)
Similarly, for any scalar \(c\text{,}\) we have
\begin{align*} c\vec a \amp = c(a_1\vec{v}_1+a_2\vec{v}_2+\cdots + a_k\vec{v}_k)\\ \amp = (ca_1)\vec{v}_1+(ca_2)\vec{v}_2+\cdots (ca_k)\vec{v}_k\text{,} \end{align*}
so that \(c\vec a\) is an element of \(V\) as well. Thus, by Definition 5.3.1, we know that \(V\) is a subspace of \(\mathbb{R}^n\text{.}\)
We conclude with a discussion of how Theorem 5.3.5 and the concept of linear independence allows us to give a complete description of the possible subspaces of \(\mathbb{R}^n\text{.}\) To begin with, we have the simplest possible subspace, the trivial subspace
\begin{equation*} V_0 = \{\vec 0\}\text{.} \end{equation*}
If a subspace \(V\) has at least one non-zero vector, let’s say \(\vec v\in V\text{,}\) then by definition it must contain every scalar multiple of that vector. Thus, the next simplest type of subspace is given as the span of a single, non-zero vector:
\begin{equation*} V_1 = \{t\vec v \, | \, t\in\mathbb{R} \text{ and } \vec v \neq \vec 0\}\text{.} \end{equation*}
Of course, there are infinitely many possibilities for \(\vec v\text{,}\) but each choice of \(\vec v\neq \vec 0\) leads to a subspace that looks and acts “the same”. As discussed earlier, we can picture a subspace of this type as a line through the origin.
Next, we could consider a subspace \(V_2 = \operatorname{span}\{\vec v, \vec w\}\text{,}\) with \(\vec v, \vec w \neq \vec 0\text{.}\) There are two possibilities. One is that \(\vec v\) and \(\vec w\) are parallel, so that the set \(\{\vec v,\vec w\}\) is linearly dependent. In this case we can write \(\vec w = k\vec v\) for some scalar \(k\text{,}\) and for any scalars \(a\) and \(b\text{,}\)
\begin{equation*} a\vec v+b\vec w = a\vec v + b(k\vec v) = (a+bk)\vec v, \end{equation*}
so our subspace \(V_2\) is really of the same type as \(V_1\text{.}\) If, however, the vectors \(\vec v\) and \(\vec w\) are linearly independent, then adding the vector \(\vec w\) gives us a second direction to work with, and \(V_2\) becomes an object that is strictly larger than \(V_1\text{.}\) In this case, the visualization is that of a plane through the origin.
Depending on the size of \(n\text{,}\) this argument continues. If we add a third vector \(\vec u\) that is already in the span of \(\vec v\) and \(\vec w\text{,}\) then the set \(\{\vec u, \vec v,\vec w\}\) is linearly dependent, and the span of this set is the same as what we already had. If, however, \(\vec u \notin\operatorname{span}\{\vec v, \vec w\}\text{,}\) then \(\{\vec u, \vec v,\vec w\}\) is linearly independent, and
\begin{equation*} V_3 = \operatorname{span}\{\vec u, \vec v, \vec w\} \end{equation*}
is a strictly larger subspace than \(\operatorname{span}\{\vec v, \vec w\}\text{.}\) We could then look for a fourth vector, and so on. However, in the familiar case of \(\mathbb{R}^3\text{,}\) the process stops at 3.

Key Idea 5.3.6. Subspaces of \(\mathbb{R}^3\).

There are four different types of subspaces in \(\mathbb{R}^3\text{:}\)
  • The trivial subspace, \(V_0 = \{\vec 0\}\text{.}\) (Zero dimensional)
  • Lines through the origin, of the form
    \begin{equation*} V_1 = \operatorname{span}\{\vec v\}\text{,} \end{equation*}
    where \(\vec v\neq \vec 0\text{.}\) (One dimensional)
  • Planes through the origin, of the form
    \begin{equation*} V_2 = \operatorname{span}\{\vec v, \vec w\}\text{,} \end{equation*}
    where the vectors \(\vec v, \vec w\) are linearly independent. (Two dimensional)
  • The complete space \(V_3 = \mathbb{R}^3\text{.}\) (Three dimensional)
Notice the reference to dimension in Key Idea 5.3.6. In \(\mathbb{R}^3\text{,}\) we can rely on our intuitive (geometric) understanding of the concept of dimension. A complete understanding of the concept of dimension will have to wait until a second course in linear algebra; however, using the concepts in this section, we can make the following definition.

Definition 5.3.7. Dimension of a subspace.

The dimension of a subspace \(V\subseteq \mathbb{R}^n\) is the smallest number of vectors needed to span \(V\text{.}\)
One could also define dimension as the largest number of linearly independent vectors one can choose from a subspace. If \(B=\{\vec{v}_1, \ldots, \vec{v}_k\}\) is a set of vectors in a subspace \(V\) such that
  1. \(V=\operatorname{span}(B)\text{,}\) and
  2. \(B\) is linearly independent,
then we say \(B\) is a basis for \(V\text{.}\) For example, the set \(\{\veci, \vecj, \veck\}\) is a basis for \(\mathbb{R}^3\text{.}\) There are many possible bases for a subspace, but one can prove that the number of vectors in any basis is the same. Once this fact is established, we could alternatively define dimension as the number of vectors in any basis.

Exercises Exercises

Exercise Group.

Determine if the given subset of \(\mathbb{R}^2\) is a subspace. Support your conclusion with a proof or counterexample.
1.
\(S = \left\{\left. \bbm x\\y \ebm \, \right| \, 2x-3y=4\right\}\)
2.
\(T = \left\{\left. \bbm x+y\\x-y \ebm \, \right| \, x , y \in \mathbb{R}\right\}\)
3.
\(U = \left\{\left. \bbm x\\y \ebm \, \right| \, y=2x\right\}\)
4.
\(V = \left\{\left. \bbm x\\x^2 \ebm \, \right| \, x\in\mathbb{R}\right\}\)