Basis & Dimension of Vector Spaces
2391 words
12 min read
Visual companion
Python
Type and operator map
Python Week 1: the first filter for runtime behavior
View
Revision summary
What this note is really saying
Short form
# Basis & Dimension of Vector Spaces ## 🎯 Learning Objectives After this topic you will be able to: - Define a basis of a vector space - Prove that all bases of a finite-dimensional space have the same size (dimension) - Determine whether a given set is a basis for a vector space - Find a basis for a subspace given...

Basis & Dimension of Vector Spaces
🎯 Learning Objectives
After this topic you will be able to:
- Define a basis of a vector space
- Prove that all bases of a finite-dimensional space have the same size (dimension)
- Determine whether a given set is a basis for a vector space
- Find a basis for a subspace given in parametric or implicit form
- Compute the dimension of common vector spaces
- Use dimension to reason about subspaces
📋 Prerequisites
- Linear Independence and Span (Week 3) — a basis is an independent spanning set
- Gaussian Elimination (Week 2) — used to find bases computationally
- A basis is the "minimal" set of vectors you need to describe the whole space
1. Intuition: The Skeleton of a Space
Imagine you're describing locations in a city. You could say:
- "3 blocks east, 2 blocks north"
- That's a coordinate relative to two reference directions (east, north). A basis is a set of reference directions that lets you describe every point in a vector space uniquely and efficiently. (Diagram) Key properties of a basis:
- Spanning: Every vector in the space can be written as a combination of basis vectors
- Independence: The representation is unique (no redundancy)
2. Definition of a Basis
>e1=(1,0,0),e2=(0,1,0),e3=(0,0,1)>Definition (Basis). A set B={b1,b2,…,bn} of vectors in a vector space V is a basis of V if:
- B is linearly independent
- B spans V (i.e., span(B)=V) Example 1: Standard basis of Rn
The standard basis of R3 is:
>{c1+3c2=02c1−c2=0⇒c1=−3c2,2(−3c2)−c2=−7c2=0⇒c2=0⇒c1=0>Independence: c1(1,0,0)+c2(0,1,0)+c3(0,0,1)=(c1,c2,c3)=(0,0,0)⇒c1=c2=c3=0 ✓Spanning: Any (x,y,z)=xe1+ye2+ze3 ✓ Example 2: A non-standard basis of R2B={(1,2),(3,−1)}Independence: Check c1(1,2)+c2(3,−1)=(0,0):
Independent ✓Spanning: For any (x,y), solve (x,y)=c1(1,2)+c2(3,−1): c1=7x+3y, c2=72x−y — solution exists for all (x,y) ✓So B is a basis. Coordinates of (x,y) in this basis are (7x+3y,72x−y).
2.1 Uniqueness of Representation
>v=c1b1+c2b2+⋯+cnbn>Theorem. If B={b1,…,bn} is a basis of V, then every v∈V has a unique representation:
Proof: Since B spans V, a representation exists. Suppose two representations exist:
Subtracting: (c1−d1)b1+⋯+(cn−dn)bn=0. Since B is independent, all ci−di=0, so ci=di for all i. The representation is unique. ∎
The scalars ci are called the coordinates of v relative to the basis B, written [v]B.
3. Dimension
3.1 All Bases Have the Same Size
Theorem (Invariance of Dimension). If V has a basis with n vectors, then every basis of V has exactly n vectors. Proof SketchLet B1 have n vectors and B2 have m vectors, both bases of V.
- Since B1 spans V and B2 is independent, the Exchange Theorem (Steinitz) gives m≤n.
- Since B2 spans V and B1 is independent, n≤m.
- Therefore m=n. This number is called the dimension of V, denoted dim(V). Definition (Dimension). The dimension of a vector space V is the number of vectors in any basis of V. If V={0}, dim(V)=0.
3.2 Dimensions of Common Spaces
| Vector Space | Dimension | Basis |
|---|---|---|
| Rn | n | {e1,…,en} |
| Rm×n | mn | Matrices with a single 1 and rest 0 |
| Pn (polynomials ≤n ) | n+1 | {1,x,x2,…,xn} |
| Line through origin in R3 | 1 | Any non-zero vector on the line |
| Plane through origin in R3 | 2 | Any two independent vectors in the plane |
| {0} | 0 | ∅ (empty set) |
| C[a,b] (continuous functions) | ∞ | Not finite (infinite-dimensional) |
4. Finding Bases
4.1 From a Spanning Set to a Basis
Given a spanning set, we can find a basis by discarding dependent vectors.
Algorithm (Row method):
- Write the vectors as rows of a matrix
- Row reduce to RREF
- The non-zero rows form a basis for the span Algorithm (Column method):
- Write the vectors as columns of a matrix
- Row reduce to RREF
- The original columns corresponding to pivot columns form a basis
>123123511453RREF100001005−200>Example 3: Finding a basis from a spanning setFind a basis for span{(1,2,1),(2,3,4),(3,5,5),(1,1,3)}.Row method:
>121234355113RREF100010110−110>Non-zero rows: {(1,0,5),(0,1,−2)} form a basis. Dimension = 2.Column method:
Pivots in columns 1 and 2. So original vectors {(1,2,1),(2,3,4)} form a basis.
4.2 Finding a Basis for a Subspace Defined by Equations
For a subspace defined by homogeneous equations (like Ax=0):
- Solve the system using Gaussian elimination
- Express the solution in parametric form
- The vectors multiplying the free parameters form a basis for the null space
>xyz=y−210+z101>Example 4: Basis for a plane subspaceFind a basis for W={(x,y,z)∈R3∣x+2y−z=0}.x=−2y+z, y,z free.
Basis: {(−2,1,0),(1,0,1)}. Dimension = 2.
4.3 Finding a Basis for the Column Space
The pivot columns of A (original columns, not the RREF columns) form a basis for the column space.
>A=101213011101RREF100010−210100>Example 5: Basis for column space
>⎩⎨⎧101,213⎭⎬⎫>Pivots in columns 1 and 2. Basis for C(A): columns 1 and 2 of original A:
5. Dimension and Subspaces
Theorem. If W is a subspace of a finite-dimensional vector space V, then:
dim(W)≤dim(V) dim(W)=dim(V) if and only if W=V Example 6: Dimensions of subspaces of R3
| Subspace Type | Dimension |
|---|---|
| {0} | 0 |
| Line through origin | 1 |
| Plane through origin | 2 |
| R3 | 3 |
6. Edge Cases & Gotchas
| Situation | What Happens |
|---|---|
| **Trivial space {0} ** | Has dimension 0; its basis is the empty set |
| Infinite-dimensional spaces | C[a,b] , P∞ (all polynomials) have no finite basis |
| Coordinates depend on basis | A vector (1,2) has different coordinates in different bases |
| Column vs. row space bases | They come from different methods but have the same dimension |
7. Common Pitfalls
❌ Pitfall 1: Confusing dimension of a vector space with number of entries
R3 has dimension 3, but a plane inside it has dimension 2 (even though vectors in the plane still have 3 components).
❌ Pitfall 2: Taking RREF columns as basis vectors
The pivot columns of the original matrix form a basis for the column space, not the RREF columns (which are in a different coordinate system).
❌ Pitfall 3: Thinking a set must be orthogonal to be a basis
Any independent spanning set is a basis. Orthogonality (Week 8) is a convenience, not a requirement.
❌ Pitfall 4: A spanning set with too few vectors
If you have fewer than dim(V) vectors, they cannot span V. If you have more than dim(V) vectors, they cannot be independent. Either way, they're not a basis.
8. Formula Summary Table
| Concept | Key Fact |
|---|---|
| Basis | Independent spanning set |
| Dimension | Number of vectors in any basis |
| **Standard basis of Rn ** | e1,…,en |
| **Standard basis of Pn ** | {1,x,x2,…,xn} |
| ** dim(Rm×n) ** | mn |
| Basis from spanning set | Row reduce; non-zero rows = basis |
| Basis for null space | Parametric solution vectors |
| Basis for column space | Original columns at pivot positions |
9. 📝 Practice Questions
>{x=y−2zw=y+z>Q1: Is this a basis?Is B={(1,1),(1,−1)} a basis for R2?Solution: Check independence: c1(1,1)+c2(1,−1)=(c1+c2,c1−c2)=(0,0) ⇒ c1+c2=0, c1−c2=0 ⇒ c1=c2=0. Independent ✓Check spanning: For any (x,y), solve c1+c2=x, c1−c2=y ⇒ c1=2x+y, c2=2x−y. Exists for all (x,y) ✓Yes, B is a basis. Q2: Not a basis — dependentIs B={(1,2,3),(2,4,6),(1,1,1)} a basis for R3?Solution: (2,4,6)=2(1,2,3), so the set is dependent. Not a basis.Dimension of span is at most 2 (actually {(1,2,3),(1,1,1)} spans a plane). Q3: Not a basis — doesn't spanIs B={(1,0,0),(0,1,0)} a basis for R3?Solution: It spans the xy-plane only, not all of R3 (e.g., (0,0,1) cannot be formed). Not a basis. Q4: Dimension of a subspaceFind a basis and the dimension of W={(x,y,z,w)∣x−y+2z=0,y+z−w=0}.Solution: Solve:
>xyzw=y1101+z−2011>y,z free.
>110020101001RREF100001000010>Basis: {(1,1,0,1),(−2,0,1,1)}. Dimension = 2. Q5: Basis for polynomial subspaceFind a basis for W={p(x)∈P2∣p(1)=0}.Solution: p(x)=a+bx+cx2, p(1)=a+b+c=0, so a=−b−c.p(x)=(−b−c)+bx+cx2=b(x−1)+c(x2−1).Basis: {x−1,x2−1}. Dimension = 2. Q6: Extending to a basisExtend {(1,2,1)} to a basis of R3.Solution: Add standard basis vectors and eliminate dependent ones.
>[abbc]=a[1000]+b[0110]+c[0001]>Pivots in rows 1-3, so {(1,2,1),(1,0,0),(0,1,0)} is a basis (we added e1 and e2). Q7: Dimension of sum and intersectionIn R3, W1=span{(1,0,0),(0,1,0)} (xy-plane), W2=span{(0,1,0),(0,0,1)} (yz-plane). Find dim(W1∩W2) and dim(W1+W2).Solution: W1∩W2=span{(0,1,0)} (y-axis), dimension 1.W1+W2=R3, dimension 3.Check: dim(W1+W2)=dim(W1)+dim(W2)−dim(W1∩W2)=2+2−1=3 ✓ Q8: Basis for matrix spaceFind a basis for the subspace of 2×2 symmetric matrices.Solution: A symmetric 2×2 matrix is
>{[1000],[0110],[0001]}>.Basis:
>{c1+2c2=52c1+c2=3>. Dimension = 3. Q9: Proving dimension propertyProve: If W is a subspace of Rn and dim(W)=n, then W=Rn.Proof: dim(W)=n=dim(Rn). Since W⊆Rn and both have the same finite dimension, they must be equal. Q10: Coordinate vectorFind [v]B where v=(5,3) and B={(1,2),(2,1)}.Solution: Solve (5,3)=c1(1,2)+c2(2,1):
>[v]B=[1/37/3]>From first: c1=5−2c2. Substitute: 2(5−2c2)+c2=10−4c2+c2=10−3c2=3⇒c2=37. Then c1=5−2(37)=5−314=31.
.
🔗 Cross-References
- Next topic: Rank & Dimension via Gaussian Elimination
- Week 5 (Rank-Nullity): Links dimensions of null space and column space
- Week 6 (Matrix Representation): The matrix of a linear transformation depends on the choice of basis
- Week 8 (Gram-Schmidt): Builds an orthonormal basis from any basis
- BSCS2004 (ML Foundations): Dimensionality reduction, feature selection Join Discord Previous3.3 Linear IndependenceNext4.2 Rank & Dimension