MAT1041 · Week 7 · - Subspaces of Vector Spaces

Subspaces and the subspace test

You learn to check with a three-step test whether a set inside a vector space is a subspace; to recognize the typical subspaces and trap sets in Rⁿ, M₂₂ and P₂; and how intersection and union behave.

subspacesubspace testclosed under additionclosed under scalar multiplicationzero vectortrivial subspacesolution spacenull spaceintersectionunioncounterexample

Last week we defined a vector space with ten axioms. Fortunately, most of the time you don’t need to check ten axioms one by one: if the set you have is inside a known vector space (for example, a part of R3\mathbb{R}^3), you only look at three things. This is called the subspace test. It is a question type that almost certainly appears on the midterm and the final: “Determine whether WW is a subspace. Prove or give a counterexample.” Three or four choices, each a few minutes.

Golden rules:

  1. The first thing to do is to check whether 0∈W\mathbf{0} \in W. If not, the answer is “no” and it ends in one line.
  2. If 0\mathbf{0} is in, you are not done: check closure under addition and scalar multiplication too.
  3. If it is not a subspace, don’t write a general proof: give one concrete numerical counterexample.
  4. If it is a subspace, write a general proof: take arbitrary u,v,c\mathbf{u}, \mathbf{v}, c and show the condition holds.

Definition and test

Let VV be a vector space and W⊆VW \subseteq V a nonempty subset. If WW is a vector space on its own with the operations of VV, then WW is called a subspace of VV.

The subspace test. WW is a subspace if and only if:

  1. 0∈W\mathbf{0} \in W,
  2. u,v∈W⇒u+v∈W\mathbf{u}, \mathbf{v} \in W \Rightarrow \mathbf{u} + \mathbf{v} \in W (closed under addition),
  3. u∈W\mathbf{u} \in W, c∈R⇒cu∈Wc \in \mathbb{R} \Rightarrow c\mathbf{u} \in W (closed under scalar multiplication).

Why is it enough? Axioms such as commutativity, associativity and distributivity are already true in VV; since the elements of WW are also elements of VV, they hold automatically. The only risk is the operations leaving WW.

Every vector space has two “boring” subspaces: {0}\{\mathbf{0}\} (the trivial subspace) and VV itself.

Subspaces of R³

The subspaces of R3\mathbb{R}^3 are exactly these: {0}\{\mathbf{0}\}, lines through the origin, planes through the origin, and R3\mathbb{R}^3. A line or plane that does not pass through the origin cannot be a subspace because it does not contain the zero vector.

Example 1 (yes). W={(x,y,z):x−2y+5z=0}W = \{(x, y, z) : x - 2y + 5z = 0\}. The full write-up of the proof:

(1) 0 - 2·0 + 5·0 = 0              → (0,0,0) ∈ W
(2) u = (x1,y1,z1), v = (x2,y2,z2) ∈ W. For u + v:
    (x1+x2) - 2(y1+y2) + 5(z1+z2) = (x1 - 2y1 + 5z1) + (x2 - 2y2 + 5z2) = 0 + 0 = 0
(3) for cu:  cx1 - 2cy1 + 5cz1 = c(x1 - 2y1 + 5z1) = c·0 = 0
→ W is a subspace (a plane through the origin)

Example 2 (no, no zero). W={(x,y,z):x+y+z=1}W = \{(x, y, z) : x + y + z = 1\}: 0+0+0≠10 + 0 + 0 \neq 1.

Example 3 (no, zero is there but not closed). W={(x,y,z):y=x2}W = \{(x, y, z) : y = x^2\}. (0,0,0)∈W(0, 0, 0) \in W. (1,1,0)∈W(1, 1, 0) \in W, but for 2(1,1,0)=(2,2,0)2(1, 1, 0) = (2, 2, 0), 2≠22=42 \neq 2^2 = 4.

PITFALL · “the zero is in, so it’s a subspace”. The zero vector is necessary but not sufficient. In Example 3 and in Q3 the zero is in, but the set is not closed under scalar multiplication.

The solution set of Ax = 0

