Vector Spaces
A vector space is a set V of objects, called vectors, that you can add and multiply by scalars (real numbers), where the results stay in V and ten axioms hold, such as u + v = v + u and the existence of a zero vector. Examples include ℝⁿ, polynomials, matrices and functions.
Before this lesson: Linear Combinations, Matrix Operations and Adding and Subtracting Polynomials
What a vector space is
So far, vectors have been lists of numbers in ℝⁿ. But many other objects can be added and scaled in the same way: polynomials, matrices, functions and even sound signals. A vector space collects the rules that make this work, so every idea in this course, such as linear combinations, span and linear transformations, applies to all of them at once.
To define a vector space, you need three things: a set V, a way to add two of its elements, and a way to multiply an element by a scalar. The set is a vector space when those two operations obey the ten axioms below. The word “vector” then means any element of V, even if it is a polynomial or a matrix.
Most sets fail in one of two ways. Either adding or scaling can take you out of the set (closure fails), or the zero vector is missing. Those are the first things to check.
The vector space axioms
Let u, v and w be any elements of V, and let c and d be any scalars. V is a vector space if all ten statements hold:
| # | Axiom | Name |
|---|---|---|
| 1 | u + v is in V | Closure under addition |
| 2 | u + v = v + u | Addition is commutative |
| 3 | (u + v) + w = u + (v + w) | Addition is associative |
| 4 | There is a vector 0 in V with u + 0 = u for every u | Zero vector |
| 5 | For each u there is a vector −u in V with u + (−u) = 0 | Additive inverse |
| 6 | cu is in V | Closure under scalar multiplication |
| 7 | c(u + v) = cu + cv | Distributes over vector addition |
| 8 | (c + d)u = cu + du | Distributes over scalar addition |
| 9 | c(du) = (cd)u | Scalar multiplication is associative |
| 10 | 1u = u | Scalar identity |
Facts that follow from the axioms. In every vector space the zero vector is unique, 0u = 0, c0 = 0 and (−1)u = −u. Here is the proof of the first fact, using only the axioms:
0u = (0 + 0)u
The scalar 0 equals 0 + 0.
= 0u + 0u
Axiom 8.
0u + (-0u) = (0u + 0u) + (-0u)
Add the inverse −0u (Axiom 5) to both sides.
\mathbf{0} = 0u + (0u + (-0u))Axiom 5 on the left; Axiom 3 on the right.
\mathbf{0} = 0u + \mathbf{0}Axiom 5 inside the parentheses.
\mathbf{0} = 0uAxiom 4.
Standard examples of vector spaces
- \mathbb{R}^n: lists of n real numbers, added and scaled entry by entry.
- P_n: polynomials of degree at most n, such as a₀ + a₁x + a₂x² in P_2, added by combining like terms. The zero vector is the zero polynomial.
- M_{m\times n}: all m × n matrices, added and scaled entry by entry. The zero vector is the zero matrix.
- F(\mathbb{R}): all functions from ℝ to ℝ, with (f + g)(x) = f(x) + g(x) and (cf)(x) = c·f(x). The zero vector is the function that is 0 for every x.
How to check whether a set is a vector space
- Name the set, the addition and the scalar multiplication.
- Check closure under addition (Axiom 1) and scalar multiplication (Axiom 6) for general elements, not only examples.
- Find the zero vector and check that it is in the set (Axiom 4), and that each element has a negative in the set (Axiom 5).
- Check the remaining six rules. With the usual operations, they hold automatically because they hold for numbers.
- To show a set is not a vector space, one specific counterexample to one axiom is enough.
Vector space examples
Example 1: Polynomials of degree at most 2
In P_2, let p = 3 + 2x − x² and q = 1 − 4x + 5x². Find p + q and 3p, and name the zero vector and −p. Then explain why P_2 is closed under both operations.
p + q = (3 + 1) + (2 - 4)x + (-1 + 5)x^2
Add the matching coefficients (see adding polynomials).
= 4 - 2x + 4x^2
Simplify each coefficient.
3p = 3(3) + 3(2)x + 3(-1)x^2
Multiply each coefficient by 3.
= 9 + 6x - 3x^2
Simplify.
\mathbf{0} = 0 + 0x + 0x^2The zero polynomial: p + 0 = p.
-p = -3 - 2x + x^2
Change the sign of each coefficient, so p + (−p) = 0.
(a_0 + a_1x + a_2x^2) + (b_0 + b_1x + b_2x^2) = (a_0 + b_0) + (a_1 + b_1)x + (a_2 + b_2)x^2
Closure under addition: the sum still has degree at most 2.
c(a_0 + a_1x + a_2x^2) = ca_0 + ca_1x + ca_2x^2
Closure under scalar multiplication: the degree cannot go up.
Answer: p + q = 4 − 2x + 4x², 3p = 9 + 6x − 3x², the zero vector is the zero polynomial and −p = −3 − 2x + x². The other axioms hold because they hold for the real-number coefficients, so P_2 is a vector space.
Example 2: 2 × 2 matrices
In M_{2\times 2}, let A = [1 −2; 3 0], B = [4 1; −1 5] and c = 2. Check Axiom 7, c(A + B) = cA + cB, for these matrices.
A + B = \begin{bmatrix} 1 + 4 & -2 + 1 \\ 3 - 1 & 0 + 5 \end{bmatrix} = \begin{bmatrix} 5 & -1 \\ 2 & 5 \end{bmatrix}Add entry by entry (see matrix operations).
2(A + B) = \begin{bmatrix} 10 & -2 \\ 4 & 10 \end{bmatrix}Multiply each entry by 2.
2A = \begin{bmatrix} 2 & -4 \\ 6 & 0 \end{bmatrix}Multiply each entry of A by 2.
2B = \begin{bmatrix} 8 & 2 \\ -2 & 10 \end{bmatrix}Multiply each entry of B by 2.
2A + 2B = \begin{bmatrix} 2 + 8 & -4 + 2 \\ 6 - 2 & 0 + 10 \end{bmatrix} = \begin{bmatrix} 10 & -2 \\ 4 & 10 \end{bmatrix}Add entry by entry.
Answer: both sides equal [10 −2; 4 10]. In general, entry (i, j) of c(A + B) is c(aᵢⱼ + bᵢⱼ) = caᵢⱼ + cbᵢⱼ by the distributive property of numbers, so Axiom 7 holds for all matrices. The zero vector of M_{2\times 2} is the zero matrix.
Example 3: Polynomials of degree exactly 2
Is the set W of polynomials of degree exactly 2 (with the usual operations) a vector space?
p = x^2 + x,\quad q = -x^2 + 3
Choose two elements of W. Both have degree 2.
p + q = (1 - 1)x^2 + x + 3
Add the matching coefficients.
= x + 3
The x² terms cancel, so p + q has degree 1.
Answer: no. The sum x + 3 is not in W, so W is not closed under addition (Axiom 1 fails). W also has no zero vector, since the zero polynomial does not have degree 2.
Example 4: The first quadrant
Let Q be the set of points (x, y) in ℝ² with x ≥ 0 and y ≥ 0, with the usual operations. Is Q a vector space?
(x_1, y_1) + (x_2, y_2) = (x_1 + x_2,\ y_1 + y_2)
The sum of two nonnegative numbers is nonnegative, so Q is closed under addition.
u = (2, 3)
Choose an element of Q.
(-1)u = ((-1)(2),\ (-1)(3)) = (-2, -3)
Multiply by the scalar −1.
Answer: no. (−2, −3) has negative coordinates, so it is not in Q. Q is not closed under scalar multiplication (Axiom 6 fails), and u has no negative in Q (Axiom 5 fails). See the figure above.
Example 5: Mixing sound signals
A synthesizer makes signals of the form s(t) = a cos t + b sin t, where a and b are real numbers. Mixing two signals adds them, and turning the volume up or down multiplies a signal by a number. An engineer mixes f(t) = 3 cos t + 2 sin t at double volume with g(t) = −cos t + 4 sin t. Find the result, and decide whether the set V of all such signals is a vector space.
2f(t) = 6\cos t + 4\sin t
Double the volume: multiply both coefficients by 2.
2f(t) + g(t) = (6 - 1)\cos t + (4 + 4)\sin t
Mix: add the cos t terms and the sin t terms (see function operations).
= 5\cos t + 8\sin t
Simplify. The mix has the same form, so it is in V.
(a\cos t + b\sin t) + (c\cos t + d\sin t) = (a + c)\cos t + (b + d)\sin t
Closure under addition, for any two signals in V.
k(a\cos t + b\sin t) = ka\cos t + kb\sin t
Closure under scalar multiplication.
0\cos t + 0\sin t = 0
The zero vector is silence, the signal that is 0 at every time.
-(a\cos t + b\sin t) = -a\cos t - b\sin t
The negative is the inverted signal. Adding it gives silence, the idea behind noise-canceling headphones.
Answer: the mix is 5 cos t + 8 sin t. V is a vector space: it is closed under both operations, contains the zero signal and each signal’s negative, and the other axioms hold because they hold for all functions. Each signal is set by the pair (a, b), so V behaves just like ℝ².
Common mistakes
| Mistake | Example of the error | Fix |
|---|---|---|
| Checking closure only with nice examples | Testing two degree-2 polynomials whose sum still has degree 2 | Use general elements, or look for a pair that breaks the rule, such as x² + x and −x² + 3. |
| Forgetting the zero vector | Calling the line y = 2x + 1 a vector space | Check that 0 is in the set first: (0, 0) is not on y = 2x + 1. |
| Confusing the scalar 0 with the zero vector | Writing 0u = 0 and treating the result as a number | 0u is the zero vector 0 of V, such as the zero matrix or the zero polynomial. |
| Forgetting negative scalars | Saying the first quadrant is closed under scalar multiplication because 2(1, 1) = (2, 2) stays in it | Scalars can be negative: (−1)(1, 1) = (−1, −1) leaves the quadrant. |
| Assuming the usual zero vector | Saying the zero vector is 0 when “addition” is x ⊕ y = xy | Find the element z with x ⊕ z = x for every x. Here z = 1. |
Related ideas
Subspaces. Examples 3 and 4 and the line y = 3x are all subsets of a known vector space with the same operations. For such sets only three checks matter: the zero vector and the two closure rules. The next lesson, Subspaces, turns this into a quick test.
Unusual operations. The operations do not have to be the usual ones. On the positive real numbers, define x ⊕ y = xy and c ⊙ x = xᶜ. All ten axioms hold, with zero vector 1 and negative 1/x, so this strange set is a vector space too (Practice Problem 8 checks a few axioms using the exponent rules).
Why it matters. Once a set is known to be a vector space, every result about linear independence, span and linear maps applies to it. For example, differentiation is a linear transformation on polynomials, and the solutions of y″ + y = 0 form a vector space; see Differential Equations.
Practice problems
- In P_3, let p = 2 − x + 4x³ and q = 5 + 3x² − x³. Find p + q and −2p.
- In M_{2\times 3}, let A = [1 0 −2; 3 1 4] and B = [−1 5 2; 0 −3 1]. Find 3A − B.
- Name the zero vector of M_{2\times 2}, of P_2 and of F(\mathbb{R}).
- Is the set of 2 × 2 matrices with determinant 0 a vector space under the usual operations?
- Is the line y = 2x + 1, as a set of points (x, y), a vector space under the usual operations?
- Is the line y = 3x, as a set of points (x, y), a vector space under the usual operations?
- On ℝ², use the usual addition but define c ⊙ (x, y) = (cx, 0). Which axiom fails?
- On the positive real numbers, define x ⊕ y = xy and c ⊙ x = xᶜ. Find the zero vector and the negative of 5. Then check Axiom 7 for c = 2, x = 3 and y = 4.
- Let W be the set of polynomials p in P_2 with p(1) = 0. Show that W is closed under addition and scalar multiplication.
- Is the set of functions f with f(0) = 2 a vector space under the usual operations?
Show answers
1.
p + q = (2 + 5) + (-1)x + (0 + 3)x^2 + (4 - 1)x^3
Add the matching coefficients.
= 7 - x + 3x^2 + 3x^3
Simplify.
-2p = -2(2) - 2(-1)x - 2(4)x^3
Multiply each coefficient by −2.
= -4 + 2x - 8x^3
Simplify.
Answer: p + q = 7 − x + 3x² + 3x³ and −2p = −4 + 2x − 8x³.
2.
3A = \begin{bmatrix} 3 & 0 & -6 \\ 9 & 3 & 12 \end{bmatrix}Multiply each entry of A by 3.
3A - B = \begin{bmatrix} 3 + 1 & 0 - 5 & -6 - 2 \\ 9 - 0 & 3 + 3 & 12 - 1 \end{bmatrix}Subtract B entry by entry.
= \begin{bmatrix} 4 & -5 & -8 \\ 9 & 6 & 11 \end{bmatrix}Simplify.
Answer: 3A − B = [4 −5 −8; 9 6 11].
3.
Answer: the zero matrix [0 0; 0 0] in M_{2\times 2}; the zero polynomial 0 + 0x + 0x² in P_2; and the function z(x) = 0 for every x in F(\mathbb{R}).
4.
A = \begin{bmatrix} 1 & 0 \\ 0 & 0 \end{bmatrix},\quad B = \begin{bmatrix} 0 & 0 \\ 0 & 1 \end{bmatrix}Both have determinant 0, so both are in the set.
A + B = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}Add entry by entry.
\det(A + B) = 1(1) - 0(0) = 1
The sum has determinant 1, not 0.
Answer: no. The set is not closed under addition (Axiom 1 fails).
5.
2(0) + 1 = 1 \ne 0
Test the zero vector (0, 0): at x = 0 the line has y = 1.
Answer: no. The zero vector (0, 0) is not on the line, so Axiom 4 fails.
6.
(a, 3a) + (b, 3b) = (a + b,\ 3a + 3b) = (a + b,\ 3(a + b))
Add two points of the line, then factor out 3. The sum is on the line.
c(a, 3a) = (ca,\ 3ca)
Scale a point. The result is on the line.
0 = 3(0)
The zero vector (0, 0) is on the line.
Answer: yes. The line is closed under both operations and contains (0, 0); the negative of (a, 3a) is (−a, 3(−a)), and the other axioms hold because they hold in ℝ².
7.
1 \odot (2, 5) = (1 \cdot 2,\ 0) = (2, 0)
Test Axiom 10 with u = (2, 5).
Answer: Axiom 10 fails, because 1 ⊙ (2, 5) = (2, 0) ≠ (2, 5).
8.
x \oplus 1 = x \cdot 1 = x
The element 1 acts as the zero vector.
5 \oplus \tfrac{1}{5} = 5 \cdot \tfrac{1}{5} = 1So 1/5 is the negative of 5: adding it gives the zero vector 1.
2 \odot (3 \oplus 4) = (3 \cdot 4)^2 = 144
Left side of Axiom 7: “add” first, then “scale.”
(2 \odot 3) \oplus (2 \odot 4) = 3^2 \cdot 4^2 = 9 \cdot 16 = 144
Right side: “scale” each, then “add.” In general (xy)ᶜ = xᶜyᶜ.
Answer: the zero vector is 1, the negative of 5 is 1/5, and both sides of Axiom 7 equal 144.
9.
(p + q)(1) = p(1) + q(1) = 0 + 0 = 0
Closure under addition: if p(1) = 0 and q(1) = 0, the sum is also 0 at x = 1.
(cp)(1) = c \cdot p(1) = c \cdot 0 = 0
Closure under scalar multiplication.
(x^2 - 1) + (x - 1) = x^2 + x - 2
Example: two elements of W.
1^2 + 1 - 2 = 0
Check: the sum is 0 at x = 1, so it is in W.
Answer: W is closed under both operations (and contains the zero polynomial), so it passes the subspace test in the next lesson.
10.
z(0) = 0 \ne 2
Test the zero function z(x) = 0.
(f + g)(0) = f(0) + g(0) = 2 + 2 = 4
Also, the sum of two elements is 4 at 0, not 2.
Answer: no. The zero function is not in the set (Axiom 4 fails), and the set is not closed under addition (Axiom 1 fails).
Vector space FAQ
What are the 10 axioms of a vector space?
Closure under addition and under scalar multiplication; commutative and associative addition; a zero vector; additive inverses; the two distributive laws; associative scalar multiplication; and 1u = u.
Does every vector space contain a zero vector?
Yes. Axiom 4 requires it, so a set without a zero vector, such as the line y = 2x + 1, is never a vector space.
Are polynomials a vector space?
Yes. The polynomials of degree at most n form the vector space P_n, and all polynomials together also form a vector space. Polynomials of degree exactly n do not.
What is the difference between a vector space and a subspace?
A subspace is a vector space that sits inside a larger vector space and uses the same operations. Checking a subspace needs only three tests: the zero vector and the two closure rules.
Summary
- A vector space is a set with addition and scalar multiplication that satisfies ten axioms.
- The two closure axioms and the zero vector are the ones that usually fail.
- ℝⁿ, P_n, M_{m\times n} and F(\mathbb{R}) are the standard examples.
- One counterexample to one axiom shows a set is not a vector space.
- Facts like 0u = 0 and (−1)u = −u follow from the axioms in every vector space.
Previous lesson: Determinants as Area and Volume
Next lesson: Subspaces
Back to the Linear Algebra Index