Vector Spaces & Bases

Study Sheet

Vector Spaces & Bases

Span, independence, basis, dimension

The Language of Vector Spaces

Tip
Span, independence, basis

The span of a set of vectors is everything reachable by linear combinations of them. The set is independent when no member is a combination of the others. A basis is both independent and spanning: every vector then has exactly one coordinate representation, and every basis of the space has the same size, its dimension.

The two conditions pull in opposite directions. Spanning needs enough vectors to reach everything; independence forbids any redundant ones. In R2\mathbb R^2, the pair (2,1),(4,2)(2, 1), (4, 2) fails to span (both lie on one line), the triple (1,0),(0,1),(1,1)(1, 0), (0, 1), (1, 1) spans but is dependent (the third is the sum of the first two), and (1,0),(1,1)(1, 0), (1, 1) is just right. A basis is a spanning set with nothing wasted, which is why its size measures the space.

Concept
Subspaces cut dimension by conditions

Each independent linear condition on Rn\mathbb R^n removes one dimension: the hyperplane x1+x2+x3+x4=0x_1 + x_2 + x_3 + x_4 = 0 in R4\mathbb R^4 has dimension 33. Solution sets of homogeneous systems are subspaces — this is where geometry and equations meet.

Why each condition costs one dimension: the solution set of kk homogeneous equations in nn unknowns is a null space, and rank–nullity gives its dimension as n−rankn - \text{rank}. If the kk conditions are independent, the rank is kk and the dimension is n−kn - k. For the hyperplane x1+x2+x3+x4=0x_1 + x_2 + x_3 + x_4 = 0, three variables are free and the fourth is determined, so a basis is (1,0,0,−1)(1, 0, 0, -1), (0,1,0,−1)(0, 1, 0, -1), (0,0,1,−1)(0, 0, 1, -1).

Example
Coordinates in a new basis
b₁b₂(7, 3)5b₁
Five steps along b₁ = (1, 1), then two along b₂ = (1, −1), reach (7, 3).

To write (7,3)(7,3) in the basis {(1,1),(1,−1)}\{(1,1), (1,-1)\}: solve a+b=7a + b = 7, a−b=3a - b = 3, giving a=5a = 5, b=2b = 2. Changing basis is solving a linear system — and orthogonal bases make it a pair of one-line dot products.

The coordinates (5,2)(5, 2) are directions for a walk: five steps along (1,1)(1, 1), then two along (1,−1)(1, -1). On the grid built from the new basis, (7,3)(7, 3) is the lattice point five lines over and two lines across. Check: 5(1,1)+2(1,−1)=(7,3)5(1, 1) + 2(1, -1) = (7, 3) ✓. The point never moved; only the ruler changed.

Side note
Significance: the same axioms, everywhere

Polynomials, audio signals, quantum states, and solutions of linear ODEs all form vector spaces — the span/basis/dimension language transfers wholesale. That is why "the solution space of y′′+y=0y'' + y = 0 is 2-dimensional with basis {cos⁡,sin⁡}\{\cos, \sin\}" is a sentence, not an analogy: the differential equations course runs on this chapter.

Try it
Try it: dimensions by conditions

What is the dimension of the space of 2×22\times2 matrices with trace 00? Give a basis.

Show the answer

All 2×22\times2 matrices (abcd)\begin{pmatrix}a&b\\c&d\end{pmatrix} form a space of dimension 44 (one free number per entry). Trace zero is one linear condition, a+d=0a + d = 0, so the dimension drops to 4−1=34 - 1 = 3. To get a basis, solve the condition: d=−ad = -a, with a,b,ca, b, c free, so every such matrix is

a(100−1)+b(0100)+c(0010).a\begin{pmatrix}1&0\\0&-1\end{pmatrix} + b\begin{pmatrix}0&1\\0&0\end{pmatrix} + c\begin{pmatrix}0&0\\1&0\end{pmatrix}.

These three matrices span, and they are independent because each has a 11 where the others have 00. So they form a basis, and the dimension is 33.

Subspaces: Testing and Building

Tip
The subspace test

