MAT1041 · Week 7 · - Subspaces of Vector Spaces

Span and linear independence

You learn to test the subspace spanned by a set of vectors, whether the set spans the whole space, and whether the vectors are linearly independent, using a homogeneous system or a determinant, and to apply the same method in Rⁿ, P₂ and M₂₂.

linear combinationspanspanning setspans Vlinearly independentlinearly dependenttrivial solutiondependence relationcoefficient vector

We defined a subspace inside a set; now we do the opposite: starting from a few vectors, we build the subspace they generate. This idea has two faces. Span answers “where can I get to with these vectors?”, linear independence answers “is any of these vectors unnecessary?”. Combined, they give next week’s topic: the basis. The computing side is familiar: it is all Gaussian elimination.

Golden rules:

  1. Write the vectors as columns of a matrix.
  2. A span question = consistency of a nonhomogeneous system. An independence question = the homogeneous system having only the trivial solution.
  3. nn vectors in Rn\mathbb{R}^n: the determinant alone answers both.
  4. Turn polynomials and matrices into coefficient vectors first.

Span

Let S={v1,…,vk}S = \{\mathbf{v}_1, \dots, \mathbf{v}_k\} be in a space VV. The span of SS is the set of all its linear combinations:

span⁡(S)={c1v1+⋯+ckvk:ci∈R}.\operatorname{span}(S) = \{c_1\mathbf{v}_1 + \dots + c_k\mathbf{v}_k : c_i \in \mathbb{R}\}.

span⁡(S)\operatorname{span}(S) is always a subspace of VV (the sum and multiples of two combinations are again combinations) and it is the smallest subspace containing SS. If span⁡(S)=V\operatorname{span}(S) = V we say ”SS spans VV”.

Geometric intuition (R3\mathbb{R}^3):

SSspan
a single nonzero vectora line through the origin
two non-parallel vectorsa plane through the origin
three vectors not in the same planeR3\mathbb{R}^3

Whether a set spans the space

Example 1. Does S={(1,2,3),(2,1,0),(4,5,6)}S = \{(1, 2, 3), (2, 1, 0), (4, 5, 6)\} span R3\mathbb{R}^3? Reduce [A∣b][A \mid \mathbf{b}] for an arbitrary b=(b1,b2,b3)\mathbf{b} = (b_1, b_2, b_3):

[124b1215b2306b3]→R3←R3−3R1R2←R2−2R1[124b10−3−3b2−2b10−6−6b3−3b1]→R3←R3−2R2[124b10−3−3b2−2b1000b1−2b2+b3]\left[\begin{array}{ccc|c} 1 & 2 & 4 & b_1 \\ 2 & 1 & 5 & b_2 \\ 3 & 0 & 6 & b_3 \end{array}\right] \xrightarrow[R_3 \leftarrow R_3 - 3R_1]{R_2 \leftarrow R_2 - 2R_1} \left[\begin{array}{ccc|c} 1 & 2 & 4 & b_1 \\ 0 & -3 & -3 & b_2 - 2b_1 \\ 0 & -6 & -6 & b_3 - 3b_1 \end{array}\right] \xrightarrow{R_3 \leftarrow R_3 - 2R_2} \left[\begin{array}{ccc|c} 1 & 2 & 4 & b_1 \\ 0 & -3 & -3 & b_2 - 2b_1 \\ 0 & 0 & 0 & b_1 - 2b_2 + b_3 \end{array}\right]

The right side of the last row is b3−3b1−2(b2−2b1)=b1−2b2+b3b_3 - 3b_1 - 2(b_2 - 2b_1) = b_1 - 2b_2 + b_3. The system is consistent only when b1−2b2+b3=0b_1 - 2b_2 + b_3 = 0. So SS does not span R3\mathbb{R}^3; the span is the plane x−2y+z=0x - 2y + z = 0. For example (1,1,0)(1, 1, 0) is not in the span (1−2+0≠01 - 2 + 0 \neq 0).

