Subspaces: Definition, Testing & Examples

2156 words
11 min read
Python Week 1: the first filter for runtime behavior
Visual companion
Python
Type and operator map

Python Week 1: the first filter for runtime behavior

View
Revision summary

What this note is really saying

Short form

# Subspaces: Definition, Testing & Examples ## ๐ŸŽฏ Learning Objectives After this topic you will be able to: - State the subspace test (closed under $+$, closed under $\cdot$, contains $\mathbf{0}$) - Determine whether a given subset of a vector space is a subspace - Visualise subspaces of $\mathbb{R}^2$ and $\mathbb...

Subspaces: Definition, Testing & Examples

๐ŸŽฏ Learning Objectives

After this topic you will be able to:
  • State the subspace test (closed under ++, closed under โ‹…\cdot, contains 0\mathbf{0})
  • Determine whether a given subset of a vector space is a subspace
  • Visualise subspaces of R2\mathbb{R}^2 and R3\mathbb{R}^3 as lines, planes, and points through the origin
  • Describe the column space, null space, and row space of a matrix
  • Prove that the intersection of two subspaces is a subspace

๐Ÿ“‹ Prerequisites

  • Vector Spaces Definition (this week) โ€” you need to know the axioms
  • Subspaces are vector spaces that live inside bigger vector spaces

1. Intuition: A Smaller Room Inside the House

A vector space is like a house. A subspace is a room inside that house โ€” a subset that is itself a complete vector space. For a subset WW of a vector space VV to be a subspace, it must:
  1. Contain the zero vector โ€” the room must have a floor
  2. Be closed under addition โ€” adding two things in the room keeps you in the room
  3. Be closed under scalar multiplication โ€” stretching/shrinking something in the room keeps you in the room (Diagram) In R3\mathbb{R}^3, subspaces are:
  • The origin {0}\{\mathbf{0}\} (dimension 0)
  • Lines through the origin (dimension 1)
  • Planes through the origin (dimension 2)
  • The whole space R3\mathbb{R}^3 (dimension 3) Crucially: Subspaces must contain the origin. If it doesn't pass through the origin, it's not a subspace.

2. The Subspace Test

Theorem (Subspace Test). A non-empty subset WW of a vector space VV is a subspace of VV if and only if:
  1. Zero vector: 0โˆˆW\mathbf{0} \in W
  2. Closure under addition: For all u,vโˆˆW\mathbf{u}, \mathbf{v} \in W, u+vโˆˆW\mathbf{u} + \mathbf{v} \in W
  3. Closure under scalar multiplication: For all vโˆˆW\mathbf{v} \in W and cโˆˆRc \in \mathbb{R}, cvโˆˆWc\mathbf{v} \in W If these three hold, the other seven axioms are automatically inherited from VV. Why only three checks? Because WW inherits commutativity, associativity, etc. from VV. The only things that could go wrong are: (a) WW lacks a zero vector, (b) adding two elements of WW leaves WW, or (c) scaling an element of WW leaves WW.

2.1 Streamlined Test

Often we combine conditions 2 and 3 into one check:
One-step test: WW is a subspace iff 0โˆˆW\mathbf{0} \in W and for all u,vโˆˆW\mathbf{u}, \mathbf{v} \in W, cโˆˆRc \in \mathbb{R}, we have u+cvโˆˆW\mathbf{u} + c\mathbf{v} \in W.

3. Examples of Subspaces

3.1 Lines Through the Origin in R2\mathbb{R}^2

Example 1: W={(x,y)โˆˆR2โˆฃy=2x}W = \{(x, y) \in \mathbb{R}^2 \mid y = 2x\} Check:
  • 0=(0,0)\mathbf{0} = (0,0): 0=2(0)0 = 2(0) โœ“
  • Closure under addition: Let (x1,2x1)(x_1, 2x_1), (x2,2x2)โˆˆW(x_2, 2x_2) \in W. Sum = (x1+x2,2x1+2x2)=(x1+x2,2(x1+x2))(x_1+x_2, 2x_1+2x_2) = (x_1+x_2, 2(x_1+x_2)) โ€” still satisfies y=2xy = 2x โœ“
  • Closure under scalar multiplication: c(x,2x)=(cx,2cx)c(x, 2x) = (cx, 2cx) โ€” still satisfies y=2xy = 2x โœ“ So WW is a 1-dimensional subspace of R2\mathbb{R}^2.

3.2 Planes Through the Origin in R3\mathbb{R}^3