A subset WW of a vector space is a subspace when it contains 0\mathbf 0 and is closed under the two operations: u,w∈W\mathbf u, \mathbf w \in W implies u+w∈W\mathbf u + \mathbf w \in W, and cu∈Wc\mathbf u \in W for every scalar cc. The fastest way to prove a set is a subspace is to exhibit it as a span or as the solution set of homogeneous linear equations; the fastest way to disprove it is one explicit failure.

The conditions are exactly what linear combinations need: if sums and multiples stay inside, every combination stays inside, so WW is a vector space in its own right and span, basis and dimension all make sense for it. Solution sets of Ax=0A\mathbf x = \mathbf 0 pass automatically, because A(u+w)=Au+Aw=0A(\mathbf u + \mathbf w) = A\mathbf u + A\mathbf w = \mathbf 0 and A(cu)=cAu=0A(c\mathbf u) = cA\mathbf u = \mathbf 0. A nonzero right-hand side breaks the very first condition: A0=0≠bA\mathbf 0 = \mathbf 0 \ne \mathbf b.

Example
Worked: a basis for a plane

Show that W={(x,y,z):x+2y−z=0}W = \{(x, y, z) : x + 2y - z = 0\} is a subspace of R3\mathbb R^3 and find a basis. It is the null space of the 1×31\times3 matrix (12−1)\begin{pmatrix}1&2&-1\end{pmatrix}, so it is a subspace. To find a basis, solve the equation for its pivot variable: x=−2y+zx = -2y + z, with y=sy = s and z=tz = t free.

Every element is (x,y,z)=(−2s+t, s, t)=s(−2,1,0)+t(1,0,1)(x, y, z) = (-2s + t,\ s,\ t) = s(-2, 1, 0) + t(1, 0, 1). So (−2,1,0)(-2, 1, 0) and (1,0,1)(1, 0, 1) span WW. They are independent — look at the second and third coordinates: ss and tt can be read off directly, so the only combination giving 0\mathbf 0 has s=t=0s = t = 0. Hence they form a basis and dim⁡W=2\dim W = 2, as "three dimensions minus one condition" predicts. Check that both lie in WW: −2+2−0=0-2 + 2 - 0 = 0 ✓ and 1+0−1=01 + 0 - 1 = 0 ✓.

Example
Worked: two sets that fail
xyuwu + w
u and w lie in the shaded quadrants, but u + w lands in an unshaded one.

Is Q={(x,y):xy≥0}Q = \{(x, y) : xy \ge 0\} (the first and third quadrants, axes included) a subspace of R2\mathbb R^2? Is the line L={(x,y):y=2x+1}L = \{(x, y) : y = 2x + 1\}? QQ contains 0\mathbf 0 and is closed under scaling (cuc\mathbf u has (cx)(cy)=c2xy≥0(cx)(cy) = c^2xy \ge 0), so the test comes down to sums.

Take u=(1,2)\mathbf u = (1, 2) and w=(−2,−1)\mathbf w = (-2, -1), both in QQ (2≥02 \ge 0 and 2≥02 \ge 0). Their sum (−1,1)(-1, 1) has xy=−1<0xy = -1 < 0, so QQ is not closed under addition and is not a subspace — one counterexample settles it. The line LL fails even sooner: (0,0)(0, 0) is not on it, since 0≠2⋅0+10 \ne 2\cdot0 + 1. A line is a subspace of R2\mathbb R^2 only if it passes through the origin.

Example
Worked: a subspace of polynomials

Let WW be the polynomials pp of degree at most 22 with p(1)=0p(1) = 0. It is a subspace: if p(1)=0p(1) = 0 and q(1)=0q(1) = 0, then (p+q)(1)=0(p + q)(1) = 0 and (cp)(1)=0(cp)(1) = 0. Write p=a+bx+cx2p = a + bx + cx^2; the condition is one linear equation, a+b+c=0a + b + c = 0.

The full space {a+bx+cx2}\{a + bx + cx^2\} has dimension 33 and we impose one condition, so expect dimension 22. Solve for a=−b−ca = -b - c: then p=b(x−1)+c(x2−1)p = b(x - 1) + c(x^2 - 1). So {x−1, x2−1}\{x - 1,\ x^2 - 1\} spans WW; the two are independent since neither is a multiple of the other (they have different degrees). So dim⁡W=2\dim W = 2. The factor theorem says the same thing another way: p(1)=0p(1) = 0 exactly when p=(x−1)(linear)p = (x - 1)(\text{linear}), and the linear factor has two free coefficients.