Square shortcut. With nn vectors in Rn\mathbb{R}^n the matrix is square: det⁡≠0  ⟺  \det \neq 0 \iff a unique solution for every b\mathbf{b}   ⟺  \iff SS spans. In Example 1 det⁡=0\det = 0, in Q2 det⁡=2\det = 2.

PITFALL · spanning with too few vectors. You can’t span R3\mathbb{R}^3 with two vectors: a 3×23 \times 2 matrix has at most 2 pivots, the third row becomes zero and a consistency condition appears. To span Rn\mathbb{R}^n you need at least nn vectors.

Linear independence

For S={v1,…,vk}S = \{\mathbf{v}_1, \dots, \mathbf{v}_k\}, if the equation

c1v1+c2v2+⋯+ckvk=0c_1\mathbf{v}_1 + c_2\mathbf{v}_2 + \dots + c_k\mathbf{v}_k = \mathbf{0}

has only the solution c1=⋯=ck=0c_1 = \dots = c_k = 0 (the trivial solution), SS is linearly independent. If there is a nontrivial solution, it is dependent and that solution is a dependence relation.

Equivalent definition: SS is dependent   ⟺  \iff at least one of the vectors is a linear combination of the others. In a dependent set there is an “unnecessary” vector: removing it does not change the span.

The test

  1. Write the vectors as columns of a matrix AA.
  2. Solve Ac=0A\mathbf{c} = \mathbf{0} (REF is enough).
  3. No free variable ⇒\Rightarrow independent. A free variable ⇒\Rightarrow dependent; give the free variable 1 and read off the relation.

Example 2. v1=(1,0,2)\mathbf{v}_1 = (1, 0, 2), v2=(2,1,1)\mathbf{v}_2 = (2, 1, 1), v3=(0,1,−3)\mathbf{v}_3 = (0, 1, -3).

[12001121−3]→R3←R3−2R1[1200110−3−3]→R3←R3+3R2[120011000]\begin{bmatrix} 1 & 2 & 0 \\ 0 & 1 & 1 \\ 2 & 1 & -3 \end{bmatrix} \xrightarrow{R_3 \leftarrow R_3 - 2R_1} \begin{bmatrix} 1 & 2 & 0 \\ 0 & 1 & 1 \\ 0 & -3 & -3 \end{bmatrix} \xrightarrow{R_3 \leftarrow R_3 + 3R_2} \begin{bmatrix} 1 & 2 & 0 \\ 0 & 1 & 1 \\ 0 & 0 & 0 \end{bmatrix}

c3c_3 is free. c3=1c_3 = 1: c2=−1c_2 = -1, c1=−2c2=2c_1 = -2c_2 = 2. The relation: 2v1−v2+v3=02\mathbf{v}_1 - \mathbf{v}_2 + \mathbf{v}_3 = \mathbf{0}. Check: (2−2+0,0−1+1,4−1−3)=(0,0,0)(2 - 2 + 0, 0 - 1 + 1, 4 - 1 - 3) = (0, 0, 0). Dependent, and v3=v2−2v1\mathbf{v}_3 = \mathbf{v}_2 - 2\mathbf{v}_1.

Cases that decide without computation

CaseResult
The set contains 0\mathbf{0}dependent (1⋅0=01 \cdot \mathbf{0} = \mathbf{0})
Two vectors, one a multiple of the otherdependent
Two vectors, not multiplesindependent
More than nn vectors in Rn\mathbb{R}^ndependent
A subset of an independent setindependent
Adding a vector to a dependent setstays dependent

Polynomials and matrices

In P2P_2 match the polynomial a+bx+cx2a + bx + cx^2 with the vector (a,b,c)(a, b, c), in M2,2M_{2,2} match [abcd]\begin{bmatrix} a & b \\ c & d \end{bmatrix} with (a,b,c,d)(a, b, c, d). Since linear combinations are preserved exactly in the coefficients, span and independence questions turn into questions in R3\mathbb{R}^3 or R4\mathbb{R}^4.

Example 3. Does {1+x,x+x2,1+x2}\{1 + x, x + x^2, 1 + x^2\} span P2P_2? The coefficient vectors are (1,1,0)(1, 1, 0), (0,1,1)(0, 1, 1), (1,0,1)(1, 0, 1); the determinant is 2≠02 \neq 0. It is both independent and spanning. The set in Q9 is different because it contains 1−x21 - x^2: there the determinant is 0.

