Survey of Mathematics

2.2 Span, independence, basis, dimension

A basis is a set of building blocks with no waste. Every vector is built from it in exactly one way, and every basis of a space has the same size, its dimension.

Taught in 375/376Beyond the courseApostol 1.7 to 1.10Spagnolie, Lectures 2 and 3MATH 375 HW2

Chapter 2.1 said what a vector space is. This chapter asks how to describe one economically. The answer is to pick a few vectors so that every vector in the space is built from them, and none of them is wasted. That set is a basis. The number of vectors in it is the dimension, which measures how big the space really is.

Before you start

2.1: vector space, subspace and the subspace test. For one proof below you also need induction: prove a statement for 1, then show that if it holds for k−1k - 1 it holds for kk. Here are three quick checks on 2.1.

Quick checkWhich of these is a subspace of R3\mathbb R^3?
Quick checkIn a vector space, what is 0x0x for a vector xx?
Quick checkIs the set of polynomials of degree exactly 2 closed under addition?

The picture

Two arrows in space. Slide aa and bb: the point au+bvau + bv moves, but it never leaves the blue plane. That plane is everything two arrows can build. Now pick “v is a multiple of u”. The plane collapses to a line, because the second arrow adds no new direction.

Questions this chapter answers: which vectors can a set build (the span)? When is a vector in the set wasted (dependence)? What is the smallest set that builds everything (a basis)? And how many vectors does that take (the dimension)?

Definitions and theorems

Building vectors: span

Definition T

Linear combination

Given vectors x1,…,xkx_1, \dots, x_k in VV and scalars c1,…,ckc_1, \dots, c_k, the vector

c1x1+c2x2+⋯+ckxk=∑i=1kcixic_1 x_1 + c_2 x_2 + \dots + c_k x_k = \sum_{i=1}^k c_i x_i

is a linear combination of x1,…,xkx_1, \dots, x_k. The cic_i are its coefficients. It lies in VV by the closure axioms.

In one lineA sum of scalar multiples, c1x1+c2x2+⋯+ckxkc_1 x_1 + c_2 x_2 + \dots + c_k x_k.

Why it existsIt is everything you can build from given vectors using only the two vector-space operations.

Definition T

Span

The span of a set S={x1,…,xk}S = \{x_1, \dots, x_k\} is the set of all linear combinations of its elements:

L(S)={∑i=1kcixi:c1,…,ck∈R}.L(S) = \left\{ \sum_{i=1}^k c_i x_i : c_1, \dots, c_k \in \mathbb R \right\}.

Apostol writes L(S)L(S), “the linear span”. Many books write span⁡(S)\operatorname{span}(S). If L(S)=VL(S) = V, we say SS spans VV.

In one lineThe set of all linear combinations of the given vectors: everything they can build.

Why it existsIt is the smallest subspace containing the vectors, so it answers 'what can these vectors reach?'

Spagnolie’s gloss: the span is “the space that can be reached by SS”. In R3\mathbb R^3 with x1=(1,0,0)x_1 = (1, 0, 0) and x2=(1,1,0)x_2 = (1, 1, 0):

c1x1+c2x2=(c1+c2, c2, 0).c_1 x_1 + c_2 x_2 = (c_1 + c_2,\ c_2,\ 0).

Every vector with third entry 0 is reached: to get (p,q,0)(p, q, 0), take c2=qc_2 = q and c1=p−qc_1 = p - q. So L(S)L(S) is the xyxy-plane. For example, (0,2,0)=−2x1+2x2(0, 2, 0) = -2x_1 + 2x_2.

Your answerWith x1=(1,0,0)x_1 = (1, 0, 0) and x2=(1,1,0)x_2 = (1, 1, 0) as above, (5,3,0)=c1x1+c2x2(5, 3, 0) = c_1 x_1 + c_2 x_2. What is c1c_1?
Quick checkWhat is the span of the single vector (1,2,3)(1, 2, 3) in R3\mathbb R^3?
Worked example
Is (3,5,7)(3, 5, 7) in the span of (1,1,1)(1, 1, 1) and (0,1,2)(0, 1, 2)? Is (3,5,8)(3, 5, 8)?

Solution.

  1. Ask the question as an equation. Is there a pair c1,c2c_1, c_2 with c1(1,1,1)+c2(0,1,2)=(3,5,7)c_1(1, 1, 1) + c_2(0, 1, 2) = (3, 5, 7)? ‘In the span’ means ‘is some linear combination’, so we look for the coefficients.
  2. Compare entries. c1=3c_1 = 3, then c1+c2=5c_1 + c_2 = 5, then c1+2c2=7c_1 + 2c_2 = 7. One vector equation in R3\mathbb R^3 is three ordinary equations.
  3. Solve with the first two. c1=3c_1 = 3 and c2=5−3=2c_2 = 5 - 3 = 2. Two equations fix the two unknowns.
  4. Test the third equation. c1+2c2=3+4=7c_1 + 2c_2 = 3 + 4 = 7. It holds. Three equations, two unknowns: the leftover equation is a check that can fail.
  5. Repeat for (3,5,8)(3, 5, 8). The first two entries still give c1=3c_1 = 3, c2=2c_2 = 2, but now the third needs c1+2c2=8c_1 + 2c_2 = 8, and 3+4=7≠83 + 4 = 7 \ne 8. The only candidate coefficients fail the third entry, so no combination works.

Answer. (3,5,7)=3(1,1,1)+2(0,1,2)(3, 5, 7) = 3(1,1,1) + 2(0,1,2) is in the span. (3,5,8)(3, 5, 8) is not: the span of two independent vectors is a plane in R3\mathbb R^3, and this point lies off it.

Theorem T Apostol 1.6

The span is a subspace

For any finite set S={x1,…,xk}S = \{x_1, \dots, x_k\} in a vector space VV, the span L(S)L(S) is a subspace of VV.

In one lineFor any finite set SS in VV, the span L(S)L(S) is a subspace of VV.

Why it is trueA sum of two combinations is a combination (add coefficients); a multiple of a combination is a combination (multiply coefficients).

ProofSpagnolie Lecture 2
The idea: Use the subspace test. Combinations of the same vectors add by adding their coefficients, and scale by scaling their coefficients.
O=0x1+⋯+0xk∈L(S)O = 0x_1 + \dots + 0x_k \in L(S).
Choosing every coefficient to be 0 gives the zero vector, by 'Scaling by zero' from 2.1.
Let v=∑cixiv = \sum c_i x_i and w=∑bixiw = \sum b_i x_i be in L(S)L(S).
Two arbitrary elements of L(S)L(S). Each is SOME combination, so each has its own coefficients.
v+w=∑(ci+bi) xiv + w = \sum (c_i + b_i)\, x_i, a combination, so v+w∈L(S)v + w \in L(S).
Axioms 3 and 4 let us regroup the terms; axiom 9 combines cixi+bixic_i x_i + b_i x_i into (ci+bi)xi(c_i + b_i) x_i.
av=∑(aci) xi∈L(S)av = \sum (a c_i)\, x_i \in L(S).
Axiom 8 distributes aa over the sum; axiom 7 turns a(cixi)a(c_i x_i) into (aci)xi(ac_i)x_i.
L(S)L(S) is a subspace of VV.
All three parts of the subspace test hold.

Wasted vectors: dependence

