---
title: Vector Spaces and Subspaces
module: Vector Spaces
moduleNumber: 4
lessonNumber: 1
order: 401
summary: >
  A vector space is any set closed under addition and scalar multiplication that
  obeys ten algebraic axioms. The same axioms that govern arrows in the plane
  govern polynomials, functions, matrices, and infinite signals, so one theory
  covers them all. A subspace is a subset that is a vector space in its own
  right, tested by three conditions, and the span of any set of vectors is the
  smallest subspace containing them.
topics: [Vector Spaces]
draft: false
sources:
  - book: Lay
    ref: "Ch. 4 — Vector Spaces; §4.1 Vector Spaces and Subspaces"
---

Every algebraic fact proved for $\mathbb{R}^n$ in the earlier chapters rested on
a short list of properties: addition is commutative and associative, scalar
multiplication distributes over sums, there is a zero vector, and so on. Those
properties are not special to columns of numbers. Polynomials add and scale the
same way. So do real-valued functions, matrices of a fixed size, and infinite
sequences of measurements. A **vector space** is the abstraction that isolates
exactly those properties, so a theorem proved once from the axioms holds
simultaneously in all of these settings.[^lay-def]

## The axioms

> **Definition (Vector space).** A vector space is a nonempty set $V$ of objects,
> called _vectors_, together with two operations — addition and multiplication by
> real scalars — satisfying the following ten axioms for all $u, v, w$ in $V$ and
> all scalars $c, d$:
>
> 1. $u + v$ is in $V$ (closure under addition).
> 2. $u + v = v + u$.
> 3. $(u + v) + w = u + (v + w)$.
> 4. There is a zero vector $0$ in $V$ with $u + 0 = u$.
> 5. For each $u$ there is a $-u$ in $V$ with $u + (-u) = 0$.
> 6. $cu$ is in $V$ (closure under scalar multiplication).
> 7. $c(u + v) = cu + cv$.
> 8. $(c + d)u = cu + du$.
> 9. $c(du) = (cd)u$.
> 10. $1u = u$.

The scalars here are real numbers, so $V$ is a **real** vector space; the same
theory holds verbatim with complex scalars, which becomes relevant once
[complex eigenvalues](/linear-algebra/eigenvalues/complex-eigenvalues) appear.
The two closure axioms, 1 and 6, are the ones that fail most often when a
candidate set turns out not to be a vector space, and they are the first thing to
check.

From the axioms alone, three facts follow that are used constantly. For every $u$
in $V$ and every scalar $c$,

$$
0u = 0, \qquad c0 = 0, \qquad -u = (-1)u.
$$

The first two are statements about the _scalar_ zero and the _vector_ zero; the
third identifies the additive inverse promised by Axiom 5 with the scalar multiple
$(-1)u$, so subtraction never needs a separate definition.

## Examples across five settings

The following sets are all vector spaces under their natural operations, and none
is a column of numbers except the first.

- **Euclidean space $\mathbb{R}^n$.** The standard example. Geometric intuition
  built in $\mathbb{R}^2$ and $\mathbb{R}^3$ carries over to every space below.
- **The space $\mathbb{S}$ of signals.** Doubly infinite sequences
  $\{y_k\} = (\dots, y_{-1}, y_0, y_1, y_2, \dots)$, added and scaled term by term.
  A signal is a function defined on the integers, produced whenever a process is
  sampled at discrete times. These reappear in
  [difference equations](/linear-algebra/vector-spaces/difference-equations-and-markov).
- **Polynomials $\mathbb{P}_n$ of degree at most $n$.** All expressions
  $p(t) = a_0 + a_1 t + \cdots + a_n t^n$ with real coefficients. Sums and scalar
  multiples of such polynomials are again polynomials of degree at most $n$, and
  the zero polynomial is the zero vector.
- **Real-valued functions on a set $D$.** With $(f + g)(t) = f(t) + g(t)$ and
  $(cf)(t) = c\,f(t)$, the set of all functions $D \to \mathbb{R}$ is a vector
  space. The zero vector is the function identically zero.
- **Matrices $M_{m \times n}$.** All $m \times n$ real matrices, under
  entry-wise addition and scalar multiplication.

