1.7.2: Finding a Basis of a Subspace
- Page ID
- 186297
\( \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{\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}\)Now we show how to find bases for the column space of a matrix and the null space of a matrix. In order to find a basis for a given subspace, it is usually easiest to rewrite the subspace as a column space or a null space first.
First, we show how to compute a basis for the column space of a matrix.
The pivot columns of a matrix \(A\) form a basis for \(\text{Col}(A)\).
The above theorem is referring to the pivot columns in the original matrix, not its reduced row echelon form. Indeed, a matrix and its reduced row echelon form generally have different column spaces. For example, consider the matrix \(A\) below:

Figure \(\PageIndex{4}\)
The pivot columns are the first two columns, so a basis for \(\text{Col}(A)\) is
\[\left\{\left[\begin{array}{c}1\\-2\\2\end{array}\right],\:\left[\begin{array}{c}2\\-3\\4\end{array}\right]\right\}\nonumber\]
The first two columns of the reduced row echelon form certainly span a different subspace, as
\[\text{Span}\left\{\left[\begin{array}{c}1\\0\\0\end{array}\right],\:\left[\begin{array}{c}0\\1\\0\end{array}\right]\right\}=\left\{\left[\begin{array}{c}a\\b\\0\end{array}\right]\,:\, a,b\text{ in }\mathbb{R}\right\}=(xy\text{-plane with }z=0)\nonumber\]
but \(\text{Col}(A)\) contains vectors whose last coordinate is nonzero.
The dimension of \(\text{Col}(A)\) is the number of pivots of \(A\).
Computing a basis for a span is the same as computing a basis for a column space. Indeed, the span of finitely many vectors \(\vec{v}_1,\vec{v}_2,\ldots,\vec{v}_m\) is the column space of a matrix, namely, the matrix \(A\) whose columns are \(\vec{v}_1,\vec{v}_2,\ldots,\vec{v}_m\text{:}\)
\[A=\left[\begin{array}{cccc}|&|&\quad &| \\ \vec{v}_1 &\vec{v}_2 &\cdots &\vec{v}_m \\ |&|&\quad &|\end{array}\right]\nonumber\]
Find a basis of the subspace
\[V=\text{Span}\left\{\left[\begin{array}{c}1\\-2\\2\end{array}\right],\:\left[\begin{array}{c}2\\-3\\4\end{array}\right],\:\left[\begin{array}{c}0\\4\\0\end{array}\right],\:\left[\begin{array}{c}-1\\5\\-2\end{array}\right]\right\}.\nonumber\]
Solution
The subspace \(V\) is the column space of the matrix
\[A=\left[\begin{array}{cccc}1&2&0&-1 \\ -2&-3&4&5 \\ 2&4&0&-2\end{array}\right]\nonumber\]
The reduced row echelon form of this matrix is
\[\left[\begin{array}{cccc}1&0&-8&-7 \\ 0&1&4&3 \\ 0&0&0&0\end{array}\right]\nonumber\]
The first two columns are pivot columns, so a basis for \(V\) is
\[\left\{\left[\begin{array}{c}1\\-2\\2\end{array}\right],\:\left[\begin{array}{c}2\\-3\\4\end{array}\right]\right\}\nonumber\]
Find a basis of the subspace
\[V=\text{Span}\left\{\left[\begin{array}{c}1\\-2\\2\end{array}\right],\:\left[\begin{array}{c}2\\-3\\4\end{array}\right],\:\left[\begin{array}{c}0\\4\\0\end{array}\right],\:\left[\begin{array}{c}-1\\5\\-2\end{array}\right]\right\}\nonumber\]
which does not consist of the first two vectors, as in the previous Example \(\PageIndex{6}\).
Solution
The point of this example is that the above Theorem \(\PageIndex{1}\) gives one basis for \(V\text{;}\) as always, there are infinitely more.
Reordering the vectors, we can express \(V\) as the column space of
\[A'=\left[\begin{array}{cccc}0&-1&1&2 \\ 4&5&-2&-3 \\ 0&-2&2&4\end{array}\right]\nonumber\]
The reduced row echelon form of this matrix is
\[\left[\begin{array}{cccc}1&0&\frac{3}{4} &\frac{7}{4} \\ 0&1&-1&-2 \\ 0&0&0&0\end{array}\right]\nonumber\]
The first two columns are pivot columns, so a basis for \(V\) is
\[\left\{\left[\begin{array}{c}0\\4\\0\end{array}\right],\:\left[\begin{array}{c}-1\\5\\-2\end{array}\right]\right\}\nonumber\]
These are the last two vectors in the given spanning set.
Of course, a cheaper way to answer this question is to scale our previous answer \(\left\{\left[\begin{array}{c}10\\-20\\20\end{array}\right],\:\left[\begin{array}{c}200\\-300\\400\end{array}\right]\right\}\) to span the same subspace.
In order to compute a basis for the null space of a matrix, one has to find the parametric vector form of the solutions of the homogeneous equation \(A\vec{x}=\vec{0}\).
The vectors attached to the free variables in the parametric vector form of the solution set of \(A\vec{x}=\vec{0}\) form a basis of \(\text{Nul}(A)\).
The proof of the theorem has two parts. The first part is that every solution lies in the span of the given vectors. This is automatic: the vectors are exactly chosen so that every solution is a linear combination of those vectors. The second part is that the vectors are linearly independent, which we have already discussed to be true.
As mentioned at the beginning of this subsection, when given a subspace written in a different form, in order to compute a basis it is usually best to rewrite it as a column space or null space of a matrix.
Let \(V\) be the subspace defined by
\[V=\left\{\left[\begin{array}{c}x\\y\\z\end{array}\right] : x+2y=z\right\}\nonumber\]
Find \(\dim(V)\text{?}\)
Solution
First, we notice that \(V\) is exactly the solution set of the homogeneous linear equation \(x + 2y - z = 0\). Hence, \(V = \text{Null}\left(\left[\begin{array}{ccc}1&2&-1\end{array}\right]\right).\) This matrix is in reduced row echelon form; the parametric form of the general solution is \(x = -2y + z\text{,}\) so the parametric vector form is
\[\left[\begin{array}{c}x\\y\\z\end{array}\right]=y\left[\begin{array}{c}-2\\1\\0\end{array}\right]+z\left[\begin{array}{c}1\\0\\1\end{array}\right]\nonumber\]
It follows that a basis for \(V\) is \(\left\{\left[\begin{array}{c}-2\\1\\0\end{array}\right],\:\left[\begin{array}{c}1\\0\\1\end{array}\right]\right\}.\)
Since \(V\) has a basis with two vectors, its dimension is \(2\text{:}\) it is a plane.
Recall that \(\{\vec{v}_1,\vec{v}_2,\ldots,\vec{v}_n\}\) forms a basis for \(\mathbb{R}^n \) if and only if the matrix \(A\) with columns \(\vec{v}_1,\vec{v}_2,\ldots,\vec{v}_n\) has a pivot in every row and column (see this Example \(\PageIndex{4}\)). Since \(A\) is an \(n\times n\) matrix, these two conditions are equivalent: the vectors span if and only if they are linearly independent. The basis theorem is an abstract version of the preceding statement, that applies to any subspace.
Let \(V\) be a subspace of dimension \(m\). Then:
- Any \(m\) linearly independent vectors in \(V\) form a basis for \(V\).
- Any \(m\) vectors that span \(V\) form a basis for \(V\).
- Proof
-
Suppose that \(\mathcal{B} = \{\vec{v}_1,\vec{v}_2,\ldots,\vec{v}_m\}\) is a set of linearly independent vectors in \(V\). In order to show that \(\mathcal{B}\) is a basis for \(V\text{,}\) we must prove that \(V = \text{Span}\{\vec{v}_1,\vec{v}_2,\ldots,\vec{v}_m\}.\) If not, then there exists some vector \(\vec{v}_{m+1}\) in \(V\) that is not contained in \(\text{Span}\{\vec{v}_1,\vec{v}_2,\ldots,\vec{v}_m\}.\) By the increasing span criterion, the set \(\{\vec{v}_1,\vec{v}_2,\ldots,\vec{v}_m,\vec{v}_{m+1}\}\) is also linearly independent. Continuing in this way, we keep choosing vectors until we eventually do have a linearly independent spanning set: say \(V = \text{Span}\{\vec{v}_1,\vec{v}_2,\ldots,\vec{v}_m,\ldots,\vec{v}_{m+k}\}\). Then \(\{\vec{v}_1,\vec{v}_2,\ldots,\vec{v}_{m+k}\}\) is a basis for \(V\text{,}\) which implies that \(\dim(V) = m+k > m\). But we were assuming that \(V\) has dimension \(m\text{,}\) so \(\mathcal{B}\) must have already been a basis.
Now suppose that \(\mathcal{B} = \{\vec{v}_1,\vec{v}_2,\ldots,\vec{v}_m\}\) spans \(V\). If \(\mathcal{B}\) is not linearly independent, then we can remove some number of vectors from \(\mathcal{B}\) without shrinking its span. After reordering, we can assume that we removed the last \(k\) vectors without shrinking the span, and that we cannot remove any more. Now \(V = \text{Span}\{\vec{v}_1,\vec{v}_2,\ldots,\vec{v}_{m-k}\}\text{,}\) and \(\{\vec{v}_1,\vec{v}_2,\ldots,\vec{v}_{m-k}\}\) is a basis for \(V\) because it is linearly independent. This implies that \(\dim V=m-k < m\). But we were assuming that \(\dim V = m\text{,}\) so \(\mathcal{B}\) must have already been a basis.
In other words, if you already know that \(\dim (V) = m \), and if you have a set of \(m\) vectors \(\mathcal{B} = \{\vec{v}_1,\vec{v}_2,\ldots,\vec{v}_m\}\) in \(V\), then you only have to check one of:
- \(\mathcal{B}\) is linearly independent, or
- \(\mathcal{B}\) spans \(V\)
In order for \(\mathcal{B}\) to be a basis of \(V\). If you did not already know that \(\dim (V) = m\), then you would have to check both properties.
To put it yet another way, suppose we have a set of vectors \(\mathcal{B} = \{\vec{v}_1,\vec{v}_2,\ldots,\vec{v}_m\}\) in a subspace \(V\). Then if any two of the following statements is true, the third must also be true:
- \(\mathcal{B}\) is linearly independent
- \(\mathcal{B}\) spans \(V\)
- \(\dim (V) = m\)
For example, if \(V\) is a plane, then any two non-collinear vectors in \(V\) form a basis.
Find a basis for the subspace
\[V=\left\{\left[\begin{array}{c}x_1\\x_2\\x_3\\x_4\end{array}\right]: x_1 +x_2=x_4; x_2+2x_3=x_4\right\}\nonumber\]
Solution
First, note that \(V\) is the null space of the matrix \(\left[\begin{array}{cccc}1&1&0&-1\\0&1&2&-1\end{array}\right]\)
We put this matrix in reduced row echelon form \(\left[\begin{array}{cccc}1&0&-2&0\\0&1&2&-1\end{array}\right]\) and see it has two free variables, so \(V\) is indeed a plane. We write our solution in parametric vector form:
\[\left[\begin{array}{c}x_1\\x_2\\x_3\\x_4\end{array}\right]= x_3\left[\begin{array}{c}2\\-2\\1\\0\end{array}\right]+x_4\left[\begin{array}{c}0\\1\\0\\1\end{array}\right]\nonumber\]
This shows \(V=\text{Span}\left\{ \left[\begin{array}{c}2\\-2\\1\\0\end{array}\right],\left[\begin{array}{c}0\\1\\0\\1\end{array}\right]\right\} \). Since these are clearly not collinear, they are linearly independent; so \(\left\{ \left[\begin{array}{c}2\\-2\\1\\0\end{array}\right],\left[\begin{array}{c}0\\1\\0\\1\end{array}\right]\right\}\) is a basis for \(V\).