Spagnolie’s motivation: “It is very useful to describe a space using only a few building blocks. But redundancy is not great.” Take x1=(1,0)x_1 = (1, 0), x2=(1,1)x_2 = (1, 1), x3=(−1,3)x_3 = (-1, 3) in R2\mathbb R^2. Then x3=−4x1+3x2x_3 = -4x_1 + 3x_2. The third vector is wasted, because anything built with it could be built without it. Moving everything to one side gives

−4x1+3x2−1x3=O,-4x_1 + 3x_2 - 1x_3 = O,

a combination equal to zero with coefficients that are not all zero. This form is the definition, because it does not single out which vector is the wasted one.

Taking every coefficient 0 always gives OO, for any vectors at all, so that tells us nothing. Dependence asks whether there is a second way to get OO.

Definition T

Linearly dependent

A set {x1,…,xk}\{x_1, \dots, x_k\} is linearly dependent if there are scalars c1,…,ckc_1, \dots, c_k, not all zero, with

c1x1+⋯+ckxk=O.c_1 x_1 + \dots + c_k x_k = O.

In one lineSome combination of the vectors equals zero without all coefficients being zero; equivalently, one of them is a combination of the others.

Why it existsIt detects waste: a dependent set has a vector that adds nothing to the span.

Definition T

Linearly independent

A set {x1,…,xk}\{x_1, \dots, x_k\} is linearly independent if it is not dependent. That is, the equation

c1x1+⋯+ckxk=Oc_1 x_1 + \dots + c_k x_k = O

has only the solution c1=c2=⋯=ck=0c_1 = c_2 = \dots = c_k = 0.

In one lineThe only combination of the vectors equal to zero is the one with every coefficient zero.

Why it existsIndependent vectors carry no waste, so each vector they build is built in only one way.

Why· Why the two forms say the same thing

Suppose c1x1+⋯+ckxk=Oc_1 x_1 + \dots + c_k x_k = O with some cj≠0c_j \ne 0. Move the other terms across and divide by cjc_j:

xj=−1cj∑i≠jcixi.x_j = -\frac{1}{c_j} \sum_{i \ne j} c_i x_i.

So xjx_j is a combination of the others. Conversely, if xj=∑i≠jdixix_j = \sum_{i \ne j} d_i x_i, then ∑i≠jdixi−1⋅xj=O\sum_{i \ne j} d_i x_i - 1 \cdot x_j = O, and the coefficient −1-1 is not zero. Dependence means some vector is a combination of the rest.

Quick checkThree vectors satisfy x1−2x2+x3=Ox_1 - 2x_2 + x_3 = O. Are they dependent or independent?
Your answerFor which value of tt are the vectors (1,2)(1, 2) and (3,t)(3, t) dependent?

Quick ways to be dependent, from Lecture 3:

  • one vector is a multiple of another;
  • the zero vector is in the set, since 1⋅O=O1 \cdot O = O uses a non-zero coefficient;
  • too many vectors. Three vectors in the plane are always dependent, and the theorem below proves it.
Worked example
Are (1,1,0)(1, 1, 0), (0,1,1)(0, 1, 1) and (1,0,1)(1, 0, 1) independent in R3\mathbb R^3?

Solution.

  1. Write the equation that defines independence. c1(1,1,0)+c2(0,1,1)+c3(1,0,1)=(0,0,0)c_1(1, 1, 0) + c_2(0, 1, 1) + c_3(1, 0, 1) = (0, 0, 0). The set is independent exactly when the only solution is c1=c2=c3=0c_1 = c_2 = c_3 = 0.
  2. Compare entries. The first entries give c1+c3=0c_1 + c_3 = 0, the second give c1+c2=0c_1 + c_2 = 0, and the third give c2+c3=0c_2 + c_3 = 0. One vector equation in R3\mathbb R^3 is three ordinary equations, one per entry.
  3. Solve. The first equation gives c3=−c1c_3 = -c_1 and the second gives c2=−c1c_2 = -c_1. Put both into the third: −c1−c1=0-c_1 - c_1 = 0, so c1=0c_1 = 0. Then c2=0c_2 = 0 and c3=0c_3 = 0. Substituting leaves one equation in one unknown, which has only one solution.
  4. Read the result. The all-zero solution is the only one. That is the definition of independent.

Answer. Independent. In the step-through above a free unknown appeared, and that is what a dependence looks like. Here no unknown stayed free.

Worked example
Prove: if uu and vv are independent, then u+vu + v and u−vu - v are independent.

Solution. The plan: take any combination of u+vu + v and u−vu - v that equals OO, rewrite it as a combination of uu and vv, and use the independence of uu and vv.

  1. Start with a combination equal to zero. a(u+v)+b(u−v)=Oa(u + v) + b(u - v) = O. To show a set is independent, take an arbitrary combination equal to OO and show every coefficient is 0. We name the coefficients aa and bb and assume nothing else about them.
  2. Regroup by uu and vv. (a+b)u+(a−b)v=O(a + b)u + (a - b)v = O. Axioms 8 and 9 multiply out the brackets, and axioms 3 and 4 let us collect the uu terms and the vv terms.
  3. Use the hypothesis. a+b=0a + b = 0 and a−b=0a - b = 0. uu and vv are independent, so a combination of them equal to OO must have both coefficients 0.
  4. Solve the two equations. Adding them gives 2a=02a = 0, so a=0a = 0. Then b=0b = 0. Two equations in two unknowns.

Answer. The only combination of u+vu + v and u−vu - v that equals OO has a=b=0a = b = 0, so they are independent. The same pattern proves most statements about independence: name a combination equal to OO, rewrite it, and read off the coefficients.

The key theorem: too many vectors are always dependent

This theorem is what makes “dimension” make sense. The course stated it and left the proof to Apostol. We prove it in full here, because the proof is the same elimination you just did in the step-through. We will call it the k+1k + 1 theorem.

Theorem T Apostol Thm 1.5

More vectors than a spanning set means dependent

Let x1,…,xkx_1, \dots, x_k be any vectors and L=L({x1,…,xk})L = L(\{x_1, \dots, x_k\}). Then every set of k+1k + 1 vectors in LL is linearly dependent.

In one lineIf kk vectors span a space, then any k+1k + 1 vectors in that space are linearly dependent.

Why it is trueEliminate one building block at a time. Each round uses up one of the k+1k+1 vectors and one building block, and the vectors outlast the blocks.

Two small points. The case k=0k = 0 is trivial: the span of no vectors is {O}\{O\}, so a single vector in it is OO, and 1⋅O=O1 \cdot O = O is a dependence. And we treat a ‘set’ of vectors as a list, so a list with a repeated vector counts as dependent (1⋅y−1⋅y=O1 \cdot y - 1 \cdot y = O).

Why· The picture behind the proof

Take k=2k = 2. The two arrows uu and vv in the picture below are the building blocks, and their span is the blue plane. Now pick any three vectors y1,y2,y3y_1, y_2, y_3 in that plane. The theorem says they are dependent, and the picture shows why. Each yiy_i is a mix of “some uu” and “some vv”, so a vector in the plane is described by two numbers, and three vectors carry three pairs of numbers.

The proof removes one building block at a time. Subtract the right multiple of y1y_1 from y2y_2 and from y3y_3 so that their uu-parts cancel. The two new vectors z2z_2 and z3z_3 then have no uu in them, so both lie along vv alone. Switch the picture to “v is a multiple of u” and you see that case: the plane has collapsed to a line, and two vectors on one line are dependent (the base case of the proof). Undoing the subtraction turns that dependence of z2,z3z_2, z_3 into a dependence of y1,y2,y3y_1, y_2, y_3.

