Skip to content

Vector spaces and subspaces

Test whether a set of vectors is closed under adding and scaling, see why every subspace passes through zero, and meet the column space.

Helps to know firstA matrix moves the plane

Helps to know first
This topic

First, the picture

Add two points of a flat plane, or stretch one. Watch where the results land: on the plane, or off it.

Why subspaces pass through zero

Add two points of a plane, or stretch one: do the results stay on it?

The plane x + y + z = 0: every point whose three coordinates add up to 0. It passes through the origin.

level b
0
v + w adds to
–
2v adds to
–
0
0.00 / 11.40 s
Describe this picture

A slowly turning view of 3-D space with axes xx, yy, zz and the tilted plane x+y+z=bx+y+z=b, starting at b=0b=0, so it passes through the origin. Two points on the plane grow as arrows from the origin, v=(1,−1,0)\mathbf{v}=(1,-1,0) and w=(0,1,−1)\mathbf{w}=(0,1,-1). Then w\mathbf{w} slides so that it starts at the tip of v\mathbf{v}, and the sum v+w=(1,0,−1)\mathbf{v}+\mathbf{w}=(1,0,-1) is drawn: it lands on the plane. Last, a wide faded copy of v\mathbf{v} stretches to 2v=(2,−2,0)2\mathbf{v}=(2,-2,0), also on the plane. Readouts give the level bb and what the coordinates of v+w\mathbf{v}+\mathbf{w} and of 2v2\mathbf{v} add up to, with “on” or “off”. One control: a slider for the level bb, from −1-1 to 1 in steps of 0.5. The plane slides along, and the two points ride with it, each lifted by bb along the zz axis, so their coordinates still add up to bb. Their sum and the stretched copy add up to 2b2b: they leave the plane, drawn as open rings with a dashed drop to the plane.

Staying inside

Take the plane of all points whose three coordinates add up to 0, such as (1,−1,0)(1,-1,0) and (0,1,−1)(0,1,-1). Add those two and you get (1,0,−1)(1,0,-1). Its coordinates add up to 0 again, so the sum is still on the plane. Stretch (1,−1,0)(1,-1,0) by 2 and you get (2,−2,0)(2,-2,0), still on the plane.

That is no accident. If x+y+z=0x+y+z=0 for one point and for another, then adding them adds two zeros, and scaling by cc gives c⋅0c\cdot0. Both are 0. Nothing you do with adding and scaling can carry you off this plane.

Now move the plane. Take the points whose coordinates add up to 3, such as (1,1,1)(1,1,1). Add (1,1,1)(1,1,1) to itself and you get (2,2,2)(2,2,2), whose coordinates add up to 6. The sum has left the plane. In the picture at the top of the page, move the level bb away from 0 and watch the sum and the stretched copy fly off.

Subspaces

A set of vectors SS is a subspace when adding and scaling never take you out of it. For every v\mathbf{v} and w\mathbf{w} in SS, and every number cc:

v+w is in S,c v is in S.\begin{aligned} \mathbf{v}+\mathbf{w}&\ \text{is in}\ S,\\ c\,\mathbf{v}&\ \text{is in}\ S. \end{aligned}

I write ”v\mathbf{v} is in SS” as v∈S\mathbf{v}\in S. A set with this property is closed under adding and scaling.

One consequence is worth seeing at once. Take any v\mathbf{v} in SS and scale it by c=0c=0. The result is 0\mathbf{0}, so it must be in SS. So every subspace contains the origin. That is why the plane only kept its points at b=0b=0: a plane that misses the origin fails the test before you add anything.

Here are the subspaces of the plane R2\mathbb{R}^2:

  • the origin alone, {0}\{\mathbf{0}\};
  • any line through the origin;
  • the whole plane.

In space, R3\mathbb{R}^3, add the planes through the origin. Every one of these is the span of some vectors, as in Linear combinations and span: a span is closed, because a combination of combinations is again a combination.

Watch out

