Skip to main content

Section 1.4 Span

Recall that a linear combination of a set of vectors \(\vv_1,\ldots, \vv_k\) is a vector expression of the form
\begin{equation*} \ww=c_1\vv_1+c_2\vv_2+\cdots +c_k\vv_k, \end{equation*}
where \(c_1,\ldots, c_k\) are scalars.
It’s important to make sure you don’t get lost in the notation here. Be sure that you can keep track of which symbols are vectors, and which are scalars! Note that in a sense, this is the most general sort of expression you can form using the two operations of a vector space: addition, and scalar multiplication. We multiply some collection of vectors by scalars, and then use addition to “combine” them into a single vector.

Example 1.4.1.

In \(\R^3\text{,}\) let \(\uu = \bbm 1\\0\\3\ebm\text{,}\) \(\vv = \bbm -1\\2\\1\ebm\text{,}\) and \(\ww = \bbm 0\\3\\1\ebm\text{.}\) With scalars \(3,-2,4\) we can form the linear combination
\begin{equation*} 3\uu-2\vv+4\ww = \bbm 3\\0\\9\ebm+\bbm 2\\-4\\-2\ebm + \bbm 0\\12\\4\ebm = \bbm 5\\8\\11\ebm\text{.} \end{equation*}
Notice how the end result is a single vector, and we’ve lost all information regarding the vectors it came from. Sometimes we want the end result, but often we are more interested in details of the linear combination itself.
In the vector space of all real-valued continuous functions on \(\R\text{,}\) we can consider linear combinations such as \(f(x)=3e^{2x}+4\sin(3x)-3\cos(3x)\text{.}\) (This might, for example, be a particular solution to some differential equation.) Note that in this example, there is no nice way to “combine” these functions into a single term.
The span of those same vectors is the set of all possible linear combinations that can be formed:

Definition 1.4.2. Span.

Let \(\vv_1,\ldots, \vv_k\) be a set of vectors in a vector space \(V\text{.}\) The span of this set of vectors is the subset of \(V\) defined by
\begin{equation*} \spn\{\vv_1,\ldots, \vv_k\} = \{c_1\vv_1+ \cdots + c_k\vv_k \,|\, c_1,\ldots, c_k \in \mathbb{F}\}\text{.} \end{equation*}
The vectors \(\vv_1,\ldots, \vv_k\) can be thought of as the generators of the span. Every other vector in the set can be obtained as a linear combination of these vectors. Note that even though we have finitely many generators, because the set (usually \(\R\)) from which we choose our scalars is infinite, there are infinitely many elements in the span.
Since span is defined in terms of linear combinations, what the question “Is the vector \(\ww\) in \(\spn\{\vv_1,\ldots, \vv_k\}\text{?}\)” is really asking is, “Can \(\ww\) be written as a linear combination of \(\vv_1,\ldots, \vv_k\text{?}\)

Exercise 1.4.3.

    Let \(S = \{\vv_1,\ldots, \vv_k\}\) be a set of vectors. Which of the following statements are equivalent to the statement, “The vector \(\ww\) belongs to the span of \(S\text{.}\)”?
  • \(\ww=\vv_1+\cdots +\vv_k\text{.}\)
  • This is a tricky one: the statement implies that \(\ww\in\spn(S)\text{,}\) but it is not equivalent, since the converse is not necessarily true.
  • For some scalars \(c_1,\ldots, c_k\text{,}\) \(c_1\vv_1+\cdots + c_k\vv_k=\ww\text{.}\)
  • Yes! This is the definition of span.
  • The vector \(\ww\) is a linear combination of the vectors in \(S\text{.}\)
  • Correct.
  • For any scalars \(c_1,\ldots, c_k\text{,}\) \(c_1\vv_1+\cdots + c_k\vv=\ww\text{.}\)
  • The only way this statement could be true for all possible scalars is if all the vectors involved are zero. Otherwise, changing a scalar is going to change the resulting linear combination.
  • \(\ww = \vv_i\) for some \(i=1,\ldots, k\text{.}\)
  • Although each vector in \(S\) belongs to the span of \(S\text{,}\) the span of \(S\) contains much more than just the vectors in \(S\text{!}\)
With the appropriate setup, all such questions become questions about solving systems of equations. Here, we will look at a few such examples.

Example 1.4.4.