Side note
Where it goes wrong: counting conditions that repeat

"Two conditions in R3\mathbb R^3 leave dimension 11" is only true when the conditions are independent. The set where x+y+z=0x + y + z = 0 and 2x+2y+2z=02x + 2y + 2z = 0 is a plane, dimension 22: the second equation is twice the first and cuts nothing. Row reduce the conditions first; the dimension is nn minus the rank, not nn minus the number of equations written down.

Try it
Try it: basis of a solution space

Find a basis and the dimension of the subspace of R4\mathbb R^4 defined by x1+x2+x3+x4=0x_1 + x_2 + x_3 + x_4 = 0 and x1−x2=0x_1 - x_2 = 0.

Show the answer

The conditions are independent (neither equation is a multiple of the other), so expect 4−2=24 - 2 = 2 dimensions. Solve: the second equation gives x1=x2x_1 = x_2; call it ss. Let x3=tx_3 = t. The first equation then gives x4=−x1−x2−x3=−2s−tx_4 = -x_1 - x_2 - x_3 = -2s - t. So

(x1,x2,x3,x4)=s(1,1,0,−2)+t(0,0,1,−1).(x_1, x_2, x_3, x_4) = s(1, 1, 0, -2) + t(0, 0, 1, -1).

The vectors (1,1,0,−2)(1, 1, 0, -2) and (0,0,1,−1)(0, 0, 1, -1) span the subspace and are independent (look at the first and third coordinates), so they are a basis and the dimension is 22. Check the first: 1+1+0−2=01 + 1 + 0 - 2 = 0 and 1−1=01 - 1 = 0 ✓.

Change of Basis

Tip
The change-of-basis matrix

Put the basis vectors b1,…,bn\mathbf b_1, \ldots, \mathbf b_n as the columns of PP. If [x]B=(c1,…,cn)[\mathbf x]_B = (c_1, \ldots, c_n) are the coordinates of x\mathbf x in that basis, then

x=c1b1+⋯+cnbn=P [x]B,[x]B=P−1x.\mathbf x = c_1\mathbf b_1 + \cdots + c_n\mathbf b_n = P\,[\mathbf x]_B, \qquad [\mathbf x]_B = P^{-1}\mathbf x.

PP converts basis coordinates to standard ones; P−1P^{-1} goes the other way.

The first formula is just the column picture of P[x]BP[\mathbf x]_B: a matrix times a vector is the combination of the columns weighted by the vector's entries. PP is invertible precisely because its columns form a basis — independent columns mean no nonzero combination vanishes, so PP has no null space. Going from standard coordinates to BB-coordinates means solving Pc=xP\mathbf c = \mathbf x, which is the same as multiplying by P−1P^{-1}.

Example
Worked: coordinates by the inverse matrix
b₁b₂x = (1, 2)2b₁
x = (1, 2) is two steps along b₁ = (2, 1), then three along b₂ = (−1, 0).

Find the coordinates of x=(1,2)\mathbf x = (1, 2) in the basis b1=(2,1)\mathbf b_1 = (2, 1), b2=(−1,0)\mathbf b_2 = (-1, 0). Here P=(2−110)P = \begin{pmatrix}2&-1\\1&0\end{pmatrix} with det⁡P=0−(−1)=1\det P = 0 - (-1) = 1, so P−1=(01−12)P^{-1} = \begin{pmatrix}0&1\\-1&2\end{pmatrix}.

Multiply: [x]B=P−1x=(0+2−1+4)=(23)[\mathbf x]_B = P^{-1}\mathbf x = \begin{pmatrix}0 + 2\\-1 + 4\end{pmatrix} = \begin{pmatrix}2\\3\end{pmatrix}. So x=2 b1+3 b2\mathbf x = 2\,\mathbf b_1 + 3\,\mathbf b_2. Check: 2(2,1)+3(−1,0)=(1,2)2(2, 1) + 3(-1, 0) = (1, 2) ✓. On the grid drawn from b1\mathbf b_1 and b2\mathbf b_2, x\mathbf x is the lattice point two lines over and three across. Unlike the orthogonal basis earlier, b1⋅b2=−2≠0\mathbf b_1 \cdot \mathbf b_2 = -2 \ne 0 here, so the one-dot-product shortcut does not apply; the inverse matrix does the work instead.

