The outputs a matrix can βreachβ form what is known as a subspace. The directions a matrix βforgetsβ also form a subspace. The definitions below make this precise.
We are already familiar with geometric spaces living inside bigger ones, like lines lying in the plane, or planes lying in 3-space. We are now going to formalize this notion algebraically. Recall the definition of the set \(\R^n\) in DefinitionΒ 1.1.1.
If \(\mathbf{x}\) is in \(U\) and \(y\) is in \(U\text{,}\) then \(\mathbf{x} + \mathbf{y}\) is in \(U\text{.}\) This means \(U\) is closed under addition.
If \(\mathbf{x}\) is in \(U\text{,}\) then \(a \mathbf{x}\) is in \(U\) for every scalar \(a\text{.}\) This means \(U\) is closed under scalar multiplication.
Note2.3.2.Subspaces are closed under linear combinations.
Let \(U\) be a subspace. If \(\mathbf{u},\mathbf{v}\in U\) and \(a,b\in\R\text{,}\) closure under scalar multiplication gives \(a\mathbf{u}\in U\) and \(b\mathbf{v}\in U\text{.}\) Closure under addition then gives
\begin{equation*}
a\mathbf{u}+b\mathbf{v}\in U.
\end{equation*}
More generally, if \(\mathbf{u}_1,\ldots,\mathbf{u}_k\in U\) and \(c_1,\ldots,c_k\in\R\text{,}\) each vector \(c_i\mathbf{u}_i\) lies in \(U\text{.}\) Adding these vectors one at a time shows that
\begin{equation*}
c_1\mathbf{u}_1+\cdots+c_k\mathbf{u}_k\in U.
\end{equation*}
Thus every finite linear combination of vectors in a subspace remains in that subspace.
The set containing only the zero vector, i.e., the set \(\{ \mathbf{0} \}\text{,}\) is a subspace of \(\R^n\) (called the trivial subspace or zero subspace).
If \(\mathbf{x}, \mathbf{y} \in \{ \mathbf{0} \}\text{,}\) then \(\mathbf{x} = 0\) and \(\mathbf{y} = 0\text{,}\) so \(\mathbf{x} + \mathbf{y} = 0\text{,}\) which is an element of \(\{ \mathbf{0} \}\text{.}\)
If \(\mathbf{x} \in \{ \mathbf{0} \}\) and \(a\) is a scalar, then \(\mathbf{x} = 0\text{,}\) and \(a\mathbf{x} = a \mathbf{0} = 0\) is in \(\{ \mathbf{0} \}\text{.}\)
Since \(\{ \mathbf{0} \}\) satisfies all three of the necessary conditions, it is a subspace.
Let \(R\) be a plane through the origin. Then there exist scalars \(a,b,c\text{,}\) not all zero, such that \(R\) is the set of points \((x,y,z)\) satisfying the equation \(ax + by + cz = 0\text{.}\) The vector
\begin{equation*}
\mathbf{n} = \begin{bmatrix} a \\ b \\ c \end{bmatrix}
\end{equation*}
is a normal vector for the plane, and we can write \(R\) as the set of vectors \(\mathbf{v} \in \R^3\) such that \(\mathbf{n} \cdot \mathbf{v} = 0\text{.}\)
If \(\mathbf{v} \in R\) and \(\mathbf{w} \in R\) then to verify \(\mathbf{v} + \mathbf{w} \in R\) we must argue that \(\mathbf{n} \cdot ( \mathbf{v} + \mathbf{w}) = 0\text{.}\) Indeed,
If \(\mathbf{v} \in R\text{,}\) and \(a\) is a scalar, to verify \(a \mathbf{v} \in R\) we must argue that \(\mathbf{n} \cdot (a \mathbf{v}) = 0\text{.}\) Indeed,
\begin{equation*}
\mathbf{n} \cdot (a \mathbf{v}) = a ( \mathbf{n} \cdot \mathbf{v}) = a (0) = 0\text{.}
\end{equation*}
Let \(L\) be a line through the origin in \(\R^3\text{.}\) If \(L\) has direction vector \(\mathbf{d}\text{,}\) then \(L = \{ t \mathbf{d}: t \in \R \}\text{,}\) i.e., the line \(L\) consists of all scalar multiples of \(\mathbf{d}\text{.}\)
Suppose \(\mathbf{v} \in L\) and \(\mathbf{w} \in L\text{.}\) Then \(\mathbf{v}\) and \(\mathbf{w}\) are both scalar multiples of \(\mathbf{d}\text{,}\) i.e., \(\mathbf{v} = t_1 \mathbf{d}\) and \(\mathbf{w} = t_2 \mathbf{d}\text{.}\) Then
Lines and planes which do not pass through the origin in \(\R^3\) are not subspaces of \(\R^3\text{.}\) Nonetheless, if \(\Pi\) is a plane, and we consider the set of displacement vectors
then \(\Delta\Pi\) forms a plane passing through the origin, and so is a subspace of \(\R^3\text{.}\) A similar result holds for sets of displacement vectors given by a line not passing through the origin.
It suffices to show one of the conditions required to be a subspace does not hold. \(U\)does contain the zero vector, and \(is\) closed under scalar multiplication. But \(U\)is not closed under addition. Define
is not in \(W\text{,}\) since if it were of the form
\begin{equation*}
\begin{bmatrix} r \\ s \\ r + 2s \end{bmatrix}\text{,}
\end{equation*}
then \(r = 1\) and \(s = 1\text{,}\) and the third entry would have to be \(3\text{.}\) Thus \(W\) does not contain every vector, and thus cannot be equal to \(\R^3\text{.}\) But it also contains some non-zero vectors, such as
To show a set is a subspace, you tend to need to parameterize all elements of the set in order to show they all satisfy some property (closure under addition or scalar multiplication), and so your argument should use variables. To show a set is not a subspace, you need to find one or more counterexamples that show that some property does not hold for all elements; a single explicit counterexample usually suffices.
Let \(A\) be an \(m \times n\) matrix. The null space of \(A\text{,}\) denoted \(\nulls(A)\text{,}\) is the set of vectors \(\mathbf{x}\) in \(\R^n\) which are solutions to the equation \(A \mathbf{x} = \mathbf{0}\text{,}\) i.e.,
The image space of \(A\text{,}\) denoted \(\im(A)\text{,}\) is the set of vectors \(\mathbf{y}\) in \(\R^m\) such that \(A\mathbf{x} = \mathbf{y}\) has a solution, i.e.,
Both panels show multiplication by an \(m\times n\) matrix \(A\text{,}\) from \(\mathbb R^n\) on the left to \(\mathbb R^m\) on the right. In the upper panel, a smaller oval labeled \(\operatorname{null}(A)\) lies inside the input space, and arrows from that oval converge to \(\mathbf{0}\) in the output space. In the lower panel, arrows from the whole input space lead to a smaller oval labeled \(\operatorname{im}(A)\) inside the output space. The ovals are schematic representations of sets.
For any \(m \times n\) matrix, the null space of \(A\) is a subspace of \(\R^n\text{,}\) and the image space of \(A\) is a subspace of \(\R^m\text{.}\)
Suppose \(\mathbf{v} \in \nulls(A)\) and \(\mathbf{w} \in \nulls(A)\text{.}\) Then \(A \mathbf{v} = \mathbf{0}\) and \(A \mathbf{w} = \mathbf{0}\text{.}\) So
\begin{equation*}
A (\mathbf{v} + \mathbf{w}) = A \mathbf{v} + A \mathbf{w} = \mathbf{0} + \mathbf{0} = \mathbf{0}\text{.}
\end{equation*}
Suppose \(\mathbf{v} \in \im(A)\) and \(\mathbf{w} \in \im(A)\text{.}\) Then the equations \(A\mathbf{x} = \mathbf{v}\) and \(A \mathbf{x} = \mathbf{w}\) both have solutions, i.e., there exists \(\mathbf{x}_1\) and \(\mathbf{x}_2\) such that \(A\mathbf{x}_1 = \mathbf{v}\) and \(A\mathbf{x}_2 = \mathbf{w}\text{.}\) Then
If \(\mathbf{v} \in \im(A)\text{,}\) and \(a\) is a scalar, then we may write \(\mathbf{v} = A\mathbf{x}_1\) for some \(\mathbf{x}_1\text{.}\) But then
\begin{equation*}
A(a\mathbf{x}_1) = a (A\mathbf{x}_1) = a \mathbf{v}\text{,}
\end{equation*}
so the equation \(A\mathbf{x} = a \mathbf{v}\) has a solution, so that \(a \mathbf{v} \in \im(A)\text{.}\)
The solution set of \(A\mathbf{x}=\mathbf{0}\) is a subspace. The solution set of \(A\mathbf{x}=\mathbf{b}\) for \(\mathbf{b}\neq\mathbf{0}\) is usually not a subspace; when it is nonempty, it is a shifted copy of \(\nulls(A)\text{.}\)
From here on, homogeneous equations play a special role. To solve \(A\mathbf{x}=\mathbf{0}\) by row reduction, we could write the augmented matrix \([A\mid \mathbf{0}]\text{.}\) Since the right-hand side stays zero throughout the row operations, the coefficient matrix \(A\) carries the essential information.
The set of all linear combinations of a set of vectors \(\mathbf{x}_1,\dots,\mathbf{x}_k\) in \(\R^n\) is called the span of the vectors \(\mathbf{x}_1,\dots,\mathbf{x}_k\text{,}\) and is denoted
If \(V = \spans \{ \mathbf{x}_1, \dots, \mathbf{x}_k \}\text{,}\) we say that \(V\) is spanned by the vectors \(\mathbf{x}_1,\dots,\mathbf{x}_k\text{,}\) and that the vectors \(\mathbf{x}_1,\dots,\mathbf{x}_k\) span the space \(V\text{.}\)
The free variables are \(x_3\) and \(x_4\text{.}\) Setting \(x_3 = s\) and \(x_4 = t\text{,}\) we obtain that \(A\mathbf{x} = 0\) when \(x_1 = -2s + t\) and \(x_2 = -3s + 2t\text{.}\) Thus a general solution to this equation is given by
\begin{equation*}
\begin{bmatrix} -2s + t \\ -3s + 2t \\ s \\ t \end{bmatrix} = s \begin{bmatrix} -2 \\ -3 \\ 1 \\ 0 \end{bmatrix} + t \begin{bmatrix} 1 \\ 2 \\ 0 \\ 1 \end{bmatrix}\text{.}
\end{equation*}
To summarize: basic solutions of \(A\mathbf{x}=\mathbf{0}\) form a spanning set for \(\operatorname{null}(A)\text{,}\) and the columns of \(A\) form a spanning set for \(\operatorname{im}(A)\text{.}\)
If \(W\) is a subspace of \(\R^n\) and each of the vectors \(\mathbf{x}_1,\dots,\mathbf{x}_k\) is in \(W\text{,}\) then \(U\) is a subset of \(W\text{,}\) i.e., \(U \subseteq W\text{.}\)
Define an \(n \times k\) matrix \(A\text{,}\) with the vectors \(\mathbf{x}_1,\dots,\mathbf{x}_k\) as columns. Then \(U = \im(A)\text{,}\) and is thus a subspace of \(\R^n\text{.}\) Since \(\mathbf{x}_i = A \mathbf{e}_i\) for \(1 \leq i \leq k\text{,}\) the set \(U\) contains each of the vectors \(\mathbf{x}_i\text{.}\)
Conversely, suppose \(W\) is a subspace of \(\R^n\) and \(\mathbf{x}_1,\dots,\mathbf{x}_k \in W\text{.}\) Since \(W\) is closed under addition and scalar multiplication, all of the linear combinations of \(\mathbf{x}_1,\dots,\mathbf{x}_k\) are elements of \(W\text{,}\) and so \(U \subseteq W\text{.}\)
We need to determine if \(\mathbf{w}\) is a linear combination of the vectors \(\mathbf{v}_1\) and \(\mathbf{v}_2\text{,}\) i.e., if it is possible to find scalars \(a\) and \(b\) such that \(\mathbf{w} = a \mathbf{v}_1 + b \mathbf{v}_2\text{.}\) Comparing entries of the vectors in each side of the equation, we obtain a system of equations in \(a\) and \(b\text{,}\) i.e.,
\begin{align*}
2a + b \amp = 1\\
a - b \amp = 5\\
a + 3b \amp = -7
\end{align*}
The first entry in column 1 is already nonzero. Following AlgorithmΒ 2.2.40, first scale row 1 to obtain a leading one, then eliminate the entries below it. Repeat this process on the remaining rows:
The last row represents \(0=0\text{,}\) so it imposes no additional condition. The second row gives \(b=-3\text{.}\) Back substitution into the first row, \(a+\tfrac{1}{2}b=\tfrac{1}{2}\text{,}\) gives \(a=\tfrac{1}{2}-\tfrac{1}{2}b=2\text{.}\) Thus the system is consistent, with solution \(a=2\) and \(b=-3\text{.}\) Therefore \(\mathbf{w}=2\mathbf{v}_1-3\mathbf{v}_2\text{,}\) so \(\mathbf{w}\) belongs to \(\spans\{\mathbf{v}_1,\mathbf{v}_2\}\text{.}\)
The last row represents \(0=1\text{,}\) so the system is inconsistent. Therefore \(\mathbf{w}\) does not belong to \(\spans\{\mathbf{v}_1,\mathbf{v}_2\}\text{.}\)
Let \(A\) be an \(m\times n\) matrix with columns \(\mathbf{c}_1,\ldots,\mathbf{c}_n\text{.}\) Then \(A\mathbf{x}=\mathbf{b}\) has a solution for every \(\mathbf{b}\in\R^m\) if and only if \(\spans\{\mathbf{c}_1,\ldots,\mathbf{c}_n\}=\R^m\text{.}\)
Thus \(A\mathbf{x}=\mathbf{b}\) has a solution exactly when \(\mathbf{b}\) is a linear combination of the columns of \(A\text{.}\) By DefinitionΒ 2.3.22, this holds for every \(\mathbf{b}\in\R^m\) exactly when the columns span \(\R^m\text{.}\)