Determine whether the vector \(\bbm 2\\3\ebm\) is in the span of the vectors \(\bbm 1\\1\ebm,\bbm -1\\2\ebm\text{.}\)
Solution.
This is really asking: are there scalars \(s,t\) such that
\begin{equation*} s\bbm 1\\1\ebm + t\bbm -1\\2\ebm = \bbm 2\\3\ebm\text{?} \end{equation*}
And this, in turn, is equivalent to the system
\begin{align*} s -t \amp=2 \\ s+2t \amp=3 \text{,} \end{align*}
which is the same as the matrix equation
\begin{equation*} \bbm 1\amp -1\\1\amp 2\ebm\bbm s\\t\ebm = \bbm 2\\3\ebm. \end{equation*}
Solving the system confirms that there is indeed a solution, so the answer to our original question is yes.
To confirm your work for the above exercise, we can use the computer. This first code cell loads the sympy Python library, and then configures the output to look nice. For details on the code used below, see the Appendix.
The above code produces the reduced row-echelon form of the augmented matrix for our system. (The tuple \((0,1)\) lists the pivot columns — note that Python indexes the columns starting at \(0\) rather than \(1\text{.}\) If you’d rather just get the reduced matrix without this extra information, try adding pivots=False as an optional argument, in the empty parentheses of the rref command.) Do you remember how to get the answer from here? Here’s another approach.
Of course, this second approach only works if we know the matrix \(B\) is invertible. With a bit of experience, you’ll probably guess that invertibility of this matrix guarantees that any vector can be written as the span of its columns.
Our next example involves polynomials. At first this looks like a different problem, but it’s essentially the same once we set it up.

Example 1.4.5.

Determine whether \(p(x)=1+x+4x^2\) belongs to \(\spn\{1+2x-x^2,3+5x+2x^2\}\text{.}\)
Solution.
We seek scalars \(s,t\) such that
\begin{equation*} s(1+2x-2x^2)+t(3+5x+2x^2)=1+x+4x^2\text{.} \end{equation*}
On the left-hand side, we expand and gather terms:
\begin{equation*} (s+3t)+(2s+5t)x+(-2s+2t)x^2 = 1+x+4x^2\text{.} \end{equation*}
These two polynomials are equal if and only if we can solve the system
\begin{align*} s+3t \amp = 1 \\ 2s+5t \amp =1\\ -2s+2t \amp =4\text{.} \end{align*}
Adding the second and third equations gives \(7t=5\text{,}\) so \(t=\frac57\text{.}\) The third equation then gives \(s = t-2=-\frac97\text{.}\) With three equations and two unknowns, there is a risk that our system could be inconsistent. (In fact, this is the point: if the system is consistent, then \(p(x)\) is in the span. If the system is inconsistent, \(p(x)\) is not in the span.) We still need to check if our values work in the first equation:
\begin{equation*} s+3t = -\frac97+3\left(\frac57\right)=\frac67\neq 1\text{,} \end{equation*}
which shows that our system is inconsistent, and therefore, \(p(x)\) does not belong to the span of the other two polynomials.
Of course, we can also use matrices (and the computer) to help us solve the problem.
Based on this output, can you tell whether or not \(p(x)\) in the span? Why or why not?

Remark 1.4.6.

Can we determine what polynomials are in the span? Let’s consider a general polynomial \(q(x)=a+bx+cx^2\text{.}\) A bit of thought tells us that the coefficients \(a,b,c\) should replace the constants \(1,1,4\) above.
Asking the computer to reduce this matrix to RREF won’t produce the desired result. But we can always specify row operations.
In the elementary_row_op function called above, we are asking the computer to change row \(1\) (the second row) by adding \(-2\) times row \(0\) (the first row). See Section B.3.2 for complete details on this syntax.
Now we repeat. Here is another cell to work with:
Another option is to replace the rref() function with the echelon_form() function, which doesn’t simplify quite as far:
For a consistent system, we need \(c=14a-8b\text{.}\) Therefore,
\begin{equation*} \spn\{1+2x-x^2,3+5x+2x^2\} = \{a+bx+cx^2 \,|\, c=14a-8b\}\text{.} \end{equation*}
One of the reasons we care about linear combinations and span is that it gives us an easy means of generating subspaces, as the following theorem suggests.
For the first part, we will rely on our trusty Subspace Test. The proof is essentially the same as the motivating example from the beginning of Section 1.3, modified to allow an arbitrary number of vectors. First, we will write the zero vector as a linear combination of the given vectors. (What should the scalars be?) Then we check addition and scalar multiplication.
How do we show that a subspace is smallest? As suggested in the statement above, show that if a subspace \(W\) contains the vectors \(\vv_1,\vv_2,\ldots, \vv_k\text{,}\) then it must contain every vector in \(U\text{.}\) This must be the case because \(W\) is closed under addition and scalar multiplication, and every vector in \(U\) is formed using these operations.
Let \(U=\spn\{\vv_1,\vv_2,\ldots, \vv_k\}\text{.}\) Then \(0\in U\text{,}\) since \(0=0\vv_1+0\vv_2+\cdots + 0\vv_k\text{.}\) If \(\uu=a_1\vv_1+a_2\vv_2+\cdots +a_k\vv_k\) and \(\ww=b_1\vv_1+b_2\vv_2+\cdots +b_k\vv_k\) are vectors in \(U\text{,}\) then
\begin{align*} \uu+\ww \amp =(a_1\vv_1+a_2\vv_2+\cdots +a_k\vv_k)+(b_1\vv_1+b_2\vv_2+\cdots +b_k\vv_k)\\ \amp = (a_1+b_1)\vv_1+(a_2+b_2)\vv_2+\cdots + (a_k+b_k)\vv_k \end{align*}
is in \(U\text{,}\) and
\begin{align*} c\uu \amp =c(a_1\vv_1+a_2\vv_2+\cdots +a_k\vv_k)\\ \amp =(ca_1)\vv_1+(ca_2)\vv_2+\cdots + (ca_k)\vv_k \end{align*}
is in \(U\text{,}\) so by Theorem 1.3.2, \(U\) is a subspace.
To see that \(U\) is the smallest subspace containing \(\vv_1,\ldots, \vv_k\text{,}\) we need only note that if \(\vv_1,\ldots, \vv_k\in W\text{,}\) where \(W\) is a subspace, then since \(W\) is closed under scalar multiplication, we know that \(c_1\vv_1,\ldots, c_k\vv_k\) for any scalars \(c_1,\ldots, c_k\text{,}\) and since \(W\) is closed under addition, \(c_1\vv_1+\cdots+c_k\vv_k\in W\text{.}\) Thus, \(W\) contains all linear combinations of \(\vv_1,\ldots, \vv_k\text{,}\) which is to say that \(W\) contains \(U\text{.}\)