$$
% caption: The abstract axioms hold identically in each of these sets, so one
% theory of vectors covers arrows, sequences, polynomials, functions, and
% matrices at once.
\begin{tikzpicture}[font=\footnotesize]
\definecolor{acc}{HTML}{2F6DB5}
\draw[acc, thick, fill=acc!8] (-0.3,-2.7) rectangle (11.3,1.5);
\node[acc, anchor=north west, font=\small] at (-0.2,1.4) {vector spaces (ten axioms)};
\foreach \x/\lab/\ex in {0.55/{$\mathbb{R}^n$}/{columns}, 2.7/{$\mathbb{S}$}/{signals}, 4.85/{$\mathbb{P}_n$}/{polynomials}, 7.0/{funcs}/{$f$ on $D$}, 9.6/{$M_{mn}$}/{matrices}} {
  \draw[black, fill=white] (\x,-1.9) rectangle ++(1.7,2.3);
  \node[font=\small] at (\x+0.85,-0.4) {\lab};
  \node[black, font=\scriptsize] at (\x+0.85,-1.4) {\ex};
}
\end{tikzpicture}
$$

> **Definition (Degree).** The degree of a nonzero polynomial
> $p(t) = a_0 + \cdots + a_n t^n$ is the highest power of $t$ with a nonzero
> coefficient. The zero polynomial is included in $\mathbb{P}_n$ even though its
> degree is left undefined.

Once a set is known to be a vector space, every calculation done in $\mathbb{R}^n$
transfers to it unchanged. A function $f$ is then a single _point_ in the space of
functions, not a graph.

## Subspaces

Most vector spaces met in practice arise as a subset of a larger space — the
solutions of a system, the polynomials vanishing at a point, the symmetric
matrices. A subset that is itself a vector space under the inherited operations is
a **subspace**, and checking it requires only three of the ten axioms rather than
all ten.

> **Definition (Subspace).** A subspace of a vector space $V$ is a subset $H$ of
> $V$ with three properties:
> a. the zero vector of $V$ is in $H$;
> b. $H$ is closed under addition: $u, v$ in $H$ implies $u + v$ in $H$;
> c. $H$ is closed under scalar multiplication: $u$ in $H$ and $c$ a scalar imply
> $cu$ in $H$.

Properties (a), (b), (c) are Axioms 4, 1, and 6. The remaining axioms — 2, 3, and
7 through 10 — are automatic, because they are identities that already hold for
every element of $V$, including those that happen to lie in $H$. Axiom 5 follows
from (c) with $c = -1$, since $-u = (-1)u$. So the three conditions guarantee that
$H$ is a vector space. Every subspace is a vector space, and every vector space is
a subspace of itself; the word _subspace_ signals that a smaller space is being
viewed inside a larger one.

$$
% caption: A subspace $H$ is closed: adding two of its vectors or scaling one
% never produces a vector outside $H$, so all arrows stay in the shaded region.
\begin{tikzpicture}[>=stealth, font=\footnotesize, scale=1.0]
\definecolor{acc}{HTML}{2F6DB5}
\fill[acc!10] (-3,-1.2) -- (3.4,0.1) -- (3.4,2.1) -- (-3,0.8) -- cycle;
\draw[acc, thick] (-3,-1.2) -- (3.4,0.1) -- (3.4,2.1) -- (-3,0.8) -- cycle;
\node[acc, font=\small] at (-2.4,0.3) {$H$};
\coordinate (O) at (0,0);
\coordinate (u) at (1.7,0.5);
\coordinate (v) at (0.7,0.95);
\draw[->, black, thick] (O) -- (u) node[below right] {$u$};
\draw[->, black, thick] (O) -- (v) node[above left] {$v$};
\draw[->, acc, thick] (O) -- ($(u)+(v)$);
\node[acc, anchor=south west] at ($(u)+(v)$) {$u+v$};
\draw[black, dashed] (u) -- ($(u)+(v)$);
\draw[black, dashed] (v) -- ($(u)+(v)$);
\fill[black] (O) circle (1.6pt);
\node[anchor=north east] at (-0.05,0.02) {$0$};
\end{tikzpicture}
$$

Two small subspaces exist inside every vector space $V$: the **zero subspace**
$\{0\}$, containing only the zero vector, and $V$ itself. For polynomials,
$\mathbb{P}_n$ is a subspace of $\mathbb{P}$, the space of all polynomials, which
in turn is a subspace of the space of all functions on $\mathbb{R}$.

### When closure fails