If AA is m×nm \times n, the set of all solutions of Ax=0A\mathbf{x} = \mathbf{0} is a subspace of Rn\mathbb{R}^n. It is called the null space (solution space) of AA:

  • A0=0A\mathbf{0} = \mathbf{0},
  • A(u+v)=Au+Av=0+0=0A(\mathbf{u} + \mathbf{v}) = A\mathbf{u} + A\mathbf{v} = \mathbf{0} + \mathbf{0} = \mathbf{0},
  • A(cu)=cAu=0A(c\mathbf{u}) = cA\mathbf{u} = \mathbf{0}.

All the “yes” answers in Q1, Q8, Q9, Q12 are really special cases of this theorem: the condition is linear equations with a zero right-hand side.

If b≠0\mathbf{b} \neq \mathbf{0}, the solution set of Ax=bA\mathbf{x} = \mathbf{b} is not a subspace: A0=0≠bA\mathbf{0} = \mathbf{0} \neq \mathbf{b}. Also the sum of two solutions gives A(u+v)=2bA(\mathbf{u} + \mathbf{v}) = 2\mathbf{b}. For example, for x+2y=3x + 2y = 3 (second equation 2x+4y=62x + 4y = 6), (3,0)(3, 0) is a solution, but for 2(3,0)=(6,0)2(3, 0) = (6, 0), x+2y=6≠3x + 2y = 6 \neq 3.

Matrix and polynomial subspaces

The same test, the same logic. Don’t be scared because the elements are matrices or polynomials; write the condition in terms of the coefficients.

SetSubspace?Reason
Symmetric 2×22 \times 2 (AT=AA^T = A)Yes(A+B)T=A+B(A + B)^T = A + B, (cA)T=cA(cA)^T = cA
Trace 0 (a11+a22=0a_{11} + a_{22} = 0)Yeshomogeneous linear equation
Upper triangularYesa21=0a_{21} = 0
det⁡A=0\det A = 0Nodiag⁡(1,0)+diag⁡(0,1)=I\operatorname{diag}(1, 0) + \operatorname{diag}(0, 1) = I
Invertible matricesNothe zero matrix is not invertible
A2=AA^2 = ANoII is in, (2I)2=4I≠2I(2I)^2 = 4I \neq 2I
P2P_2, p(1)=0p(1) = 0Yesa+b+c=0a + b + c = 0
P2P_2, p(0)=1p(0) = 1Nofor the zero polynomial 0≠10 \neq 1
P2P_2, integer coefficientsNo12⋅1\frac12 \cdot 1 is not in the set
Continuous ff, f(0)=0f(0) = 0Yes(f+g)(0)=0(f + g)(0) = 0, (cf)(0)=0(cf)(0) = 0

Quick intuition: If the condition is homogeneous linear equation(s) (every term is a constant multiple of a variable, right side 0), the set is a subspace. If the condition has a product, a square, an absolute value, an inequality, a nonzero constant, “integer” or a determinant, it most likely is not. Intuition lets you decide quickly; on the exam still write the justification.

Ready-made counterexamples

xy = 0       : (1,0) + (0,1) = (1,1),   1·1 ≠ 0
x ≥ 0        : (-1)·(1,0) = (-1,0)
integers     : (1/2)·(1,0) = (1/2,0)
y = x²       : 2·(1,1) = (2,2),  2 ≠ 4
det = 0      : diag(1,0) + diag(0,1) = I
right side ≠ 0: the zero vector is not in the set

Intersection and union

If W1W_1 and W2W_2 are subspaces:

  • W1∩W2W_1 \cap W_2 is always a subspace. 0\mathbf{0} is in both sets; the sum of two vectors that are in both is in both.
  • W1∪W2W_1 \cup W_2 is generally not a subspace. In the union of the xx-axis and the yy-axis, (1,0)+(0,1)=(1,1)(1, 0) + (0, 1) = (1, 1) is not there. (If one is inside the other, the union equals the larger one, and then it is a subspace.)

To find the intersection of two planes, solve the two equations together (Q12). The result is usually a line through the origin.

Common mistakes

WrongRight
Saying subspace because 0∈W\mathbf{0} \in WCheck closure too
Using a vector that is not an element of WW in a counterexampleFirst show that u,v∈W\mathbf{u}, \mathbf{v} \in W
Proving “subspace” with a single numerical exampleA general proof with arbitrary u,v,c\mathbf{u}, \mathbf{v}, c
Trying only positive cc for scalar multiplicationc=−1c = -1 and c=12c = \frac12 break most sets
Thinking a plane not through the origin is a subspaceThere is no zero vector
Thinking a union is a subspaceIntersection yes, union generally no
Thinking the condition p(0)=1p(0) = 1 in P2P_2 gives a subspaceThe zero polynomial has p(0)=0p(0) = 0
Thinking the set det⁡A=0\det A = 0 is “like a null space”The determinant is not linear

