Home›Courses›Linear Algebra›Week 4 · Lecture 14
← Lecture 13
On this pageMotivation·Recall·Subspace Defined·First Examples·Lines & Planes·Null & Image·Not Subspaces·Spanning: Why·Linear Combinations·Span Defined·Span Examples·Theorem 5.1.1·More Examples·Exercises
Lecture 15 →
MATH-120 · Linear Algebra · Lecture 142 July 2026

Subspaces and Spanning

The first step into vector spaces: which subsets of ℝⁿ are self-contained worlds of their own, and how a handful of vectors can build an entire space

§1A Story Before We Begin

Imagine you run a delivery company in a flat city. Every route your trucks can take is some combination of "go east" and "go north." You never need a third instruction — from those two moves you can reach any address in town. Those two directions span the whole city.

Now suppose one truck is stuck on a single straight highway. No matter how it drives — forward, backward, fast, slow — it stays on that one line. The set of places it can reach is smaller than the whole city, but it is still self-contained: combine any two reachable points and you land on another reachable point. That smaller self-contained world is a subspace.

🌍
Where this really matters
This is not just a story. When Google compresses an image, it keeps only the few "directions" in the data that carry most of the picture and throws away the rest — it replaces a huge space with a small subspace that is almost as good. When engineers model the vibrations of a bridge, each natural mode of shaking is one direction in a space of motions. Signal processing, machine learning, quantum states, error-correcting codes on your phone — all of them work by asking: which subspace does my data live in, and what small set of vectors spans it? Those two questions — subspace and span — are the whole of today's lecture.
📜
A bit of history
The word "vector" comes from the Latin for "carrier." The idea of adding arrows was used by physicists (forces, velocities) long before anyone made it abstract. It was Giuseppe Peano in 1888 who first wrote down the modern axioms — the exact rules a set must obey to be a "space of vectors." For decades almost no one read his work. Today those axioms are the foundation of a huge part of mathematics. We are taking the first step into that world now.

§2Quick Recall & A Word on Where We Are

You already know $\mathbb{R}^n$: the set of all lists of $n$ real numbers, which we call vectors. You can add two of them and scale one by a number, and the result is again in $\mathbb{R}^n$. From Lecture 1 you also know a homogeneous system $A\mathbf{x} = \mathbf{0}$ and its solutions.

