Tutorials › Linear Algebra › Testing Whether One Generated Span Lies Inside Another

Span and the Column Space View · Tutorial 159 of 1000

Testing Whether One Generated Span Lies Inside Another

Test whether one generated span lies inside another by checking whether each generator can be written as a combination of the other list.

Beginner 9 min read

What You'll Learn

  • State the generator-by-generator criterion for containment of spans.
  • Convert membership in a generated span into a coefficient system.
  • Use a contradiction in a coefficient system to disprove containment.
  • Explain why a nonunique representation still proves membership.
  • Test both directions when deciding whether two spans are equal.

Containment of Spans Is a Generator-by-Generator Question

Suppose two lists of vectors generate two subspaces of \(\mathbb{R}^n\). To decide whether one generated span lies inside the other, we do not need to describe every vector in the first span separately. It is enough to check its generators: if each generator can be built from the second list, then every combination of the first generators can also be built from the second list. This turns a question about whole sets of vectors into a finite collection of membership questions whenever the generating lists are finite.

For a set \(S\subseteq\mathbb{R}^n\), its span, \(\operatorname{span}(S)\), is the set of all finite linear combinations of vectors in \(S\). Thus, a vector in \(\operatorname{span}(S)\) has the form \(c_1\mathbf{s}_1+\cdots+c_k\mathbf{s}_k\), where \(k\) is a nonnegative integer, each \(\mathbf{s}_i\in S\), and the coefficients are real. The zero vector is included; in particular, \(\operatorname{span}(\varnothing)=\{\mathbf{0}\}\). A span is always considered as a set of vectors, regardless of whether its displayed generators form a list with repetitions.

Theorem (Generator test for containment): For any sets \(S,T\subseteq\mathbb{R}^n\), \(\operatorname{span}(S)\subseteq\operatorname{span}(T)\) if and only if every vector in \(S\) belongs to \(\operatorname{span}(T)\).

Proof. First suppose \(\operatorname{span}(S)\subseteq\operatorname{span}(T)\). Each \(\mathbf{s}\in S\) belongs to \(\operatorname{span}(S)\), since \(\mathbf{s}=1\mathbf{s}\). The assumed containment therefore gives \(\mathbf{s}\in\operatorname{span}(T)\). Conversely, suppose every \(\mathbf{s}\in S\) belongs to \(\operatorname{span}(T)\). Any \(\mathbf{x}\in\operatorname{span}(S)\) is a finite sum \(\mathbf{x}=c_1\mathbf{s}_1+\cdots+c_k\mathbf{s}_k\). For each \(i\), write \(\mathbf{s}_i\) as a finite linear combination of vectors in \(T\). Substituting those combinations into the expression for \(\mathbf{x}\) shows that \(\mathbf{x}\) is itself a finite linear combination of vectors in \(T\). Hence \(\mathbf{x}\in\operatorname{span}(T)\), proving the containment. If \(S\) is empty, there are no generators to check and \(\operatorname{span}(S)=\{\mathbf{0}\}\), which is contained in every span. \(\square\)

The theorem is about the generators of the proposed smaller span. It does not say that every vector in \(\operatorname{span}(S)\) must be tested individually. Nor does it say that every generator in \(T\) must belong to \(\operatorname{span}(S)\); that would be an additional condition in the opposite direction.

Turning Each Membership Check into a System

Let \(\mathbf{t}_1,\ldots,\mathbf{t}_q\in\mathbb{R}^n\) be the list generating the proposed containing span, and place them as columns of \(\mathbf{A}=\begin{bmatrix}\mathbf{t}_1&\cdots&\mathbf{t}_q\end{bmatrix}\). A target vector \(\mathbf{s}\) belongs to \(\operatorname{span}\{\mathbf{t}_1,\ldots,\mathbf{t}_q\}\) exactly when there are coefficients \(x_1,\ldots,x_q\) such that \(x_1\mathbf{t}_1+\cdots+x_q\mathbf{t}_q=\mathbf{s}\). By the definition of matrix-vector multiplication, this is exactly the system \(\mathbf{A}\mathbf{x}=\mathbf{s}\), where \(\mathbf{x}=(x_1,\ldots,x_q)^\top\).

Coefficient-system test: If \(S=\{\mathbf{s}_1,\ldots,\mathbf{s}_p\}\) and \(T=\{\mathbf{t}_1,\ldots,\mathbf{t}_q\}\) are finite lists in \(\mathbb{R}^n\), then \(\operatorname{span}(S)\subseteq\operatorname{span}(T)\) if and only if each system \(\mathbf{A}\mathbf{x}=\mathbf{s}_i\) is consistent, where \(\mathbf{A}\) has the vectors in \(T\) as its columns. A system is consistent when it has at least one solution.

This test requires no assumption that the generators in \(T\) are independent or that the representation is unique. The question is only whether at least one coefficient vector produces the target. If the systems are inconsistent for even one generator in \(S\), the generator test proves that the proposed containment fails. If they are all consistent, the generator test proves the containment.

Worked Example: Two Generators Fit Inside a Plane