Test yourself

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

Question 1easy

Is W={(x,y,z):x−2y+5z=0}W = \{(x, y, z) : x - 2y + 5z = 0\} a subspace of R3\mathbb{R}^3?

Show answer
Yes

(1) 0\mathbf{0}: 0−0+0=00 - 0 + 0 = 0, it is in. (2) u,v∈W\mathbf{u}, \mathbf{v} \in W: (x1+x2)−2(y1+y2)+5(z1+z2)=0+0=0(x_1 + x_2) - 2(y_1 + y_2) + 5(z_1 + z_2) = 0 + 0 = 0. (3) cuc\mathbf{u}: c(x−2y+5z)=c⋅0=0c(x - 2y + 5z) = c \cdot 0 = 0.
A plane through the origin. A homogeneous linear equation (right side 0) always gives a subspace.

Question 2easy

Is W={(x,y,z):x+y+z=1}W = \{(x, y, z) : x + y + z = 1\} a subspace of R3\mathbb{R}^3?

Show answer
No

(0,0,0)(0, 0, 0): 0+0+0=0≠10 + 0 + 0 = 0 \neq 1. The zero vector is not in the set, done.
Geometrically a plane that does not pass through the origin.

Question 3medium

Is W={(x,y):y=∣x∣}W = \{(x, y) : y = |x|\} a subspace of R2\mathbb{R}^2?

Show answer
No

0∈W\mathbf{0} \in W but it is not closed under scalar multiplication: (1,1)∈W(1, 1) \in W, (−1)(1,1)=(−1,−1)(-1)(1, 1) = (-1, -1) and ∣−1∣=1≠−1|-1| = 1 \neq -1.
"The zero is there, so it's a subspace" is a trap.

Question 4medium

Is W={(a,b,a+2b):a,b∈R}W = \{(a, b, a + 2b) : a, b \in \mathbb{R}\} a subspace of R3\mathbb{R}^3?

Show answer
Yes

(a,b,a+2b)=a(1,0,1)+b(0,1,2)(a, b, a + 2b) = a(1, 0, 1) + b(0, 1, 2). WW is the set of all linear combinations of two vectors, that is, a span: always a subspace.
Direct test: a=b=0a = b = 0 gives zero; sums and scalar multiples again obey the rule "third = first + 2·second".

Question 5medium

Is W={(x,y,z):xz=0}W = \{(x, y, z) : xz = 0\} a subspace of R3\mathbb{R}^3?

Show answer
No

Not closed under addition: (1,0,0)∈W(1, 0, 0) \in W, (0,0,1)∈W(0, 0, 1) \in W, but their sum (1,0,1)(1, 0, 1) has xz=1≠0xz = 1 \neq 0.
If the variables are multiplied in the condition, it is most likely not a subspace.

Question 6medium

Is the set of all 2×22 \times 2 upper triangular matrices a subspace of M2,2M_{2,2}?

Show answer
Yes

Upper triangular: a21=0a_{21} = 0. The zero matrix is upper triangular. In the sum of two upper triangular matrices the (2,1)(2,1) entry is 0+0=00 + 0 = 0; in the cc multiple, c⋅0=0c \cdot 0 = 0.
The condition is a single homogeneous linear equation (a21=0a_{21} = 0).

Question 7medium

Is W={A∈M2,2:det⁡A=0}W = \{A \in M_{2,2} : \det A = 0\} a subspace of M2,2M_{2,2}?

Show answer
No

[1000]\begin{bmatrix} 1 & 0 \\ 0 & 0 \end{bmatrix} and [0001]\begin{bmatrix} 0 & 0 \\ 0 & 1 \end{bmatrix} are singular (det 0), their sum is II and det⁡I=1\det I = 1.
Not closed under addition. (It is closed under scalar multiplication, but that is not enough.)

Question 8medium