TIP · fix the order. When converting to coefficient vectors, use the same order for every polynomial (constant, xx, x2x^2). If you write x2x^2 first in one polynomial, the columns get mixed up.

Span and independence together

IndependentDependent
Spansa basis (next week)there are extra vectors, remove them
Does not spana vector is missing, add oneboth problems

In Rn\mathbb{R}^n, whether exactly nn vectors span and whether they are independent is the same question: det⁡≠0\det \neq 0.

Common mistakes

WrongRight
Writing the vectors as rows and setting up [A∣b][A \mid \mathbf{b}]Vectors are columns, b\mathbf{b} is the last column
Deciding “doesn’t span” without finding a single example b\mathbf{b}Write the consistency condition or use det⁡\det
Putting b\mathbf{b} on the right in the independence testIndependence is a homogeneous system: right side 0\mathbf{0}
Thinking three vectors are independent because two areThe third may be a combination of the first two
Confusing spanning with independence{(1,2),(3,4),(5,6)}\{(1,2),(3,4),(5,6)\} spans but is dependent
Saying “no solution” when det⁡=0\det = 0In a homogeneous system det⁡=0\det = 0 means infinitely many solutions = dependent
Writing polynomial coefficients in a different orderAlways (constant, xx, x2x^2)

Test yourself

Exam-style questions. Solve them on paper first, then reveal the answer.

Question 1easy

Are u=(1,2)\mathbf{u} = (1, 2) and v=(−3,−6)\mathbf{v} = (-3, -6) linearly independent?

Show answer
No

v=−3u\mathbf{v} = -3\mathbf{u}. Two vectors are dependent if one is a multiple of the other: 3u+v=03\mathbf{u} + \mathbf{v} = \mathbf{0} is a nontrivial relation.
Geometrically the two are on the same line.

Question 2medium

Does S={(1,1,0),(0,1,1),(1,0,1)}S = \{(1, 1, 0), (0, 1, 1), (1, 0, 1)\} span R3\mathbb{R}^3?

Show answer
Yes

Make the vectors columns: det⁡[101110011]=1(1−0)−0+1(1−0)=2≠0\det\begin{bmatrix} 1 & 0 & 1 \\ 1 & 1 & 0 \\ 0 & 1 & 1 \end{bmatrix} = 1(1 - 0) - 0 + 1(1 - 0) = 2 \neq 0.
The square matrix is invertible, so Ac=bA\mathbf{c} = \mathbf{b} can be solved for every b\mathbf{b}. It spans R3\mathbb{R}^3 (and is independent).

Question 3medium

Describe span⁡{(1,2,3),(2,1,0),(4,5,6)}\operatorname{span}\{(1, 2, 3), (2, 1, 0), (4, 5, 6)\} as a geometric object in R3\mathbb{R}^3.

Show answer
The plane x−2y+z=0x - 2y + z = 0

det⁡=0\det = 0, so the three are dependent and do not span R3\mathbb{R}^3. Elimination on [A∣b][A \mid \mathbf{b}] gives the consistency condition b1−2b2+b3=0b_1 - 2b_2 + b_3 = 0.
Check: (1,2,3)(1, 2, 3): 1−4+3=01 - 4 + 3 = 0; (2,1,0)(2, 1, 0): 2−2=02 - 2 = 0; (4,5,6)(4, 5, 6): 4−10+6=04 - 10 + 6 = 0.
The first two vectors are not parallel, so the span is a plane through the origin.

Question 4medium

Show that v1=(1,−1,2)\mathbf{v}_1 = (1, -1, 2), v2=(2,1,1)\mathbf{v}_2 = (2, 1, 1), v3=(0,3,−3)\mathbf{v}_3 = (0, 3, -3) are linearly dependent and find a dependence relation.

Show answer
2v1−v2+v3=02\mathbf{v}_1 - \mathbf{v}_2 + \mathbf{v}_3 = \mathbf{0}