A subset can contain the zero vector and still fail to be a subspace, because
closure is a condition about _all_ sums or _all_ scalar multiples. A single
counterexample settles the matter.

- **A line not through the origin** in $\mathbb{R}^2$ misses $0$ outright, so it
  is not a subspace. The same holds for any plane in $\mathbb{R}^3$ that avoids
  the origin.
- **$\mathbb{R}^2$ is not a subspace of $\mathbb{R}^3$.** Its vectors have two
  entries, not three, so it is not even a subset of $\mathbb{R}^3$. The set of
  $(s, t, 0)$ with $s, t$ real is a genuine subspace that behaves like
  $\mathbb{R}^2$ but is logically distinct from it.
- **The first quadrant** $\{(x, y) : x \ge 0, y \ge 0\}$ contains $0$ and is
  closed under addition, but scaling by $c = -1$ sends the vector $(1, 1)$ to
  $(-1, -1)$, which leaves the quadrant. Closure under scalar multiplication
  fails.

$$
% caption: The first quadrant contains $0$ and survives addition, but scaling a
% vector by a negative number escapes it, so closure under scalar multiplication
% fails and the quadrant is not a subspace.
\begin{tikzpicture}[>=stealth, font=\footnotesize]
\definecolor{acc}{HTML}{2F6DB5}
\definecolor{red}{HTML}{B23A48}
\fill[acc!10] (0,0) rectangle (2.3,2.1);
\draw[->, black] (-2.4,0) -- (2.5,0) node[right] {$x$};
\draw[->, black] (0,-2.3) -- (0,2.3) node[above] {$y$};
\node[acc, font=\small] at (1.7,1.7) {$V$};
\coordinate (u) at (1.0,0.9);
\draw[->, black, thick] (0,0) -- (u) node[right] {$u$};
\draw[->, red, thick] (0,0) -- (-1.0,-0.9) node[left] {(-1)$u$};
\fill[black] (0,0) circle (1.4pt);
\end{tikzpicture}
$$

## Spans are subspaces

The most common way to describe a subspace is as the set of all linear
combinations of a fixed collection of vectors. Recall that $\operatorname{Span}\{v_1,
\dots, v_p\}$ is the set of every vector $c_1 v_1 + \cdots + c_p v_p$. This set
is always a subspace.

> **Theorem (Span is a subspace).** If $v_1, \dots, v_p$ are in a vector space
> $V$, then $\operatorname{Span}\{v_1, \dots, v_p\}$ is a subspace of $V$.

The proof checks the three conditions. The zero vector equals $0v_1 + \cdots +
0v_p$, so it lies in the span. If $u = s_1 v_1 + \cdots + s_p v_p$ and $w = t_1 v_1 +
\cdots + t_p v_p$ are two linear combinations, then

$$
u + w = (s_1 + t_1)v_1 + \cdots + (s_p + t_p)v_p
$$

is again a linear combination, and for any scalar $c$,

$$
cu = (cs_1)v_1 + \cdots + (cs_p)v_p
$$

is one as well. All three conditions hold. The subspace $\operatorname{Span}\{v_1,
\dots, v_p\}$ is called the subspace **spanned** (or **generated**) by the set,
and a set whose span is $H$ is a **spanning set** for $H$.

Membership of a specific vector in a span is a consistency question.

> **Worked example.** For which value of $h$ is $y = (-4, 3, h)$ in
> $\operatorname{Span}\{v_1, v_2, v_3\}$, where $v_1 = (1, -1, -2)$,
> $v_2 = (5, -4, -7)$, and $v_3 = (-3, 1, 0)$?
>
> Membership means $c_1 v_1 + c_2 v_2 + c_3 v_3 = y$ has a solution. Row reduce the
> augmented matrix $[\,v_1 \;\; v_2 \;\; v_3 \;\; y\,]$:
> $$
> \left[\begin{array}{ccc|c} 1 & 5 & -3 & -4 \\ -1 & -4 & 1 & 3 \\ -2 & -7 & 0 & h \end{array}\right]
> \sim
> \left[\begin{array}{ccc|c} 1 & 5 & -3 & -4 \\ 0 & 1 & -2 & -1 \\ 0 & 3 & -6 & h - 8 \end{array}\right]
> \sim
> \left[\begin{array}{ccc|c} 1 & 5 & -3 & -4 \\ 0 & 1 & -2 & -1 \\ 0 & 0 & 0 & h - 5 \end{array}\right].
> $$
>
> The last row reads $0 = h - 5$. The system is consistent, so $y$ lies in the
> span, exactly when $h = 5$.