ProofApostol 1.7
The idea: Induction on k. Write each of the k+1 vectors as a combination of x₁,…,x_k. Use y₁ to cancel the x₁-part from all the others (exactly like eliminating c₁ in the step-through). The k leftover vectors live in the span of only k−1 building blocks, so the induction hypothesis says they are dependent. Rewrite that dependence among the leftovers as a dependence among the original y's.
Claim: for every k≥1k \ge 1, any k+1k + 1 vectors in the span of kk vectors are dependent.
Induction on kk. The base case k=1k = 1 is checked first.CS 240 induction: prove it for the first value, then prove 'true for k−1 implies true for k'.
Let y1=ax1y_1 = a x_1 and y2=bx1y_2 = b x_1.
Base case, k=1k = 1. Everything in L({x1})L(\{x_1\}) is a multiple of x1x_1.
If a=0a = 0: 1y1+0y2=O1y_1 + 0y_2 = O. If a≠0a \ne 0: by1−ay2=abx1−abx1=Ob y_1 - a y_2 = ab x_1 - ab x_1 = O. Either way {y1,y2}\{y_1, y_2\} is dependent.
If a=0a = 0, then y1=Oy_1 = O, and 1⋅y1+0⋅y2=O1 \cdot y_1 + 0 \cdot y_2 = O has a non-zero coefficient. If a≠0a \ne 0, the combination below has the coefficient −a≠0-a \ne 0.
Assume the claim holds for k−1k - 1. Let y1,…,yk+1y_1, \dots, y_{k+1} be in L({x1,…,xk})L(\{x_1, \dots, x_k\}).
Inductive step. The hypothesis is the claim for k−1k - 1 building blocks; we prove it for kk.
Write yi=ai1x1+ai2x2+⋯+aikxky_i = a_{i1} x_1 + a_{i2} x_2 + \dots + a_{ik} x_k for i=1,…,k+1i = 1, \dots, k + 1. The number aija_{ij} is the amount of xjx_j in yiy_i.
Each yiy_i is in the span, so it is SOME combination of the xx's.In the picture (k=2k = 2): yiy_i is an arrow in the blue plane, and ai1a_{i1}, ai2a_{i2} say how far it goes along uu and along vv.
If every ai1=0a_{i1} = 0, then y1,…,yky_1, \dots, y_k lie in L({x2,…,xk})L(\{x_2, \dots, x_k\}). The hypothesis (the claim with k−1k - 1 in place of kk) says any kk vectors in the span of k−1k - 1 vectors are dependent. So y1,…,yky_1, \dots, y_k are dependent, and the whole set is too: add 0⋅yk+10 \cdot y_{k+1}.
Case 1: no yiy_i uses x1x_1 at all. Then they live in a span of k−1k - 1 vectors, and we can use the hypothesis directly.
Otherwise, renumber so that a11≠0a_{11} \ne 0.
Case 2: some yiy_i uses x1x_1. Renumber the yy's so that it is y1y_1.Renumbering does not change whether a set is dependent.
For i=2,…,k+1i = 2, \dots, k + 1, let zi=yi−ai1a11 y1z_i = y_i - \dfrac{a_{i1}}{a_{11}}\, y_1. The x1x_1-coefficient of ziz_i is ai1−ai1a11a11=0a_{i1} - \dfrac{a_{i1}}{a_{11}}a_{11} = 0.
Subtract the right multiple of y1y_1 from each other yiy_i to cancel its x1x_1-part. This is elimination: the same move as subtracting a multiple of equation 1.In the picture: each ziz_i has lost its uu-part, so it lies along vv alone. The plane has been cut down to the line case.
By the hypothesis, z2,…,zk+1z_2, \dots, z_{k+1} are dependent: ∑i=2k+1cizi=O\sum_{i=2}^{k+1} c_i z_i = O with some ci≠0c_i \ne 0.
So the kk vectors z2,…,zk+1z_2, \dots, z_{k+1} lie in the span of the k−1k - 1 vectors x2,…,xkx_2, \dots, x_k. That is exactly the induction hypothesis, with k−1k - 1 in place of kk.
O=∑i=2k+1cizi=∑i=2k+1ci(yi−ai1a11 y1).\displaystyle O = \sum_{i=2}^{k+1} c_i z_i = \sum_{i=2}^{k+1} c_i \left( y_i - \frac{a_{i1}}{a_{11}}\, y_1 \right).
Substitute the definition of each ziz_i.
O=∑i=2k+1ciyi−(∑i=2k+1ciai1a11)y1.\displaystyle O = \sum_{i=2}^{k+1} c_i y_i - \left( \sum_{i=2}^{k+1} \frac{c_i a_{i1}}{a_{11}} \right) y_1.
Multiply out and collect the y1y_1 terms into one coefficient.
So {y1,…,yk+1}\{y_1, \dots, y_{k+1}\} is dependent. By induction, the claim holds for every kk.
This is a combination of y1,…,yk+1y_1, \dots, y_{k+1} equal to OO, and some cic_i with i≥2i \ge 2 is non-zero, so not all coefficients are zero.
Same idea elsewhere· Where the idea came from

Each round of the proof spends one building block (x1x_1) and one vector (y1y_1). After kk rounds no building blocks are left, but one vector is still left over. A vector built from no building blocks can only be OO, and that forces a dependence. In matrix language (chapter 2.6): a system of equations with more unknowns than equations always has a non-zero solution.

Quick checkWhich statement does the k+1k + 1 theorem guarantee?
Worked example
Are (2,1)(2, 1), (0,3)(0, 3) and (5,−4)(5, -4) independent in R2\mathbb R^2? If not, find a dependence.

Solution.

  1. Count first. There are three vectors in R2\mathbb R^2, which is spanned by two vectors, (1,0)(1, 0) and (0,1)(0, 1). The k+1k + 1 theorem with k=2k = 2 says any 3 vectors there are dependent, so the answer is known before any algebra.
  2. Set up the equation to find the dependence. c1(2,1)+c2(0,3)+c3(5,−4)=(0,0)c_1(2, 1) + c_2(0, 3) + c_3(5, -4) = (0, 0) gives 2c1+5c3=02c_1 + 5c_3 = 0 and c1+3c2−4c3=0c_1 + 3c_2 - 4c_3 = 0. The theorem says a non-zero solution exists. Solving shows what it is.
  3. Choose the free unknown. There are two equations and three unknowns, so c3c_3 can be chosen. Take c3=6c_3 = 6. The first equation gives c1=−52c3c_1 = -\tfrac52 c_3, and c3=6c_3 = 6 clears the fraction.
  4. Solve for the rest. c1=−15c_1 = -15. The second equation gives 3c2=−c1+4c3=15+24=393c_2 = -c_1 + 4c_3 = 15 + 24 = 39, so c2=13c_2 = 13. Back-substitution, as in the step-through above.
  5. Check by multiplying out. −15(2,1)+13(0,3)+6(5,−4)=(−30+0+30, −15+39−24)=(0,0)-15(2, 1) + 13(0, 3) + 6(5, -4) = (-30 + 0 + 30,\ -15 + 39 - 24) = (0, 0). The coefficients −15,13,6-15, 13, 6 are not all zero, so this is a genuine dependence.

