Skip to main content
Mathematics LibreTexts

5.1: Subspaces and Spanning

  • Page ID
    58855
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\dsum}{\displaystyle\sum\limits} \)

    \( \newcommand{\dint}{\displaystyle\int\limits} \)

    \( \newcommand{\dlim}{\displaystyle\lim\limits} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \(\newcommand{\longvect}{\overrightarrow}\)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \(\newcommand{\ket}[1]{\left| #1 \right>}\)
    \(\newcommand{\bra}[1]{\left< #1 \right|}\)
    \(\newcommand{\braket}[2]{\left< #1 \vphantom{#2} \right| \left. #2 \vphantom{#1} \right>}\)
    \(\newcommand{\braopket}[3]{\left< #1 \vphantom{#2}\vphantom{#3} \right| #2 \vphantom{#1}\vphantom{#3} \left| #3 \vphantom{#1}\vphantom{#2} \right>}\)
    \(\newcommand{\qmvec}[1]{\mathbf{\vec{#1}}}\)
    \(\newcommand{\op}[1]{\hat{\mathbf{#1}}}\)
    \(\newcommand{\expect}[1]{\langle #1 \rangle}\)
    \(\newcommand{\dfn}[1]{\emph{\textbf{#1}}}\)

    \(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)

    Subspace of \(\mathbb{R}^n\)

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

    A set \(U\) of vectors in \(\mathbb{R}^n\) is called a subspace of \(\mathbb{R}^n\) if it satisfies the following properties:

    • S1 The zero vector \(\mathbf{0} \in U\).
    • S2 If \(\mathbf{x} \in U\) and \(\mathbf{y} \in U\), then \(\mathbf{x} + \mathbf{y} \in U\).
    • S3 If \(\mathbf{x} \in U\), then \(a\mathbf{x} \in U\) for every real number \(a\).

    We say that the subset \(U\) is closed under addition if S2 holds, and that \(U\) is closed under scalar multiplication if S3 holds.

    Clearly \(\mathbb{R}^n\) is a subspace of itself, and this chapter is about these subspaces and their properties. The set \(U = \{\mathbf{0}\}\), consisting of only the zero vector, is also a subspace because \(\mathbf{0} + \mathbf{0} = \mathbf{0}\) and \(a\mathbf{0} = \mathbf{0}\) for each \(a\) in \(\mathbb{R}\); it is called the zero subspace. Any subspace of \(\mathbb{R}^n\) other than {\(\mathbf{0}\)} or \(\mathbb{R}^n\) is called a proper subspace.

    We saw in Section 4.2 that every plane \(M\) through the origin in \(\mathbb{R}^3\) has equation \(ax + by + cz = 0\) where \(a\), \(b\), and \(c\) are not all zero. Here \(\mathbf{n} = \left[ \begin{array}{r} a \\ b \\ c \end{array} \right]\) is a normal for the plane and

    \[M = \{ \mathbf{v} \mbox{ in } \mathbb{R}^3 \mid \mathbf{n} \cdot \mathbf{v} = 0 \} \nonumber \]

    where \(\mathbf{v} = \left[ \begin{array}{r} x \\ y \\ z \end{array} \right]\) and \(\mathbf{n} \cdot \mathbf{v}\) denotes the dot product introduced in Section 2.2 (see the diagram).1 Then \(M\) is a subspace of \(\mathbb{R}^3\).

    clipboard_e1d801f202cc9ffe6296819080b480664.png

    Indeed we show that \(M\) satisfies S1, S2, and S3 as follows:

    • \(\mathbf{0} \in M\) because \(\mathbf{n} \cdot \mathbf{0} = 0\);
    • If \(\mathbf{v} \in M\) and \(\mathbf{v}_{1} \in M\) , then \(\mathbf{n} \cdot (\mathbf{v} + \mathbf{v}_{1}) = \mathbf{n} \cdot \mathbf{v} + \mathbf{n} \cdot \mathbf{v}_{1} = 0 + 0 = 0\) , so \(\mathbf{v} + \mathbf{v}_{1} \in M\);
    • If \(\mathbf{v} \in M\) , then \(\mathbf{n} \cdot (a\mathbf{v}) = a(\mathbf{n} \cdot \mathbf{v}) = a(0) = 0\) , so \(a\mathbf{v} \in M\).

    This proves the first part of

    Example \(\PageIndex{1}\)

    Planes and lines through the origin in \(\mathbb{R}^3\) are all subspaces of \(\mathbb{R}^3\).

    clipboard_ec8aafb057110eebff321e24f0ebed41d.png

    We dealt with planes above. If \(L\) is a line through the origin with direction vector \(\mathbf{d}\), then \(L = \{t\mathbf{d} \mid t \in \mathbb{R}\}\) (see the diagram). We leave it as an exercise to verify that \(L\) satisfies S1, S2, and S3.

    Example 5.1.1 shows that lines through the origin in \(\mathbb{R}^2\) are subspaces; in fact, they are the only proper subspaces of \(\mathbb{R}^2\) (Exercise 5.1.24). Indeed, we shall see in Example 5.2.14 that lines and planes through the origin in \(\mathbb{R}^3\) are the only proper subspaces of \(\mathbb{R}^3\). Thus the geometry of lines and planes through the origin is captured by the subspace concept. (Note that every line or plane is just a translation of one of these.)

    Subspaces can also be used to describe important features of an \(m \times n\) matrix \(A\). The null space of \(A\), denoted \(\text{null } A\), and the image space of \(A\), denoted \(im \; A\), are defined by

    \[\text{null } A = \{ \mathbf{x} \in \mathbb{R}^n \mid A\mathbf{x} = \mathbf{0}\} \quad \mbox{ and } \quad im \; A = \{A\mathbf{x} \mid \mathbf{x} \in \mathbb{R}^n\} \nonumber \]

    In the language of Chapter 2, \(\text{null } A\) consists of all solutions \(\mathbf{x}\) in \(\mathbb{R}^n\) of the homogeneous system \(A\mathbf{x} = \mathbf{0}\), and \(im \; A\) is the set of all vectors \(\mathbf{y}\) in \(\mathbb{R}^m\) such that \(A\mathbf{x} = \mathbf{y}\) has a solution \(\mathbf{x}\). Note that \(\mathbf{x}\) is in \(\text{null } A\) if it satisfies the condition \(A\mathbf{x} = \mathbf{0}\), while \(im \; A\) consists of vectors of the form \(A\mathbf{x}\) for some \(\mathbf{x}\) in \(\mathbb{R}^n\). These two ways to describe subsets occur frequently.

    Example \(\PageIndex{2}\)

    If \(A\) is an \(m \times n\) matrix, then:

    1. \(\text{null } A\) is a subspace of \(\mathbb{R}^n\).
    2. \(im \; A\) is a subspace of \(\mathbb{R}^m\).
    Solution
    1. The zero vector \(\mathbf{0} \in \mathbb{R}^n\) lies in \(\text{null } A\) because \(A\mathbf{0} = \mathbf{0}\). If \(\mathbf{x}\) and \(\mathbf{x}_{1}\) are in \(\text{null } A\), then \(\mathbf{x} + \mathbf{x}_{1}\) and \(a\mathbf{x}\) are in \(\text{null } A\) because they satisfy the required condition:

      \[A(\mathbf{x} + \mathbf{x}_1) = A\mathbf{x} + A\mathbf{x}_1 = \mathbf{0} + \mathbf{0} = \mathbf{0} \quad \mbox{and} \quad A(a\mathbf{x}) = a(A\mathbf{x}) = a\mathbf{0} = \mathbf{0} \nonumber \]

    2. The zero vector \(\mathbf{0} \in \mathbb{R}^m\) lies in \(im \; A\) because \(\mathbf{0} = A\mathbf{0}\). Suppose that \(\mathbf{y}\) and \(\mathbf{y}_{1}\) are in \(im \; A\), say \(\mathbf{y} = A\mathbf{x}\) and \(\mathbf{y}_{1} = A\mathbf{x}_{1}\) where \(\mathbf{x}\) and \(\mathbf{x}_{1}\) are in \(\mathbb{R}^n\). Then

      \[\mathbf{y} + \mathbf{y}_1 = A\mathbf{x} + A\mathbf{x}_1 = A(\mathbf{x} + \mathbf{x}_1) \quad \mbox{and} \quad a\mathbf{y} = a(A\mathbf{x}) = A(a\mathbf{x}) \nonumber \]

    There are other important subspaces associated with a matrix \(A\) that clarify basic properties of \(A\). If \(A\) is an \(n \times n\) matrix and \(\lambda\) is any number, let

    \[E_\lambda(A) = \{\mathbf{x} \in \mathbb{R}^n \mid A\mathbf{x} = \lambda\mathbf{x} \} \nonumber \]

    A vector \(\mathbf{x}\) is in \(E_\lambda(A)\) if and only if \((\lambda I - A)\mathbf{x} = \mathbf{0}\), so Example 5.1.2 gives:

    Example \(\PageIndex{3}\)

    \(E_\lambda(A) = \text{null }(\lambda I- A)\) is a subspace of \(\mathbb{R}^n\) for each \(n \times n\) matrix \(A\) and number \(\lambda\).

    \(E_\lambda(A)\) is called the eigenspace of \(A\) corresponding to \(\lambda\). The reason for the name is that, in the terminology of Section 3.3, \(\lambda\) is an eigenvalue of \(A\) if \(E_\lambda(A) \neq \{\mathbf{0}\}\). In this case the nonzero vectors in \(E_\lambda(A)\) are called the eigenvectors of \(A\) corresponding to \(\lambda\).

    The reader should not get the impression that every subset of \(\mathbb{R}^n\) is a subspace. For example:

    \[\begin{aligned} U_1 &= \left \{ \left[ \begin{array}{l} x \\ y \end{array} \right] \, \middle| \, x \geq 0 \right\} \mbox{ satisfies S1 and S2, but not S3;} \\ U_2 &= \left \{ \left[ \begin{array}{l} x \\ y \end{array} \right] \, \middle| \, x^2 = y^2 \right\} \mbox{ satisfies S1 and S3, but not S2;}\end{aligned} \nonumber \]

    Hence neither \(U_{1}\) nor \(U_{2}\) is a subspace of \(\mathbb{R}^2\). (However, see Exercise 5.1.20.)

    Spanning Sets

    Let \(\mathbf{v}\) and \(\mathbf{w}\) be two nonzero, nonparallel vectors in \(\mathbb{R}^3\) with their tails at the origin. The plane \(M\) through the origin containing these vectors is described in Section 4.2 by saying that \(\mathbf{n} = \mathbf{v} \times \mathbf{w}\) is a normal for \(M\), and that \(M\) consists of all vectors \(\mathbf{p}\) such that \(\mathbf{n} \cdot \mathbf{p} = 0\).2 While this is a very useful way to look at planes, there is another approach that is at least as useful in \(\mathbb{R}^3\) and, more importantly, works for all subspaces of \(\mathbb{R}^n\) for any \(n \geq 1\).

    clipboard_e4dda14b377a220ecc19b46b77d6e6db4.png

    The idea is as follows: Observe that, by the diagram, a vector \(\mathbf{p}\) is in \(M\) if and only if it has the form

    \[\mathbf{p} = a\mathbf{v} + b\mathbf{w} \nonumber \]

    for certain real numbers \(a\) and \(b\) (we say that \(\mathbf{p}\) is a linear combination of \(\mathbf{v}\) and \(\mathbf{w}\)). Hence we can describe \(M\) as

    \[M = \{a\mathbf{x} + b\mathbf{w} \mid a, b \in \mathbb{R} \}.^1\nonumber \]

    and we say that \(\{\mathbf{v}, \mathbf{w}\}\) is a spanning set for \(M\). It is this notion of a spanning set that provides a way to describe all subspaces of \(\mathbb{R}^n\).

    As in Definition 1.3, given vectors \(\mathbf{x}_{1}, \mathbf{x}_{2}, \dots, \mathbf{x}_{k}\) in \(\mathbb{R}^n\), a vector of the form

    \[t_1\mathbf{x}_1 + t_2\mathbf{x}_2 + \dots + t_k\mathbf{x}_k \quad \mbox{where the } t_i \mbox{ are scalars} \nonumber \]

    is called a linear combination of the \(\mathbf{x}_{i}\), and \(t_{i}\) is called the coefficient of \(\mathbf{x}_{i}\) in the linear combination.

    Definition: Linear Combinations and Span in \(\mathbb{R}^n\)

    The set of all such linear combinations is called the span of the \(\mathbf{x}_{i}\) and is denoted

    \[span \;\{\mathbf{x}_1, \mathbf{x}_2, \dots, \mathbf{x}_k\} = \{t_1\mathbf{x}_1 + t_2\mathbf{x}_2 + \dots + t_k\mathbf{x}_k \mid t_i \mbox{ in } \mathbb{R}\} \nonumber \]

    If \(V = span \;\{\mathbf{x}_{1}, \mathbf{x}_{2}, \dots, \mathbf{x}_{k}\}\), we say that \(V\) is spanned by the vectors \(\mathbf{x}_{1}, \mathbf{x}_{2}, \dots, \mathbf{x}_{k}\), and that the vectors \(\mathbf{x}_{1}, \mathbf{x}_{2}, \dots, \mathbf{x}_{k}\) span the space \(V\).

    Here are two examples:

    \[span \;\{ \mathbf{x} \} = \{t\mathbf{x} \mid t \in \mathbb{R}\} \nonumber \]

    which we write as \(span \;\{\mathbf{x}\} = \mathbb{R} \mathbf{x}\) for simplicity.

    \[span \;\{\mathbf{x}, \mathbf{y}\} = \{r\mathbf{x} + s\mathbf{y} \mid r, s \in \mathbb{R} \} \nonumber \]

    In particular, the above discussion shows that, if \(\mathbf{v}\) and \(\mathbf{w}\) are two nonzero, nonparallel vectors in \(\mathbb{R}^3\), then

    \[M = span \;\{\mathbf{v}, \mathbf{w} \} \nonumber \]

    is the plane in \(\mathbb{R}^3\) containing \(\mathbf{v}\) and \(\mathbf{w}\). Moreover, if \(\mathbf{d}\) is any nonzero vector in \(\mathbb{R}^3\) (or \(\mathbb{R}^2\)), then

    \[L = span \; \{\mathbf{v}\} = \{t\mathbf{d} \mid t \in \mathbb{R}\} = \mathbb{R}\mathbf{d} \nonumber \]

    is the line with direction vector \(\mathbf{d}\). Hence lines and planes can both be described in terms of spanning sets.

    Example \(\PageIndex{4}\)

    Let \(\mathbf{x} = (2, -1, 2, 1)\) and \(\mathbf{y} = (3, 4, -1, 1)\) in \(\mathbb{R}^4\). Determine whether \(\mathbf{p} = (0, -11, 8, 1)\) or \(\mathbf{q} = (2, 3, 1, 2)\) are in \(U = span \;\{\mathbf{x}, \mathbf{y}\}\).

    Solution

    The vector \(\mathbf{p}\) is in \(U\) if and only if \(\mathbf{p} = s\mathbf{x} + t\mathbf{y}\) for scalars \(s\) and \(t\). Equating components gives equations

    \[2s + 3t = 0, \quad -s + 4t = -11, \quad 2s - t = 8, \quad \mbox{and} \quad s + t = 1 \nonumber \]

    This linear system has solution \(s = 3\) and \(t = -2\), so \(\mathbf{p}\) is in \(U\). On the other hand, asking that \(\mathbf{q} = s\mathbf{x} + t\mathbf{y}\) leads to equations

    \[2s + 3t = 2, \quad -s +4t = 3, \quad 2s -t = 1, \quad \mbox{and} \quad s + t = 2 \nonumber \]

    and this system has no solution. So \(\mathbf{q}\) does not lie in \(U\).

    Theorem \(\PageIndex{1}\): Span Theorem

    Let \(U = span \;\{\mathbf{x}_{1}, \mathbf{x}_{2}, \dots, \mathbf{x}_{k}\}\) in \(\mathbb{R}^n\). Then:

    1. \(U\) is a subspace of \(\mathbb{R}^n\) containing each \(\mathbf{x}_{i}\).
    2. If \(W\) is a subspace of \(\mathbb{R}^n\) and each \(\mathbf{x}_{i} \in W\), then \(U \subseteq W\).
    Proof
    1. The zero vector \(\mathbf{0}\) is in \(U\) because \(\mathbf{0} = 0\mathbf{x}_{1} + 0\mathbf{x}_{2} + \dots + 0\mathbf{x}_{k}\) is a linear combination of the \(\mathbf{x}_{i}\). If \(\mathbf{x} = t_{1}\mathbf{x}_{1} + t_{2}\mathbf{x}_{2} + \dots + t_{k}\mathbf{x}_{k}\) and \(\mathbf{y} = s_{1}\mathbf{x}_{1} + s_{2}\mathbf{x}_{2} + \dots + s_{k}\mathbf{x}_{k}\) are in \(U\), then \(\mathbf{x} + \mathbf{y}\) and \(a\mathbf{x}\) are in \(U\) because

      \[\begin{aligned} \mathbf{x} + \mathbf{y} &=& (t_1 + s_1)\mathbf{x}_1 + (t_2 + s_2)\mathbf{x}_2 + \dots + (t_k + s_k)\mathbf{x}_k, \mbox{ and} \\ a\mathbf{x} &=& (at_1)\mathbf{x}_1 + (at_2)\mathbf{x}_2 + \dots + (at_k)\mathbf{x}_k\end{aligned} \nonumber \]

    2. Let \(\mathbf{x} = t_{1}\mathbf{x}_{1} + t_{2}\mathbf{x}_{2} + \dots + t_{k}\mathbf{x}_{k}\) where the \(t_{i}\) are scalars and each \(\mathbf{x}_{i} \in W\). Then each \(t_{i}\mathbf{x}_{i} \in W\) because \(W\) satisfies S3. But then \(\mathbf{x} \in W\) because \(W\) satisfies S2 (verify). This proves (2).

    Condition (2) in Theorem 5.1.1 can be expressed by saying that \(span \;\{\mathbf{x}_{1}, \mathbf{x}_{2}, \dots, \mathbf{x}_{k}\}\) is the smallest subspace of \(\mathbb{R}^n\) that contains each \(\mathbf{x}_{i}\). This is useful for showing that two subspaces \(U\) and \(W\) are equal, since this amounts to showing that both \(U \subseteq W\) and \(W \subseteq U\). Here is an example of how it is used.

    Example \(\PageIndex{5}\)

    If \(\mathbf{x}\) and \(\mathbf{y}\) are in \(\mathbb{R}^n\), show that \(span \;\{\mathbf{x}, \mathbf{y}\} = span \;\{\mathbf{x} + \mathbf{y}, \mathbf{x} - \mathbf{y}\}\).

    Solution

    Since both \(\mathbf{x} + \mathbf{y}\) and \(\mathbf{x} - \mathbf{y}\) are in \(span \;\{\mathbf{x}, \mathbf{y}\}\), Theorem 5.1.1 gives

    \[span \;\{\mathbf{x} + \mathbf{y}, \mathbf{x} - \mathbf{y} \} \subseteq span \;\{\mathbf{x}, \mathbf{y}\} \nonumber \]

    But \(\mathbf{x} = \frac{1}{2}(\mathbf{x} + \mathbf{y}) + \frac{1}{2}(\mathbf{x} - \mathbf{y})\) and \(\mathbf{y} = \frac{1}{2}(\mathbf{x} + \mathbf{y}) - \frac{1}{2}(\mathbf{x} - \mathbf{y})\) are both in \(span \;\{\mathbf{x} + \mathbf{y}, \mathbf{x} - \mathbf{y}\}\), so

    \[span \;\{\mathbf{x}, \mathbf{y}\} \subseteq span \;\{\mathbf{x} + \mathbf{y}, \mathbf{x} - \mathbf{y} \} \nonumber \]

    again by Theorem 5.1.1. Thus \(span \;\{\mathbf{x}, \mathbf{y}\} = span \;\{\mathbf{x} + \mathbf{y}, \mathbf{x} - \mathbf{y}\}\), as desired.

    It turns out that many important subspaces are best described by giving a spanning set. Here are three examples, beginning with an important spanning set for \(\mathbb{R}^n\) itself. Column \(j\) of the \(n \times n\) identity matrix \(I_{n}\) is denoted \(\mathbf{e}_{j}\) and called the \(j\)th coordinate vector in \(\mathbb{R}^n\), and the set \(\{\mathbf{e}_{1}, \mathbf{e}_{2}, \dots, \mathbf{e}_{n}\}\) is called the standard basis of \(\mathbb{R}^n\). If \(\mathbf{x} = \left[ \begin{array}{r} x_1 \\ x_2 \\ \vdots \\ x_n \end{array} \right]\) is any vector in \(\mathbb{R}^n\), then \(\mathbf{x} = x_{1}\mathbf{e}_{1} + x_{2}\mathbf{e}_{2} + \dots + x_{n}\mathbf{e}_{n}\), as the reader can verify. This proves:

    Example \(\PageIndex{6}\)

    \(\mathbb{R}^n = span \;\{\mathbf{e}_{1}, \mathbf{e}_{2}, \dots, \mathbf{e}_{n}\}\) where \(\mathbf{e}_{1}, \mathbf{e}_{2}, \dots, \mathbf{e}_{n}\) are the columns of \(I_{n}\).

    If \(A\) is an \(m \times n\) matrix \(A\), the next two examples show that it is a routine matter to find spanning sets for \(\text{null } A\) and \(im \; A\).

    Example \(\PageIndex{7}\)

    Given an \(m \times n\) matrix \(A\), let \(\mathbf{x}_{1}, \mathbf{x}_{2}, \dots, \mathbf{x}_{k}\) denote the basic solutions to the system \(A\mathbf{x} = \mathbf{0}\) given by the gaussian algorithm. Then

    \[\text{null } A = span \;\{\mathbf{x}_1, \mathbf{x}_2, \dots, \mathbf{x}_k\} \nonumber \]

    Solution

    If \(\mathbf{x} \in \text{null } A\), then \(A\mathbf{x} = \mathbf{0}\) so Theorem 1.3.2 shows that \(\mathbf{x}\) is a linear combination of the basic solutions; that is, \(\text{null } A \subseteq span \;\{\mathbf{x}_{1}, \mathbf{x}_{2}, \dots, \mathbf{x}_{k}\}\). On the other hand, if \(\mathbf{x}\) is in \(span \;\{\mathbf{x}_{1}, \mathbf{x}_{2}, \dots, \mathbf{x}_{k}\}\), then \(\mathbf{x} = t_{1}\mathbf{x}_{1} + t_{2}\mathbf{x}_{2} + \dots + t_{k}\mathbf{x}_{k}\) for scalars \(t_{i}\), so

    \[A\mathbf{x} = t_1A\mathbf{x}_1 + t_2A\mathbf{x}_2 + \dots + t_kA\mathbf{x}_k = t_1\mathbf{0} + t_2\mathbf{0} + \dots + t_k\mathbf{0} = \mathbf{0} \nonumber \]

    This shows that \(\mathbf{x} \in \text{null } A\), and hence that \(span \;\{\mathbf{x}_{1}, \mathbf{x}_{2}, \dots, \mathbf{x}_{k}\} \subseteq \text{null } A\). Thus we have equality.

    Example \(\PageIndex{8}\)

    Let \(\mathbf{c}_{1}, \mathbf{c}_{2}, \dots, \mathbf{c}_{n}\) denote the columns of the \(m \times n\) matrix \(A\). Then

    \[im \; A = span \;\{\mathbf{c}_1, \mathbf{c}_2, \dots, \mathbf{c}_n\} \nonumber \]

    Solution

    If \(\{\mathbf{e}_{1}, \mathbf{e}_{2}, \dots, \mathbf{e}_{n}\}\) is the standard basis of \(\mathbb{R}^n\), observe that

    \[\left[ \begin{array}{cccc} A\mathbf{e}_1 & A\mathbf{e}_2 & \cdots & A\mathbf{e}_n \end{array}\right] = A \left[ \begin{array}{cccc} \mathbf{e}_1 & \mathbf{e}_2 & \cdots & \mathbf{e}_n \end{array}\right] = AI_n = A = \left[ \begin{array}{cccc} \mathbf{c}_1 & \mathbf{c}_2 & \cdots \mathbf{c}_n \end{array}\right]. \nonumber \]

    Hence \(\mathbf{c}_{i} = A\mathbf{e}_{i}\) is in \(im \; A\) for each \(i\), so \(span \;\{\mathbf{c}_{1}, \mathbf{c}_{2}, \dots, \mathbf{c}_{n}\} \subseteq \text{ im} A\).

    Conversely, let \(\mathbf{y}\) be in \(im \; A\), say \(\mathbf{y} = A\mathbf{x}\) for some \(\mathbf{x}\) in \(\mathbb{R}^n\). If \(\mathbf{x} = \left[ \begin{array}{c} x_1 \\ x_2 \\ \vdots \\ x_n \end{array} \right]\), then Definition 2.2.1 gives

    \[\mathbf{y} = A\mathbf{x} = x_1\mathbf{c}_1 + x_2\mathbf{c}_2 + \dots + x_n\mathbf{c}_n \mbox{ is in } span \; \{\mathbf{c}_1, \mathbf{c}_2, \ \dots, \mathbf{c}_n\} \nonumber \]

    This shows that \(im \; A \subseteq span \;\{\mathbf{c}_{1}, \mathbf{c}_{2}, \dots, \mathbf{c}_{n}\}\), and the result follows.


    1. We are using set notation here. In general {\(q \mid p\)} means the set of all objects \(q\) with property \(p\).
    2. The vector \(\mathbf{n} = \mathbf{v} \times \mathbf{w}\) is nonzero because \(\mathbf{v}\) and \(\mathbf{w}\) are not parallel.
    3. In particular, this implies that any vector \(\mathbf{p}\) orthogonal to \(\mathbf{v} \times \mathbf{w}\) must be a linear combination \(\mathbf{p} = a\mathbf{v} + b\mathbf{w}\) of \(\mathbf{v}\) and \(\mathbf{w}\) for some \(a\) and \(b\). Can you prove this directly?

    This page titled 5.1: Subspaces and Spanning was last modified on Sat, 17 Jan 2026 00:22:24 GMT and is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by W. Keith Nicholson via source content that was edited to the style and standards of the LibreTexts platform.