$$
% caption: One nonzero vector spans a line through the origin; two vectors that
% are not multiples span a plane through the origin. In $\mathbb{R}^3$, these and
% $\{0\}$ and $\mathbb{R}^3$ itself are the only subspaces.
\begin{tikzpicture}[>=stealth, font=\footnotesize]
\definecolor{acc}{HTML}{2F6DB5}
% line span
\begin{scope}[xshift=0cm]
  \draw[acc, thick] (-1.6,-1.1) -- (1.6,1.1);
  \draw[->, black, thick] (0,0) -- (0.9,0.62);
  \node[black] at (1.25,0.3) {$v$};
  \fill[black] (0,0) circle (1.4pt);
  \node[font=\small] at (0,-1.8) {$\operatorname{Span}(v)$: a line};
\end{scope}
% plane span
\begin{scope}[xshift=6cm]
  \fill[acc!10] (-1.7,-0.9) -- (1.7,-0.2) -- (1.7,1.4) -- (-1.7,0.7) -- cycle;
  \draw[acc, thick] (-1.7,-0.9) -- (1.7,-0.2) -- (1.7,1.4) -- (-1.7,0.7) -- cycle;
  \draw[->, black, thick] (0,0) -- (1.1,0.15) node[below] {$v_1$};
  \draw[->, black, thick] (0,0) -- (0.3,0.75) node[above left] {$v_2$};
  \fill[black] (0,0) circle (1.4pt);
  \node[font=\small] at (0,-1.8) {$\operatorname{Span}(v_1$, $v_2)$: a plane};
\end{scope}
\end{tikzpicture}
$$

Every nonzero subspace of $\mathbb{R}^3$ other than $\mathbb{R}^3$ itself is
either a line through the origin, $\operatorname{Span}\{v\}$ for a nonzero $v$, or
a plane through the origin, $\operatorname{Span}\{v_1, v_2\}$ for two vectors that
are not multiples. This classification, proved once
[dimension](/linear-algebra/vector-spaces/dimension-and-rank) is available, is
worth keeping in mind even for abstract spaces.

### Reading a subspace as a span

A subset written with free parameters is recognized as a span by pulling the
parameters out as coefficients.

> **Worked example.** The set $H$ of all vectors $(a - 3b,\; b - a,\; a,\; b)$ with
> $a, b$ real is a subspace of $\mathbb{R}^4$.
>
> Write a general element as a column and split it into its $a$-part and $b$-part:
> $$
> \begin{bmatrix} a - 3b \\ b - a \\ a \\ b \end{bmatrix}
> = a\begin{bmatrix} 1 \\ -1 \\ 1 \\ 0 \end{bmatrix}
> + b\begin{bmatrix} -3 \\ 1 \\ 0 \\ 1 \end{bmatrix}
> = a v_1 + b v_2.
> $$
>
> Every element of $H$ is a linear combination of $v_1$ and $v_2$, so
> $H = \operatorname{Span}\{v_1, v_2\}$ and $H$ is a subspace of $\mathbb{R}^4$ by
> the span-subspace theorem.

Reading the free parameters off as coefficients and collecting their vectors is the
same procedure that produces a spanning set for the
[null space of a matrix](/linear-algebra/vector-spaces/null-and-column-spaces).

The subspace test also applies where no coordinates are available, directly on the
defining property.

> **Worked example.** The set $S$ of symmetric $3 \times 3$ matrices — those with
> $A^\top = A$ — is a subspace of $M_{3 \times 3}$.
>
> Check the three conditions. The zero matrix satisfies $0^\top = 0$, so it is
> symmetric. If $A^\top = A$ and $B^\top = B$, then
> $$
> (A + B)^\top = A^\top + B^\top = A + B,
> $$
> so the sum is symmetric. For any scalar $c$, $(cA)^\top = cA^\top = cA$, so scalar
> multiples are symmetric. All three conditions hold, so $S$ is a subspace.

[^lay-def]: **Lay**, _Linear Algebra and Its Applications_, §4.1 — Vector Spaces and Subspaces: the ten axioms, the subspace test, Theorem 1 on spans, and the examples $\mathbb{R}^n$, $\mathbb{S}$, $\mathbb{P}_n$, function spaces, and $M_{m \times n}$.