Answer. Dependent. Equivalently (5,−4)=52(2,1)−136(0,3)(5, -4) = \tfrac52 (2, 1) - \tfrac{13}{6}(0, 3): the third vector is wasted.

No waste and nothing missing: basis and dimension

Where this came from· Where basis and dimension came from

Hermann Grassmann, a school teacher in Stettin, published his Ausdehnungslehre (theory of extension) in 1844. He wanted an algebra for geometric objects that works in any number nn of dimensions, not only the 2 and 3 of everyday pictures. For that he needed a way to say “how many independent directions”, which is the idea of independence and dimension used in this chapter. Few mathematicians read the book at the time, partly because it was so abstract. Giuseppe Peano restated its ideas with axioms in 1888, close to the ten axioms of 2.1. The k+1k + 1 theorem is today called the Steinitz exchange lemma, after Ernst Steinitz, who proved it in the early 1910s.

Definition T

Basis

A finite set B={e1,…,en}B = \{e_1, \dots, e_n\} in VV is a basis of VV if it is linearly independent and spans VV.

In one lineAn independent set that spans the whole space: enough vectors to build everything, and none wasted.

Why it existsIt lets you describe every vector by a list of numbers, its coordinates, in exactly one way.

Spagnolie: “There is never a unique basis for a space!” For the polynomials P2P_2 of degree at most 2, both {1,t,t2}\{1, t, t^2\} (the standard basis) and {1,t+2,t2−t}\{1, t + 2, t^2 - t\} work. To see that the second spans, write t=(t+2)−2⋅1t = (t + 2) - 2 \cdot 1 and t2=(t2−t)+tt^2 = (t^2 - t) + t. It is independent too: if c0+c1(t+2)+c2(t2−t)=0c_0 + c_1(t + 2) + c_2(t^2 - t) = 0, the t2t^2 coefficient gives c2=0c_2 = 0, then the tt coefficient gives c1=0c_1 = 0, then c0=0c_0 = 0.

Quick checkThe set {(1,0),(0,1),(1,1)}\{(1, 0), (0, 1), (1, 1)\} spans R2\mathbb R^2. Is it a basis of R2\mathbb R^2?
Theorem T Apostol Thm 1.6

All bases have the same size

If a vector space VV has a basis of nn elements, then every basis of VV has exactly nn elements.

In one lineIf VV has a basis with nn elements, every basis of VV has nn elements.

Why it is trueEach basis spans, and the other basis is independent. By the k+1k + 1 theorem an independent set cannot outnumber a spanning set, so each basis is at most as big as the other.

ProofApostol 1.8
The idea: Compare two bases using the theorem above, in both directions.
Let BB be a basis with nn elements and B′B' a basis with mm elements.
Two bases, sizes nn and mm.
Every element of B′B' lies in V=L(B)V = L(B). If m>nm > n, some n+1n + 1 elements of B′B' would be dependent, which is impossible since B′B' is independent. So m≤nm \le n.
BB spans VV. If m≥n+1m \ge n + 1, then any n+1n + 1 elements of B′B' are n+1n + 1 vectors in the span of the nn vectors of BB, so by the k+1k + 1 theorem they are dependent. But a subset of an independent set is independent (proved in the problems below).
Likewise n≤mn \le m. So m=nm = n.
The same argument with the roles of BB and B′B' swapped.
Definition T

Dimension

If VV has a basis with nn elements, VV has dimension nn, written dim⁡V=n\dim V = n. The space {O}\{O\} has dimension 0. Its basis is the empty set: the empty set is independent (there is no combination to check), and by convention its span is {O}\{O\}. If VV has no finite basis, then VV is infinite-dimensional.

In one lineThe number of vectors in any basis. It is the number of independent directions, the number of coordinates you need.

Why it existsThe theorem above makes it well defined: it does not depend on which basis you pick.

Examples from Lecture 3:

  • dim⁡R3=3\dim \mathbb R^3 = 3, with standard basis (1,0,0),(0,1,0),(0,0,1)(1,0,0), (0,1,0), (0,0,1). In general dim⁡Rn=n\dim \mathbb R^n = n.
  • dim⁡P4=5\dim P_4 = 5, with basis 1,t,t2,t3,t41, t, t^2, t^3, t^4. Watch the count: degree at most 4 means five coefficients.
  • The line {(x,y):x+y=0}\{(x, y) : x + y = 0\} has basis {(1,−1)}\{(1, -1)\}, so its dimension is 1.
  • All polynomials, with no limit on the degree, form an infinite-dimensional space. If some kk polynomials spanned them, any k+1k + 1 polynomials would be dependent by the k+1k + 1 theorem. But 1,t,…,tk1, t, \dots, t^k are k+1k + 1 independent polynomials.
Worked example
Find a basis and the dimension of W={(x,y,z,w)∈R4:x+y=0 and z=2w}W = \{(x, y, z, w) \in \mathbb R^4 : x + y = 0 \text{ and } z = 2w\}.

Solution.

  1. Solve the conditions for some coordinates. The conditions give y=−xy = -x and z=2wz = 2w. That leaves xx and ww free to choose. Each independent condition fixes one coordinate in terms of the others. The coordinates still free tell you the dimension.
  2. Write a general element of WW. (x,−x,2w,w)=x(1,−1,0,0)+w(0,0,2,1)(x, -x, 2w, w) = x(1, -1, 0, 0) + w(0, 0, 2, 1). Pull out the free numbers xx and ww as coefficients.
  3. Spanning. Every element of WW is a combination of (1,−1,0,0)(1, -1, 0, 0) and (0,0,2,1)(0, 0, 2, 1). Both vectors are in WW: 1+(−1)=01 + (-1) = 0, and 0+0=00 + 0 = 0 with 2=2⋅12 = 2 \cdot 1. The two vectors must lie in WW, or their span could be bigger than WW.
  4. Independence. If a(1,−1,0,0)+b(0,0,2,1)=Oa(1, -1, 0, 0) + b(0, 0, 2, 1) = O, the first entry gives a=0a = 0 and the fourth gives b=0b = 0. Compare entries, as in the independence checks above.
  5. Count. The basis has 2 vectors. Dimension is the size of any basis.

Answer. A basis is {(1,−1,0,0), (0,0,2,1)}\{(1, -1, 0, 0),\ (0, 0, 2, 1)\}, and dim⁡W=2\dim W = 2. Two independent conditions removed two dimensions from dim⁡R4=4\dim \mathbb R^4 = 4. A repeated condition removes nothing: x+y=0x + y = 0 together with 2x+2y=02x + 2y = 0 is only one condition.

Your answerWhat is the dimension of {(x1,…,x5)∈R5:x1+x2+x3=0 and x4=x5}\{(x_1, \dots, x_5) \in \mathbb R^5 : x_1 + x_2 + x_3 = 0 \text{ and } x_4 = x_5\}?
Your answerWhat is the dimension of the space of symmetric 3×33 \times 3 matrices (those with Aij=AjiA_{ij} = A_{ji})?
Theorem T Apostol Thm 1.7

Extending to a basis

Let dim⁡V=n\dim V = n. Then:

(a) every independent set in VV is part of some basis of VV;

(b) every set of nn independent vectors in VV is a basis.

In one lineIn an nn-dimensional space, any independent set can be extended to a basis, and any nn independent vectors already form a basis.

