Skip to content

13. Vector Subspaces

Updated
17 Sept 2026
8 min read
6 sections
Page 15 of 17
Master Linear Algebra with Python

Vector Subspaces

The concept of a subspace is one of the most foundational and important topics in linear algebra. It bridges pure algebra (linear combinations of column vectors) with geometry (infinite lines, spanned planes, and high-dimensional hyperplanes).

In this lesson, we will explore both the algebraic and geometric perspectives of subspaces, study the formal closure criteria, and define how subspaces relate to their surrounding ambient space.


1. Algebraic Perspective

From an algebraic perspective, a subspace is defined by the set of all vectors that can be created by taking linear combinations of a specific vector or a set of vectors.

Recall that a linear combination of vectors involves multiplying them by real-valued scalars (λ,β∈R\lambda, \beta \in \mathbb{R}) and adding them together.

Example A: A Subspace from One Vector

Consider a single vector v\mathbf{v} in R2\mathbb{R}^2: v=[23]\mathbf{v} = \begin{bmatrix} 2 \\ 3 \end{bmatrix}

Any other vector that can be expressed as a scaled multiple λv\lambda \mathbf{v} is in the same subspace as v\mathbf{v}. For instance:

  • [46]\begin{bmatrix} 4 \\ 6 \end{bmatrix} is in the subspace (where λ=2\lambda = 2).
  • [−2−3]\begin{bmatrix} -2 \\ -3 \end{bmatrix} is in the subspace (where λ=−1\lambda = -1).
  • [00]\begin{bmatrix} 0 \\ 0 \end{bmatrix} is in the subspace (where λ=0\lambda = 0).

Conversely, vectors like [24]\begin{bmatrix} 2 \\ 4 \end{bmatrix}, [03]\begin{bmatrix} 0 \\ 3 \end{bmatrix}, and [04]\begin{bmatrix} 0 \\ 4 \end{bmatrix} are NOT in the subspace:

  • For the vector [24]\begin{bmatrix} 2 \\ 4 \end{bmatrix}, we would need a scalar λ=1\lambda = 1 to match the first element (1⋅2=21 \cdot 2 = 2). However, for the second element, 1⋅3=3≠41 \cdot 3 = 3 \neq 4. Since no single scalar λ\lambda satisfies both components, this vector lies outside the subspace of v\mathbf{v}.

Example B: A Subspace from Two Vectors

A subspace is not limited to a single vector. We can define a subspace from two vectors v\mathbf{v} and w\mathbf{w} by considering all of their possible linear combinations: λv+βw\lambda \mathbf{v} + \beta \mathbf{w}

For example: v=[23],w=[04]\mathbf{v} = \begin{bmatrix} 2 \\ 3 \end{bmatrix}, \quad \mathbf{w} = \begin{bmatrix} 0 \\ 4 \end{bmatrix}

Let's test if the vector [122]\begin{bmatrix} 12 \\ 2 \end{bmatrix} is in the spanned subspace. We choose scalars λ=6\lambda = 6 and β=−4\beta = -4: 6v−4w=6[23]−4[04]=[1218]−[016]=[122]6 \mathbf{v} - 4 \mathbf{w} = 6 \begin{bmatrix} 2 \\ 3 \end{bmatrix} - 4 \begin{bmatrix} 0 \\ 4 \end{bmatrix} = \begin{bmatrix} 12 \\ 18 \end{bmatrix} - \begin{bmatrix} 0 \\ 16 \end{bmatrix} = \begin{bmatrix} 12 \\ 2 \end{bmatrix}

Because we can successfully combine v\mathbf{v} and w\mathbf{w} to produce [122]\begin{bmatrix} 12 \\ 2 \end{bmatrix}, this vector is officially a member of the subspace.



3. Subsets vs. Subspaces

A common point of confusion in linear algebra is the difference between a subset and a subspace. While they sound similar, they are very different mathematical objects:

  • Subset: Simply any collection of points or vectors in a coordinate space that satisfies any custom condition you define. Subsets do not need to be closed under vector addition or scalar multiplication, nor do they need to contain the origin.
  • Subspace: A highly restricted, "closed" subset that must satisfy the closure criteria and contain the zero vector.
All subspaces are subsets, but very few subsets are subspaces. Subspaces are subsets that act as "closed universes"—once you are inside, no linear operation can take you out.

Let's look at three concrete algebraic examples in R2\mathbb{R}^2 to master this distinction.

Example 1: The Boundary Region (y≥2y \ge 2)

