Quiz 2

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: 0W\mathbf{0} \in W
  2. Closure under addition: For all u,vW\mathbf{u}, \mathbf{v} \in W, u+vW\mathbf{u} + \mathbf{v} \in W
  3. Closure under scalar multiplication: For all vW\mathbf{v} \in W and cRc \in \mathbb{R}, cvWc\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 0W\mathbf{0} \in W and for all u,vW\mathbf{u}, \mathbf{v} \in W, cRc \in \mathbb{R}, we have u+cvW\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)R2y=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)R3x+yz=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+00=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+y1z1=0x_1+y_1-z_1 = 0, x2+y2z2=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+y1z1)+(x2+y2z2)=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+cycz=c(x+yz)=c0=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)P2p(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)=cp(0)=c0=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)R2y=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 0W\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)R2x0,y0}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)={xRnAx=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:
  • 0N(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=c0=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)={yRmy=Ax for some xRn}>> 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]|yR}>> 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 W1W2W_1 \cap W_2 is also a subspace of VV. Proof: 0W1\mathbf{0} \in W_1 and 0W2\mathbf{0} \in W_2, so 0W1W2\mathbf{0} \in W_1 \cap W_2. If u,vW1W2\mathbf{u}, \mathbf{v} \in W_1 \cap W_2, then u+vW1\mathbf{u}+\mathbf{v} \in W_1 and u+vW2\mathbf{u}+\mathbf{v} \in W_2, so u+vW1W2\mathbf{u}+\mathbf{v} \in W_1 \cap W_2. Similarly for scalar multiplication.

6.2 Sum of Subspaces

Definition (Sum). W1+W2={w1+w2w1W1,w2W2}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).
W1W2={(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 subspacesW1W2W_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 0W\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 space0W\mathbf{0} \in W , closed under ++ and \cdot
Null spaceN(A)={xAx=0}N(A) = \{\mathbf{x} \mid A\mathbf{x} = \mathbf{0}\}Subspace of Rn\mathbb{R}^n
Column spaceC(A)={AxxRn}C(A) = \{A\mathbf{x} \mid \mathbf{x} \in \mathbb{R}^n\}Subspace of Rm\mathbb{R}^m
IntersectionW1W2W_1 \cap W_2Always a subspace
SumW1+W2W_1 + W_2Always a subspace
UnionW1W2W_1 \cup W_2Usually not a subspace

10. 📝 Practice Questions

Q1: Subspace test — line through origin
Is W={(x,y)R2x=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)R32xy+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)=(2x1y1+3z1)+(2x2y2+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(2xy+3z)=c0=02(cx)-cy+3(cz) = c(2x-y+3z) = c\cdot0 = 0Q3: Not a subspace — line not through origin
Is W={(x,y)R2y=3x1}W = \{(x,y) \in \mathbb{R}^2 \mid y = 3x - 1\} a subspace?
Solution: No. (0,0)W(0,0) \notin W because 010 \neq -1. Fails the zero vector condition. Q4: Not a subspace — discrete set
Is W={(x,y)R2x2=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: 22022^2 \neq 0^2, so (2,0)W(2,0) \notin W. Fails closure under addition. Q5: Polynomial subspace
Is W={p(x)P2p(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)=c0=0(cp)'(0) = c p'(0) = c\cdot0 = 0Q6: Null space
Find a basis for N(A)N(A) where
>A=[101210]>> A = \begin{bmatrix} 1 & 0 & -1 \\ 2 & 1 & 0 \end{bmatrix} >
.
Solution: Solve Ax=0A\mathbf{x} = \mathbf{0}:
>{xz=02x+y=0x=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[121]}>> 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)yz=0}W_2 = \{(x,y,z) \mid y - z = 0\}. Find W1W2W_1 \cap W_2.
Solution: x+y=0x + y = 0 and yz=0y - z = 0x=yx = -y, z=yz = y. W1W2={(y,y,y)yR}=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 W1W2W_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)W1W2(1,0) \in W_1 \cup W_2, (0,1)W1W2(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)W1W2(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
System Normal // Awaiting Context

Intelligence Hub

Navigate the knowledge graph to generate context. The Hub adapts dynamically to surface backlinks, related notes, and metadata insights.