Example 2: W={(x,y,z)โˆˆR3โˆฃx+yโˆ’z=0}W = \{(x,y,z) \in \mathbb{R}^3 \mid x + y - z = 0\} Check:
  • 0=(0,0,0)\mathbf{0} = (0,0,0): 0+0โˆ’0=00 + 0 - 0 = 0 โœ“
  • Closure under addition: Let (x1,y1,z1)(x_1,y_1,z_1), (x2,y2,z2)โˆˆW(x_2,y_2,z_2) \in W. Then x1+y1โˆ’z1=0x_1+y_1-z_1 = 0, x2+y2โˆ’z2=0x_2+y_2-z_2 = 0. Sum = (x1+x2,y1+y2,z1+z2)(x_1+x_2, y_1+y_2, z_1+z_2). Check: (x1+x2)+(y1+y2)โˆ’(z1+z2)=(x1+y1โˆ’z1)+(x2+y2โˆ’z2)=0+0=0(x_1+x_2)+(y_1+y_2)-(z_1+z_2) = (x_1+y_1-z_1)+(x_2+y_2-z_2) = 0+0 = 0 โœ“
  • Closure under scalar multiplication: c(x,y,z)=(cx,cy,cz)c(x,y,z) = (cx, cy, cz). Check: cx+cyโˆ’cz=c(x+yโˆ’z)=cโ‹…0=0cx + cy - cz = c(x+y-z) = c \cdot 0 = 0 โœ“ So WW is a 2-dimensional subspace of R3\mathbb{R}^3.

3.3 Polynomial Subspaces

Example 3: W={p(x)โˆˆP2โˆฃp(0)=0}W = \{p(x) \in P_2 \mid p(0) = 0\} (polynomials of degree โ‰ค2\leq 2 with zero constant term) Check:
  • Zero polynomial: p(x)=0p(x) = 0 satisfies p(0)=0p(0) = 0 โœ“
  • Closure under addition: If p(0)=0p(0)=0 and q(0)=0q(0)=0, then (p+q)(0)=p(0)+q(0)=0+0=0(p+q)(0) = p(0)+q(0) = 0+0 = 0 โœ“
  • Closure under scalar multiplication: (cp)(0)=cโ‹…p(0)=cโ‹…0=0(cp)(0) = c\cdot p(0) = c\cdot 0 = 0 โœ“ So WW is a subspace of P2P_2. It consists of polynomials like a1x+a2x2a_1 x + a_2 x^2.

4. Non-Examples

4.1 Line Not Through the Origin

W={(x,y)โˆˆR2โˆฃy=2x+1}W = \{(x,y) \in \mathbb{R}^2 \mid y = 2x + 1\} Fails zero vector: (0,0)(0,0) gives 0=10 = 1, so 0โˆ‰W\mathbf{0} \notin W. Not a subspace. Also fails closure under addition: (x1,2x1+1)+(x2,2x2+1)=(x1+x2,2(x1+x2)+2)(x_1, 2x_1+1) + (x_2, 2x_2+1) = (x_1+x_2, 2(x_1+x_2)+2). The sum has y=2x+2y = 2x + 2, not 2x+12x+1.

4.2 First Quadrant

W={(x,y)โˆˆR2โˆฃxโ‰ฅ0,yโ‰ฅ0}W = \{(x,y) \in \mathbb{R}^2 \mid x \geq 0, y \geq 0\} Contains 0\mathbf{0} โœ“, closed under addition โœ“, but fails scalar multiplication: (โˆ’1)(1,1)=(โˆ’1,โˆ’1)โˆ‰W(-1)(1,1) = (-1,-1) \notin W. Not a subspace.

5. Important Subspaces Associated with a Matrix

5.1 Null Space (Kernel)

Definition (Null Space). For an mร—nm \times n matrix AA, the null space is:
>N(A)={xโˆˆRnโˆฃAx=0}>> N(A) = \{\mathbf{x} \in \mathbb{R}^n \mid A\mathbf{x} = \mathbf{0}\} >
N(A)N(A) is a subspace of Rn\mathbb{R}^n. Proof of subspace:
  • 0โˆˆN(A)\mathbf{0} \in N(A) because A0=0A\mathbf{0} = \mathbf{0} โœ“
  • If Ax=0A\mathbf{x} = \mathbf{0} and Ay=0A\mathbf{y} = \mathbf{0}, then A(x+y)=Ax+Ay=0+0=0A(\mathbf{x}+\mathbf{y}) = A\mathbf{x} + A\mathbf{y} = \mathbf{0} + \mathbf{0} = \mathbf{0} โœ“
  • If Ax=0A\mathbf{x} = \mathbf{0}, then A(cx)=cAx=cโ‹…0=0A(c\mathbf{x}) = cA\mathbf{x} = c \cdot \mathbf{0} = \mathbf{0} โœ“

