What a vector space is
A vector space is a set V with an addition and a multiplication by numbers that obey the usual rules: the sum
is commutative and associative, there is a zero vector, every vector has an opposite, and the multiplication
by numbers distributes over sums and is compatible with the product of numbers, with 1·v = v. Besides the
vectors of the plane and of space, the polynomials of degree at most n, the m×n matrices and the continuous
functions on an interval are vector spaces. The rules are what the proofs use, not what the elements look
like.
A subset U of a vector space V is a subspace when it is a vector space with the same operations. That takes
three checks, the subspace test:
- the zero vector is in U
- u + w is in U whenever u and w are in U
- λu is in U whenever u is in U and λ is a number
The dimension of a sum
For two subspaces U and W of the same vector space, their sum U + W is all vectors u + w with u in U and w in
W. It is the smallest subspace that contains both. If the spaces are finite-dimensional,
- dim(U + W) = dim U + dim W − dim(U ∩ W)
The intersection U ∩ W, the vectors in both, is counted in both dimensions and has to be taken away once. The
card above gives any one of the four dimensions from the other three.
Holds for subspaces of one and the same vector space, when the dimensions are finite.
Worked example
Let U be the xy-plane in ℝ³, the vectors (x, y, 0), and W the yz-plane, the vectors (0, y, z). Both have
dimension 2. A vector in both has x = 0 and z = 0, so U ∩ W is the y-axis, of dimension 1. Then
- dim(U + W) = 2 + 2 − 1 = 3
so U + W is all of ℝ³: any (x, y, z) is (x, y, 0) + (0, 0, z). Adding the dimensions without the intersection
gives 4, which is impossible in a space of dimension 3.
Is it a subspace?
The plane x + y + z = 0 in ℝ³ is a subspace. It contains (0, 0, 0). If both (x, y, z) and (x′, y′, z′) satisfy
the equation, their sum does too, since (x + x′) + (y + y′) + (z + z′) = 0 + 0, and so does λ(x, y, z). Its
dimension is 2.
The plane x + y + z = 1 is not: it does not contain the zero vector, and the sum of two of its points has
coordinate sum 2.
The set of points (x, y) with xy ≥ 0, the first and third quadrants with the axes, passes the first and third
checks: (0, 0) is in it, and λ(x, y) has the product λ²xy ≥ 0. It fails the second.
(1, 2) and (−3, −1) are in the set, and their sum (−2, 1) is not.
| Set |
Subspace? |
Why |
| A line through the origin in ℝ² |
yes |
dimension 1 |
| A line not through the origin |
no |
does not contain 0 |
| The solutions of Ax = 0 |
yes |
the null space, see the page on rank |
| The solutions of Ax = b, b ≠ 0 |
no |
does not contain 0 |
| The union of two different lines through the origin |
no |
the sum of two nonzero vectors, one from each line, is on neither |
Common mistakes
- Forgetting the zero vector. A set without 0 is not a subspace, whatever else holds. Check it first.
- Testing with examples. The sum and scalar conditions are for all vectors in the set, which an example
cannot show. A counterexample can show that a set is not a subspace; a proof is needed to show that it is.
- Taking the union for the sum. The union of two subspaces is a subspace only if one contains the other.
The sum U + W is the smallest subspace that contains both.
- Leaving out the intersection. dim U + dim W is too large by dim(U ∩ W) whenever the subspaces share more
than the zero vector.
Where to go next
The number of vectors that span a subspace without waste is its dimension; see
basis and dimension and
linear independence.
Frequently asked questions
Is the set containing only the zero vector a subspace?
Yes. It contains 0, and 0 + 0 and λ·0 are 0. Its dimension is 0, and it is contained in every subspace.
What is the difference between a vector space and a subspace?
A subspace is a vector space that sits inside a bigger one and uses the same addition and multiplication.
The rules already hold in the bigger space, so what is left to check is that the zero vector, the sums and
the multiples stay in the subset: the three conditions above.
When is the sum of two subspaces a direct sum?
When U ∩ W contains only the zero vector. The formula then gives dim(U + W) = dim U + dim W, and every
vector of U + W can be written as u + w in exactly one way.