Subspaces
A subspace of a vector space V is a subset H that is itself a vector space under the same addition and scalar multiplication. To check, use the subspace test: H contains the zero vector, H is closed under addition, and H is closed under scalar multiplication. Lines and planes through the origin are subspaces of ℝ³.
Before this lesson: Vector Spaces and Span of Vectors
What a subspace is
A vector space can contain smaller vector spaces. In ℝ², a line through the origin is one: add two vectors on the line or stretch one, and you stay on the line. A line that misses the origin is not: it has no zero vector, and adding two of its points lands off the line.
The full list of subspaces of ℝ² is short: the zero subspace {0}, every line through the origin, and ℝ² itself. In ℝ³ you also get every plane through the origin. Subspaces show up everywhere later in the course, as solution sets of Ax = 0, as spans and as eigenspaces.
The subspace test
A subset H of a vector space V is a subspace of V if and only if all three conditions hold:
- Zero vector: 0 is in H.
- Closed under addition: if u and v are in H, then u + v is in H.
- Closed under scalar multiplication: if u is in H and c is any scalar, then cu is in H.
Why only three checks? The other seven axioms, such as u + v = v + u, are equations. They hold for every vector of V, so they hold for the vectors of H automatically. The negative of u is also in H, because −u = (−1)u and H is closed under scalar multiplication.
Shortcut. Conditions 2 and 3 together are the same as one check: if u and v are in H and c is a scalar, then cu + v is in H.
Spans are subspaces. For any vectors v₁, …, vₖ in V, the span Span{v₁, …, vₖ} is a subspace of V. Here is the proof for two vectors (more vectors work the same way):
\mathbf{0} = 0v_1 + 0v_2The zero vector is a linear combination, so it is in the span.
u = a_1v_1 + a_2v_2,\quad w = b_1v_1 + b_2v_2
Take any two vectors u and w in the span.
u + w = (a_1 + b_1)v_1 + (a_2 + b_2)v_2
Add and group the terms by vector. This is a linear combination, so it is in the span.
cu = (ca_1)v_1 + (ca_2)v_2
Multiply by c. This is also a linear combination, so it is in the span.
This gives a fast way to prove a set is a subspace: write it as a span.
How to show a set is a subspace
- Write the condition that defines H, and make sure H is a subset of a known vector space V.
- Check that the zero vector of V satisfies the condition.
- Take two general elements u and v of H and show that u + v satisfies the condition.
- Take a general u in H and any scalar c and show that cu satisfies the condition.
- If any check fails, give one specific counterexample. If the set can be written as Span{v₁, …, vₖ}, you are done without the checks.
Subspace examples
Example 1: A plane through the origin
Show that H = {(x, y, z) : x − 2y + 3z = 0} is a subspace of ℝ³.
0 - 2(0) + 3(0) = 0
Zero vector: (0, 0, 0) satisfies the equation, so it is in H.
x_1 - 2y_1 + 3z_1 = 0,\quad x_2 - 2y_2 + 3z_2 = 0
Take u = (x₁, y₁, z₁) and v = (x₂, y₂, z₂) in H.
(x_1 + x_2) - 2(y_1 + y_2) + 3(z_1 + z_2) = (x_1 - 2y_1 + 3z_1) + (x_2 - 2y_2 + 3z_2)
Test u + v: regroup the terms (see distributive property).
= 0 + 0 = 0
Use the two equations. So u + v is in H.
cx_1 - 2(cy_1) + 3(cz_1) = c(x_1 - 2y_1 + 3z_1)
Test cu: factor out c.
= c \cdot 0 = 0
Use the equation for u. So cu is in H.
Answer: H passes all three checks, so it is a subspace of ℝ³. It is a plane through the origin.
Example 2: A plane that misses the origin
Is H = {(x, y, z) : x + y + z = 1} a subspace of ℝ³?
0 + 0 + 0 = 0 \ne 1
Test the zero vector (0, 0, 0).
Answer: no. The zero vector is not in H, so H is not a subspace. It is a plane, but it does not pass through the origin.
Example 3: A set with the zero vector that still fails
Let H = {(x, y) : xy ≥ 0}, the first and third quadrants together with the axes. Is H a subspace of ℝ²?
0 \cdot 0 = 0 \ge 0
The zero vector is in H.
(cx)(cy) = c^2(xy) \ge 0
Scalar multiplication: c² ≥ 0 and xy ≥ 0, so cu stays in H.
u = (2, 1),\quad v = (-1, -3)
Choose u in quadrant I and v in quadrant III. Both products are positive: 2 and 3.
u + v = (2 - 1,\ 1 - 3) = (1, -2)
Add.
1 \cdot (-2) = -2 \lt 0
The product is negative, so u + v is not in H.
Answer: no. H contains 0 and is closed under scalar multiplication, but it is not closed under addition.
Example 4: Symmetric matrices
A square matrix A is symmetric if Aᵀ = A. Show that the set S of symmetric 2 × 2 matrices is a subspace of M_{2\times 2}, and write S as a span.
O^{T} = OZero vector: the zero matrix O equals its transpose, so O is in S.
(A + B)^{T} = A^{T} + B^{T}Take A and B in S and use a rule of the transpose.
= A + B
Since Aᵀ = A and Bᵀ = B. So A + B is in S.
(cA)^{T} = cA^{T} = cAAnother transpose rule, then Aᵀ = A. So cA is in S.
\begin{bmatrix} a & b \\ b & d \end{bmatrix} = a\begin{bmatrix} 1 & 0 \\ 0 & 0 \end{bmatrix} + b\begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix} + d\begin{bmatrix} 0 & 0 \\ 0 & 1 \end{bmatrix}Every symmetric 2 × 2 matrix has this form. Split it by its free entries a, b and d.
Answer: S is a subspace of M_{2\times 2}, and S = Span{[1 0; 0 0], [0 1; 1 0], [0 0; 0 1]}.
Example 5: Shapes of a bent beam
An engineer models the sag of a 4-meter beam by a polynomial p in P_3, where p(x) is the drop in centimeters at x meters from the left end. The beam is pinned at both ends, so p(0) = 0 and p(4) = 0. Is the set H of allowed shapes a subspace of P_3? Test it on p = x² − 4x and q = x³ − 4x² by finding 2p + q.
z(0) = 0,\quad z(4) = 0
Zero vector: the zero polynomial z is 0 everywhere, so z is in H.
(p + q)(0) = p(0) + q(0) = 0 + 0 = 0
Closure under addition at x = 0.
(p + q)(4) = p(4) + q(4) = 0 + 0 = 0
Closure under addition at x = 4.
(cp)(0) = c \cdot 0 = 0,\quad (cp)(4) = c \cdot 0 = 0
Closure under scalar multiplication.
2p + q = 2x^2 - 8x + x^3 - 4x^2
Test the sample shapes: double p and add q.
= x^3 - 2x^2 - 8x
Combine like terms.
4^3 - 2(4^2) - 8(4) = 64 - 32 - 32 = 0
Check x = 4. At x = 0 every term is 0.
Answer: yes, H is a subspace of P_3, and 2p + q = x³ − 2x² − 8x is an allowed shape. If instead the right end had to sit 1 cm low, p(4) = 1, the zero polynomial would fail and the set would not be a subspace.
Common mistakes
| Mistake | Example of the error | Fix |
|---|---|---|
| Stopping after the zero vector | Calling {(x, y) : xy ≥ 0} a subspace because it contains (0, 0) | Check both closure rules too: (2, 1) + (−1, −3) = (1, −2) is not in the set. |
| Using a line or plane that misses the origin | Calling x + y + z = 1 a subspace | A subspace must contain 0; only lines and planes through the origin qualify. |
| Checking closure with only one example | Showing (1, 2) + (2, 4) is on y = 2x and stopping | Use general elements (x₁, 2x₁) and (x₂, 2x₂) to cover every case. |
| Forgetting negative scalars | Saying the first quadrant is closed because 3(1, 2) = (3, 6) stays in it | Test c = −1 as well: (−1, −2) leaves the quadrant. |
| Calling ℝ² a subspace of ℝ³ | Saying ℝ² sits inside ℝ³ | Pairs are not triples, so ℝ² is not a subset of ℝ³. The plane z = 0 in ℝ³ is a subspace that looks like ℝ². |
Related ideas
Solution sets of Ax = 0. If Au = 0 and Av = 0, then A(u + v) = 0 and A(cu) = 0, so the solutions of a homogeneous system always form a subspace. The solutions of Ax = b with b ≠ 0 never do, since 0 fails. The next lesson, Null Space and Column Space, names these subspaces.
Intersections and unions. The intersection of two subspaces is always a subspace. A union usually is not: the x-axis together with the y-axis contains (1, 0) and (0, 1) but not their sum (1, 1).
Subspaces of ℝ³. Every subspace of ℝ³ is {0}, a line through the origin, a plane through the origin or ℝ³ itself. The equation of a plane ax + by + cz = d gives a subspace exactly when d = 0.
Practice problems
- Is {(x, y) : y = −4x} a subspace of ℝ²?
- Is {(x, y, z) : z = 2} a subspace of ℝ³?
- Is {(x, y) : y = x²} a subspace of ℝ²?
- Is {(x, y, z) : x = 3y and z = −y} a subspace of ℝ³? If so, write it as a span.
- The trace of a square matrix is the sum of its diagonal entries. Is the set of 2 × 2 matrices with trace 0 a subspace of M_{2\times 2}?
- Is the set of invertible 2 × 2 matrices a subspace of M_{2\times 2}?
- Is {p in P_2 : p(0) = 1} a subspace of P_2?
- Is {(a, b, c) : a ≥ 0} a subspace of ℝ³?
- Let W = Span{(1, 0, 2), (0, 1, −1)}. Explain why W is a subspace of ℝ³, and show that (3, −2, 8) is in W.
- Is the solution set of the system x + 2y − z = 0, 3x − y + 4z = 0 a subspace of ℝ³?
Show answers
1.
-4(0) = 0
Zero vector: (0, 0) is on the line.
(x_1 + x_2,\ -4x_1 - 4x_2) = (x_1 + x_2,\ -4(x_1 + x_2))
Add (x₁, −4x₁) and (x₂, −4x₂), then factor out −4. The sum is on the line.
c(x_1, -4x_1) = (cx_1,\ -4(cx_1))
Scale. The result is on the line.
Answer: yes. It is a line through the origin.
2.
0 \ne 2
The zero vector (0, 0, 0) has z = 0, not 2.
Answer: no. The zero vector is not in the set.
3.
(1, 1)
This point is in the set, since 1 = 1².
2(1, 1) = (2, 2)
Multiply by 2.
2 \ne 2^2 = 4
The point (2, 2) is not on y = x².
Answer: no. The set is not closed under scalar multiplication.
4.
(x, y, z) = (3y,\ y,\ -y)
Write a general element using the free variable y.
= y(3, 1, -1)
Factor out y.
Answer: yes. The set equals Span{(3, 1, −1)}, a line through the origin, and every span is a subspace.
5.
\operatorname{tr}(O) = 0 + 0 = 0Zero vector: the zero matrix has trace 0.
\operatorname{tr}(A + B) = (a_{11} + b_{11}) + (a_{22} + b_{22}) = \operatorname{tr}(A) + \operatorname{tr}(B) = 0Closure under addition: regroup the diagonal entries.
\operatorname{tr}(cA) = ca_{11} + ca_{22} = c\operatorname{tr}(A) = 0Closure under scalar multiplication: factor out c.
Answer: yes. The trace-0 matrices form a subspace of M_{2\times 2}.
6.
\det O = 0(0) - 0(0) = 0
The zero matrix has determinant 0, so it is not invertible.
Answer: no. The zero matrix is not in the set.
7.
z(0) = 0 \ne 1
The zero polynomial has value 0 at x = 0.
Answer: no. The zero polynomial is not in the set.
8.
(-1)(1, 0, 0) = (-1, 0, 0)
(1, 0, 0) is in the set, but its first entry becomes −1 after multiplying by −1.
Answer: no. The set is not closed under scalar multiplication.
9.
3(1, 0, 2) + (-2)(0, 1, -1) = (3, 0, 6) + (0, -2, 2)
Try the weights 3 and −2, chosen to match the first two entries.
= (3, -2, 8)
Add entry by entry.
Answer: W is a span, so it is a subspace of ℝ³. And (3, −2, 8) = 3(1, 0, 2) − 2(0, 1, −1), so it is in W.
10.
A = \begin{bmatrix} 1 & 2 & -1 \\ 3 & -1 & 4 \end{bmatrix}Write the system as Ax = 0.
A\mathbf{0} = \mathbf{0}The zero vector is a solution.
A(u + v) = Au + Av = \mathbf{0} + \mathbf{0} = \mathbf{0}If u and v are solutions, so is u + v.
A(cu) = c(Au) = c\mathbf{0} = \mathbf{0}If u is a solution, so is cu.
Answer: yes. The solution set of any homogeneous system Ax = 0 is a subspace.
Subspace FAQ
What are the three conditions for a subspace?
The subset must contain the zero vector, be closed under addition and be closed under scalar multiplication. If all three hold, the other vector space axioms follow automatically.
Is the zero vector by itself a subspace?
Yes. The set {0} contains the zero vector, and 0 + 0 = 0 and c0 = 0. It is called the zero subspace.
Is a line through the origin a subspace?
Yes. A line through the origin in ℝ² or ℝ³ is the span of one nonzero vector, so it is a subspace. A line that does not pass through the origin is not.
Is the span of a set of vectors always a subspace?
Yes. The span contains 0, and sums and scalar multiples of linear combinations are again linear combinations.
Summary
- A subspace is a subset of a vector space that is a vector space under the same operations.
- The subspace test: contains 0, closed under addition, closed under scalar multiplication.
- If the zero vector is missing, the set is not a subspace, so check that first.
- Every span is a subspace, and so is the solution set of every homogeneous system Ax = 0.
- The subspaces of ℝ³ are {0}, lines and planes through the origin, and ℝ³.
Previous lesson: Vector Spaces
Next lesson: Null Space and Column Space
Back to the Linear Algebra Index