5.2 Column Space (Range)

Definition (Column Space). For an mร—nm \times n matrix AA, the column space is:
>C(A)={yโˆˆRmโˆฃy=Axย forย someย xโˆˆRn}>> C(A) = \{\mathbf{y} \in \mathbb{R}^m \mid \mathbf{y} = A\mathbf{x} \text{ for some } \mathbf{x} \in \mathbb{R}^n\} >
C(A)C(A) is a subspace of Rm\mathbb{R}^m. It is the span of the columns of AA.

5.3 Row Space

Definition (Row Space). The row space of AA is the span of its rows (as vectors in Rn\mathbb{R}^n). It equals C(AT)C(A^T). Example 4: Null space and column space
>A=[1224]>> A = \begin{bmatrix} 1 & 2 \\ 2 & 4 \end{bmatrix} >
Null space: Solve Ax=0A\mathbf{x} = \mathbf{0}: x+2y=0x + 2y = 0, 2x+4y=02x + 4y = 0. Solutions: x=โˆ’2yx = -2y, yy free.
>N(A)={y[โˆ’21]|yโˆˆR}>> N(A) = \left\{ y\begin{bmatrix} -2 \\ 1 \end{bmatrix} \middle| y \in \mathbb{R} \right\} >
โ€” a line through origin.
Column space: Columns are (1,2)(1,2) and (2,4)(2,4). The second is a scalar multiple of the first, so C(A)=span{(1,2)}C(A) = \text{span}\{(1,2)\} โ€” also a line through origin.

6. Subspace Operations

6.1 Intersection of Subspaces

Theorem. If W1W_1 and W2W_2 are subspaces of VV, then W1โˆฉW2W_1 \cap W_2 is also a subspace of VV. Proof: 0โˆˆW1\mathbf{0} \in W_1 and 0โˆˆW2\mathbf{0} \in W_2, so 0โˆˆW1โˆฉW2\mathbf{0} \in W_1 \cap W_2. If u,vโˆˆW1โˆฉW2\mathbf{u}, \mathbf{v} \in W_1 \cap W_2, then u+vโˆˆW1\mathbf{u}+\mathbf{v} \in W_1 and u+vโˆˆW2\mathbf{u}+\mathbf{v} \in W_2, so u+vโˆˆW1โˆฉW2\mathbf{u}+\mathbf{v} \in W_1 \cap W_2. Similarly for scalar multiplication.

6.2 Sum of Subspaces

Definition (Sum). W1+W2={w1+w2โˆฃw1โˆˆW1,w2โˆˆW2}W_1 + W_2 = \{\mathbf{w}_1 + \mathbf{w}_2 \mid \mathbf{w}_1 \in W_1, \mathbf{w}_2 \in W_2\}. The sum of two subspaces is also a subspace. Example 5: Intersection and sum
In R3\mathbb{R}^3, let W1={(x,y,0)}W_1 = \{(x,y,0)\} (the xyxy-plane) and W2={(0,y,z)}W_2 = \{(0,y,z)\} (the yzyz-plane).
W1โˆฉW2={(0,y,0)}W_1 \cap W_2 = \{(0,y,0)\} โ€” the yy-axis (a line). W1+W2=R3W_1 + W_2 = \mathbb{R}^3 (every vector can be written as sum of something in xyxy-plane and something in yzyz-plane).

7. Edge Cases & Gotchas

SituationWhat Happens
** W={0}W = \{\mathbf{0}\} **The trivial subspace โ€” always a subspace
** W=VW = V **The whole space is a subspace (of itself)
Union of subspacesW1โˆชW2W_1 \cup W_2 is generally not a subspace (except if one contains the other)
Affine subspaces (lines/planes not through origin)Not subspaces โ€” they are "translates" of subspaces (Week 7)

8. Common Pitfalls

โŒ Pitfall 1: Checking only closure

Students forget to check 0โˆˆW\mathbf{0} \in W. Without it, WW could be non-empty but still not a subspace (e.g., a line not through the origin).