Example
Worked: coordinates of a polynomial

Write p(x)=3+2x+x2p(x) = 3 + 2x + x^2 in the basis {1, x−1, (x−1)2}\{1,\ x - 1,\ (x - 1)^2\}. We need p(x)=c0+c1(x−1)+c2(x−1)2p(x) = c_0 + c_1(x - 1) + c_2(x - 1)^2. Setting x=1x = 1 kills the last two terms, so c0=p(1)=6c_0 = p(1) = 6.

Differentiate both sides: p′(x)=c1+2c2(x−1)p'(x) = c_1 + 2c_2(x - 1), and at x=1x = 1, c1=p′(1)=2+2⋅1=4c_1 = p'(1) = 2 + 2\cdot1 = 4. Differentiate again: p′′(x)=2c2p''(x) = 2c_2, so c2=p′′(1)2=22=1c_2 = \tfrac{p''(1)}{2} = \tfrac22 = 1. So p=6+4(x−1)+(x−1)2p = 6 + 4(x - 1) + (x - 1)^2 and the coordinate vector is (6,4,1)(6, 4, 1). Check by expanding: 6+4x−4+x2−2x+1=3+2x+x26 + 4x - 4 + x^2 - 2x + 1 = 3 + 2x + x^2 ✓. This is the Taylor expansion at 11 — Taylor coefficients are coordinates in a shifted basis.

Side note
Where it goes wrong: multiplying by P instead of P⁻¹

With P=(2−110)P = \begin{pmatrix}2&-1\\1&0\end{pmatrix} and x=(1,2)\mathbf x = (1, 2), computing Px=(0,1)P\mathbf x = (0, 1) and calling it the coordinates is the classic slip. Test it: 0(2,1)+1(−1,0)=(−1,0)0(2, 1) + 1(-1, 0) = (-1, 0), not (1,2)(1, 2). PP takes coordinates to vectors, so from a vector back to coordinates needs P−1P^{-1}. The check "rebuild x\mathbf x from the coordinates" catches the mistake every time.

Try it
Try it: coordinates in a skewed basis

Find the coordinates of x=(1,1)\mathbf x = (1, 1) in the basis b1=(1,2)\mathbf b_1 = (1, 2), b2=(3,5)\mathbf b_2 = (3, 5), and check them.

Show the answer

P=(1325)P = \begin{pmatrix}1&3\\2&5\end{pmatrix} has det⁡P=5−6=−1\det P = 5 - 6 = -1, so P−1=1−1(5−3−21)=(−532−1)P^{-1} = \tfrac{1}{-1}\begin{pmatrix}5&-3\\-2&1\end{pmatrix} = \begin{pmatrix}-5&3\\2&-1\end{pmatrix}. Then [x]B=P−1(11)=(−5+32−1)=(−21)[\mathbf x]_B = P^{-1}\begin{pmatrix}1\\1\end{pmatrix} = \begin{pmatrix}-5 + 3\\2 - 1\end{pmatrix} = \begin{pmatrix}-2\\1\end{pmatrix}. Check: −2(1,2)+(3,5)=(1,1)-2(1, 2) + (3, 5) = (1, 1) ✓. Negative coordinates are fine; they mean walking backwards along b1\mathbf b_1.

Proofs & Why It Matters

Tip
Proof: coordinates in a basis are unique

Suppose v=∑aibi=∑cibi\mathbf v = \sum a_i\mathbf b_i = \sum c_i\mathbf b_i in a basis {bi}\{\mathbf b_i\}. Subtract: ∑(ai−ci)bi=0\sum (a_i - c_i)\mathbf b_i = \mathbf 0. Independence forces every coefficient to vanish: ai=cia_i = c_i. Existence comes from spanning, uniqueness from independence — a basis delivers both at once. ■\blacksquare

Tip
Proof sketch: every basis has the same size

