Vector Spaces, Subspaces, Span, Basis and Dimension
A vector space is a set with addition and multiplication by scalars that obey eight axioms; a subspace is a subset that is itself a vector space (closed under addition and scalar multiples), a basis is a linearly independent set that spans the space, and the dimension is the number of vectors in any basis. In brief: the set {(x, y, z) : x + y + z = 0} is a subspace of ℝ3 with the basis (1, −1, 0), (0, 1, −1), so its dimension is 2. By contrast, {(x, y) : xy = 0} is not a subspace, because (1, 0) + (0, 1) = (1, 1) leaves it.
Vector spaces unify the vectors of the plane, the polynomials, the matrices and the functions under one set of rules, so one theory handles them all. This guide gives the axioms and examples, the subspace test, span, linear independence, bases and coordinates, the dimension theorem and the dimension of sums of subspaces, with worked examples and a table.
What is a vector space?
A vector space over a field of scalars F (usually ℝ or ℂ) is a set V with two operations, vector addition and scalar multiplication, such that for all u, v, w in V and scalars a, b:
- addition is commutative and associative, there is a zero vector 0 with v + 0 = v, and every v has an opposite −v with v + (−v) = 0;
- a(u + v) = au + av, (a + b)v = av + bv, (ab)v = a(bv) and 1v = v.
Besides ℝn, examples include: the polynomials of degree at most n; the m × n matrices; the continuous functions on an interval; the sequences of numbers; and the solutions of a homogeneous linear system or a homogeneous linear differential equation. The complex numbers are a vector space of dimension 2 over ℝ (basis 1, i) and of dimension 1 over ℂ.
How do you test a subspace?
A subset W of V is a subspace exactly when it contains the zero vector (or is nonempty), is closed under addition (u, v in W implies u + v in W) and is closed under scalar multiplication (v in W implies av in W). Equivalently, any combination au + bv of elements of W must stay in W.
Example 1: a plane through the origin
W = {(x, y, z) : x + y + z = 0}. Zero: 0 + 0 + 0 = 0 ✓. If (x, y, z) and (x′, y′, z′) satisfy it, then so does their sum, and so does a multiple. Hence W is a subspace. The solution z = −x − y gives the basis (1, 0, −1), (0, 1, −1), or equivalently (1, −1, 0), (0, 1, −1). So dim W = 2.
Example 2: non-examples
{(x, y) : xy = 0} (the two axes) is not closed under addition: (1, 0) + (0, 1) = (1, 1). The plane x + y + z = 1 does not contain 0. The polynomials of degree exactly 2 are not a subspace: x2 + (−x2 + x) = x has degree 1.
Example 3: subspaces of matrices
The symmetric 2 × 2 matrices [[a, b], [b, c]] form a subspace of dimension 3, as do the 2 × 2 matrices with trace 0 (basis [[1, 0], [0, −1]], [[0, 1], [0, 0]], [[0, 0], [1, 0]]). The invertible matrices do not: I + (−I) = O is not invertible.
What are span and linear independence?
The span of vectors v1, …, vk is the set of all combinations a1v1 + … + akvk; it is the smallest subspace containing them. The vectors are linearly independent if the only combination equal to 0 is the trivial one (all ai = 0); otherwise they are dependent, and one of them is a combination of the others. To test vectors in ℝn, put them in a matrix and row reduce: they are independent exactly when the rank equals their number.
Example 4: dependent vectors
(1, 2, 3), (4, 5, 6), (7, 8, 9) have the rank 2, so they are dependent: (7, 8, 9) = 2(4, 5, 6) − (1, 2, 3). Their span is a plane, not all of ℝ3.
Example 5: independence of functions
sin x and cos x in the space of functions: if a sin x + b cos x = 0 for all x, then x = 0 gives b = 0 and x = π/2 gives a = 0, so they are independent. By contrast, 1, cos2 x, sin2 x are dependent, as cos2 x + sin2 x − 1 = 0.
Example 6: membership in a span
Is (4, 3) in the span of (1, 1) and (1, −1)? Solve a + b = 4, a − b = 3: a = 7/2, b = 1/2. Yes. The two vectors span all of ℝ2, since the determinant −2 ≠ 0.
What are a basis and the dimension?
A basis is a linearly independent spanning set. Every vector has exactly one expression as a combination of basis vectors; its coefficients are the coordinates. The Steinitz exchange lemma shows that all bases of V have the same number of vectors, called the dimension dim V. In an n-dimensional space, any n independent vectors form a basis, and any n spanning vectors form a basis; no more than n vectors can be independent.
Example 7: a basis of polynomials
P2 (polynomials of degree at most 2) has the basis 1, x, x2 and dimension 3. Is 1 + x, x + x2, 1 + x2 also a basis? The coordinate rows (1, 1, 0), (0, 1, 1), (1, 0, 1) have the determinant 1(1 − 0) − 1(0 − 1) + 0 = 2 ≠ 0, so yes. The polynomial x2 has the coordinates (−1/2, 1/2, 1/2) in this basis: −(1/2)(1 + x) + (1/2)(x + x2) + (1/2)(1 + x2) = x2 ✓.
Example 8: dimensions of familiar spaces
The space of m × n matrices has dimension mn. The symmetric n × n matrices have dimension n(n + 1)/2 (for n = 2 this gives 3, as in Example 3). The solutions of y″ + y = 0 form a space of dimension 2 with the basis sin x, cos x.
What is the dimension of a sum of subspaces?
For subspaces U and W, the sum U + W is the set of all u + w, and dim(U + W) = dim U + dim W − dim(U ∩ W). The sum is direct (written U ⊕ W) when U ∩ W = {0}, in which case the dimensions add.
Example 9: a sum in ℝ3
U = span{(1, 0, 0), (0, 1, 0)} (the xy-plane) and W = span{(0, 1, 0), (0, 0, 1)} (the yz-plane). The intersection is the y-axis, of dimension 1, so dim(U + W) = 2 + 2 − 1 = 3: the sum is all of ℝ3. The sum is not direct.
Table of standard spaces
| Space | Dimension | A basis |
|---|---|---|
| ℝn | n | e1, …, en |
| polynomials of degree ≤ n | n + 1 | 1, x, …, xn |
| m × n matrices | mn | matrix units Eij |
| symmetric 2 × 2 matrices | 3 | E11, E22, E12 + E21 |
| ℂ over ℝ | 2 | 1, i |
| solutions of y″ + y = 0 | 2 | sin x, cos x |
Where does the concept come from?
Hermann Grassmann developed the idea of an abstract linear space in 1844, and Giuseppe Peano gave the first axiomatic definition of a vector space in 1888. Functional analysis in the early twentieth century, with the work of Hilbert, Banach and others, showed the power of treating function spaces as vector spaces. The theory of dimension for infinite-dimensional spaces needs the axiom of choice for the existence of bases.
Which mistakes are common?
Forgetting the zero vector
Every subspace contains 0. A line or plane not through the origin is not a subspace.
Checking only some closure conditions
You must verify both addition and scalar multiplication (or the combined condition).
Confusing a spanning set with a basis
A basis must be independent as well as spanning. Counting vectors of a spanning set overestimates the dimension if the set is dependent.
Mixing the field
The dimension depends on the scalars: ℂ is 1-dimensional over ℂ but 2-dimensional over ℝ.