Consider the set of all points in 2D space where the yy-coordinate is greater than or equal to $2$: S1={[xy]∈R2  |  y≥2}S_1 = \left\{ \begin{bmatrix} x \\ y \end{bmatrix} \in \mathbb{R}^2 \;\middle|\; y \ge 2 \right\}

  1. Origin Test: Let's check if the zero vector 0=[00]\mathbf{0} = \begin{bmatrix} 0 \\ 0 \end{bmatrix} is in S1S_1. Since the yy-coordinate is $0$, and $0 < 2$, the zero vector is not in this set: 0∉S1\mathbf{0} \notin S_1
  2. Scalar Multiplication Test: Let's choose a valid vector in the set, e.g., u=[03]∈S1\mathbf{u} = \begin{bmatrix} 0 \\ 3 \end{bmatrix} \in S_1 (since 3≥23 \ge 2). Let's scale it by a negative factor λ=−1\lambda = -1: λu=−1[03]=[0−3]\lambda \mathbf{u} = -1 \begin{bmatrix} 0 \\ 3 \end{bmatrix} = \begin{bmatrix} 0 \\ -3 \end{bmatrix} Since $-3 < 2$, the scaled vector has escaped the set: λu∉S1\lambda \mathbf{u} \notin S_1
  • Conclusion: S1S_1 is a perfectly valid subset, but it is NOT a subspace because it contains no origin and fails closure under scaling.

Example 2: The Curved Curve (y=x2y = x^2)

Consider the set of all points that lie on the parabola y=x2y = x^2: S2={[xy]∈R2  |  y=x2}S_2 = \left\{ \begin{bmatrix} x \\ y \end{bmatrix} \in \mathbb{R}^2 \;\middle|\; y = x^2 \right\}

  1. Origin Test: Check if the zero vector 0=[00]\mathbf{0} = \begin{bmatrix} 0 \\ 0 \end{bmatrix} is in S2S_2. Since 0=020 = 0^2, the zero vector is successfully included: 0∈S2\mathbf{0} \in S_2
  2. Vector Addition Test: Let's pick two valid points on this parabola: u=[11]∈S2(since 1=12)\mathbf{u} = \begin{bmatrix} 1 \\ 1 \end{bmatrix} \in S_2 \quad (\text{since } 1 = 1^2) w=[24]∈S2(since 4=22)\mathbf{w} = \begin{bmatrix} 2 \\ 4 \end{bmatrix} \in S_2 \quad (\text{since } 4 = 2^2) Let's add these two vectors together: u+w=[11]+[24]=[1+21+4]=[35]\mathbf{u} + \mathbf{w} = \begin{bmatrix} 1 \\ 1 \end{bmatrix} + \begin{bmatrix} 2 \\ 4 \end{bmatrix} = \begin{bmatrix} 1 + 2 \\ 1 + 4 \end{bmatrix} = \begin{bmatrix} 3 \\ 5 \end{bmatrix} For this sum to belong to S2S_2, its coordinates must satisfy y=x2y = x^2. However: 5≠32=9  ⟹  u+w∉S25 \neq 3^2 = 9 \implies \mathbf{u} + \mathbf{w} \notin S_2 Adding the vectors took us completely off the parabola!
  • Conclusion: S2S_2 is a valid subset containing the origin, but it is NOT a subspace because it is not closed under addition (curvature breaks linearity).

Example 3: The Linear Equation (y=2xy = 2x)

Consider the set of all points lying on the line y=2xy = 2x: S3={[xy]∈R2  |  y=2x}S_3 = \left\{ \begin{bmatrix} x \\ y \end{bmatrix} \in \mathbb{R}^2 \;\middle|\; y = 2x \right\}

  1. Origin Test: Since 0=2(0)0 = 2(0), the zero vector is included: 0∈S3\mathbf{0} \in S_3
  2. Addition & Scaling Test: Let's take any arbitrary vector u=[x12x1]∈S3\mathbf{u} = \begin{bmatrix} x_1 \\ 2x_1 \end{bmatrix} \in S_3 and another vector w=[x22x2]∈S3\mathbf{w} = \begin{bmatrix} x_2 \\ 2x_2 \end{bmatrix} \in S_3, and scale them by any real numbers λ\lambda and α\alpha: λu+αw=λ[x12x1]+α[x22x2]=[λx1+αx22(λx1+αx2)]\lambda \mathbf{u} + \alpha \mathbf{w} = \lambda \begin{bmatrix} x_1 \\ 2x_1 \end{bmatrix} + \alpha \begin{bmatrix} x_2 \\ 2x_2 \end{bmatrix} = \begin{bmatrix} \lambda x_1 + \alpha x_2 \\ 2(\lambda x_1 + \alpha x_2) \end{bmatrix} The yy-component of the result is exactly twice its xx-component. Thus, the linear combination must remain on the line: λu+αw∈S3\lambda \mathbf{u} + \alpha \mathbf{w} \in S_3
  • Conclusion: This subset S3S_3 is closed under all operations and contains the origin. Therefore, it IS a perfectly valid subspace!