Why it is trueKeep adding a vector outside the current span; this keeps independence and must stop after nn steps.

ProofApostol 1.8
The idea: First a lemma: adding a vector from OUTSIDE the span keeps a set independent. Then add such vectors one at a time. The process must stop, because there can never be more than n independent vectors.
Lemma. If S={x1,…,xk}S = \{x_1, \dots, x_k\} is independent and y∉L(S)y \notin L(S), then S∪{y}S \cup \{y\} (the set SS with yy added) is independent.
We prove this lemma first, then use it.
Suppose c y+∑cixi=Oc\,y + \sum c_i x_i = O.
To show a set is independent, take any combination of it equal to OO and show every coefficient is 0.
Then c=0c = 0, since otherwise y=−1c∑cixi∈L(S)y = -\frac1c \sum c_i x_i \in L(S).
If c≠0c \ne 0, solve for yy. That makes yy a combination of the xix_i, so y∈L(S)y \in L(S), contradicting the choice of yy.
So ∑cixi=O\sum c_i x_i = O, which forces every ci=0c_i = 0. Hence S∪{y}S \cup \{y\} is independent.
With c=0c = 0, what is left is a combination of the independent xix_i equal to zero.
Starting from an independent SS: while L(S)≠VL(S) \ne V, add a vector outside L(S)L(S). By the lemma, SS stays independent.
Part (a). If SS already spans, it is a basis. If not, some yy is outside its span; add it.
An independent set in VV has at most nn elements, so the process stops after at most nn additions. It stops only when L(S)=VL(S) = V. Then SS is independent and spans: a basis containing the original set.
By the k+1k + 1 theorem, with the nn basis vectors as the spanning set, any n+1n + 1 vectors of VV are dependent.
If SS has nn independent vectors, the basis from (a) contains SS and has exactly nn elements, so it is SS itself.
Part (b). Extend the nn independent vectors to a basis by part (a). Every basis has nn elements, so nothing was added.
Proof workshopGive the reason for each line of the lemma: adding a vector outside the span keeps independence

Each line of the proof is shown in order. Choose the reason that justifies it, then press Check.

  1. Let S={x1,…,xk}S = \{x_1, \dots, x_k\} be independent and y∉L(S)y \notin L(S). Suppose c y+∑cixi=Oc\,y + \sum c_i x_i = O.
  2. If c≠0c \ne 0, then y=−1c∑cixiy = -\frac1c \sum c_i x_i.
  3. Then y∈L(S)y \in L(S), which contradicts the choice of yy. So c=0c = 0.
  4. Now ∑cixi=O\sum c_i x_i = O.
  5. Every ci=0c_i = 0, so S∪{y}S \cup \{y\} is independent.
Quick checkYou have 3 independent vectors in R4\mathbb R^4. Which statement is guaranteed?
Worked example
Extend the independent set {(1,1,0), (0,1,1)}\{(1, 1, 0),\ (0, 1, 1)\} to a basis of R3\mathbb R^3.

Solution.

  1. Count what is missing. dim⁡R3=3\dim \mathbb R^3 = 3 and we have 2 vectors, so we need to add exactly 1. Every basis of R3\mathbb R^3 has 3 vectors.
  2. Describe the span we already have. a(1,1,0)+b(0,1,1)=(a, a+b, b)a(1, 1, 0) + b(0, 1, 1) = (a,\ a + b,\ b). To add a vector OUTSIDE the span, we must know what the span is.
  3. Try a candidate. Is (1,0,0)(1, 0, 0) of the form (a,a+b,b)(a, a + b, b)? That needs a=1a = 1, b=0b = 0 and a+b=0a + b = 0, but a+b=1a + b = 1. Not possible, so (1,0,0)(1, 0, 0) is outside the span. Standard basis vectors are the quickest candidates to test. If one is inside the span, try the next.
  4. Add it. The set {(1,1,0),(0,1,1),(1,0,0)}\{(1,1,0), (0,1,1), (1,0,0)\} is independent by the lemma. Adding a vector outside the span keeps independence.
  5. Finish. Three independent vectors in the 3-dimensional R3\mathbb R^3 form a basis. Part (b) of ‘Extending to a basis’.

Answer. {(1,1,0),(0,1,1),(1,0,0)}\{(1,1,0), (0,1,1), (1,0,0)\} is a basis. Many other choices work: any vector off the plane {(a,a+b,b)}\{(a, a+b, b)\} would do.

Coordinates

Theorem T Apostol 1.9

Unique coordinates

Let {e1,…,en}\{e_1, \dots, e_n\} be a basis of VV. Every x∈Vx \in V can be written as x=∑i=1ncieix = \sum_{i=1}^n c_i e_i for exactly one choice of scalars c1,…,cnc_1, \dots, c_n.

In one lineIf e1,…,ene_1, \dots, e_n is a basis, each vector is ∑ciei\sum c_i e_i for exactly one list (c1,…,cn)(c_1, \dots, c_n).

Why it is trueSpanning gives at least one way; independence gives at most one, since two ways would subtract to a non-zero combination equal to zero.

Why· The picture behind the proof

In the Basis2D picture above, the dashed route to the point xx is “go c1c_1 steps along b1b_1, then c2c_2 steps along b2b_2”. Each grid point has exactly one such route. Now drag b1b_1 and b2b_2 onto one line. The grid collapses, most points cannot be reached at all, and the points on the line can be reached in many ways. That is the proof in a picture. Two different routes to the same point would give a closed loop that moves along b1b_1 and b2b_2 and ends where it started. Such a loop with non-zero steps is a dependence of b1b_1 and b2b_2, and it exists only when they lie on one line.

ProofApostol 1.9
The idea: Existence comes from spanning. For uniqueness, take two representations and subtract them.
Some representation x=∑cieix = \sum c_i e_i exists.
The basis spans VV.In the picture: every point of the plane has a route along b1b_1 then b2b_2.
Suppose also x=∑dieix = \sum d_i e_i.
Suppose there is a second one.
O=x−x=∑(ci−di) eiO = x - x = \sum (c_i - d_i)\, e_i.
Subtract the two expressions for the same vector xx, and collect terms with axiom 9.In the picture: this is the closed loop from the box above, with steps ci−dic_i - d_i along the bib_i.
ci−di=0c_i - d_i = 0 for every ii, so the two representations are the same.
The basis is independent, so every coefficient of a combination equal to OO is zero.In the picture: independent arrows give no closed loop with non-zero steps.
Proof workshopRebuild the proof that coordinates are unique

