Linear AlgebraVector Spaces

Vector Spaces and Subspaces

A subspace contains 0 and is closed under addition and scaling.

Not started Jump to practice

Everything we have done with vectors in $\mathbb{R}^n$ used only a few rules: you can add, you can scale, and the usual algebra holds. Many other objects follow the same rules, so the same ideas apply to them. With the tools of short proofs and span, we can now say this precisely.

A vector space is a set $V$ with an addition and a scalar multiplication such that sums and multiples stay in $V$ and the familiar rules hold: $\mathbf{u} + \mathbf{v} = \mathbf{v} + \mathbf{u}$, $(\mathbf{u} + \mathbf{v}) + \mathbf{w} = \mathbf{u} + (\mathbf{v} + \mathbf{w})$, there is a zero vector with $\mathbf{u} + \mathbf{0} = \mathbf{u}$, each $\mathbf{u}$ has a negative, $c(\mathbf{u} + \mathbf{v}) = c\mathbf{u} + c\mathbf{v}$, $(c + d)\mathbf{u} = c\mathbf{u} + d\mathbf{u}$, $c(d\mathbf{u}) = (cd)\mathbf{u}$ and $1\mathbf{u} = \mathbf{u}$. Examples: $\mathbb{R}^n$; the polynomials $\mathbb{P}_n$ of degree at most $n$; all $m \times n$ matrices; all functions on an interval.

A subspace $H$ of $V$ is a subset that is a vector space on its own, using the same operations. Most of the rules are inherited, so only three things need checking:

  • (1) $\mathbf{0}$ is in $H$;
  • (2) $H$ is closed under addition: if $\mathbf{u}, \mathbf{v}$ are in $H$, so is $\mathbf{u} + \mathbf{v}$;
  • (3) $H$ is closed under scalar multiplication: if $\mathbf{u}$ is in $H$, so is $c\mathbf{u}$ for every $c$.

Key idea

A subspace contains $\mathbf{0}$ and is closed under addition and scaling. Every span is a subspace, and in $\mathbb{R}^3$ the subspaces are exactly: $\{\mathbf{0}\}$, lines through the origin, planes through the origin, and $\mathbb{R}^3$ itself.

Why it works

Why is a span always a subspace? $\mathbf{0} = 0\mathbf{v}_1 + \cdots + 0\mathbf{v}_p$ is in it. The sum of two combinations, $(a_1\mathbf{v}_1 + \cdots) + (b_1\mathbf{v}_1 + \cdots)$ $= (a_1 + b_1)\mathbf{v}_1 + \cdots$, is again a combination, and so is $c(a_1\mathbf{v}_1 + \cdots)$ $= (ca_1)\mathbf{v}_1 + \cdots$. Lines and planes that miss the origin fail test (1), so they are never subspaces.
The plane $x - 2y + z = 0$ is the span of $(2, 1, 0)$ and $(-1, 0, 1)$: a subspace. Every combination stays in the plane.

Worked example: A plane through the origin

Show that $H = \{(x, y, z) : x - 2y + z = 0\}$ is a subspace of $\mathbb{R}^3$.
  1. (1) $0 - 2(0) + 0 = 0$, so $\mathbf{0}$ is in $H$.
  2. (2) If $\mathbf{u}$ and $\mathbf{v}$ are in $H$, then $(u_1 + v_1) - 2(u_2 + v_2) + (u_3 + v_3)$ $= (u_1 - 2u_2 + u_3) + (v_1 - 2v_2 + v_3)$ $= 0 + 0$ $= 0$.
  3. (3) $cu_1 - 2(cu_2) + cu_3$ $= c(u_1 - 2u_2 + u_3)$ $= c \cdot 0$ $= 0$.
  4. All three hold. (Or: $H$ is the null space of $[\,1\ \ -2\ \ 1\,]$, as the next topic will show.)

Answer: Yes, a subspace.

Worked example: Two that fail

Are these subspaces of $\mathbb{R}^2$? (a) $\{(x, y) : x \geq 0\}$; (b) $\{(x, y) : y = x^{2}\}$.
  1. (a) Contains $\mathbf{0}$ and is closed under addition, but $(1, 0)$ is in it while $-1\cdot(1, 0) = (-1, 0)$ is not. Fails (3).
  2. (b) Contains $(0, 0)$. But $(1, 1)$ is in it and $(1, 1) + (1, 1) = (2, 2)$ is not, since $2 \neq 2^{2}$. Fails (2).

Answer: Neither is a subspace.

Worked example: Polynomials

Is $H = \{p \text{ in } \mathbb{P}_2 : p(2) = 0\}$ a subspace of $\mathbb{P}_2$?
  1. The zero polynomial has value $0$ at $2$.
  2. If $p(2) = 0$ and $q(2) = 0$, then $(p + q)(2) = 0 + 0 = 0$ and $(cp)(2) = c \cdot 0 = 0$.

Answer: Yes.

Common mistake

Skipping the zero-vector check, or stopping after it. A set like $\{(x, y, z) : x - 2y + z = 5\}$ looks just like the plane above, but $\mathbf{0}$ is not in it, so it is not a subspace. And passing the zero test is not enough either, as the parabola in (b) shows. Check all three conditions, and to say "no", give one specific failure.

Practice

Pass with 3 right answers, the last 2 in a row. Each right answer earns 2 XP.

Loading practice…

Builds on

Leads to

Sources and further reading

  • Lay, Lay and McDonald, Linear Algebra and Its Applications, §4.1 Vector Spaces and Subspaces
  • Margalit and Rabinoff, Interactive Linear Algebra (Georgia Tech), §2.6 Subspaces
@teddyrookbook GitHub