A subspace is not just any piece of space, and it is not “a smaller copy of Rn\mathbb{R}^n”. The line y=2x+1y=2x+1 is not a subspace, because it misses the origin. The half-plane of points with x≥0x\ge0 is not, because −1⋅(1,0)=(−1,0)-1\cdot(1,0)=(-1,0) leaves it. The two axes together are not, because (1,0)+(0,1)=(1,1)(1,0)+(0,1)=(1,1) lies on neither axis.

Beyond arrows

The test never asked what the vectors look like. It only asked that you can add them and scale them. So the same idea works for things that are not arrows.

Signals. A signal of three samples is a vector in R3\mathbb{R}^3, as in Vectors: component x1x_1 is the sample x[0]x[0], since matrix and vector entries count from 1 and samples from 0. The signals whose three samples add up to zero are exactly the plane x+y+z=0x+y+z=0 from the picture. Add two such signals, or turn one up, and the total stays 0.

Polynomials. The polynomials of degree at most 2, such as 1+2x−x21+2x-x^2 or 3x23x^2, can be added and scaled, and the result is again a polynomial of degree at most 2. They form a space with three numbers per member, just like R3\mathbb{R}^3.

Anything you can add and scale, with the usual rules of arithmetic, is called a vector space. Rn\mathbb{R}^n is the example to keep in mind. I won’t list the rules here; adding and scaling as you already know them is all this course uses.

In signal processing · band-limited signals

The sampling theorem, in the signal processing course, works with band-limited signals, which contain nothing above some frequency fmaxf_\text{max}. Add two signals with nothing above 3 kHz, or turn one up, and the result still has nothing above 3 kHz. So the band-limited signals form a subspace, and the theorem is a statement about it.

The column space

Every matrix brings a subspace with it. In A matrix moves the plane, Ax\mathbf{A}\mathbf{x} was a combination of the columns of A\mathbf{A}, with the entries of x\mathbf{x} as weights. Collect every output the matrix can produce:

C(A)={ Ax for all x }.C(\mathbf{A})=\{\,\mathbf{A}\mathbf{x}\ \text{for all}\ \mathbf{x}\,\}.

This is the column space of A\mathbf{A}: the span of its columns. It is a subspace of the output side, because outputs add and scale: Ax+Ay=A(x+y)\mathbf{A}\mathbf{x}+\mathbf{A}\mathbf{y}=\mathbf{A}(\mathbf{x}+\mathbf{y}) and c Ax=A(c x)c\,\mathbf{A}\mathbf{x}=\mathbf{A}(c\,\mathbf{x}).

The column space answers the question of Two pictures of a linear system once and for all: Ax=b\mathbf{A}\mathbf{x}=\mathbf{b} has a solution exactly when b∈C(A)\mathbf{b}\in C(\mathbf{A}).

Take the 3×23\times2 matrix

B=[100111].\mathbf{B}=\begin{bmatrix}1&0\\0&1\\1&1\end{bmatrix}.

It sends (x1,x2)(x_1,x_2) to (x1, x2, x1+x2)(x_1,\,x_2,\,x_1+x_2). Every output has its third entry equal to the sum of the first two, so C(B)C(\mathbf{B}) is the plane b3=b1+b2b_3=b_1+b_2 in space.

Column space

Every output of B = [1 0; 0 1; 1 1] lies on one plane. Which targets are on it?

The plane of all outputs Bx: every point whose third number is the sum of the first two.

Bx = (2, 3, 5)
–
Bx = (2, 3, 4)
–
0.00 / 11.30 s
Describe this picture

A slowly turning view of 3-D space with the plane of all outputs of B\mathbf{B}: every point whose third number is the sum of the first two. Its two columns, (1,0,1)(1,0,1) and (0,1,1)(0,1,1), grow as arrows from the origin. Then two steps of (1,0,1)(1,0,1) and three steps of (0,1,1)(0,1,1) walk tip to tail along the plane to the target (2,3,5)(2,3,5), which is marked on it. Last, the target (2,3,4)(2,3,4) appears as an open ring, 1 below the plane, with a dashed gap up to it. Readouts say that Bx=(2,3,5)\mathbf{B}\mathbf{x}=(2,3,5) is solved by x=(2,3)\mathbf{x}=(2,3) and that Bx=(2,3,4)\mathbf{B}\mathbf{x}=(2,3,4) has none. There is no control.