โŒ Pitfall 2: Assuming any subset of Rn\mathbb{R}^n is a subspace

Only subsets satisfying all three conditions are subspaces. Most subsets fail at least one.

โŒ Pitfall 3: Confusing null space and column space

N(A)N(A) is in Rn\mathbb{R}^n (domain), C(A)C(A) is in Rm\mathbb{R}^m (codomain). They live in different spaces.

9. Formula Summary Table

ConceptDescriptionCheck
SubspaceSubset that is itself a vector space0โˆˆW\mathbf{0} \in W , closed under ++ and โ‹…\cdot
Null spaceN(A)={xโˆฃAx=0}N(A) = \{\mathbf{x} \mid A\mathbf{x} = \mathbf{0}\}Subspace of Rn\mathbb{R}^n
Column spaceC(A)={AxโˆฃxโˆˆRn}C(A) = \{A\mathbf{x} \mid \mathbf{x} \in \mathbb{R}^n\}Subspace of Rm\mathbb{R}^m
IntersectionW1โˆฉW2W_1 \cap W_2Always a subspace
SumW1+W2W_1 + W_2Always a subspace
UnionW1โˆชW2W_1 \cup W_2Usually not a subspace

10. ๐Ÿ“ Practice Questions

Q1: Subspace test โ€” line through origin
Is W={(x,y)โˆˆR2โˆฃx=โˆ’2y}W = \{(x,y) \in \mathbb{R}^2 \mid x = -2y\} a subspace?
Solution: Yes.
  • 0=(0,0)\mathbf{0} = (0,0): 0=โˆ’2(0)0 = -2(0) โœ“
  • Addition: (x1,โˆ’x12)+(x2,โˆ’x22)=(x1+x2,โˆ’x1+x22)(x_1, -\frac{x_1}{2}) + (x_2, -\frac{x_2}{2}) = (x_1+x_2, -\frac{x_1+x_2}{2}) โœ“
  • Scalar: c(x,โˆ’x2)=(cx,โˆ’cx2)c(x, -\frac{x}{2}) = (cx, -\frac{cx}{2}) โœ“ Q2: Subspace test โ€” plane in โ„ยณ
Is W={(x,y,z)โˆˆR3โˆฃ2xโˆ’y+3z=0}W = \{(x,y,z) \in \mathbb{R}^3 \mid 2x - y + 3z = 0\} a subspace?
Solution: Yes (plane through origin).
  • 0\mathbf{0}: 2(0)โˆ’0+3(0)=02(0) - 0 + 3(0) = 0 โœ“
  • Addition: (x1+x2,y1+y2,z1+z2)(x_1+x_2, y_1+y_2, z_1+z_2). Check: 2(x1+x2)โˆ’(y1+y2)+3(z1+z2)=(2x1โˆ’y1+3z1)+(2x2โˆ’y2+3z2)=0+0=02(x_1+x_2)-(y_1+y_2)+3(z_1+z_2) = (2x_1-y_1+3z_1)+(2x_2-y_2+3z_2) = 0+0 = 0 โœ“
  • Scalar: c(x,y,z)c(x,y,z). Check: 2(cx)โˆ’cy+3(cz)=c(2xโˆ’y+3z)=cโ‹…0=02(cx)-cy+3(cz) = c(2x-y+3z) = c\cdot0 = 0 โœ“ Q3: Not a subspace โ€” line not through origin