Is W={p∈P2:p(2)=0}W = \{p \in P_2 : p(2) = 0\} a subspace of P2P_2?

Show answer
Yes

The zero polynomial: 0(2)=00(2) = 0. (p+q)(2)=p(2)+q(2)=0(p + q)(2) = p(2) + q(2) = 0. (cp)(2)=c⋅0=0(cp)(2) = c \cdot 0 = 0.
For p=a+bx+cx2p = a + bx + cx^2 the condition is a+2b+4c=0a + 2b + 4c = 0: a homogeneous linear equation.

Question 9hard

Is W={p∈P2:p′(1)=p(0)}W = \{p \in P_2 : p'(1) = p(0)\} a subspace of P2P_2?

Show answer
Yes

p=a+bx+cx2p = a + bx + cx^2: p′(x)=b+2cxp'(x) = b + 2cx, p′(1)=b+2cp'(1) = b + 2c, p(0)=ap(0) = a. The condition is b+2c−a=0b + 2c - a = 0.
A homogeneous linear equation in the coefficients, that is, a null space: a subspace.
Alternatively: differentiation and evaluation are linear operations, (p+q)′=p′+q′(p + q)' = p' + q', (cp)(0)=cp(0)(cp)(0) = cp(0).

Question 10hard

For which value of kk is W={(x,y,z):x+2y−z=k}W = \{(x, y, z) : x + 2y - z = k\} a subspace of R3\mathbb{R}^3?

Show answer
k=0k = 0

For 0∈W\mathbf{0} \in W we need 0+0−0=k0 + 0 - 0 = k, so k=0k = 0 is required.
When k=0k = 0 it is a homogeneous plane and all three conditions hold. If k≠0k \neq 0 it is a shifted parallel plane, not a subspace.

Question 11hard

Let W1W_1 be the xx-axis and W2W_2 the yy-axis in R2\mathbb{R}^2. Is W1∪W2W_1 \cup W_2 a subspace?

Show answer
No

(1,0)∈W1(1, 0) \in W_1, (0,1)∈W2(0, 1) \in W_2, but (1,0)+(0,1)=(1,1)(1, 0) + (0, 1) = (1, 1) is on neither axis.
A union is generally not a subspace. An intersection ({0}\{\mathbf{0}\}) is always a subspace.

Question 12medium

Find the intersection of the subspaces x+y−z=0x + y - z = 0 and 2x−y+z=02x - y + z = 0 of R3\mathbb{R}^3.

Show answer
span⁡{(0,1,1)}\operatorname{span}\{(0, 1, 1)\}

Solve the two equations together: [11−12−11]\begin{bmatrix} 1 & 1 & -1 \\ 2 & -1 & 1 \end{bmatrix}, R2←R2−2R1R_2 \leftarrow R_2 - 2R_1: (0,−3,3)(0, -3, 3), so y=zy = z.
Equation 1: x+z−z=0⇒x=0x + z - z = 0 \Rightarrow x = 0. z=tz = t: (0,t,t)=t(0,1,1)(0, t, t) = t(0, 1, 1).
The intersection of two planes is a line through the origin.

Verification: For the sets that are subspaces, closure was tested in node with 200 random integer vector pairs and scalars from each set using BigInt fractions; for the sets that are not subspaces, the given counterexamples were computed one by one; the null space in the intersection question was found with the exact RREF (verify/MAT1041/07.mjs).

Review card

W ⊆ V is a subspace ⇔ (1) 0 ∈ W (2) u,v ∈ W → u+v ∈ W (3) u ∈ W → cu ∈ W Check 0 first: if it is not there you are DONE, not a subspace. Having 0 is not enough: check (2) and (3) too. To say "no", write ONE numerical counterexample. YES signs: linear equation(s) with right side 0, span{...}, solutions of Ax=0, symmetric, trace 0, upper triangular, diagonal matrices, p(a)=0, p'(a)=p(b). NO signs: right side ≠ 0, product (xy=0), square (y=x²), absolute value, inequality (x≥0), integers, det=0, invertible matrices, A²=A, p(0)=1, degree EXACTLY n. Subspaces of R³: {0}, lines through the origin, planes through the origin, R³. The solution set of Ax=0 is a subspace (null space); of Ax=b, b≠0, it is not. Intersection is ALWAYS a subspace; union generally is NOT.