4. Geometric Perspective

Geometrically, a subspace is represented as an infinite flat shape passing directly through the origin of the coordinate space.

The 1D Subspace (Line)

A single non-zero vector v1\mathbf{v}_1 in a 3D coordinate space represents a line. By scaling v1\mathbf{v}_1 by all scalars λ\lambda from −∞-\infty to +∞+\infty, we trace out an infinitely long line. This line is a 1D subspace passing through the origin.

The 2D Subspace (Plane)

If we introduce a second vector v2\mathbf{v}_2 that is independent of v1\mathbf{v}_1, they can be combined to reach any point on a flat plane.

Here we see two vectors and their linear combination vector 0.4v1+1.2v20.4\mathbf{v}_1 + 1.2\mathbf{v}_2:

Two vectors in a 3D coordinate system
Two vectors in a 3D coordinate system

By taking all possible linear combinations of these two vectors, we span an entire two-dimensional plane passing through the origin. This represents a 2D subspace embedded inside a 3D surrounding space:

Spanned 2D plane subspace
Spanned 2D plane subspace

5. Subspaces vs. Ambient Space

It is crucial to distinguish between a subspace and the surrounding ambient space (also called the ambient dimensionality).

The Ambient Space is the full dimensional space in which our vectors are embedded. For example, if all vectors have three elements (x,y,zx, y, z), the ambient space is R3\mathbb{R}^3.

Inside an ambient 3D space (R3\mathbb{R}^3), there are exactly four possible dimensionalities for subspaces:

Subspace DimensionGeometric DescriptionNumber of Possibilities
0D SubspaceThe single point at the origin $[0, 0, 0]$Exactly 1
1D SubspaceAny infinite straight line passing through the originInfinite
2D SubspaceAny infinite flat plane passing through the originInfinite
3D SubspaceThe entire ambient 3D space R3\mathbb{R}^3 itselfExactly 1

Every single one of these subspaces intersects at the origin, because all subspaces must contain the zero vector.


6. Linear Independence and High-Dimensional Collapse

Simply having multiple vectors does not guarantee a high-dimensional subspace. The vectors must be linearly independent (meaning no vector can be expressed as a linear multiple of the others).

2D Collapse (Line instead of Plane)

Suppose we have two vectors: v1=[124],v2=[248]\mathbf{v}_1 = \begin{bmatrix} 1 \\ 2 \\ 4 \end{bmatrix}, \quad \mathbf{v}_2 = \begin{bmatrix} 2 \\ 4 \\ 8 \end{bmatrix}

Because v2=2v1\mathbf{v}_2 = 2\mathbf{v}_1, they lie on the exact same line. Taking all possible linear combinations of v1\mathbf{v}_1 and v2\mathbf{v}_2 will only yield that single line. Thus, despite having two vectors, we only get a 1D line subspace, not a 2D plane.

5D Generalization (R5\mathbb{R}^5)

This principle holds for any arbitrary dimension, such as an ambient 5D space (R5\mathbb{R}^5):

  • 0D: The zero vector $[0, 0, 0, 0, 0]$.
  • 1D: A single non-zero vector (spans a 5D line).
  • 2D: Two independent vectors (span a 5D plane).
  • 3D: Three independent vectors (span a 3D cube-like subspace).
  • Collapse: If we have three vectors but the third is a scaled multiple of the second, they collapse and only span a 2D plane subspace.

In high-dimensional contexts, mathematicians use the term Hyperplane to describe a high-dimensional subspace embedded inside an even higher-dimensional ambient space.


Key Takeaways

  • Subspace: A set of all vectors formed by the linear combinations of a starting set of vectors.
  • Closure Criteria: A subspace must be closed under vector addition and scalar multiplication (λu+αw∈V\lambda\mathbf{u} + \alpha\mathbf{w} \in V).
  • Zero Vector Rule: Every subspace must contain the origin (0∈V\mathbf{0} \in V).
  • Ambient Space: The parent coordinate space in which the subspace is embedded.
  • Linear Independence: Multiple vectors only increase subspace dimensionality if they are independent; dependent vectors collapse into lower-dimensional subspaces.