Let \(\mathbf{t}_1=\begin{bmatrix}1\\0\\1\end{bmatrix}\), \(\mathbf{t}_2=\begin{bmatrix}0\\1\\1\end{bmatrix}\), and let \(S\) consist of \(\mathbf{s}_1=\begin{bmatrix}2\\-1\\1\end{bmatrix}\) and \(\mathbf{s}_2=\begin{bmatrix}1\\3\\4\end{bmatrix}\). Test whether \(\operatorname{span}(S)\subseteq\operatorname{span}\{\mathbf{t}_1,\mathbf{t}_2\}\).

The column matrix for the containing span is \(\mathbf{A}=\begin{bmatrix}1&0\\0&1\\1&1\end{bmatrix}\). For \(\mathbf{s}_1\), solve \(\mathbf{A}\mathbf{x}=\mathbf{s}_1\). The augmented system reduces by \(R_3\to R_3-R_1-R_2\):

$$ \left[\begin{array}{cc|c}1&0&2\\0&1&-1\\1&1&1\end{array}\right] \sim \left[\begin{array}{cc|c}1&0&2\\0&1&-1\\0&0&0\end{array}\right]. $$

Thus \(x_1=2\) and \(x_2=-1\), so \(\mathbf{s}_1=2\mathbf{t}_1-\mathbf{t}_2\). Check: \(2\begin{bmatrix}1\\0\\1\end{bmatrix}-\begin{bmatrix}0\\1\\1\end{bmatrix}=\begin{bmatrix}2\\-1\\1\end{bmatrix}=\mathbf{s}_1\).

For \(\mathbf{s}_2\), the augmented system is

$$ \left[\begin{array}{cc|c}1&0&1\\0&1&3\\1&1&4\end{array}\right] \sim \left[\begin{array}{cc|c}1&0&1\\0&1&3\\0&0&0\end{array}\right], $$

using \(R_3\to R_3-R_1-R_2\). This gives \(x_1=1\), \(x_2=3\), so \(\mathbf{s}_2=\mathbf{t}_1+3\mathbf{t}_2\). Check: \(\begin{bmatrix}1\\0\\1\end{bmatrix}+3\begin{bmatrix}0\\1\\1\end{bmatrix}=\begin{bmatrix}1\\3\\4\end{bmatrix}=\mathbf{s}_2\). Both generators belong to the containing span, so the generator test proves \(\operatorname{span}(S)\subseteq\operatorname{span}\{\mathbf{t}_1,\mathbf{t}_2\}\).

One Failed Generator Is Enough

To disprove containment, it is enough to find one generator of the proposed smaller span that cannot be expressed using the proposed containing list. In a coefficient system, this appears as inconsistency: row reduction produces a row asserting that a linear combination of the unknowns equals a nonzero number, even though the left side is zero.

Worked Example: A Generator Outside the Proposed Span

Let \(\mathbf{t}_1=\begin{bmatrix}1\\0\\0\end{bmatrix}\), \(\mathbf{t}_2=\begin{bmatrix}0\\1\\0\end{bmatrix}\), and let \(S\) consist of \(\mathbf{s}_1=\begin{bmatrix}1\\2\\0\end{bmatrix}\) and \(\mathbf{s}_2=\begin{bmatrix}1\\0\\1\end{bmatrix}\). Determine whether \(\operatorname{span}(S)\subseteq\operatorname{span}\{\mathbf{t}_1,\mathbf{t}_2\}\).

The first generator is in the proposed containing span because \(\mathbf{s}_1=\mathbf{t}_1+2\mathbf{t}_2\). For the second generator, the coefficient system is

$$ \left[\begin{array}{cc|c}1&0&1\\0&1&0\\0&0&1\end{array}\right]. $$

The last row says \(0=1\), so the system has no solution. Equivalently, every combination \(x_1\mathbf{t}_1+x_2\mathbf{t}_2=\begin{bmatrix}x_1\\x_2\\0\end{bmatrix}\) has third coordinate \(0\), whereas \(\mathbf{s}_2\) has third coordinate \(1\). Thus \(\mathbf{s}_2\notin\operatorname{span}\{\mathbf{t}_1,\mathbf{t}_2\}\), and the generator test shows that the proposed containment is false.

The conclusion concerns the spans, not whether one particular expression was found. A successful expression certifies membership; a failed guess at coefficients does not certify nonmembership. To show nonmembership, the full coefficient system must be inconsistent, or another valid reason must rule out every possible choice of coefficients.

Containment, Equality, and Nonunique Coefficients

Theorem (Equality test by mutual containment): For sets \(S,T\subseteq\mathbb{R}^n\), \(\operatorname{span}(S)=\operatorname{span}(T)\) if and only if every vector in \(S\) belongs to \(\operatorname{span}(T)\) and every vector in \(T\) belongs to \(\operatorname{span}(S)\).

Proof. If the spans are equal, each is a subset of the other. Since every generator belongs to the span of its own set, every vector in \(S\) belongs to \(\operatorname{span}(T)\), and every vector in \(T\) belongs to \(\operatorname{span}(S)\). Conversely, if both generator conditions hold, the generator test gives \(\operatorname{span}(S)\subseteq\operatorname{span}(T)\) and \(\operatorname{span}(T)\subseteq\operatorname{span}(S)\). Two sets contained in each other are equal, so the spans are equal. \(\square\)