🧭
Honest framing: what this lecture is (and isn't)
Today we study $\textbf{subspaces of } \mathbb{R}^n$ (Nicholson §5.1). This is a preview of a larger idea. Later you will meet the full definition of an abstract "vector space," where the vectors need not be lists of numbers at all — they can be polynomials, functions, or matrices. For now we keep both feet inside the familiar $\mathbb{R}^n$, so every example is concrete. Keep in the back of your mind: the three rules below are the seed of that bigger theory.

§3What Is a Subspace?

A subspace is a subset of $\mathbb{R}^n$ that is a self-contained world: you cannot escape it by adding its vectors or scaling them. Three simple rules capture exactly this.

Subspace of ℝⁿ

A set $U$ of vectors in $\mathbb{R}^n$ is called a subspace of $\mathbb{R}^n$ if it satisfies all three:

$\textbf{S1.}$ The zero vector $\mathbf{0}$ is in $U$.

$\textbf{S2.}$ If $\mathbf{x}$ and $\mathbf{y}$ are in $U$, then $\mathbf{x} + \mathbf{y}$ is in $U$.

$\textbf{S3.}$ If $\mathbf{x}$ is in $U$, then $a\mathbf{x}$ is in $U$ for every real number $a$.

We say $U$ is closed under addition when S2 holds, and closed under scalar multiplication when S3 holds. "Closed" is the key word: you stay inside $U$ no matter what you do.

⚡
A fast shortcut for S1
If S3 holds, you can scale any vector $\mathbf{x}$ in $U$ by $a = 0$ to get $\mathbf{0}$. So if $U$ is non-empty and closed under scalar multiplication, it automatically contains $\mathbf{0}$. The usual quick test is: first check that $\mathbf{0}$ is in $U$ (it rules out most impostors instantly), then check S2 and S3.

§4The Two "Free" Subspaces

Every $\mathbb{R}^n$ comes with two subspaces you get for free, sitting at the two extremes of size.

Example 1The whole space and the zero space

$\textbf{(a) } \mathbb{R}^n$ itself is a subspace of $\mathbb{R}^n$. It obviously contains $\mathbf{0}$, and adding or scaling vectors in $\mathbb{R}^n$ lands you back in $\mathbb{R}^n$. All three axioms hold trivially.

$\textbf{(b) } U = \{\mathbf{0}\}$, the set containing only the zero vector, is a subspace. Check: $\mathbf{0}$ is in it (S1); $\mathbf{0} + \mathbf{0} = \mathbf{0}$ stays in it (S2); $a\mathbf{0} = \mathbf{0}$ stays in it (S3). This is the smallest possible subspace.

These two — the whole space and the zero space — are called the improper subspaces (some texts say "trivial"). Any other subspace, sitting strictly between them in size, is called a proper subspace. The interesting geometry lives in the proper ones.

§5Lines and Planes Through the Origin

The proper subspaces of $\mathbb{R}^3$ turn out to be exactly the lines and planes that pass through the origin. The "through the origin" part is not optional — it is what makes S1 work. Let us prove it for a plane.

★ 2A plane through the origin is a subspace

Let $U = \{ (x, y, z) : ax + by + cz = 0 \}$ be the set of points on a plane through the origin in $\mathbb{R}^3$ (here $a, b, c$ are fixed numbers, not all zero). Show $U$ is a subspace.

Play with the four cases below. Watch how "through the origin" is exactly the dividing line between a subspace and an impostor.

🎛 Is It a Subspace?
U = { (t, 2t) : t ∈ ℝ }
✓ Subspace
Passes through 0, and adding or scaling any point keeps you on the line. All three axioms hold.
White dot = origin is inside U · red ring = origin is outside U.

§6Two Subspaces Every Matrix Carries

Every matrix quietly creates two subspaces. They are among the most useful objects in all of linear algebra.

Null space and image

Let $A$ be an $m \times n$ matrix.

• The null space is $\operatorname{null} A = \{\mathbf{x} \text{ in } \mathbb{R}^n : A\mathbf{x} = \mathbf{0}\}$ — all the inputs that $A$ crushes to zero.

• The image is $\operatorname{im} A = \{A\mathbf{x} : \mathbf{x} \text{ in } \mathbb{R}^n\}$ — all the outputs $A$ can produce.

★ 3Null space is a subspace of ℝⁿ

Show that for an $m \times n$ matrix $A$, $\operatorname{null} A$ is a subspace of $\mathbb{R}^n$.

🔑
Why you should care
The null space answers "what does this matrix destroy?" and the image answers "what can this matrix produce?" Together they tell you everything about how a matrix transforms space. You met $\operatorname{null} A$ already — it is just the solution set of $A\mathbf{x} = \mathbf{0}$ from Lecture 1. Now you know that solution set has a shape: it is always a subspace.

§7Impostors: Sets That Are NOT Subspaces

Do not fall into thinking every subset of $\mathbb{R}^n$ is a subspace. Most are not. To disprove a subspace claim, you only need one axiom to fail — and one specific counterexample is enough.

Example 4Two sets that fail

$\textbf{Impostor 1: } U_1 = \{ (x, y) \text{ in } \mathbb{R}^2 : x \geq 0 \}$ — the right half-plane.

This one contains $\mathbf{0}$ and is closed under addition (two points with $x \geq 0$ add to a point with $x \geq 0$). But S3 fails. Take the point $(1, 0)$, which is in $U_1$, and scale by $a = -1$:

$$(-1)\cdot(1, 0) = (-1, 0), \quad \text{which has } x = -1 < 0.$$

So $(-1, 0)$ is not in $U_1$. Scaling knocked us out of the set. Not a subspace.

$\textbf{Impostor 2: } U_2 = \{ (x, y) \text{ in } \mathbb{R}^2 : x^2 = y^2 \}$.

This set is the two diagonal lines $y = x$ and $y = -x$. It contains $\mathbf{0}$ and is closed under scaling (if $x^2 = y^2$ then $(ax)^2 = (ay)^2$). But S2 fails. Both $(1, 1)$ and $(1, -1)$ are in $U_2$ (each satisfies $x^2 = y^2$). Add them:

$$(1, 1) + (1, -1) = (2, 0), \quad \text{but } 2^2 = 4 \neq 0 = 0^2.$$

So $(2, 0)$ is not in $U_2$. Adding two members left the set. Not a subspace. Lesson: a set built from a non-linear condition (an inequality, a square, a product) almost always fails one of the closure rules.

§8Part B — Spanning: Building a Space From a Few Vectors

Subspaces can be infinite — a plane has infinitely many points. It would be hopeless to list them all. The magic of spanning is that you can describe an entire infinite subspace with just a handful of vectors, plus one instruction: "take all combinations of these."

🎨
An everyday version
Think of mixing paint. From just three tubes — red, green, blue — you can mix every colour a screen can show. Those three colours span the space of all screen colours. You do not need a separate tube for orange or teal; they are combinations. Spanning is exactly this: a small "starter kit" of vectors from which everything else is built by mixing.

§9Linear Combinations

Linear combination

A linear combination of vectors $\mathbf{v}_1, \mathbf{v}_2, \ldots, \mathbf{v}_k$ is any vector of the form $$a_1\mathbf{v}_1 + a_2\mathbf{v}_2 + \cdots + a_k\mathbf{v}_k,$$ where the numbers $a_1, a_2, \ldots, a_k$ are called the coefficients. You scale each vector by a number and add the results.

Example 5A concrete linear combination

Let $\mathbf{v}_1 = (1, 0)$ and $\mathbf{v}_2 = (0, 1)$ in $\mathbb{R}^2$. Then

$$3\mathbf{v}_1 + 5\mathbf{v}_2 = 3(1,0) + 5(0,1) = (3, 0) + (0, 5) = (3, 5).$$

So $(3, 5)$ is a linear combination of $\mathbf{v}_1$ and $\mathbf{v}_2$ with coefficients $3$ and $5$. In fact every vector $(x, y)$ in $\mathbb{R}^2$ is $x\mathbf{v}_1 + y\mathbf{v}_2$ — these two build the whole plane.

§10The Span of a Set of Vectors

Span

The span of vectors $\mathbf{v}_1, \mathbf{v}_2, \ldots, \mathbf{v}_k$ is the set of all their linear combinations: $$\operatorname{span}\{\mathbf{v}_1, \ldots, \mathbf{v}_k\} = \{\, a_1\mathbf{v}_1 + a_2\mathbf{v}_2 + \cdots + a_k\mathbf{v}_k \;:\; a_1, \ldots, a_k \text{ in } \mathbb{R} \,\}.$$ If $U = \operatorname{span}\{\mathbf{v}_1, \ldots, \mathbf{v}_k\}$, we say the vectors span $U$, or that $U$ is spanned by them, and we call $\{\mathbf{v}_1, \ldots, \mathbf{v}_k\}$ a spanning set for $U$.

In words: the span is everything you can reach by mixing the given vectors with every possible choice of coefficients. Let us see what different numbers of vectors produce.

• One nonzero vector $\mathbf{v}$: $\operatorname{span}\{\mathbf{v}\} = \{t\mathbf{v}\}$ is a line through the origin.

• Two vectors in different directions: their span is a plane through the origin.

• Three independent vectors in $\mathbb{R}^3$: their span is $\textbf{all of } \mathbb{R}^3$.

Watch this happen live — go from zero, to one, to two vectors and see the span grow from a point to a line to a plane:

🎛 What Does a Span Look Like?
span{ v } = a line through the origin
All scalar multiples t·v trace out a line. One vector spans a 1-dimensional subspace.
The span always contains 0 and is always closed — that is why every span is automatically a subspace (Theorem 5.1.1).

§11Testing Membership: Is a Vector in the Span?

The core skill is answering: "is a given vector $\mathbf{p}$ in $\operatorname{span}\{\ldots\}$?" This is just asking whether $\mathbf{p}$ can be written as a linear combination — which turns into solving a linear system.

★ 6Example 5.1.4 — membership in a span

Let $\mathbf{x} = (2, -1, 2, 1)$ and $\mathbf{y} = (3, 4, -1, 1)$ in $\mathbb{R}^4$. Determine whether $\mathbf{p} = (0, -11, 8, 1)$ or $\mathbf{q} = (2, 3, 1, 2)$ lies in $U = \operatorname{span}\{\mathbf{x}, \mathbf{y}\}$.

§12Theorem 5.1.1 — Every Span Is a Subspace

The two big ideas of today — subspace and span — are secretly the same idea. This theorem is the bridge.

Theorem 5.1.1

Let $U = \operatorname{span}\{\mathbf{x}_1, \mathbf{x}_2, \ldots, \mathbf{x}_k\}$ in $\mathbb{R}^n$. Then:

$\textbf{1.}$ $U$ is a subspace of $\mathbb{R}^n$ containing each $\mathbf{x}_i$.

$\textbf{2.}$ If $W$ is any subspace that contains each $\mathbf{x}_i$, then $U \subseteq W$.

🧠
What this theorem is really saying
$\textbf{Part 1}$ says spans come for free as subspaces. You never have to check the three axioms for a span — it is automatically a subspace, and it contains the very vectors you built it from. (Makes sense: $\mathbf{x}_1 = 1\mathbf{x}_1 + 0\mathbf{x}_2 + \cdots$ is itself a linear combination.)
🎯
Part 2 in plain words: the span is the SMALLEST subspace
Part 2 says $U$ is the smallest subspace containing your vectors. Any subspace $W$ that holds $\mathbf{x}_1, \ldots, \mathbf{x}_k$ is forced (by closure) to also hold all their combinations — which is exactly $U$. So $U$ fits inside every such $W$. Picture it: you drop a few vectors into space, and the span is the tightest subspace that wraps around them with no room to spare. Give it two independent vectors in $\mathbb{R}^3$ and the smallest subspace containing them is the plane they span — nothing smaller works, and you do not get the whole of $\mathbb{R}^3$ either.

We will not prove this formally, but you already have the pieces: Part 1 is just checking S1, S2, S3 for combinations (each holds because a combination of combinations is still a combination), and Part 2 is the closure argument in the box above.

§13Four Classic Spanning Facts

★ 7Example 5.1.5 — two spanning sets can describe the same subspace

If $\mathbf{x}$ and $\mathbf{y}$ are in $\mathbb{R}^n$, show that $\operatorname{span}\{\mathbf{x}, \mathbf{y}\} = \operatorname{span}\{\mathbf{x} + \mathbf{y}, \mathbf{x} - \mathbf{y}\}$.

Example 8Example 5.1.6 — the standard vectors span ℝⁿ

Show that $\mathbb{R}^n = \operatorname{span}\{\mathbf{e}_1, \mathbf{e}_2, \ldots, \mathbf{e}_n\}$, where $\mathbf{e}_1, \ldots, \mathbf{e}_n$ are the columns of the identity matrix $I_n$.

Example 9Example 5.1.7 — the null space as a span

For an $m \times n$ matrix $A$, let $\mathbf{x}_1, \ldots, \mathbf{x}_k$ be the basic solutions of $A\mathbf{x} = \mathbf{0}$ produced by the Gaussian algorithm. Then $\operatorname{null} A = \operatorname{span}\{\mathbf{x}_1, \ldots, \mathbf{x}_k\}$.

Example 10Example 5.1.8 — the image as the span of the columns

Let $\mathbf{c}_1, \mathbf{c}_2, \ldots, \mathbf{c}_n$ be the columns of an $m \times n$ matrix $A$. Then $\operatorname{im} A = \operatorname{span}\{\mathbf{c}_1, \mathbf{c}_2, \ldots, \mathbf{c}_n\}$.

🔗
The big picture
Look at what just happened: the null space and the image — two subspaces that seemed abstract — both turned out to be spans of concrete, computable vectors. Spanning is not a side topic; it is how every subspace in this course gets described. Whenever someone hands you a subspace, your first question should be: what spans it?

§14Exercises

Instructive problems are solved in full. Where several are the same type, one is worked and the rest carry hints. The proof problems are worth your time — do not just read the solution, try them first.

Exercise 5.1.1Which sets U are subspaces of ℝ³? [SOLVED — with the reasoning]

For each set, we check the axioms. Remember: one failing axiom (with a counterexample) is enough to disqualify.

Exercise 5.1.2Is x in span{y, z}? If so, write it as a combination [ONE SOLVED, REST HINTED]

$\textbf{(a)}$ $\mathbf{x} = (2, -1, 0, 1)$, $\mathbf{y} = (1, 0, 0, 1)$, $\mathbf{z} = (0, 1, 0, 1)$.

$\textbf{(b)}$ $\mathbf{x} = (1, 2, 15, 11)$, $\mathbf{y} = (2, -1, 0, 2)$, $\mathbf{z} = (1, -1, -3, 1)$. $\quad\textbf{(c)}$ $\mathbf{x} = (8, 3, -13, 20)$, $\mathbf{y} = (2, 1, -3, 5)$, $\mathbf{z} = (-1, 0, 2, -3)$. $\quad\textbf{(d)}$ $\mathbf{x} = (2, 5, 8, 3)$, $\mathbf{y} = (2, -1, 0, 5)$, $\mathbf{z} = (-1, 2, 2, -3)$.

🧭
Hints for (b), (c), (d)
Same method as (a): set up $a\mathbf{y} + b\mathbf{z} = \mathbf{x}$, solve two coordinates for $a, b$, then check the other two. Results to check yourself: (d) works, giving $\mathbf{x} = 3\mathbf{y} + 4\mathbf{z}$. But (b) and (c) fail — in each, the first three coordinates are consistent but the fourth coordinate does not match, so the vector is not in the span. This is exactly the trap from Example 6: always verify every coordinate.
Exercise 5.1.3Do the given vectors span ℝ⁴? [HINT ONLY]

$\textbf{(a)}$ $\{(1,1,1,1),(0,1,1,1),(0,0,1,1),(0,0,0,1)\}$. $\quad\textbf{(b)}$ $\{(1,3,-5,0),(-2,1,0,0),(0,2,1,-1),(1,-4,5,0)\}$.

🧭
Hint
Four vectors span $\mathbb{R}^4$ exactly when the $4\times4$ matrix with them as columns is invertible — equivalently, has non-zero determinant, equivalently, has rank $4$. Build the matrix and row-reduce. One of these two sets spans $\mathbb{R}^4$ and the other does not: (a) reduces to full rank (it is triangular with non-zero diagonal — spans), while (b) collapses to rank $3$ (the vectors are dependent — does not span). Compute and confirm which is which.
Exercise 5.1.4Can {(1,2,0),(2,0,3)} span U = {(r, s, 0) : r, s ∈ ℝ}? [SOLVED — subtle]
Exercise 5.1.5 / 5.1.6Spanning set for {0}; and is ℝ² a subspace of ℝ³? [HINTS — think first]
🧭
Hints
$\textbf{5.1.5:}$ what is the smallest possible spanning set for the zero subspace $\{\mathbf{0}\}$? Consider the empty set, or just $\{\mathbf{0}\}$ itself — both span only $\mathbf{0}$. $\;\;\textbf{5.1.6:}$ is $\mathbb{R}^2$ a subspace of $\mathbb{R}^3$? Careful — vectors in $\mathbb{R}^2$ have two coordinates, vectors in $\mathbb{R}^3$ have three. A pair $(a, b)$ is not literally a member of $\mathbb{R}^3$ at all, so strictly $\mathbb{R}^2 \not\subseteq \mathbb{R}^3$. (The copy $\{(a, b, 0)\}$ is a subspace, but that is a different set.)
Exercise 5.1.7 / 5.1.8span{x, y, z} = span{x + tz, y, z} and span{x + y, y + z, z + x} [PROOF — SOLVE 5.1.7 shown, 5.1.8 hinted]
🧭
Hint for 5.1.8
Show $\operatorname{span}\{\mathbf{x}, \mathbf{y}, \mathbf{z}\} = \operatorname{span}\{\mathbf{x}+\mathbf{y}, \mathbf{y}+\mathbf{z}, \mathbf{z}+\mathbf{x}\}$ by the same two-way method. The "$\supseteq$" direction is easy (each new vector is a combination of the old). For "$\subseteq$", solve for $\mathbf{x}, \mathbf{y}, \mathbf{z}$ in terms of the three sums — e.g. $\mathbf{x} = \tfrac12[(\mathbf{x}+\mathbf{y}) - (\mathbf{y}+\mathbf{z}) + (\mathbf{z}+\mathbf{x})]$. Find the analogous expressions for $\mathbf{y}$ and $\mathbf{z}$.
Exercise 5.1.9 / 5.1.10 / 5.1.11Spans and scalar multiples [MIXED: 5.1.9 hinted, 5.1.11 solved]
🧭
Hint for 5.1.9 & 5.1.10
$\textbf{5.1.9:}$ show $\operatorname{span}\{a\mathbf{x}\} = \operatorname{span}\{\mathbf{x}\}$ when $a \neq 0$. Any multiple of $a\mathbf{x}$ is a multiple of $\mathbf{x}$ and vice versa (use $\mathbf{x} = \tfrac{1}{a}(a\mathbf{x})$). $\;\textbf{5.1.10}$ generalizes this to several vectors — same idea, scale each one by its own non-zero constant.
Exercise 5.1.20U ⊆ ℝⁿ is a subspace ⟺ S2 and S3 hold [PROOF — SOLVED]

Let $U$ be a non-empty subset of $\mathbb{R}^n$. Show $U$ is a subspace if and only if S2 (closed under addition) and S3 (closed under scalar multiplication) both hold.

Exercise 5.1.22Intersection and sum of subspaces are subspaces [PROOF — SOLVED]

Let $U$ and $W$ be subspaces of $\mathbb{R}^n$. Define $U \cap W = \{\mathbf{x} : \mathbf{x} \in U \text{ and } \mathbf{x} \in W\}$ and $U + W = \{\mathbf{u} + \mathbf{w} : \mathbf{u} \in U, \mathbf{w} \in W\}$. Show both are subspaces of $\mathbb{R}^n$.

Exercise 5.1.24Every proper subspace of ℝ² is a line through the origin [PROOF — HINT, think geometrically]
🧭
Hint
Let $U$ be a proper subspace of $\mathbb{R}^2$ (so $U \neq \{\mathbf{0}\}$ and $U \neq \mathbb{R}^2$). Since $U \neq \{\mathbf{0}\}$, pick a non-zero $\mathbf{d} \in U$; then the whole line $L = \mathbb{R}\mathbf{d} = \{t\mathbf{d}\}$ lies in $U$ (closure under scaling). The claim is $U = L$. Suppose not — then there is some $\mathbf{u} \in U$ not on $L$. Argue geometrically: two vectors $\mathbf{u}$ and $\mathbf{d}$ pointing in different directions span all of $\mathbb{R}^2$ (every vector $\mathbf{v}$ is a combination of them), which would force $U = \mathbb{R}^2$, contradicting "proper." Hence no such $\mathbf{u}$ exists and $U = L$, a line through the origin. This is why $\mathbb{R}^2$ has only three kinds of subspace: the origin, lines through it, and everything.
📌
What to take from these exercises
The subspace checks (5.1.1) train your eye for which axiom fails. The span-membership problems (5.1.2, 5.1.4) drill the "set up a system, check every coordinate" habit. The proofs (5.1.7, 5.1.20, 5.1.22, 5.1.24) are the real prize — they show that subspaces and spans behave predictably under intersection, sum, and re-combination. Those structural facts are what the rest of the course is built on.
Looking ahead

A subspace is a self-contained world; a span is how you build one from a few vectors.

We now know a subspace can be described by a spanning set — but a spanning set can be wasteful. In Example 5, two different sets described the same subspace, and one might carry a redundant vector that adds nothing. That raises the sharpest question in linear algebra: what is the smallest set of vectors that still spans a subspace, with no waste? Vectors that carry no redundancy are called linearly independent, and a smallest spanning set is a basis. Those two ideas — independence and basis — are where we go next, and they unlock the notion of dimension.

Lecture 14 — complete
MATH-120 · Shoaib Khan · LUMS · July 2026
← Lecture 13Lecture 15 →