Exercise 1.4.8.

Let \(V\) be a vector space, and let \(X,Y\subseteq V\text{.}\) Show that if \(X\subseteq Y\text{,}\) then \(\spn X \subseteq \spn Y\text{.}\)
Hint.
Your goal is to show that any linear combination of vectors in \(X\) can also be written as a linear combination of vectors in \(Y\text{.}\) What value should you choose for the scalars in front of any vectors that belong to \(Y\) but not \(X\text{?}\)

Exercise 1.4.9.

    True or false: the vectors \(\{(1,2,0), (1,1,1)\}\) span \(\{(a,b,0)\,|\, a,b \in\R\}\text{.}\)
  • True.

  • The only way to get \(0\) as the third component of \(s(1,2,0)+t(1,1,1)\) is to set \(t=0\text{.}\) But the scalar multiples of \((1,2,0)\) do not generate all vectors of the form \((a,b,0)\text{.}\)
  • False.

  • The only way to get \(0\) as the third component of \(s(1,2,0)+t(1,1,1)\) is to set \(t=0\text{.}\) But the scalar multiples of \((1,2,0)\) do not generate all vectors of the form \((a,b,0)\text{.}\)
We end with a result that will be important as we work on our understanding of the structure of vector spaces.
We need to first recall that the span of a set of vectors is, first and foremost, a set. That means that we are proving the equality of two sets. Recall that this typically requires us to prove that each set is a subset of the other.
This means that we need to show that any linear combination of the vectors \(\uu,\vv_1,\ldots, \vv_k\) can be written as a linear combination of the vectors \(\vv_1,\ldots, \vv_k\text{,}\) and vice-versa. In one direction, we will need our hypothesis: \(\uu\in \spn\{\vv_1,\ldots, \vv_k\}\text{.}\) In the other direction, we come back to a trick we’ve already seen: adding zero does nothing. That is, if a vector is missing from a linear combination, we can include it, using \(0\) for its coefficient.
Suppose that \(\uu\in \spn\{\vv_1,\ldots, \vv_k\}\text{.}\) This means that \(\uu\) can be written as a linear combination of the vectors \(\vv_1,\ldots, \vv_k\text{,}\) so there must exist scalars \(a_1,\ldots, a_k\) such that
\begin{equation} \uu=a_1\vv_1+a_2\vv_2+\cdots + a_k\vv_k\text{.}\tag{1.4.1} \end{equation}
Now, let \(\ww\in \uu\in \spn\{\uu,\vv_1,\ldots, \vv_k\}\text{.}\) Then we must have
\begin{equation*} \ww = b\uu+c_1\vv_1+\cdots+c_k\vv_k \end{equation*}
for scalars \(b,c_1,\ldots, c_k\text{.}\) From our hypothesis (using (1.4.1)), we get
\begin{align*} \ww \amp = b(a_1\vv_1+a_2\vv_2+\cdots + a_k\vv_k) +c_1\vv_1+\cdots +c_k\vv_k\\ \amp = ((ba_1)\vv_1+\cdots + (ba_k)\vv_k)+(c_1\vv_1+\cdots +c_k\vv_k)\\ \amp = (ba_1+c_1)\vv_1+\cdots+(ba_k+c_k)\vv_k\text{.} \end{align*}
Since \(\ww\) can be written as a linear combination of \(\vv_1,\ldots, \vv_k\text{,}\) \(\ww\in\spn\{\vv_1,\ldots, \vv_k\}\text{,}\) and therefore \(\spn\{\uu,\vv_1,\ldots, \vv_k\}\subseteq \spn\{\vv_1,\ldots, \vv_k\}\text{.}\)
On the other hand, let \(\xx\in \spn\{\vv_1,\ldots, \vv_k\}\text{.}\) Then there exist scalars \(c_1,\ldots, c_k\) for which we have
\begin{align*} \xx \amp = c_1\vv_1+\cdots +c_k\vv_k\\ \amp = 0\uu + c_1\vv_1+\cdots + c_k\vv_k\text{.} \end{align*}
Therefore, \(\xx\in\spn\{\uu,\vv_1,\ldots, \vv_k\}\text{,}\) which proves the opposite conclusion, and therefore the result.
The moral of Theorem 1.4.10 is that one vector in a set is a linear combination of the others, we can remove it from the set without affecting the span. This suggests that we might want to look for the most “efficient” spanning sets – those in which no vector in the set can be written in terms of the others. Such sets are called linearly independent, and they are the subject of Section 1.6.