Watch the two targets as the view turns. The point (2,3,5)(2,3,5) stays in the plane from every side. The point (2,3,4)(2,3,4) only seems to touch it from some angles. Bx=(2,3,5)\mathbf{B}\mathbf{x}=(2,3,5) has a solution, and Bx=(2,3,4)\mathbf{B}\mathbf{x}=(2,3,4) has none.

Worked example

  1. A line through the origin. The line y=2xy=2x is a subspace. Sum: (1,2)+(2,4)=(3,6)(1,2)+(2,4)=(3,6), and 6=2⋅36=2\cdot3. Scaling: 3(1,2)=(3,6)3(1,2)=(3,6), on the line again.
  2. A shifted line. y=2x+1y=2x+1 is not: at x=0x=0 it gives y=1y=1, so it misses 0\mathbf{0}.
  3. A half-plane. {(x,y):x≥0}\{(x,y):x\ge0\} is not: −1⋅(1,0)=(−1,0)-1\cdot(1,0)=(-1,0) leaves it.
  4. Two axes. The set where xy=0xy=0 is not: (1,0)+(0,1)=(1,1)(1,0)+(0,1)=(1,1), and 1⋅1≠01\cdot1\ne0.
  5. The tilted plane. At b=0b=0, (1,−1,0)+(0,1,−1)=(1,0,−1)(1,-1,0)+(0,1,-1)=(1,0,-1) has total 0. At b=3b=3, (1,1,1)+(1,1,1)=(2,2,2)(1,1,1)+(1,1,1)=(2,2,2) has total 6≠36\ne3.
  6. Column space. (2,3,5)∈C(B)(2,3,5)\in C(\mathbf{B}) with x=(2,3)\mathbf{x}=(2,3): B(2,3)=(2, 3, 2+3)\mathbf{B}(2,3)=(2,\,3,\,2+3). The point (1,2,3)(1,2,3) is in it too, with x=(1,2)\mathbf{x}=(1,2). The point (2,3,4)(2,3,4) is not, because 2+3≠42+3\ne4.

Predict before you drag: at which level bb do sums stay on the plane? Only at b=0b=0.

Where you’ll meet this

Band-limited audio. The signals with nothing above a given frequency form a subspace, as the callout above shows. A telephone channel keeps signals inside the one with nothing above about 3.4 kHz, and any mix of two voices stays inside it.

Removing the average. Subtracting a signal’s average moves it into the subspace of signals that add up to zero. The samples (1,2,6)(1,2,6) have average 3; take it away and you get (−2,−1,3)(-2,-1,3), which adds up to 0.

What a system can produce. If a system is a matrix, its column space is the set of every output it can make. A target outside it can’t be reached exactly by any input, and the best you can do is come close.

Reference card

QuantityFormulaNotes
Subspace SSv+w∈S\mathbf{v}+\mathbf{w}\in S and c v∈Sc\,\mathbf{v}\in Sclosed under adding and scaling
Always inside0∈S\mathbf{0}\in Sscale any member by 0
In the plane{0}\{\mathbf{0}\}, a line through 0\mathbf{0}, all of R2\mathbb{R}^2in space, add the planes through 0\mathbf{0}
Not subspacesy=2x+1y=2x+1; x≥0x\ge0; the two axesmiss 0\mathbf{0}; leave under −1-1; leave under adding
Column spaceC(A)={Ax}C(\mathbf{A})=\{\mathbf{A}\mathbf{x}\}the span of the columns
SolvableAx=b\mathbf{A}\mathbf{x}=\mathbf{b} has a solution exactly when b∈C(A)\mathbf{b}\in C(\mathbf{A})the target must be an output

Keep reading with a free account.

By creating an account you accept the terms of use.

Sign in

Already have an account? Use the service you signed up with.

Or keep reading: get new lessons by email

Are you 13 or over?

Accounts and email updates are for people aged 13 or over. We keep only your answer, never your date of birth.

End of the lesson

Where to go next.

Phasorium

Account

Sign inKeep your place on any device

Subjects

Site

Look