Solve the system c1v1+c2v2+c3v3=0c_1\mathbf{v}_1 + c_2\mathbf{v}_2 + c_3\mathbf{v}_3 = \mathbf{0}. The column matrix is [120−11321−3]\begin{bmatrix} 1 & 2 & 0 \\ -1 & 1 & 3 \\ 2 & 1 & -3 \end{bmatrix}.R2←R2+R1R_2 \leftarrow R_2 + R_1: (0,3,3)(0, 3, 3). R3←R3−2R1R_3 \leftarrow R_3 - 2R_1: (0,−3,−3)(0, -3, -3). R3←R3+R2R_3 \leftarrow R_3 + R_2: a zero row. c3=tc_3 = t is free: c2=−tc_2 = -t, c1=−2c2=2tc_1 = -2c_2 = 2t.t=1t = 1: 2v1−v2+v3=(2−2+0,−2−1+3,4−1−3)=02\mathbf{v}_1 - \mathbf{v}_2 + \mathbf{v}_3 = (2 - 2 + 0, -2 - 1 + 3, 4 - 1 - 3) = \mathbf{0}.

Question 5hard

For which values of kk are (1,k,0)(1, k, 0), (0,1,k)(0, 1, k), (k,0,1)(k, 0, 1) linearly dependent?

Show answer
k=−1k = -1

The determinant of the matrix written with these as rows (the transpose does not change the determinant): ∣1k001kk01∣=1(1−0)−k(0−k2)+0=1+k3\begin{vmatrix} 1 & k & 0 \\ 0 & 1 & k \\ k & 0 & 1 \end{vmatrix} = 1(1 - 0) - k(0 - k^2) + 0 = 1 + k^3.
Dependent   ⟺  1+k3=0  ⟺  k=−1\iff 1 + k^3 = 0 \iff k = -1 (the only real root).

Question 6easy

True or false: Any set of four vectors in R3\mathbb{R}^3 is linearly dependent.

Show answer
True

c1v1+⋯+c4v4=0c_1\mathbf{v}_1 + \dots + c_4\mathbf{v}_4 = \mathbf{0}: a homogeneous system with 3 equations and 4 unknowns. There are more unknowns, at least one free variable, so there is a nontrivial solution.
General rule: more than nn vectors in Rn\mathbb{R}^n are always dependent.

Question 7medium

Is {1+x, x+x2, 1+x2}\{1 + x,\ x + x^2,\ 1 + x^2\} linearly independent in P2P_2?

Show answer
Yes

The coefficient vectors, in the order (1,x,x2)(1, x, x^2): (1,1,0)(1, 1, 0), (0,1,1)(0, 1, 1), (1,0,1)(1, 0, 1).
The determinant of the column matrix is 2≠02 \neq 0, so c1=c2=c3=0c_1 = c_2 = c_3 = 0 is the only solution. Independent.

Question 8medium

Are A1=[1011]A_1 = \begin{bmatrix} 1 & 0 \\ 1 & 1 \end{bmatrix}, A2=[0110]A_2 = \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}, A3=[1121]A_3 = \begin{bmatrix} 1 & 1 \\ 2 & 1 \end{bmatrix} linearly independent in M2,2M_{2,2}?

Show answer
No: A3=A1+A2A_3 = A_1 + A_2

A1+A2=[1121]=A3A_1 + A_2 = \begin{bmatrix} 1 & 1 \\ 2 & 1 \end{bmatrix} = A_3, so A1+A2−A3=OA_1 + A_2 - A_3 = O.
Systematic way: turn each matrix into the vector (a11,a12,a21,a22)(a_{11}, a_{12}, a_{21}, a_{22}); the 4×34 \times 3 matrix has rank 2.

Question 9hard

Is p(x)=1+4x+x2p(x) = 1 + 4x + x^2 in span⁡{1+x, x+x2, 1−x2}\operatorname{span}\{1 + x,\ x + x^2,\ 1 - x^2\}?

Show answer
No