Tap the lines in the order a proof would write them. Each line can only use what is already above it.

    Quick checkWhy can a vector have only ONE list of coordinates in a basis?
    Definition T

    Coordinates

    A set has no order, but a list of coordinates does, so we fix which basis vector is first, second, and so on. That choice is an ordered basis. Given an ordered basis (e1,…,en)(e_1, \dots, e_n) of VV, the numbers c1,…,cnc_1, \dots, c_n with x=∑cieix = \sum c_i e_i are the coordinates (Apostol: components) of xx in that basis.

    In one lineThe unique numbers (c1,…,cn)(c_1, \dots, c_n) with x=∑cieix = \sum c_i e_i for a chosen, ordered basis.

    Why it existsThey turn any nn-dimensional space into Rn\mathbb R^n, so everything can be computed with lists of numbers.

    Coordinates are why Rn\mathbb R^n matters so much. Once you choose a basis, a polynomial in P2P_2 becomes a list of 3 numbers, and a 2 by 2 matrix becomes a list of 4. Any nn-dimensional space then behaves exactly like Rn\mathbb R^n. Chapter 2.4 makes this precise: it calls such spaces isomorphic.

    Worked example
    Find the coordinates of x=(7,4)x = (7, 4) in the ordered basis b1=(1,2)b_1 = (1, 2), b2=(3,1)b_2 = (3, 1) of R2\mathbb R^2. Then find the coordinates of p=4+3t+2t2p = 4 + 3t + 2t^2 in the ordered basis (1, t+2, t2−t)(1,\ t + 2,\ t^2 - t) of P2P_2.

    Solution, part 1 (vectors in R2\mathbb R^2).

    1. Check that it is a basis. b2b_2 is not a multiple of b1b_1, so the two are independent. Two independent vectors in the 2-dimensional R2\mathbb R^2 form a basis, by part (b) of ‘Extending to a basis’. Without a basis, coordinates may not exist or may not be unique.
    2. Write the defining equation. c1(1,2)+c2(3,1)=(7,4)c_1(1, 2) + c_2(3, 1) = (7, 4), so c1+3c2=7c_1 + 3c_2 = 7 and 2c1+c2=42c_1 + c_2 = 4. The coordinates are the numbers that build xx from the basis.
    3. Solve. The first equation gives c1=7−3c2c_1 = 7 - 3c_2. Put that into the second: 14−6c2+c2=414 - 6c_2 + c_2 = 4, so c2=2c_2 = 2 and c1=1c_1 = 1. Substitution, as in the independence checks.
    4. Check. 1(1,2)+2(3,1)=(1+6, 2+2)=(7,4)1(1, 2) + 2(3, 1) = (1 + 6,\ 2 + 2) = (7, 4). Multiplying out confirms the numbers.

    Answer. The coordinates are (1,2)(1, 2). In the standard basis the same vector has coordinates (7,4)(7, 4). The list of numbers changes with the basis, and the vector does not.

    Solution, part 2 (polynomials).

    1. Write the defining equation. p=c0⋅1+c1(t+2)+c2(t2−t)p = c_0 \cdot 1 + c_1 (t + 2) + c_2 (t^2 - t). Same idea as part 1, with polynomials as the vectors.
    2. Expand and collect powers of tt. The right side is c2t2+(c1−c2) t+(c0+2c1)c_2 t^2 + (c_1 - c_2)\,t + (c_0 + 2c_1). Two polynomials are equal exactly when their coefficients match, because 1,t,t21, t, t^2 are independent.
    3. Match coefficients, from the top. t2t^2 gives c2=2c_2 = 2. Then tt gives c1−2=3c_1 - 2 = 3, so c1=5c_1 = 5. Then the constant term gives c0+10=4c_0 + 10 = 4, so c0=−6c_0 = -6. The top equation has one unknown, and each next equation has one new unknown.
    4. Check. −6+5(t+2)+2(t2−t)=−6+5t+10+2t2−2t=4+3t+2t2-6 + 5(t + 2) + 2(t^2 - t) = -6 + 5t + 10 + 2t^2 - 2t = 4 + 3t + 2t^2. It returns pp.

    Answer. The coordinates are (−6,5,2)(-6, 5, 2). In the standard basis 1,t,t21, t, t^2 they are (4,3,2)(4, 3, 2).

    Your answerWrite (10,5)=c1(1,2)+c2(3,1)(10, 5) = c_1 (1, 2) + c_2 (3, 1) in the basis b1=(1,2)b_1 = (1, 2), b2=(3,1)b_2 = (3, 1). What is c2c_2?

    Examples and non-examples

    Polynomials 1,t,…,tn1, t, \dots, t^n are independent. This is Spagnolie’s Lecture 3 proof. Suppose F(t)=c0+c1t+⋯+cntnF(t) = c_0 + c_1 t + \dots + c_n t^n is the zero function. Since FF is zero for every tt, so are all its derivatives. Then F(0)=c0=0F(0) = c_0 = 0. Differentiate: F′(0)=c1=0F'(0) = c_1 = 0. Differentiating jj times and setting t=0t = 0 gives j! cj=0j!\,c_j = 0. So every cj=0c_j = 0.

    cos⁡2t\cos^2 t, sin⁡2t\sin^2 t and 11 are dependent, because 1⋅cos⁡2t+1⋅sin⁡2t−1⋅1=01 \cdot \cos^2 t + 1 \cdot \sin^2 t - 1 \cdot 1 = 0 for every tt. A dependence among functions must hold at every tt, and this one does.

    eate^{at} and t eatt\,e^{at} are independent (Apostol 1.10 #23(b)). If c0eat+c1teat=0c_0 e^{at} + c_1 t e^{at} = 0 for all tt, divide by eate^{at}, which is never 0: c0+c1t=0c_0 + c_1 t = 0 for all tt. A polynomial that is zero everywhere has zero coefficients, so c0=c1=0c_0 = c_1 = 0.

    Worked example
    Show that sin⁡t\sin t and cos⁡t\cos t are independent. Then show that 11, tt and e2te^{2t} are independent.

    For functions, "F=0F = 0" means F(t)=0F(t) = 0 for EVERY tt. That lets us pick values of tt, or differentiate, to get equations for the coefficients.

    Solution, part 1 (evaluate at chosen points).

    1. Set up. Suppose c1sin⁡t+c2cos⁡t=0c_1 \sin t + c_2 \cos t = 0 for every tt. Independence means this forces c1=c2=0c_1 = c_2 = 0.
    2. Put t=0t = 0. c1⋅0+c2⋅1=0c_1 \cdot 0 + c_2 \cdot 1 = 0, so c2=0c_2 = 0. sin⁡0=0\sin 0 = 0 and cos⁡0=1\cos 0 = 1, so one point kills one unknown.
    3. Put t=π/2t = \pi/2. c1⋅1+c2⋅0=0c_1 \cdot 1 + c_2 \cdot 0 = 0, so c1=0c_1 = 0. sin⁡(π/2)=1\sin(\pi/2) = 1 and cos⁡(π/2)=0\cos(\pi/2) = 0. The equation holds at every tt, so it holds at this one.

    Solution, part 2 (differentiate).

    1. Set up. Suppose F(t)=c0+c1t+c2e2t=0F(t) = c_0 + c_1 t + c_2 e^{2t} = 0 for every tt. Same idea.
    2. Differentiate twice. F′(t)=c1+2c2e2t=0F'(t) = c_1 + 2c_2 e^{2t} = 0 and F′′(t)=4c2e2t=0F''(t) = 4c_2 e^{2t} = 0. The zero function has zero derivatives. Each derivative removes a term: the constant first, then tt.
    3. Solve from the bottom. 4c2e2t=04c_2 e^{2t} = 0 and e2t≠0e^{2t} \ne 0, so c2=0c_2 = 0. Then F′F' gives c1=0c_1 = 0, and FF gives c0=0c_0 = 0. Each equation has only one new unknown, so we can climb back up.

    Answer. Both sets are independent. Evaluating at points works when a few values of tt give a solvable system. Differentiating works when each derivative removes a term.

    Worked example MATH 375 HW2, Apostol 1.10 #14
    Let S={f∈Pn:f(0)+f′(0)=0}S = \{f \in P_n : f(0) + f'(0) = 0\}. Find a basis of SS and its dimension.

    Solution.

    1. Write a general ff. f=c0+c1t+⋯+cntnf = c_0 + c_1 t + \dots + c_n t^n, so f(0)=c0f(0) = c_0 and f′(0)=c1f'(0) = c_1. The condition is about ff and f′f' at 0, and only the constant and linear coefficients show up there.
    2. Translate the condition. c0+c1=0c_0 + c_1 = 0, so c1=−c0c_1 = -c_0. The condition is one linear equation on the n+1n + 1 coefficients.
    3. Substitute and factor. f=c0(1−t)+c2t2+⋯+cntnf = c_0 (1 - t) + c_2 t^2 + \dots + c_n t^n. So {1−t,t2,…,tn}\{1 - t, t^2, \dots, t^n\} spans SS. Every element of SS has this form, and each of these polynomials satisfies the condition itself.
    4. Check independence. If a(1−t)+b2t2+⋯+bntn=0a(1 - t) + b_2 t^2 + \dots + b_n t^n = 0, the constant term gives a=0a = 0, and then each bj=0b_j = 0. Only 1−t1 - t has a constant term, and t2,…,tnt^2, \dots, t^n are independent.
    5. Count. The basis has 1+(n−1)=n1 + (n - 1) = n vectors. Dimension is the size of any basis.

    Answer. dim⁡S=n\dim S = n. One linear condition on n+1n + 1 coefficients removed exactly one dimension.

    Where it is used

    Used inside maths· Inside maths: solution spaces of differential equations

    The solutions of y′′+y=0y'' + y = 0 form a vector space of dimension 2, with basis {cos⁡t,sin⁡t}\{\cos t, \sin t\}. Chapter 7.2 proves that an order-nn linear homogeneous equation always has an nn-dimensional solution space. So you never need more than nn “basic” solutions, and you need all nn of them. That is why MATH 376 looked for exactly two solutions of a second-order equation.

    Used in the real world· Signals: JPEG is a change of basis

    A JPEG cuts an image into 8 by 8 blocks. Each block is a vector in R64\mathbb R^{64}: 64 brightness values. In the standard basis, its coordinates are those 64 pixel values. JPEG switches to a different basis of R64\mathbb R^{64}, made of 64 cosine patterns running from smooth to finely striped (the discrete cosine transform). In the new basis, most coordinates of a typical photo block are tiny, because photos are mostly smooth. JPEG stores the few large coordinates and throws the tiny ones away. The change of basis itself saves nothing. It is what makes the saving possible: after it, rounding off the tiny coordinates and storing the few large ones compactly is what shrinks a 20 MB photo to about 2 MB.

    Used in the real world· AI: dimension of a representation

    A language model such as BERT-base turns each token into a vector in R768\mathbb R^{768}. “768-dimensional” is this chapter’s dimension: 768 coordinates in the standard basis. LoRA, a popular way to fine-tune such models, learns a change ΔW\Delta W to each weight matrix that has low rank (for example rank 8). For a 768 by 768 matrix that means about 12,000 trainable numbers instead of about 590,000, roughly 48 times fewer. Chapter 3.4 explains rank and why low rank works.

    Traps

    Watch out· Independence belongs to the whole set

    Independence is a property of a whole set, not of the vectors one at a time. Vectors that look fine individually can still be dependent together. (1,2,3)(1,2,3), (4,5,6)(4,5,6) and (7,8,9)(7,8,9) are each non-zero, and no two lie on one line, yet the three are dependent, as the step-through above showed.

    Watch out· Count the coefficients

    dim⁡Pn=n+1\dim P_n = n + 1. The polynomials of degree at most 2 need three numbers: c0c_0, c1c_1 and c2c_2.

    Watch out· Spanning and independence are separate checks

    A basis needs both. {(1,0),(0,1),(1,1)}\{(1,0), (0,1), (1,1)\} spans R2\mathbb R^2 but is dependent. {(1,0)}\{(1,0)\} is independent but does not span. In an nn-dimensional space, ‘Extending to a basis’ (part b) saves half the work: nn independent vectors automatically span.

    Watch out· A typo in the course notes

    Lecture 3 lists {1,t,t3}\{1, t, t^3\} as the standard basis of P2P_2. It should be {1,t,t2}\{1, t, t^2\}: t3t^3 is not even in P2P_2.

    Problems

    checkSpagnolie Lecture 3

    Is {(1,0),(1,1),(−1,3)}\{(1, 0), (1, 1), (-1, 3)\} independent in R2\mathbb R^2? Answer without solving any equations.

    Solution

    No. Three vectors in a space spanned by two vectors are dependent (the k+1k + 1 theorem). Concretely, (−1,3)=−4(1,0)+3(1,1)(-1, 3) = -4(1, 0) + 3(1, 1).

    check

    What is the dimension of (a) R2×3\mathbb R^{2 \times 3}, (b) P3P_3, (c) the plane {(x,y,z):x+y+z=0}\{(x, y, z) : x + y + z = 0\}?

    Solution

    (a) 6: one basis matrix for each entry. (b) 4: 1,t,t2,t31, t, t^2, t^3. (c) 2. The condition gives x=−y−zx = -y - z, so every element is (−y−z,y,z)=y(−1,1,0)+z(−1,0,1)(-y - z, y, z) = y(-1, 1, 0) + z(-1, 0, 1). The two vectors (−1,1,0)(-1, 1, 0) and (−1,0,1)(-1, 0, 1) span the plane and are independent, so they form a basis.

    check

    Does a set containing the zero vector ever count as independent?

    Solution

    Never. 1⋅O+0⋅(the rest)=O1 \cdot O + 0 \cdot (\text{the rest}) = O is a combination equal to zero with a non-zero coefficient.

    useApostol 1.10 #9

    Show S={(x,y,z):y=2x, z=3x}S = \{(x, y, z) : y = 2x,\ z = 3x\} is a subspace of R3\mathbb R^3 and find its dimension.

    Solution

    Every element is (x,2x,3x)=x(1,2,3)(x, 2x, 3x) = x(1, 2, 3), so S=L({(1,2,3)})S = L(\{(1, 2, 3)\}), which is a subspace because a span is a subspace. The set {(1,2,3)}\{(1, 2, 3)\} is independent (one non-zero vector) and spans SS, so dim⁡S=1\dim S = 1. Geometrically, SS is a line through the origin.

    useApostol 1.10 #17

    Find a basis and the dimension of the even polynomials in PnP_n (those with f(−t)=f(t)f(-t) = f(t)).

    Solution

    f(−t)=f(t)f(-t) = f(t) means cj(−1)j=cjc_j(-1)^j = c_j for every jj, which forces cj=0c_j = 0 for odd jj. So a basis is {1,t2,t4,… }\{1, t^2, t^4, \dots\}, up to the largest even power that is at most nn. Its dimension is n/2+1n/2 + 1 if nn is even, and (n+1)/2(n + 1)/2 if nn is odd.

    useApostol 1.10 #23(a)

    For a≠ba \ne b, both non-zero, show that 1,eat,ebt1, e^{at}, e^{bt} are independent.

    Solution

    Suppose F(t)=c0+c1eat+c2ebt=0F(t) = c_0 + c_1 e^{at} + c_2 e^{bt} = 0 for all tt. Then F′(t)=ac1eat+bc2ebt=0F'(t) = a c_1 e^{at} + b c_2 e^{bt} = 0 and F′′(t)=a2c1eat+b2c2ebt=0F''(t) = a^2 c_1 e^{at} + b^2 c_2 e^{bt} = 0. At t=0t = 0: ac1+bc2=0a c_1 + b c_2 = 0 and a2c1+b2c2=0a^2 c_1 + b^2 c_2 = 0. Multiply the first by aa and subtract from the second: (b2−ab)c2=b(b−a)c2=0(b^2 - ab)c_2 = b(b - a)c_2 = 0. Since b≠0b \ne 0 and b≠ab \ne a, c2=0c_2 = 0. Then ac1=0a c_1 = 0 with a≠0a \ne 0, so c1=0c_1 = 0. Finally F(0)=c0=0F(0) = c_0 = 0.

    use

    Find the coordinates of x=(3,1)x = (3, 1) in the basis b1=(1,1)b_1 = (1, 1), b2=(1,−1)b_2 = (1, -1). Check them in the Basis2D visualizer by dragging.

    Solution

    Solve c1(1,1)+c2(1,−1)=(3,1)c_1(1, 1) + c_2(1, -1) = (3, 1): c1+c2=3c_1 + c_2 = 3 and c1−c2=1c_1 - c_2 = 1. Adding gives c1=2c_1 = 2, then c2=1c_2 = 1. Coordinates (2,1)(2, 1). Check: 2(1,1)+1(1,−1)=(3,1)2(1,1) + 1(1,-1) = (3, 1).

    prove

    Prove that any subset of an independent set is independent.

    Solution

    Let SS be independent and T⊆ST \subseteq S. Suppose a combination of elements of TT equals OO. Give every element of SS that is not in TT the coefficient 0. That gives a combination of elements of SS equal to OO, so every coefficient is zero by the independence of SS, including those on TT. So TT is independent.

    proveApostol 1.10, adapted

    Let dim⁡V=n\dim V = n. Prove that any nn vectors that span VV form a basis.

    Solution

    Suppose S={x1,…,xn}S = \{x_1, \dots, x_n\} spans VV but is dependent. Then some xjx_j is a combination of the others, so removing it leaves a set of n−1n - 1 vectors that still spans VV: anything built using xjx_j can be rebuilt with xjx_j replaced by its expression. But VV has a basis of nn independent vectors, and by the k+1k + 1 theorem, nn vectors in the span of n−1n - 1 vectors are dependent. That is a contradiction, so SS is independent, and it is a basis.

    prove

    Prove: if WW is a subspace of VV and dim⁡V=n\dim V = n, then dim⁡W≤n\dim W \le n, with equality only if W=VW = V.

    Solution

    By the k+1k + 1 theorem, any independent set in WW, which is also in VV, has at most nn elements. So build a basis of WW as in ‘Extending to a basis’ (part a), starting from the empty set and adding vectors of WW outside the current span. This stops after at most nn steps, so WW has a basis and dim⁡W≤n\dim W \le n. If dim⁡W=n\dim W = n, a basis of WW is nn independent vectors in VV, so it is a basis of VV by ‘Extending to a basis’ (part b). Then W=L(basis)=VW = L(\text{basis}) = V.

    prove

    Prove that the span of SS is the smallest subspace containing SS: if WW is a subspace with S⊆WS \subseteq W, then L(S)⊆WL(S) \subseteq W.

    Solution

    Take any element ∑cixi\sum c_i x_i of L(S)L(S). Each xix_i is in SS, hence in WW. By closure under scaling, each cixi∈Wc_i x_i \in W. By closure under addition, applied k−1k - 1 times, the sum is in WW. So L(S)⊆WL(S) \subseteq W.

    stretchAxler 2C

    Let UU and WW be subspaces of a finite-dimensional space. Let U+WU + W be the set of all sums u+wu + w with u∈Uu \in U and w∈Ww \in W. Show U+WU + W is a subspace, and prove

    dim⁡(U+W)=dim⁡U+dim⁡W−dim⁡(U∩W).\dim(U + W) = \dim U + \dim W - \dim(U \cap W).
    Solution

    U+WU + W contains O+OO + O, and (u+w)+(u′+w′)=(u+u′)+(w+w′)(u + w) + (u' + w') = (u + u') + (w + w') and a(u+w)=au+awa(u + w) = au + aw, so it is a subspace.

    For the formula, take a basis v1,…,vmv_1, \dots, v_m of U∩WU \cap W. Extend it to a basis v1,…,vm,u1,…,ujv_1, \dots, v_m, u_1, \dots, u_j of UU, and separately to a basis v1,…,vm,w1,…,wkv_1, \dots, v_m, w_1, \dots, w_k of WW (‘Extending to a basis’ (part a)). The combined list vv‘s, uu‘s, ww‘s spans U+WU + W. Suppose ∑aivi+∑biui+∑ciwi=O\sum a_i v_i + \sum b_i u_i + \sum c_i w_i = O. Then ∑ciwi=−∑aivi−∑biui\sum c_i w_i = -\sum a_i v_i - \sum b_i u_i lies in UU, and also in WW, so it is in U∩WU \cap W. So ∑ciwi=∑divi\sum c_i w_i = \sum d_i v_i for some did_i, that is, ∑ciwi−∑divi=O\sum c_i w_i - \sum d_i v_i = O. The vv‘s and ww‘s together are a basis of WW, hence independent, so all ci=0c_i = 0 (and all di=0d_i = 0). Then ∑aivi+∑biui=O\sum a_i v_i + \sum b_i u_i = O forces all ai=bi=0a_i = b_i = 0. So the list is a basis, and

    dim⁡(U+W)=m+j+k=(m+j)+(m+k)−m.\dim(U + W) = m + j + k = (m + j) + (m + k) - m.

    This is the vector-space version of inclusion–exclusion, ∣A∪B∣=∣A∣+∣B∣−∣A∩B∣|A \cup B| = |A| + |B| - |A \cap B|, from CS 240.

    Summary

    • The span of some vectors is everything they can build; it is always a subspace, the smallest one containing them.
    • A set is dependent if some combination with coefficients not all zero gives OO. Equivalently, one vector is a combination of the others: it is wasted.
    • To test independence, set ∑cixi=O\sum c_i x_i = O and solve. Independent means the only solution is all ci=0c_i = 0.
    • Key theorem: k+1k + 1 vectors in the span of kk vectors are dependent. The proof is elimination plus induction.
    • A basis is independent and spanning. All bases of a space have the same size, the dimension.
    • In an nn-dimensional space, nn independent vectors form a basis, nn spanning vectors form a basis, and any independent set extends to a basis.
    • A basis gives every vector unique coordinates, so an nn-dimensional space can be computed in as if it were Rn\mathbb R^n.

    Watch and read

    The same ideas explained by someone else. Use these when an explanation here does not land.

    Where this sits

    Comes from
    2.1 Vector spaces and subspaces
    Leads to
    2.3 Linear maps, null space, range, rank–nullity
    Same idea elsewhere
    CS 240: The main proof here is an induction on the number of vectors. It is the same induction you wrote in CS 240, used on a harder statement.
    MATH 376: 'The general solution of y'' + y = 0 is a cos t + b sin t' means that cos and sin are a basis of the solution space, which has dimension 2.
    CS 532 / AI: The 'dimension' of a dataset or of an embedding (768 numbers per token in BERT) is exactly this dimension: the number of coordinates needed.