Exercises Exercises

1.

Let \(V\) be the vector space of symmetric \(2\times 2\) matrices and \(W\) be the subspace
\begin{equation*} W=\operatorname{span} \left\{ {\left[\begin{array}{cc} 2 \amp -5\cr -5 \amp -3 \end{array}\right]},{\left[\begin{array}{cc} 0 \amp 4\cr 4 \amp 4 \end{array}\right]} \right\} . \end{equation*}
(a) Find a nonzero element \(X\) in \(W\text{.}\)
(b) Find an element \(Y\) in \(V\) that is not in \(W\text{.}\)

2.

Let \(V\) be the vector space \(P_3(\mathbb{R})\) of polynomials in \(x\) with degree less than 3 and \(W\) be the subspace
\begin{equation*} W=\operatorname{span} \left\lbrace {5+3x+3x^{2}},{6x-5-2x^{2}} \right\rbrace . \end{equation*}
(a) Find a nonzero polynomial \(p(x)\) in \(W\text{.}\)
(b) Find a polynomial \(q(x)\) in \(V\) that does not belong to \(W\text{.}\)

3.

If possible, write \({24+8x+14x^{2}}\) as a linear combination of \({2+x+x^{2}}, {-2-x^{2}}\) and \({-3-x-2x^{2}}\text{.}\)
\({24+8x+14x^{2}} =\) \(({2+x+x^{2}}) +\) \(({-2-x^{2}}) +\) \(({-3-x-2x^{2}})\text{.}\)

4.

    Let \(\uu_4\) be a vector that is not a linear combination of the vectors \(\uu_1,\uu_2,\uu_3\text{.}\) Select the best statement.
  • We only know that \(\spn\{\uu_1,\uu_2,\uu_3\}\subseteq \spn\{\uu_1,\uu_2,\uu_3,\uu_4\}\text{.}\)
  • \(\spn\{\uu_1,\uu_2,\uu_3\}\) is a proper subset of \(\spn\{\uu_1,\uu_2,\uu_3,\uu_4\}\text{.}\)
  • We only know that \(\spn\{\uu_1,\uu_2,\uu_3,\uu_4\}\subseteq \spn\{\uu_1,\uu_2,\uu_3\}\text{.}\)
  • There is no obvious relationship between \(\spn\{\uu_1,\uu_2,\uu_3\}\) and \(\spn\{\uu_1,\uu_2,\uu_3,\uu_4\}\text{.}\)
  • \(\spn\{uu_1,\uu_2,\uu_3\} = \spn\{\uu_1,\uu_2,\uu_3,\uu_4\}\text{.}\)

5.

    Let \(\uu_4\) be a linear combination of the vectors \(\uu_1,\uu_2,\uu_3\text{.}\) Select the best statement.
  • There is no obvious relationship between \(\spn\{\uu_1,\uu_2,\uu_3\}\) and \(\spn\{\uu_1,\uu_2,\uu_3,\uu_4\}\text{.}\)
  • We only know that \(\spn\{\uu_1,\uu_2,\uu_3\}\subseteq \spn\{uu_1,\uu_2,\uu_3,\uu_4\}\text{.}\)

6.

Let \(x, y, z\) be (non-zero) vectors and suppose \(w = -20x-10y+4z\text{.}\)
If \(z= 4x+2y\text{,}\) then \(w =\) \(x+\) \(y\text{.}\)
Using the calculation above, mark the statements below that must be true.
  • Span(x, y, z) = Span(w, x, y)
  • Span(w, z) = Span(y, z)
  • Span(x, z) = Span(y, z)
  • Span(w, y, z) = Span(w, z)
  • Span(w, x, z) = Span(x, y)