a(1+x)+b(x+x2)+c(1−x2)=(a+c)+(a+b)x+(b−c)x2a(1 + x) + b(x + x^2) + c(1 - x^2) = (a + c) + (a + b)x + (b - c)x^2.
Equations: a+c=1a + c = 1, a+b=4a + b = 4, b−c=1b - c = 1. Add the 1st and 3rd: a+b=2a + b = 2. But the 2nd equation says a+b=4a + b = 4. Inconsistent.
Note: the three polynomials are dependent ((1+x)−(x+x2)=1−x2(1 + x) - (x + x^2) = 1 - x^2), the span is only 2-dimensional.

Question 10hard

Suppose {u,v,w}\{\mathbf{u}, \mathbf{v}, \mathbf{w}\} is linearly independent. Is {u+v, v+w, u+w}\{\mathbf{u} + \mathbf{v},\ \mathbf{v} + \mathbf{w},\ \mathbf{u} + \mathbf{w}\} linearly independent?

Show answer
Yes

a(u+v)+b(v+w)+c(u+w)=(a+c)u+(a+b)v+(b+c)w=0a(\mathbf{u} + \mathbf{v}) + b(\mathbf{v} + \mathbf{w}) + c(\mathbf{u} + \mathbf{w}) = (a + c)\mathbf{u} + (a + b)\mathbf{v} + (b + c)\mathbf{w} = \mathbf{0}.
Because u,v,w\mathbf{u}, \mathbf{v}, \mathbf{w} are independent, a+c=0a + c = 0, a+b=0a + b = 0, b+c=0b + c = 0. The determinant of the coefficient matrix is 2≠02 \neq 0, the only solution is a=b=c=0a = b = c = 0.

Question 11medium

Does {(1,2),(3,4),(5,6)}\{(1, 2), (3, 4), (5, 6)\} span R2\mathbb{R}^2? Is it linearly independent?

Show answer
Spans R2\mathbb{R}^2; linearly dependent

(1,2)(1, 2) and (3,4)(3, 4) are already independent: det⁡[1324]=−2≠0\det\begin{bmatrix} 1 & 3 \\ 2 & 4 \end{bmatrix} = -2 \neq 0. The two span R2\mathbb{R}^2, and adding the third does not shrink the span.
But three vectors in R2\mathbb{R}^2 are always dependent. Spanning and being independent are different questions.

Question 12hard

Find kk so that (1,2,k)(1, 2, k) lies in span⁡{(1,1,1),(1,3,2)}\operatorname{span}\{(1, 1, 1), (1, 3, 2)\}.

Show answer
k=3/2k = 3/2

a(1,1,1)+b(1,3,2)=(a+b,a+3b,a+2b)a(1, 1, 1) + b(1, 3, 2) = (a + b, a + 3b, a + 2b).a+b=1a + b = 1, a+3b=2a + 3b = 2: 2b=12b = 1, b=12b = \frac12, a=12a = \frac12.
Third component: k=a+2b=12+1=32k = a + 2b = \frac12 + 1 = \frac32.

Verification: The span and independence tests were done in node with BigInt fractions using exact RREF, rank and determinants; the dependence relations were found from the null space and recomputed to confirm that the linear combination gives the zero vector; in the parametric independence question det = 1 + k³ was checked at many values of k (verify/MAT1041/07.mjs).

Review card

span(S) = ALL linear combinations of the vectors in S. Always a subspace. w ∈ span(S)? → solve the system [v1 ... vk | w] (vectors as COLUMNS). Is it consistent? Does S span Rⁿ? → is it consistent for every b? If square: det ≠ 0 ⇔ spans. Independent: c1v1 + ... + ckvk = 0 ⇒ only c1 = ... = ck = 0. Test: [v1 ... vk] x = 0 → NO free variable ⇔ independent. Square (n vectors, Rⁿ): det ≠ 0 ⇔ independent ⇔ spans. If dependent, a null space vector = a dependence relation. Quick rules: a set containing the 0 vector → dependent two vectors: one is a multiple of the other ⇔ dependent more than n vectors in Rⁿ → dependent; fewer than n vectors do NOT span Rⁿ P_n, M_mn: turn the polynomial/matrix into a coefficient vector, same test. Dependent ⇔ at least one is a combination of the others.