The exchange argument: if {u1,…,um}\{\mathbf u_1, \ldots, \mathbf u_m\} is independent and {b1,…,bn}\{\mathbf b_1, \ldots, \mathbf b_n\} spans, insert the u\mathbf us one at a time into the spanning set, each time ejecting some b\mathbf b (writing the new u\mathbf u in the current spanning set must use a surviving b\mathbf b, which can then be solved for). The process never runs out of b\mathbf bs to eject, so m≤nm \le n. Applying this both ways to two bases gives m≤nm \le n and n≤mn \le m: dimension is well-defined. ■\blacksquare

Going Deeper: Explanations & Worked Problems

Concept
Independence testing is elimination in disguise

To decide whether vectors v1,…,vk\mathbf v_1, \ldots, \mathbf v_k are independent, ask whether c1v1+⋯+ckvk=0c_1\mathbf v_1 + \cdots + c_k\mathbf v_k = \mathbf 0 forces all ci=0c_i = 0 — but that is a homogeneous linear system in the cic_i, with the vectors as columns.

Row reduce: if every column earns a pivot, only the zero combination works — independent; a pivotless column means a free variable, hence a nonzero combination summing to zero — dependent, and back-substitution hands you the actual dependence. The same computation delivers dimension: the pivot columns form a basis of the span, so dim⁡(span)=rank\dim(\text{span}) = \text{rank}. This is the great economy of the subject — span, independence, basis, dimension, and solvability are all read off one echelon form.

Example
Worked: dependence exposed, coefficients and all

Test (1,0,1),(0,1,1),(1,1,2)(1,0,1), (0,1,1), (1,1,2).

Step 1 — put them as columns and reduce: (101011112)→R3−R1:(101011011)→R3−R2:(101011000)\begin{pmatrix}1&0&1\\0&1&1\\1&1&2\end{pmatrix} \to R_3 - R_1: \begin{pmatrix}1&0&1\\0&1&1\\0&1&1\end{pmatrix} \to R_3 - R_2: \begin{pmatrix}1&0&1\\0&1&1\\0&0&0\end{pmatrix}.

Step 2 — read: pivots in columns 1, 2 only — Dependent, dimension of the span is 22.

Step 3 — recover the dependence: the free column says c3c_3 is free; rows give c1=−c3c_1 = -c_3 and c2=−c3c_2 = -c_3; take c3=1c_3 = 1: −(1,0,1)−(0,1,1)+(1,1,2)=(0,0,0)-(1,0,1) - (0,1,1) + (1,1,2) = (0,0,0) ✓ — i.e. v3=v1+v2\mathbf v_3 = \mathbf v_1 + \mathbf v_2, the hidden relation, now explicit.

Step 4 — basis: keep the pivot columns {(1,0,1),(0,1,1)}\{(1,0,1), (0,1,1)\}; they span the same plane with nothing wasted.

Example
Worked: change of basis with an orthogonal shortcut

Write (7,3)(7, 3) in the basis b1=(1,1)\mathbf b_1 = (1,1), b2=(1,−1)\mathbf b_2 = (1,-1). The system route: a(1,1)+b(1,−1)=(7,3)a(1,1) + b(1,-1) = (7,3) means a+b=7a + b = 7 and a−b=3a - b = 3; adding, 2a=102a = 10, a=5a = 5; subtracting, b=2b = 2.

The orthogonal shortcut: because b1⋅b2=1−1=0\mathbf b_1\cdot\mathbf b_2 = 1 - 1 = 0, each coefficient is an independent projection: a=(7,3)⋅(1,1)(1,1)⋅(1,1)=102=5a = \dfrac{(7,3)\cdot(1,1)}{(1,1)\cdot(1,1)} = \dfrac{10}{2} = 5 and b=(7,3)⋅(1,−1)2=42=2b = \dfrac{(7,3)\cdot(1,-1)}{2} = \dfrac{4}{2} = 2 — no system solved, no interaction between coordinates. Check: 5(1,1)+2(1,−1)=(7,3)5(1,1) + 2(1,-1) = (7, 3) ✓. This is precisely why orthogonal bases (and eventually Fourier series) are prized: coordinates decouple.