6: Subspaces

Subspaces are the building blocks of linear algebra,they’re the sets where vector operations stay contained, and understanding them reveals the geometry hidden inside matrices.

Basic Definitions

(Subspace)

A subset SRnS \subseteq \mathbb{R}^n is a subspace of Rn\mathbb{R}^n if and only if it satisfies three conditions:

  1. Contains the zero vector: 0S\mathbf{0} \in S
  2. Closed under addition: If u,vSu, v \in S, then u+vSu + v \in S
  3. Closed under scalar multiplication: If vSv \in S and cRc \in \mathbb{R}, then cvScv \in S

In other words, a subspace is a set that “behaves like a vector space” within Rn\mathbb{R}^n.


(Why These Three Conditions?)

The intuition: a subspace must be self-contained under the operations that define vector spaces.

  • The zero vector ensures you have a natural “origin”
  • Closure under addition means you can combine vectors freely
  • Closure under scalar multiplication means you can scale vectors freely

Together, these guarantee that all linear combinations of vectors in SS stay inside SS.


Examples

Example 1: The Trivial Subspaces

For any nn:

  • S={0}S = \{\mathbf{0}\} is always a subspace (the trivial subspace)
  • S=RnS = \mathbb{R}^n is always a subspace (the whole space)

Example 2: Lines Through the Origin

The set

S={tvtR}S = \{t \cdot v \mid t \in \mathbb{R}\}

where v0v \neq \mathbf{0} is a subspace of Rn\mathbb{R}^n.

This is the line through the origin in the direction of vv.

Why?

  • Contains 0\mathbf{0}: Set t=0t = 0
  • Closed under addition: t1v+t2v=(t1+t2)vSt_1 v + t_2 v = (t_1 + t_2)v \in S
  • Closed under scalar multiplication: c(tv)=(ct)vSc(tv) = (ct)v \in S

Example 3: Planes Through the Origin

The set

S={c1v1+c2v2c1,c2R}S = \{c_1 v_1 + c_2 v_2 \mid c_1, c_2 \in \mathbb{R}\}

where v1,v2v_1, v_2 are linearly independent is a subspace.

This is the plane spanned by v1v_1 and v2v_2.

Example 4: Not a Subspace

The set

S={(x,y)R2x+y=1}S = \{(x, y) \in \mathbb{R}^2 \mid x + y = 1\}

is not a subspace because:

  • It doesn’t contain 0\mathbf{0} (since 0+010 + 0 \neq 1)
  • It’s not closed under addition: (1,0)(1, 0) and (0,1)(0, 1) are in SS, but their sum (1,1)(1, 1) is not

This is a line, but it doesn’t. pass through the origin,so it fails to be a subspace.


Key Result: Span is Always a Subspace

Theorem: For any collection of vectors v1,,vkRnv_1, \dots, v_k \in \mathbb{R}^n, the span

span{v1,,vk}\operatorname{span}\{v_1, \dots, v_k\}

is a subspace of Rn\mathbb{R}^n.

Proof:

  1. Contains 0\mathbf{0}: Take all coefficients ci=0c_i = 0, then 0v1++0vk=00v_1 + \cdots + 0v_k = \mathbf{0}.

  2. Closed under addition: If u=c1v1++ckvku = c_1 v_1 + \cdots + c_k v_k and w=d1v1++dkvkw = d_1 v_1 + \cdots + d_k v_k, then

    u+w=(c1+d1)v1++(ck+dk)vkspan{v1,,vk}.u + w = (c_1 + d_1)v_1 + \cdots + (c_k + d_k)v_k \in \operatorname{span}\{v_1, \dots, v_k\}.
  3. Closed under scalar multiplication: If u=c1v1++ckvku = c_1 v_1 + \cdots + c_k v_k and aRa \in \mathbb{R}, then

    au=(ac1)v1++(ack)vkspan{v1,,vk}.au = (ac_1)v_1 + \cdots + (ac_k)v_k \in \operatorname{span}\{v_1, \dots, v_k\}.

This is why span is so important,it’s the canonical way to construct subspaces.


Column Space and Null Space

Two fundamental subspaces arise from any matrix ARm×nA \in \mathbb{R}^{m \times n}:

(Column Space)

The column space of AA, denoted col(A)\operatorname{col}(A), is the span of the columns of AA:

col(A)=span{columns of A}.\operatorname{col}(A) = \operatorname{span}\{\text{columns of } A\}.

This is a subspace of Rm\mathbb{R}^m.

Interpretation: col(A)\operatorname{col}(A) is the set of all possible outputs AxAx as xx ranges over Rn\mathbb{R}^n.

col(A)={AxxRn}.\operatorname{col}(A) = \{Ax \mid x \in \mathbb{R}^n\}.

(Null Space)

The null space (or kernel) of AA, denoted null(A)\operatorname{null}(A) or ker(A)\ker(A), is the set of all solutions to Ax=0Ax = \mathbf{0}:

null(A)={xRnAx=0}.\operatorname{null}(A) = \{x \in \mathbb{R}^n \mid Ax = \mathbf{0}\}.

This is a subspace of Rn\mathbb{R}^n.

Why is it a subspace?

  1. A0=0A\mathbf{0} = \mathbf{0}, so 0null(A)\mathbf{0} \in \operatorname{null}(A)
  2. If Au=0Au = \mathbf{0} and Av=0Av = \mathbf{0}, then A(u+v)=Au+Av=0A(u + v) = Au + Av = \mathbf{0}
  3. If Au=0Au = \mathbf{0}, then A(cu)=c(Au)=c0=0A(cu) = c(Au) = c\mathbf{0} = \mathbf{0}

Interpretation: The null space captures all the “redundancy” in the matrix,the directions that get collapsed to zero.


Dimension and Basis

(Basis)

A basis for a subspace SS is a linearly independent set of vectors whose span equals SS.

Equivalently, a basis is a minimal spanning set or a maximal independent set.

(Dimension)

The dimension of a subspace SS, denoted dim(S)\dim(S), is the number of vectors in any basis for SS.

Key fact: All bases for a given subspace have the same size.

Examples

  • dim({0})=0\dim(\{\mathbf{0}\}) = 0
  • dim(Rn)=n\dim(\mathbb{R}^n) = n
  • A line through the origin has dimension 11
  • A plane through the origin has dimension 22

The Rank-Nullity Theorem

For any m×nm \times n matrix AA:

dim(col(A))+dim(null(A))=n.\dim(\operatorname{col}(A)) + \dim(\operatorname{null}(A)) = n.

Or equivalently:

rank(A)+dim(null(A))=n.\operatorname{rank}(A) + \dim(\operatorname{null}(A)) = n.

Interpretation: The dimension of the input space (nn) is split between:

  • The dimension of directions that get mapped somewhere non-trivial (the rank)
  • The dimension of directions that collapse to zero (the nullity)

This is one of the most important equations in linear algebra.


Computing Subspaces from RREF

Given a matrix AA, we can compute both col(A)\operatorname{col}(A) and null(A)\operatorname{null}(A) from rref(A)\operatorname{rref}(A).

Finding a Basis for col(A)\operatorname{col}(A)

  1. Compute rref(A)\operatorname{rref}(A)
  2. Identify the pivot columns in rref(A)\operatorname{rref}(A)
  3. The corresponding columns from the original matrix AA form a basis for col(A)\operatorname{col}(A)

Why the original columns? Because row operations preserve the column space relationships but change the actual vectors. The pivot positions tell you which original columns are independent.

Finding a Basis for null(A)\operatorname{null}(A)

  1. Compute rref(A)\operatorname{rref}(A)
  2. Identify the free variables (columns without pivots)
  3. For each free variable, set it to 11 and all other free variables to 00, then solve for the basic variables
  4. Each solution vector forms a basis vector for null(A)\operatorname{null}(A)

The dimension of null(A)\operatorname{null}(A) equals the number of free variables.


Why Subspaces Matter

Subspaces are the geometric objects that linear algebra studies.

  • Solutions to linear systems live in subspaces
  • Eigenvectors span eigenspaces (which are subspaces)
  • Projections map onto subspaces
  • Least-squares problems minimize distance to subspaces

Understanding subspaces means understanding the structure of Rn\mathbb{R}^n, not just individual vectors.