Home / Articles / Linear Algebra
Linear Algebra · 4 min read

Vector Spaces and Subspaces Explained

Understand vector spaces and subspaces in linear algebra, learn the three-step subspace test, and see fully worked examples of sets that pass and fail.

Vector spaces are the stage on which all of linear algebra happens. The definition can look abstract at first, but the idea is simple: a vector space is any collection of objects you can add together and scale by numbers without ever leaving the collection. Once that clicks, subspaces, span, basis and dimension all follow naturally.

What Is a Vector Space?

A vector space \( V \) over the real numbers is a set of objects, called vectors, with two operations:

  • Vector addition: for \( \mathbf{u}, \mathbf{v} \in V \), the sum \( \mathbf{u} + \mathbf{v} \) is in \( V \).
  • Scalar multiplication: for a real number \( c \) and \( \mathbf{v} \in V \), the product \( c\mathbf{v} \) is in \( V \).

These operations must obey the familiar rules (axioms), including:

  1. \( \mathbf{u} + \mathbf{v} = \mathbf{v} + \mathbf{u} \) (commutativity)
  2. \( (\mathbf{u} + \mathbf{v}) + \mathbf{w} = \mathbf{u} + (\mathbf{v} + \mathbf{w}) \) (associativity)
  3. There is a zero vector \( \mathbf{0} \) with \( \mathbf{v} + \mathbf{0} = \mathbf{v} \)
  4. Every \( \mathbf{v} \) has a negative \( -\mathbf{v} \) with \( \mathbf{v} + (-\mathbf{v}) = \mathbf{0} \)
  5. \( c(\mathbf{u} + \mathbf{v}) = c\mathbf{u} + c\mathbf{v} \) and \( (c + d)\mathbf{v} = c\mathbf{v} + d\mathbf{v} \)
  6. \( c(d\mathbf{v}) = (cd)\mathbf{v} \) and \( 1\mathbf{v} = \mathbf{v} \)

Examples of Vector Spaces

The word "vector" means much more than an arrow:

  • \( \mathbb{R}^n \), lists of \( n \) real numbers, such as \( (2, -1, 5) \) in \( \mathbb{R}^3 \).
  • \( P_n \), all polynomials of degree at most \( n \). Adding two quadratics gives a polynomial of degree at most 2.
  • \( M_{m\times n} \), all \( m \times n \) matrices.
  • All continuous functions on an interval. The solutions of the ODE \( y'' + y = 0 \) also form a vector space.

What Is a Subspace?

A subspace is a subset \( W \) of a vector space \( V \) that is itself a vector space using the same operations. Luckily, you do not need to check all the axioms again. Most are inherited automatically from \( V \).

The Subspace Test

A subset \( W \) of \( V \) is a subspace if and only if:

  1. Contains zero: \( \mathbf{0} \in W \).
  2. Closed under addition: if \( \mathbf{u}, \mathbf{v} \in W \), then \( \mathbf{u} + \mathbf{v} \in W \).
  3. Closed under scalar multiplication: if \( \mathbf{v} \in W \) and \( c \in \mathbb{R} \), then \( c\mathbf{v} \in W \).

Geometrically, the subspaces of \( \mathbb{R}^3 \) are: the origin alone, lines through the origin, planes through the origin, and \( \mathbb{R}^3 \) itself.

Worked Example 1: A Plane That Is a Subspace

Show that \( W = \{(x, y, z) \in \mathbb{R}^3 : x + 2y - z = 0\} \) is a subspace of \( \mathbb{R}^3 \).

Step 1: Zero vector. For \( (0, 0, 0) \): \( 0 + 0 - 0 = 0 \). So \( \mathbf{0} \in W \).

Step 2: Closure under addition. Let \( \mathbf{u} = (x_1, y_1, z_1) \) and \( \mathbf{v} = (x_2, y_2, z_2) \) be in \( W \), so

$$ x_1 + 2y_1 - z_1 = 0 \quad\text{and}\quad x_2 + 2y_2 - z_2 = 0. $$

Their sum is \( (x_1 + x_2, \ y_1 + y_2, \ z_1 + z_2) \). Check the condition:

$$ (x_1 + x_2) + 2(y_1 + y_2) - (z_1 + z_2) = (x_1 + 2y_1 - z_1) + (x_2 + 2y_2 - z_2) = 0 + 0 = 0. $$

So \( \mathbf{u} + \mathbf{v} \in W \).

Step 3: Closure under scalar multiplication. For \( c \in \mathbb{R} \), \( c\mathbf{u} = (cx_1, cy_1, cz_1) \):

$$ cx_1 + 2cy_1 - cz_1 = c(x_1 + 2y_1 - z_1) = c(0) = 0. $$

So \( c\mathbf{u} \in W \).

Conclusion: \( W \) is a subspace. It is a plane through the origin.

Worked Example 2: Sets That Fail

(a) \( A = \{(x, y) \in \mathbb{R}^2 : y = x + 1\} \).

Test the zero vector: \( 0 = 0 + 1 \) is false. Since \( (0, 0) \notin A \), \( A \) is not a subspace. It is a line that misses the origin.

(b) \( B = \{(x, y) \in \mathbb{R}^2 : xy \geq 0\} \), the first and third quadrants including the axes.

  • Zero vector: \( 0 \cdot 0 = 0 \geq 0 \). Passes.
  • Scalar multiplication: \( (cx)(cy) = c^2xy \geq 0 \). Passes.
  • Addition: take \( (1, 0) \) and \( (0, -1) \). Both are in \( B \), since each product is 0. But their sum is \( (1, -1) \), and \( (1)(-1) = -1 < 0 \). Fails.

So \( B \) is not a subspace. One counterexample is enough to prove failure.

Worked Example 3: Span and Membership

The span of vectors is the set of all their linear combinations, and it is always a subspace. Is \( (3, 5) \) in the span of \( \mathbf{v}_1 = (1, 1) \) and \( \mathbf{v}_2 = (1, 2) \)?

We need \( a(1, 1) + b(1, 2) = (3, 5) \), which gives

$$ a + b = 3, \qquad a + 2b = 5. $$

Subtracting gives \( b = 2 \), and then \( a = 1 \). Check: \( 1(1, 1) + 2(1, 2) = (3, 5) \). Yes, it is in the span. In fact these two vectors span all of \( \mathbb{R}^2 \), and since they are linearly independent, they form a basis, so \( \dim \mathbb{R}^2 = 2 \).

Tips

  • Check the zero vector first. It is the fastest way to rule a set out.
  • Conditions that are linear and equal to zero (like \( x + 2y - z = 0 \)) usually give subspaces.
  • Conditions involving constants (\( = 1 \)), products, squares or inequalities usually fail. Find a specific counterexample.
  • To prove a subspace, use general vectors; to disprove it, use specific numbers.

Key Takeaways

  • A vector space is a set closed under addition and scalar multiplication that satisfies the standard axioms.
  • Vectors can be lists of numbers, polynomials, matrices or functions.
  • A subspace must contain zero and be closed under both operations.
  • One counterexample is enough to show a set is not a subspace.
  • The span of any set of vectors is always a subspace.

Working on a linear algebra assignment or proof you can't crack? Contact Amathify on WhatsApp or through the "Ask a Question" form for step-by-step solutions from our experts and PhD scholars.

Stuck on a problem or assignment?

Our experts and PhD scholars solve maths, physics and chemistry — step by step.

WhatsApp usAsk a question

Related articles