Is W={(x,y)โˆˆR2โˆฃy=3xโˆ’1}W = \{(x,y) \in \mathbb{R}^2 \mid y = 3x - 1\} a subspace?
Solution: No. (0,0)โˆ‰W(0,0) \notin W because 0โ‰ โˆ’10 \neq -1. Fails the zero vector condition. Q4: Not a subspace โ€” discrete set
Is W={(x,y)โˆˆR2โˆฃx2=y2}W = \{(x,y) \in \mathbb{R}^2 \mid x^2 = y^2\} a subspace?
Solution: No. (1,1)โˆˆW(1,1) \in W and (1,โˆ’1)โˆˆW(1,-1) \in W, but (1,1)+(1,โˆ’1)=(2,0)(1,1)+(1,-1) = (2,0). Check: 22โ‰ 022^2 \neq 0^2, so (2,0)โˆ‰W(2,0) \notin W. Fails closure under addition. Q5: Polynomial subspace
Is W={p(x)โˆˆP2โˆฃpโ€ฒ(0)=0}W = \{p(x) \in P_2 \mid p'(0) = 0\} a subspace of P2P_2?
Solution: Yes.
  • Zero polynomial p(x)=0p(x)=0 has pโ€ฒ(0)=0p'(0)=0 โœ“
  • If pโ€ฒ(0)=0p'(0)=0 and qโ€ฒ(0)=0q'(0)=0, then (p+q)โ€ฒ(0)=pโ€ฒ(0)+qโ€ฒ(0)=0+0=0(p+q)'(0) = p'(0)+q'(0) = 0+0 = 0 โœ“
  • (cp)โ€ฒ(0)=cpโ€ฒ(0)=cโ‹…0=0(cp)'(0) = c p'(0) = c\cdot0 = 0 โœ“ Q6: Null space
Find a basis for N(A)N(A) where
>A=[10โˆ’1210]>> A = \begin{bmatrix} 1 & 0 & -1 \\ 2 & 1 & 0 \end{bmatrix} >
.
Solution: Solve Ax=0A\mathbf{x} = \mathbf{0}:
>{xโˆ’z=02x+y=0โ‡’x=z,y=โˆ’2x=โˆ’2z>> \begin{cases} x - z = 0 \\ 2x + y = 0 \end{cases} \Rightarrow x = z, y = -2x = -2z >
x=zx = z, y=โˆ’2zy = -2z, zz free.
>N(A)={z[1โˆ’21]}>> N(A) = \left\{ z\begin{bmatrix} 1 \\ -2 \\ 1 \end{bmatrix} \right\} >
. Basis: {(1,โˆ’2,1)}\{(1,-2,1)\}. Q7: Column space
Find a basis for C(A)C(A) where
>A=[1224]>> A = \begin{bmatrix} 1 & 2 \\ 2 & 4 \end{bmatrix} >
.
Solution: Columns are (1,2)(1,2) and (2,4)(2,4). Since column 2 = 2(column 1), they are linearly dependent. A basis for C(A)C(A) is {(1,2)}\{(1,2)\}. Q8: Intersection of subspaces
In R3\mathbb{R}^3, W1={(x,y,z)โˆฃx+y=0}W_1 = \{(x,y,z) \mid x + y = 0\}, W2={(x,y,z)โˆฃyโˆ’z=0}W_2 = \{(x,y,z) \mid y - z = 0\}. Find W1โˆฉW2W_1 \cap W_2.
Solution: x+y=0x + y = 0 and yโˆ’z=0y - z = 0 โ‡’ x=โˆ’yx = -y, z=yz = y. W1โˆฉW2={(โˆ’y,y,y)โˆฃyโˆˆR}=span{(โˆ’1,1,1)}W_1 \cap W_2 = \{(-y, y, y) \mid y \in \mathbb{R}\} = \text{span}\{(-1,1,1)\}, a line. Q9: Union is not a subspace
Show that W1โˆชW2W_1 \cup W_2 is not a subspace where W1={(x,0)}W_1 = \{(x,0)\} and W2={(0,y)}W_2 = \{(0,y)\} in R2\mathbb{R}^2.
Solution: (1,0)โˆˆW1โˆชW2(1,0) \in W_1 \cup W_2, (0,1)โˆˆW1โˆชW2(0,1) \in W_1 \cup W_2, but (1,0)+(0,1)=(1,1)โˆ‰W1(1,0)+(0,1) = (1,1) \notin W_1 and (1,1)โˆ‰W2(1,1) \notin W_2, so (1,1)โˆ‰W1โˆชW2(1,1) \notin W_1 \cup W_2. Fails closure under addition. Q10: Sum of subspaces
If W1={(x,y,0)}W_1 = \{(x,y,0)\} and W2={(0,0,z)}W_2 = \{(0,0,z)\} in R3\mathbb{R}^3, show that W1+W2=R3W_1 + W_2 = \mathbb{R}^3.
Solution: Any (a,b,c)โˆˆR3(a,b,c) \in \mathbb{R}^3 can be written as (a,b,0)+(0,0,c)(a,b,0) + (0,0,c) where (a,b,0)โˆˆW1(a,b,0) \in W_1 and (0,0,c)โˆˆW2(0,0,c) \in W_2. So W1+W2=R3W_1 + W_2 = \mathbb{R}^3.

๐Ÿ”— Cross-References

Document outline

Keep your place and jump directly to a heading.

Table of contents

No note selected

Open a chapter to see its outline, backlinks, and sources here.