Worked Example: Equal Spans with a Nonunique Representation

In \(\mathbb{R}^2\), let \(S\) be the list \(\mathbf{s}_1=\begin{bmatrix}1\\0\end{bmatrix}\), \(\mathbf{s}_2=\begin{bmatrix}0\\1\end{bmatrix}\), and let \(T\) be the list \(\mathbf{t}_1=\begin{bmatrix}1\\0\end{bmatrix}\), \(\mathbf{t}_2=\begin{bmatrix}2\\0\end{bmatrix}\), \(\mathbf{t}_3=\begin{bmatrix}0\\1\end{bmatrix}\). Test equality of the generated spans.

To test whether each generator in \(S\) belongs to \(\operatorname{span}(T)\), use the coefficient matrix \(\begin{bmatrix}1&2&0\\0&0&1\end{bmatrix}\). For \(\mathbf{s}_1\), row reduction of the augmented system gives

$$ \left[\begin{array}{ccc|c}1&2&0&1\\0&0&1&0\end{array}\right] \sim \left[\begin{array}{ccc|c}1&2&0&1\\0&0&1&0\end{array}\right]. $$

The equations are \(x_1+2x_2=1\) and \(x_3=0\). Taking \(x_2=u\) gives \(x_1=1-2u\), \(x_3=0\), for any real \(u\). In particular, \(u=0\) gives \(\mathbf{s}_1=\mathbf{t}_1\). For \(\mathbf{s}_2\), the augmented system is

$$ \left[\begin{array}{ccc|c}1&2&0&0\\0&0&1&1\end{array}\right] \sim \left[\begin{array}{ccc|c}1&2&0&0\\0&0&1&1\end{array}\right]. $$

Its equations give \(x_1=-2u\), \(x_2=u\), \(x_3=1\). Taking \(u=0\) yields \(\mathbf{s}_2=\mathbf{t}_3\). These checks show \(\operatorname{span}(S)\subseteq\operatorname{span}(T)\).

For the reverse containment, each generator in \(T\) is a combination of \(S\): \(\mathbf{t}_1=1\mathbf{s}_1+0\mathbf{s}_2\), \(\mathbf{t}_2=2\mathbf{s}_1+0\mathbf{s}_2\), and \(\mathbf{t}_3=0\mathbf{s}_1+1\mathbf{s}_2\). Direct substitution gives the displayed vectors in each case. Hence \(\operatorname{span}(T)\subseteq\operatorname{span}(S)\), and the spans are equal. The free parameter in the first system also shows why uniqueness is unnecessary: many coefficient choices can represent the same target, but any one valid choice proves membership.

A Common Direction Error

A frequent mistake is to check that every generator of \(S\) lies in \(\operatorname{span}(T)\), then conclude that the spans are equal. That work proves only \(\operatorname{span}(S)\subseteq\operatorname{span}(T)\). For a concrete counterexample, take \(S\) to consist of \(\begin{bmatrix}1\\0\end{bmatrix}\), and \(T\) to consist of \(\begin{bmatrix}1\\0\end{bmatrix}\) and \(\begin{bmatrix}0\\1\end{bmatrix}\). The generator of \(S\) belongs to \(\operatorname{span}(T)\), since it is \(1\begin{bmatrix}1\\0\end{bmatrix}+0\begin{bmatrix}0\\1\end{bmatrix}\). But the second generator of \(T\) is not in \(\operatorname{span}(S)\): an equation \(c\begin{bmatrix}1\\0\end{bmatrix}=\begin{bmatrix}0\\1\end{bmatrix}\) would require both \(c=0\) and \(0=1\). Thus the spans are not equal. The correction is to test both directions if equality is the goal, and only the specified direction if the goal is containment.

For finite lists, a reliable procedure is to keep the direction visible throughout: put the generators of the proposed containing span in the coefficient matrix, then use each generator of the proposed smaller span as a right-hand side. Every system must be consistent. A single inconsistent system disproves containment; if all are consistent, the generator test proves it. If the problem asks whether the spans are equal, repeat the test with the roles of the lists reversed.

Check Your Understanding

For each question, identify the target vectors and the coefficient systems needed before deciding the conclusion.

  1. State the generator test for \(\operatorname{span}(S)\subseteq\operatorname{span}(T)\) in both directions of its “if and only if.”
  2. Let \(T\) consist of \(\begin{bmatrix}1\\1\end{bmatrix}\) and \(\begin{bmatrix}1\\-1\end{bmatrix}\). Set up a coefficient system to test whether \(\begin{bmatrix}4\\2\end{bmatrix}\) belongs to \(\operatorname{span}(T)\).
  3. Suppose one generator of \(S\) gives an inconsistent coefficient system using the generators of \(T\). What does this imply about containment, and why?
  4. Explain why a coefficient system with a free variable can still prove that a target belongs to a span.
  5. What additional test is needed after establishing \(\operatorname{span}(S)\subseteq\operatorname{span}(T)\) if the goal is to prove equality?

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon